whyczyk
2021-10-13 a355aafef5a635bd31a701127cea097338cee0a7
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) {