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/RoseChartED.vue | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/components/charts/RoseChartED.vue b/src/components/charts/RoseChartED.vue index 3234655..8cf8050 100644 --- a/src/components/charts/RoseChartED.vue +++ b/src/components/charts/RoseChartED.vue @@ -7,6 +7,7 @@ <script> import * as echarts from 'echarts'; import { WebSocketClass } from '@/assets/js/socket' +import { checkboxs } from '@/assets/js/powerInfoData' export default { name: "RoseChartED", chart: "", @@ -23,21 +24,32 @@ } }, methods: { - toParentPage() { - window.parent.parent.postMessage({ - cmd: "syncPage", - params: { - pageInfo: { - label: "鐢垫睜淇℃伅缁熻鍒嗘瀽", - name: "produceTotal", - src: "#/dataMager/produceTotal", - closable: true - }, - } - }, "*"); + toParentPage(value) { + if (typeof (value) == 'string') { + window.parent.parent.postMessage({ + cmd: "syncPage", + params: { + pageInfo: { + label: "鐢垫睜淇℃伅缁熻鍒嗘瀽", + name: "produceTotal", + src: "#/dataMager/produceTotal/?xuHang=" + value, + closable: true + }, + } + }, "*"); + } }, setOption(opt) { this.$options.chart.setOption(opt); + this.$options.chart.on('click', (params) => { + console.log(params) + let name = params.name; + checkboxs.jfxh.map(item => { + if (item.label == name) { + this.toParentPage(item.value) + } + }) + }) }, organizeData(data) { let option = { @@ -106,7 +118,6 @@ }, ] let resData = res.data; - console.log(resData) for (let key in resData) { optionData.map(item => { if (item.name == key) { -- Gitblit v1.9.1