Commit e1ea753b authored by Jenny's avatar Jenny

Merge branch 'develop' of 106.15.103.105:lihuizhen/ec-report-refactor into develop

# Conflicts:
#	components/NormalTable/NormalTable.vue
parents d46ddb17 8f9fff5e
<template>
<view class="count-to" :style="{height: `${height}px`,}">
<!-- <BasicText :elementInfo="elementInfo"></BasicText> -->
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<!-- warning:count-to的font-size单位为rpx -->
<u-count-to :start-val="startVal" :end-val="endVal" separator="," :color="elementInfo.option.countTo.color" :font-size="getFontSize()"></u-count-to>
......
<template>
<view >
<view style="margin-top: 20px;">
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<scroll-view scroll-x="true" >
<view class="scroll-view_H">
......@@ -10,6 +10,7 @@
:bg-color="elementInfo.table.tableCell.backgroundColor"
:color="elementInfo.table.tableCell.titleColor"
:font-size="$u.common.pxToRpx(elementInfo.table.tableCell.titleFontSize)"
:height="elementInfo.table.tableCell.cellRowHeight"
:align="elementInfo.table.tableCell.titlePostion"
:th-style="headerStyle"
>
......@@ -17,7 +18,7 @@
<u-th v-for="(item, index) in columns" :key="index">{{item.title}}</u-th>
</u-tr>
<u-tr v-for="(cell, cellIndex) in chartTables" :key="cellIndex" @tap="cellClick(cell)">
<u-td style="width: 300rpx;" v-for="(item, index) in columns" :key="index">
<u-td style="width: 240rpx;" v-for="(item, index) in columns" :key="index">
<template v-if="item.slots.customRender == 'rank'">{{index + 1}}</template>
<template v-else-if="item.slots.customRender == 'picture'">
<u-image
......@@ -59,7 +60,8 @@
headerStyle() {
const { headerRowHeight, titleColor, backgroundColor, titlePostion, titleFontSize } = this.elementInfo.table.tableHeader
return {
'height': `${this.$u.common.pxToRpx(headerRowHeight)}rpx`,
// 'lineHeight': `${this.$u.common.pxToRpx(headerRowHeight)}rpx`,
'lineHeight': `${headerRowHeight}px`,
'color': titleColor,
'background-color': backgroundColor,
'text-align': titlePostion,
......
<template>
<view v-if="elementInfo.option.title.show">
<a
<p
@click="onClick(elementInfo.option.title.link)"
:style="{
'color': elementInfo.option.title.textStyle.color,
......@@ -9,7 +9,7 @@
'text-align': elementInfo.option.title.left,
}">
{{elementInfo.option.title.text}}
</a>
</p>
</view>
</template>
......
......@@ -2,14 +2,12 @@
<view>
<div class="timer">
<NormalTitle :elementInfo="elementInfo"></NormalTitle>
<div
:style="{
<div :style="{
'font-size':`${elementInfo.option.time.textStyle.fontSize}px`,
'color': elementInfo.option.time.textStyle.color,
'font-weight': elementInfo.option.time.textStyle.fontWeight,
'text-align': elementInfo.option.time.left,
}"
>
}">
{{ realTime }}
</div>
</div>
......@@ -17,10 +15,10 @@
</template>
<script>
import echartElementData from '@/mixins/echartElementData.js'
import echartElementData from '@/mixins/echartElementData.js'
export default {
name:"BasicText",
export default {
name: "BasicText",
mixins: [echartElementData],
data() {
return {
......@@ -35,19 +33,38 @@ export default {
methods: {
initChart() {
this.timer = setInterval(() => {
this.realTime = this.$u.common.dateFormat()
const timestamp = new Date().getTime()
this.realTime = this.$u.timeFormat(timestamp, this.getDateFormat())
}, 1000)
},
// 大屏报表时间格式和uniapp的不一致,需要转换
getDateFormat() {
const dateFormat = this.elementInfo.option.time.dateFormat
if(dateFormat === "YYYY-MM-DD") {
return "yyyy-mm-dd"
}
if(dateFormat === "YYYY-MM-DD HH:mm") {
return "yyyy-mm-dd hh:MM"
}
if(dateFormat === "HH:mm") {
return "hh:MM"
}
if(dateFormat === "HH:mm:ss") {
return "hh:MM:ss"
}
return "yyyy-mm-dd hh:MM:ss"
}
}
}
}
</script>
<style lang="scss" scoped>
.timer {
.timer {
display: flex;
flex-flow: column;
justify-content: center;
width: 100%;
color: #fff;
}
}
</style>
......@@ -234,7 +234,7 @@ export default {
.u-count-num {
/* #ifndef APP-NVUE */
display: inline-flex;
// display: inline-flex;
/* #endif */
text-align: center;
}
......
......@@ -42,7 +42,12 @@
// td的内边距
padding: {
type: String,
default: '10rpx 6rpx'
default: '10px 10px'
},
// td的高度
height: {
type: [String, Number],
default: 30
},
// 字体大小
fontSize: {
......
......@@ -39,6 +39,7 @@
if (this.width != "auto") style.flex = `0 0 ${this.width}`;
style.textAlign = this.parent.align;
style.fontSize = this.parent.fontSize + 'rpx';
style.lineHeight = this.parent.height + 'px';
style.padding = this.parent.padding;
style.borderBottom = `${this.parent.borderStyle} ${this.parent.borderWidth}px ${this.parent.borderColor}`;
style.borderRight = `${this.parent.borderStyle} ${this.parent.borderWidth}px ${this.parent.borderColor}`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment