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