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/abeamProChart.vue | 45 +++++++++++++++++++++++++++++---------------- 1 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/components/charts/abeamProChart.vue b/src/components/charts/abeamProChart.vue index 44e7738..76058c2 100644 --- a/src/components/charts/abeamProChart.vue +++ b/src/components/charts/abeamProChart.vue @@ -1,5 +1,5 @@ <template> - <div class="flexCon" @click="toParentPage"> + <div class="flexCon"> <div class="con"> <div class="echarts-wrapper"> <div class="echarts-content" ref="chart"> @@ -17,6 +17,7 @@ chartFontsize } from '@/assets/js/chartFontsize' import { WebSocketClass } from '@/assets/js/socket' +import { checkboxs } from '@/assets/js/powerInfoData' export default { name: "abeamProChart", chart: "", @@ -34,21 +35,33 @@ } }, methods: { - toParentPage() { - window.parent.parent.postMessage({ - cmd: "syncPage", - params: { - pageInfo: { - label: "璁惧鐘舵�佹煡璇�", - name: "btsStatusTest", - src: "#/dataMager/btsStatus", - closable: true - }, - } - }, "*"); + toParentPage(value) { + if (typeof (value) == 'string') { + window.parent.parent.postMessage({ + cmd: "syncPage", + params: { + pageInfo: { + label: "璁惧鐘舵�佹煡璇�", + name: "btsStatusTest", + src: "#/dataMager/btsStatus?workStauts=" + value, + closable: true + }, + } + }, "*"); + } }, setOption(opt) { this.$options.chart.setOption(opt); + this.$options.chart.on('click', (params) => { + console.log(params) + let name = params.name; + checkboxs.sbzt.map(item => { + if (item.label == name) { + console.log(item.value) + this.toParentPage(item.value) + } + }) + }) }, organizeData(posData) { let dataColor = posData.color; @@ -121,7 +134,7 @@ data: yData }], series: [{ - name: '閲戦', + name: '', type: 'bar', zlevel: 1, itemStyle: { @@ -135,7 +148,7 @@ data: data }, { - "name": "", + name: '', type: 'pictorialBar', barCategoryGap: "0%", symbolPosition: 'end', @@ -162,7 +175,7 @@ data: data }, { - name: '鑳屾櫙', + name: '', type: 'bar', barCategoryGap: "0%", barGap: '-100%', -- Gitblit v1.9.1