| | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import { WebSocketClass } from '@/assets/js/socket' |
| | | import { checkboxs } from '@/assets/js/powerInfoData' |
| | | export default { |
| | | name: "RoseChartED", |
| | | chart: "", |
| | |
| | | } |
| | | }, |
| | | 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 = { |
| | |
| | | }, |
| | | ] |
| | | let resData = res.data; |
| | | console.log(resData) |
| | | for (let key in resData) { |
| | | optionData.map(item => { |
| | | if (item.name == key) { |