whyczyk
2022-03-01 f868ff46ef4fb25a01364f3c5d0fe220d32b7ad0
src/pages/exhibition.vue
@@ -41,10 +41,17 @@
         screenTitleBg: null,
         screenBg: null,
         isHeader: true,
         isNow: true
         isNow: true,
         state: 1,
      }
   },
   mounted() {
      if (this.$route.query.userId) {
         localStorage.setItem('userId', this.$route.query.userId);
      }
      if (this.$route.query.newPlatform) {
         sessionStorage.setItem('newPlatform', this.$route.query.newPlatform);
      }
      this.nowlayOut.appName = this.$route.query.name;
      if (this.$route.query.head && this.$route.query.head == 1) {
         this.isHeader = false
@@ -61,6 +68,7 @@
      })
   },
   methods: {
      // 加载布局数据
      loadLayout() {
         let sendData = {
@@ -101,11 +109,35 @@
                        nowBox[0].appendChild(chartModular.$el)
                        this.modularArr.push(chartModular);
                     }
                     chartModular.setData();
                     if (chartModular.id == "chart14") {
                        this.$nextTick(() => {
                           chartModular.$children[0].setData()
                        })
                     } else {
                        chartModular.setData();
                     }
                     chartModular.resize();
                  }, 0)
               })
               window.addEventListener("message", (msg) => {
                  // 处理数据
                  this.state = msg.data.state
                  if (this.state == 1) {
                     this.modularArr.map(item => {
                        if (item.postData) {
                           item.postData()
                        }
                     })
                  } else if (this.state == 0) {
                     this.modularArr.map(item => {
                        if (item.outClear) {
                           item.outClear()
                        }
                     })
                  }
               });
            }
         }).catch((err) => {
            console.log(err)