<template>
  <div class="paramsDetails">
    <div class="details-content">
      <div class="details-header">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="能耗报表" name="first">
            <energy-report v-if="activeName === 'first'"></energy-report>
          </el-tab-pane>
          <el-tab-pane label="温度变化表" name="second">
            <tem-report v-if="activeName === 'second'"></tem-report>
          </el-tab-pane>
          <el-tab-pane label="水位变化表" name="three">
            <water-report v-if="activeName === 'three'"></water-report>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import EnergyReport from "./components/energyReport.vue";
import TemReport from "./components/temReport.vue";
import WaterReport from "./components/waterReport.vue";

export default {
  components: { EnergyReport, TemReport, WaterReport },
  data() {
    return {
      activeName: "first", //能耗报表
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },

    //当在子页面中点击按钮时，会触发switch-tab事件，
    // 然后在父组件中监听到这个事件，并将activeName设置为'second'，从而让第二个tab成为当前选中的tab。
    switchToEquitesMess() {
      this.activeName = "second";
    },
    switchToPatrolTem() {
      // this.activeName = 'fourth';
    },
    // 记得请求冷水机组数据时，默认选中第一个冷水机组
  },
};
</script>

<style lang="scss" scoped>
.paramsDetails {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;

  .details-content {
    width: 100%;
    // height: 0.42rem;
    position: relative;
  }
}
</style>
<style scoped>
.none-div {
  padding-top: 0.31rem;
}

.none-div >>> .el-tree {
  background: transparent;
  color: #789d9f;
}

.none-div >>> .el-tree-node:focus > .el-tree-node__content {
  background-color: #00be97;
  color: #fff;
}

.none-div >>> .el-tree-node__content:hover,
.none-div >>> .el-upload-list__item:hover {
  background-color: #00be97;
  color: #fff;
}

.none-div >>> .el-tree-node__content {
  height: 0.48rem;
  justify-content: center;
}

.none-div >>> .el-tree-node__expand-icon.is-leaf {
  display: none !important;
}
</style>
