| | |
| | | <template> |
| | | <div class="echarts-wrapper" @click="toParentPage"> |
| | | <div class="echarts-wrapper"> |
| | | <div class="echarts-content" ref="chart"></div> |
| | | </div> |
| | | </template> |
| | |
| | | chartFontsize |
| | | } from '@/assets/js/chartFontsize'; |
| | | import { WebSocketClass } from '@/assets/js/socket' |
| | | import { checkboxs } from '@/assets/js/powerInfoData' |
| | | export default { |
| | | name: "CustomPie", |
| | | chart: "", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | toParentPage() { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "电源实时告警", |
| | | name: "powerRealtimeInfo", |
| | | src: "#/powerRealtimeInfo", |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | toParentPage(value) { |
| | | if (typeof (value) == 'string') { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "电源实时告警", |
| | | name: "powerRealtimeInfo", |
| | | src: '#/powerRealtimeInfo/?alarmType=' + value, |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | } |
| | | }, |
| | | setOption(opt) { |
| | | this.$options.chart.setOption(opt); |
| | | this.$options.chart.on('click', (params) => { |
| | | let name = params.name; |
| | | checkboxs.gz.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | organizeData(data) { |
| | | let angle = 0; |