Commit d8fd2aac authored by leon's avatar leon

feat:APPF-3577 horizontal add preview image

parent 344b4872
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
devicePixelRatio: canvasDpr devicePixelRatio: canvasDpr
}) })
canvas.setChart(chart) canvas.setChart(chart)
const { dataList: { categories, series } } = this.elementData const { dataList: { categories, series, preview, images } } = this.elementData
const options = { const options = {
...this.elementInfo.option, ...this.elementInfo.option,
tooltip: {}, tooltip: {},
...@@ -51,7 +51,17 @@ export default { ...@@ -51,7 +51,17 @@ export default {
} }
chart.setOption(options) chart.setOption(options)
chart.on('click', event => { chart.on('click', event => {
this.handleEchartsClick(event) // 特殊处理,如果preview为true,代表点击显示图片
if(preview) {
uni.previewImage({
current: event.dataIndex,
urls:images,
indicator: 'number',
loop: true
})
} else {
this.handleEchartsClick(event)
}
}) })
return chart return chart
}) })
......
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