src/views/dashboard/IndexSignage.vue
@@ -126,10 +126,6 @@
      this.drawCharts()
      this.getChartDataByApi()
    },
    activated() {
      console.log('触发activated')
      this.handleWindowResize()
    },
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWindowResize)
    },
@@ -149,8 +145,8 @@
      getRunningStateDataByApi() {
        signageApi.getEquipmentStatusStatisticsApi()
          .then(res => {
            if (res.success) this.runningStateData = res.result
            this.drawRunningStateChart()
            if (res.success) this.runningStateData = res.result.list
            this.drawRunningStateChart(res.result.producitonId)
          })
      },
@@ -253,7 +249,7 @@
      },
      /* 绘制设备运行状态玫瑰饼图 */
      drawRunningStateChart() {
      drawRunningStateChart(productionId) {
        this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
        const option = {
          height: 300,
@@ -333,6 +329,13 @@
          ]
        }
        this.runningStateChart.setOption(option, true)
        this.runningStateChart.on('click', params => {
          this.$router.push({
            name: 'mdc-base-DeviceBaseInfo',
            params: { signageData: params.data, productionId }
          })
        })
      },
      /* 绘制设备利用率胶囊图 */
@@ -526,10 +529,17 @@
        this.efficiencyChart.setOption(option, true)
        this.efficiencyChart.on('click', params => {
          // 点击触发的为柱状体,除此除外是标题
          if (params.componentType === 'series') {
            // 柱状体跳转统计分析页面展示对应层级数据
            console.log('seriesParams===========', params)
            const productionId = this.efficiencyData.find(item => item.productionCode === params.name).productionId
            const tierName = this.efficiencyData.find(item => item.productionCode === params.name).name
            console.log('productionId', productionId)
            this.$router.push({
              name: 'mdc-base-StatisticsChart',
              params: { isEquipment: false, productionId, tierName }
            })
          } else {
            console.log('yAxisParams===========', params)
            this.$emit('switchToNextSignage', { signageName: 'BranchFactory', productionCode: params.value })