index.vue 1.64 KB
Newer Older
1 2 3
<!--
 * @Author: your name
 * @Date: 2022-03-08 17:28:57
4
 * @LastEditTime: 2022-03-28 17:20:55
5 6 7 8
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/index.vue
-->
耿迪迪's avatar
耿迪迪 committed
9
<template>
10 11 12 13 14 15 16 17 18
  <div class="monitorData">
    <div class="iconfont">
      <div
        v-for="(item, index) in changeIcon"
        :key="item.class"
        :class="[item.class, { active: isCom == index }]"
        @click="isComChange(index)"
      ></div>
    </div>
19 20 21 22 23
    <transition name="fade-transform" mode="out-in">
      <keep-alive>
        <component :is="currentTabComponent"></component>
      </keep-alive>
    </transition>
耿迪迪's avatar
耿迪迪 committed
24 25 26 27
  </div>
</template>

<script>
28 29
import charsData from "./component/charsData";
import tabledata from "./component/tableData";
耿迪迪's avatar
耿迪迪 committed
30 31 32
export default {
  data() {
    return {
33 34
      // currentTabComponent: tabledata,
      changeIcon: [{ class: "icon-b" }, { class: "icon-a" }],
35
      isCom: 1,
耿迪迪's avatar
耿迪迪 committed
36 37
    };
  },
38 39 40 41
  computed: {
    currentTabComponent() {
      return this.isCom == 0 ? tabledata : charsData;
    },
耿迪迪's avatar
耿迪迪 committed
42 43
  },
  methods: {
44 45
    isComChange(index) {
      this.isCom = index;
耿迪迪's avatar
耿迪迪 committed
46
    },
47
  },
耿迪迪's avatar
耿迪迪 committed
48 49
};
</script>
50 51 52 53 54 55 56

<style lang="scss" scoped>
@import url("~@/assets/iconfont/monitorData/iconfont.css");
.iconfont {
  display: flex;
  justify-content: right;
  margin-right: 37px;
57
  padding-top: 15px;
58 59 60 61 62 63 64 65
  div {
    cursor: pointer;
    padding: 4px;
    &.active,
    &:hover {
      background-color: #666666;
      color: #fff;
    }
66
  }
67 68 69 70 71 72
  .icon-b {
    margin-right: 23px;
  }
}
</style>>