From a355aafef5a635bd31a701127cea097338cee0a7 Mon Sep 17 00:00:00 2001 From: whyczyk <525500596@qq.com> Date: 星期三, 13 十月 2021 14:55:22 +0800 Subject: [PATCH] 图形跳转对应参数界面功能 --- src/components/charts/latticeBar.vue | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/components/charts/latticeBar.vue b/src/components/charts/latticeBar.vue index c264f65..11295cb 100644 --- a/src/components/charts/latticeBar.vue +++ b/src/components/charts/latticeBar.vue @@ -1,5 +1,5 @@ <template> - <div class="echarts-wrapper" @click="toParentPage"> + <div class="echarts-wrapper"> <div class="echarts-content" ref="chart"> </div> @@ -12,6 +12,7 @@ chartFontsize } from '@/assets/js/chartFontsize' import { WebSocketClass } from '@/assets/js/socket' +import { checkboxs } from '@/assets/js/powerInfoData' export default { name: "latticeBar", chart: "", @@ -29,21 +30,36 @@ } }, methods: { - toParentPage() { - window.parent.parent.postMessage({ - cmd: "syncPage", - params: { - pageInfo: { - label: "鐢垫睜瀹炴椂鍛婅", - name: "batteryrTimequery", - src: "#/batteryrTimequery", - closable: true - }, - } - }, "*"); + toParentPage(value) { + if (typeof (value) == 'string') { + window.parent.parent.postMessage({ + cmd: "syncPage", + params: { + pageInfo: { + label: "鐢垫睜瀹炴椂鍛婅", + name: "batteryrTimequery", + src: "#/batteryrTimequery/?alarmType=" + value, + closable: true + }, + } + }, "*"); + } }, setOption(opt) { this.$options.chart.setOption(opt); + this.$options.chart.on('click', (params) => { + let name; + if (params.seriesName == '鏀剧數') { + name = '鏀剧數鐢垫祦'; + } else if (params.seriesName == '鍏呯數') { + name = '鍏呯數鐢垫祦'; + } + checkboxs.dcgj.map(item => { + if (item.label == name) { + this.toParentPage(item.value) + } + }) + }) }, organizeData(data) { let option = { -- Gitblit v1.9.1