派生自 wuyushui/SewerAndRainNetwork

seatonwan9
2021-05-21 4d265afb3419bd5cedc6f31ab78d570f6917b520
src/components/table/summarySheets.vue
@@ -1,12 +1,12 @@
<template>
  <div class="summary-sheets">
    <el-tooltip :popper-class="'map-tooltip'" effect="dark" content="报表" placement="left">
      <div :class='["iconBtn",subtopic ? "active-button" : ""]' @click="subtopicBtn" >
      <div :class='["iconBtn",selectGroup ? "active-button" : ""]' @click="subtopicBtn" >
         <i class="el-icon-tickets icon"></i>
      </div>
    </el-tooltip>
    <transition name="animationChange">
        <div class="subtopic" v-if="subtopic">
        <div class="subtopic" v-show="selectGroup">
            <el-tooltip :popper-class="'map-tooltip'" effect="dark" content="统计表" placement="bottom">
              <div :class='["iconBtn",summaryVisible ? "active-button" : ""]' @click="closeBtn">
                  <!--  -->
@@ -67,11 +67,35 @@
      comp: Warn,
      warnVisible: false,
      companyVisible: false,
      subtopic: false
      selectGroup: false
    }
  },
  mounted () {
    const that = this
    // 监听是否点击了当前图标按钮
    bus.$on('changeState', function (state) {
      if (state.num !== 2 && state.type) {
        that.selectGroup = false
      }
    })
    // 外部调用 与报警弹框
    bus.$on('forecastWarningDetails', function (state) {
      that.showWarnDialog()
    })
    // 子组件事件控制当前变量
    this.$nextTick(() => {
      this.$refs.summarySheets.$on('closeDialog', () => {
        that.summaryVisible = false
      })
      this.$refs.warnDialog.$on('closeDialog', () => {
        that.warnVisible = false
      })
      this.$refs.indexStatisticsDialog.$on('closeDialog', () => {
        that.companyVisible = false
      })
    })
  },
  methods: {
    closeBtn () {
      this.$refs.summarySheets.show()
      this.summaryVisible = true
@@ -85,32 +109,13 @@
      this.companyVisible = true
    },
    subtopicBtn () {
      this.subtopic = !this.subtopic
      this.selectGroup = !this.selectGroup
      const state = {
        type: this.subtopic,
        type: this.selectGroup,
        num: 2
      }
      bus.$emit('changeState', state)
    }
  },
  mounted () {
    const that = this
    bus.$on('changeState', function (state) {
      if (state.num !== 2 && state.type) {
        that.subtopic = false
      }
    })
    this.$nextTick(() => {
      this.$refs.summarySheets.$on('closeDialog', () => {
        that.summaryVisible = false
      })
      this.$refs.warnDialog.$on('closeDialog', () => {
        that.warnVisible = false
      })
      this.$refs.indexStatisticsDialog.$on('closeDialog', () => {
        that.companyVisible = false
      })
    })
  }
}
</script>