| | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import { WebSocketClass } from '@/assets/js/socket' |
| | | import { checkboxs } from '@/assets/js/powerInfoData' |
| | | export default { |
| | | name: "RoseChart", |
| | | chart: "", |
| | |
| | | } |
| | | }, |
| | | 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 |
| | | }, |
| | | } |
| | | }, "*"); |
| | | } |
| | | }, |
| | | toParentPage2(value) { |
| | | if (typeof (value) == 'string') { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "设备工作状态", |
| | | name: "deviceWorkState", |
| | | src: "#/device-work-state?signalStatus=" + value, |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | } |
| | | }, |
| | | setOption(opt) { |
| | | this.$options.chart.setOption(opt); |
| | | this.$options.chart.on('click', (params) => { |
| | | let name; |
| | | if (params.name == '在线浮充') { |
| | | name = '浮充' |
| | | checkboxs.sbzt.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | } else if (params.name == '充电数量') { |
| | | name = '充电' |
| | | checkboxs.sbzt.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | } else if (params.name == '内阻测试数量') { |
| | | name = '内阻测试' |
| | | checkboxs.sbzt.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | } else if (params.name == '通讯故障数量') { |
| | | this.toParentPage2('1') |
| | | } else if (params.name == '核容数量') { |
| | | name = '放电' |
| | | checkboxs.sbzt.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | organizeData(data) { |
| | | let option = { |