Commit 992a21cf authored by leon's avatar leon

feat: zoom data use default config

parent 9ad9e682
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script> <script>
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null let chart = null
export default { export default {
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
...this.elementInfo.option.tooltip, ...this.elementInfo.option.tooltip,
trigger: "axis" trigger: "axis"
}, },
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : [], dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}],
series: this.dealSeriesData(series) series: this.dealSeriesData(series)
} }
chart.setOption(this.ec.option) chart.setOption(this.ec.option)
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
const { categories, series, preview, images } = this.elementData.dataList const { categories, series, preview, images } = this.elementData.dataList
this.$set(this.ec.option, 'yAxis.data', categories) this.$set(this.ec.option, 'yAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : []) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
if(preview) { if(preview) {
this.cacheImages(images) this.cacheImages(images)
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<script> <script>
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null let chart = null
export default { export default {
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
...this.elementInfo.option.tooltip, ...this.elementInfo.option.tooltip,
trigger: "axis" trigger: "axis"
}, },
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : [], dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}],
series: this.dealSeriesData(series) series: this.dealSeriesData(series)
} }
chart.setOption(this.ec.option) chart.setOption(this.ec.option)
...@@ -71,7 +72,7 @@ ...@@ -71,7 +72,7 @@
const {categories, series } = this.elementData.dataList const {categories, series } = this.elementData.dataList
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : []) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script> <script>
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null let chart = null
export default { export default {
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
...this.elementInfo.option.tooltip, ...this.elementInfo.option.tooltip,
trigger: "axis" trigger: "axis"
}, },
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : [], dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}],
series: this.dealSeriesData(series) series: this.dealSeriesData(series)
} }
chart.setOption(this.ec.option) chart.setOption(this.ec.option)
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
const { categories, series } = this.elementData.dataList const { categories, series } = this.elementData.dataList
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : []) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script> <script>
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null let chart = null
export default { export default {
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
...this.elementInfo.option.tooltip, ...this.elementInfo.option.tooltip,
trigger: "axis" trigger: "axis"
}, },
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : [], dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}],
series: this.dealSeriesData(series) series: this.dealSeriesData(series)
} }
chart.setOption(this.ec.option) chart.setOption(this.ec.option)
...@@ -59,7 +60,7 @@ ...@@ -59,7 +60,7 @@
const { categories, series } = this.elementData.dataList const { categories, series } = this.elementData.dataList
this.$set(this.ec.option, 'xAxis.data', categories) this.$set(this.ec.option, 'xAxis.data', categories)
this.$set(this.ec.option, 'series', this.dealSeriesData(series)) this.$set(this.ec.option, 'series', this.dealSeriesData(series))
this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : []) this.$set(this.ec.option, 'dataZoom', this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}])
}, },
/** /**
* 处理数据 * 处理数据
......
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
initChart() { initChart() {
const that = this const that = this
that.$nextTick(() => { that.$nextTick(() => {
debugger
console.log(that.elementInfo)
that.columns = that.elementInfo.table.column that.columns = that.elementInfo.table.column
that.chartTables = that.elementData.dataList.chartTables that.chartTables = that.elementData.dataList.chartTables
}) })
...@@ -85,6 +87,12 @@ ...@@ -85,6 +87,12 @@
uni.$emit('handleLinkParams', { index, paramName, value: value }) uni.$emit('handleLinkParams', { index, paramName, value: value })
}, },
calculateScale() {
const { windowWidth } = uni.getSystemInfoSync()
const { width, height } = this.reportInfo.info
return windowWidth / width
},
// 图片增加点击事件,查看全部图片 // 图片增加点击事件,查看全部图片
imageClick(index, key) { imageClick(index, key) {
const images = [] const images = []
......
This diff is collapsed.
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