Commit eb4ee270 authored by Jenny's avatar Jenny

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

# Conflicts:
#	components/RealTime/RealTime.vue
parents 324501af 2cd88caf
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
export default { export default {
name: "DashboardProgress", name: "DashboardProgress",
mixins: [echartElementData], mixins: [echartElementData],
data() { data() {
return { return {
ec: { ec: {
...@@ -25,10 +24,6 @@ ...@@ -25,10 +24,6 @@
}; };
}, },
onReady() {
},
components: { components: {
uniEcCanvas uniEcCanvas
}, },
......
<template> <template>
<uni-ec-canvas <uni-ec-canvas class="uni-ec-canvas" id="horizontal-bar" ref="horizontalBarCanvas" canvas-id="horizontal-bar-chart"
class="uni-ec-canvas" :ec="ec"></uni-ec-canvas>
id="horizontal-bar"
ref="horizontalBarCanvas"
canvas-id="horizontal-bar-chart"
:ec="ec"
></uni-ec-canvas>
</template> </template>
<script> <script>
import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
let chart = null let chart = null
export default { export default {
name:"HorizontalBar", name: "HorizontalBar",
mixins: [echartElementData], mixins: [echartElementData],
data () { data() {
return { return {
ec: { ec: {
lazyLoad:true lazyLoad: true
} }
} }
},
onReady () {
}, },
components: { components: {
uniEcCanvas uniEcCanvas
...@@ -39,7 +31,14 @@ export default { ...@@ -39,7 +31,14 @@ export default {
devicePixelRatio: canvasDpr devicePixelRatio: canvasDpr
}) })
canvas.setChart(chart) canvas.setChart(chart)
const { dataList: { categories, series, preview, images } } = this.elementData const {
dataList: {
categories,
series,
preview,
images
}
} = this.elementData
const options = { const options = {
...this.elementInfo.option, ...this.elementInfo.option,
tooltip: {}, tooltip: {},
...@@ -52,10 +51,10 @@ export default { ...@@ -52,10 +51,10 @@ export default {
chart.setOption(options) chart.setOption(options)
chart.on('click', event => { chart.on('click', event => {
// 特殊处理,如果preview为true,代表点击显示图片 // 特殊处理,如果preview为true,代表点击显示图片
if(preview) { if (preview) {
uni.previewImage({ uni.previewImage({
current: event.dataIndex, current: event.dataIndex,
urls:images, urls: images,
indicator: 'number', indicator: 'number',
loop: true loop: true
}) })
...@@ -70,8 +69,8 @@ export default { ...@@ -70,8 +69,8 @@ export default {
/** /**
* 处理数据 * 处理数据
*/ */
dealSeriesData (data) { dealSeriesData(data) {
if(!data) return if (!data) return
const newData = data.map(item => { const newData = data.map(item => {
const config = { const config = {
type: 'bar', type: 'bar',
...@@ -79,16 +78,20 @@ export default { ...@@ -79,16 +78,20 @@ export default {
label: { label: {
...this.elementInfo.option.dataset, ...this.elementInfo.option.dataset,
formatter: val => { formatter: val => {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, val) return this.$u.common.converFunction(this.elementInfo.option.dataset
.formatter, val)
} }
} }
} }
return { ...item, ...config } return {
...item,
...config
}
}) })
return newData return newData
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
lazyLoad: true lazyLoad: true
} }
} }
},
onReady() {
}, },
components: { components: {
uniEcCanvas uniEcCanvas
......
<template> <template>
<uni-ec-canvas <uni-ec-canvas class="uni-ec-canvas" id="normal-bar" ref="normalbarCanvas" canvas-id="normal-bar-chart" :ec="ec">
class="uni-ec-canvas" </uni-ec-canvas>
id="normal-bar"
ref="normalbarCanvas"
canvas-id="normal-bar-chart"
:ec="ec"
></uni-ec-canvas>
</template> </template>
<script> <script>
import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
let chart = null let chart = null
export default { export default {
name:"Normalbar", name: "Normalbar",
mixins: [echartElementData], mixins: [echartElementData],
data () { data() {
return { return {
ec: { ec: {
lazyLoad:true lazyLoad: true
} }
} }
},
onReady () {
}, },
components: { components: {
uniEcCanvas uniEcCanvas
...@@ -39,7 +31,12 @@ export default { ...@@ -39,7 +31,12 @@ export default {
devicePixelRatio: canvasDpr devicePixelRatio: canvasDpr
}) })
canvas.setChart(chart) canvas.setChart(chart)
const { dataList: { categories, series } } = this.elementData const {
dataList: {
categories,
series
}
} = this.elementData
const options = { const options = {
...this.elementInfo.option, ...this.elementInfo.option,
tooltip: {}, tooltip: {},
...@@ -60,8 +57,8 @@ export default { ...@@ -60,8 +57,8 @@ export default {
/** /**
* 处理数据 * 处理数据
*/ */
dealSeriesData (data) { dealSeriesData(data) {
if(!data) return if (!data) return
const newData = data.map(item => { const newData = data.map(item => {
const config = { const config = {
type: 'bar', type: 'bar',
...@@ -69,16 +66,20 @@ export default { ...@@ -69,16 +66,20 @@ export default {
label: { label: {
...this.elementInfo.option.dataset, ...this.elementInfo.option.dataset,
formatter: val => { formatter: val => {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, val) return this.$u.common.converFunction(this.elementInfo.option.dataset
.formatter, val)
} }
} }
} }
return { ...item, ...config } return {
...item,
...config
}
}) })
return newData return newData
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -25,10 +25,6 @@ export default { ...@@ -25,10 +25,6 @@ export default {
}; };
}, },
onReady () {
},
components: { components: {
uniEcCanvas uniEcCanvas
}, },
......
<template> <template>
<uni-ec-canvas <uni-ec-canvas class="uni-ec-canvas" id="normal-line" ref="normalLineCanvas" canvas-id="normal-line-chart" :ec="ec">
class="uni-ec-canvas" </uni-ec-canvas>
id="normal-line"
ref="normalLineCanvas"
canvas-id="normal-line-chart"
:ec="ec"
></uni-ec-canvas>
</template> </template>
<script> <script>
import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
let chart = null let chart = null
export default { export default {
mixins: [echartElementData], mixins: [echartElementData],
data () { data() {
return { return {
ec: { ec: {
lazyLoad:true lazyLoad: true
} }
} }
},
onReady () {
}, },
components: { components: {
uniEcCanvas uniEcCanvas
...@@ -38,10 +30,17 @@ export default { ...@@ -38,10 +30,17 @@ export default {
devicePixelRatio: canvasDpr devicePixelRatio: canvasDpr
}) })
canvas.setChart(chart) canvas.setChart(chart)
const { dataList: { categories, series } } = this.elementData const {
dataList: {
categories,
series
}
} = this.elementData
const options = { const options = {
...this.elementInfo.option, ...this.elementInfo.option,
color: ['#00f2f1', '#ed3f35', '#1089E7', "#F8B448", "#8B78F6",'#8cd8ff', '#f0ad54','#ffffff', '#000000'], color: ['#00f2f1', '#ed3f35', '#1089E7', "#F8B448", "#8B78F6", '#8cd8ff',
'#f0ad54', '#ffffff', '#000000'
],
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
...this.elementInfo.option.xAxis, ...this.elementInfo.option.xAxis,
...@@ -60,8 +59,8 @@ export default { ...@@ -60,8 +59,8 @@ export default {
/** /**
* 处理数据 * 处理数据
*/ */
dealSeriesData (data) { dealSeriesData(data) {
if(!data) return if (!data) return
const newData = data.map(item => { const newData = data.map(item => {
const config = { const config = {
type: 'line', type: 'line',
...@@ -69,16 +68,20 @@ export default { ...@@ -69,16 +68,20 @@ export default {
label: { label: {
...this.elementInfo.option.dataset, ...this.elementInfo.option.dataset,
formatter: val => { formatter: val => {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, val) return this.$u.common.converFunction(this.elementInfo.option.dataset
.formatter, val)
} }
} }
} }
return { ...item, ...config } return {
...item,
...config
}
}) })
return newData return newData
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
...@@ -25,10 +25,6 @@ export default { ...@@ -25,10 +25,6 @@ export default {
}; };
}, },
onReady () {
},
components: { components: {
uniEcCanvas uniEcCanvas
}, },
......
...@@ -34,10 +34,6 @@ import echartElementData from '@/mixins/echartElementData.js' ...@@ -34,10 +34,6 @@ import echartElementData from '@/mixins/echartElementData.js'
export default { export default {
name:"NormalProgress", name:"NormalProgress",
mixins: [echartElementData], mixins: [echartElementData],
data() {
return {
};
},
methods: { methods: {
initChart() {} initChart() {}
} }
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
lazyLoad: true lazyLoad: true
} }
} }
},
onReady() {
}, },
components: { components: {
uniEcCanvas uniEcCanvas
......
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
required: true required: true
} }
}, },
data() {
return {
};
},
methods: { methods: {
onClick(url) { onClick(url) {
if (url != '') { if (url != '') {
......
<template> <template>
<view class="chart-num" :style="{height: `${height}px`,'margin-top': `${elementInfo.option.title.titleMarginTop}px`}"> <view class="chart-num" :style="{height: `${height}px`,'margin-top': `${elementInfo.option.title.titleMarginTop}px`}">
<!-- <BasicText :elementInfo="elementInfo"></BasicText> -->
<NormalTitle :elementInfo="elementInfo"></NormalTitle> <NormalTitle :elementInfo="elementInfo"></NormalTitle>
<ul class="box-item marginTop20"> <ul class="box-item marginTop20">
<li v-for="(item, index) in orderNum" :key="index" <li v-for="(item, index) in orderNum" :key="index"
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
}; };
}, },
onReady() { onReady() {
this.getComponentHeight() this.getComponentHeight()
}, },
...@@ -48,7 +46,6 @@ ...@@ -48,7 +46,6 @@
methods: { methods: {
initChart() { initChart() {
this.$nextTick(() => { this.$nextTick(() => {
this.endVal = this.elementData.dataList.endVal this.endVal = this.elementData.dataList.endVal
this.toOrderNumber(this.endVal) this.toOrderNumber(this.endVal)
}) })
...@@ -156,9 +153,4 @@ ...@@ -156,9 +153,4 @@
font-size: 20px; font-size: 20px;
} }
.mark-item {
display: inline-block;
margin-right: 6px;
width: 5px !important;
}
</style> </style>
...@@ -49,9 +49,6 @@ ...@@ -49,9 +49,6 @@
right: 'end' right: 'end'
} }
}; };
},
mounted() {
}, },
computed: { computed: {
tableStyle() { tableStyle() {
......
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
"text": "实时数据" "text": "实时数据"
}, { }, {
"pagePath": "pages/reports/reports", "pagePath": "pages/reports/reports",
"iconPath": "static/icon/admin_normal.png", "iconPath": "static/icon/goods_report_normal.png",
"selectedIconPath": "static/icon/admin_selected.png", "selectedIconPath": "static/icon/goods_report_selected.png",
"text": "报表" "text": "报表"
}, { }, {
"pagePath": "pages/center/index", "pagePath": "pages/center/index",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<template v-for="(element, index) in reportData"> <template v-for="(element, index) in reportData">
<view <view
class="view-element" class="view-element"
v-show="!element.hide" v-if="!element.hide"
:key="element.id" :key="element.id"
:style="{ :style="{
width: `${element.width * scale}px`, width: `${element.width * scale}px`,
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
* 组件交互 - 组件 * 组件交互 - 组件
*/ */
uni.$on('handleLinkComp', ({ showData, hideData }) => { uni.$on('handleLinkComp', ({ showData, hideData }) => {
this.reportData = this.reportData.map(item => { this.reportData.map(item => {
if(showData.includes(item.id)) item.hide = false if(showData.includes(item.id)) item.hide = false
if(hideData.includes(item.id)) item.hide = true if(hideData.includes(item.id)) item.hide = true
return item return item
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
*/ */
handleValueChange(index, paramName, value) { handleValueChange(index, paramName, value) {
if(index.length && paramName && value) { if(index.length && paramName && value) {
this.reportData = this.reportData.map(item => { this.reportData.map(item => {
const flag = index.includes(item.id) const flag = index.includes(item.id)
if(flag && item.type === 'BasicText' && item.data.dataType === 'static') { if(flag && item.type === 'BasicText' && item.data.dataType === 'static') {
this.$set(item.data.dataList, 'text', value) this.$set(item.data.dataList, 'text', value)
...@@ -191,9 +191,6 @@ ...@@ -191,9 +191,6 @@
}) })
} }
} }
},
onReachBottom() {
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getReportCharts() this.getReportCharts()
...@@ -206,7 +203,7 @@ ...@@ -206,7 +203,7 @@
position: relative; position: relative;
height: 100%; height: 100%;
user-select: none; user-select: none;
// overflow: auto; overflow: auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-position: center; background-position: center;
......
...@@ -13,11 +13,6 @@ ...@@ -13,11 +13,6 @@
<script> <script>
export default { export default {
data() {
return {
}
},
methods: { methods: {
// 打电话 // 打电话
call() { call() {
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
onLoad(option) { onLoad(option) {
this.$data.url =decodeURIComponent(option.url) this.$data.url =decodeURIComponent(option.url)
}, },
methods: {
}
} }
</script> </script>
......
...@@ -42,7 +42,6 @@ const install = (Vue, vm) => { ...@@ -42,7 +42,6 @@ const install = (Vue, vm) => {
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
// 拼接 // 拼接
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
// return year + "-" + month + "-" + day;
} }
// px转换为rpx // px转换为rpx
......
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