heyujie
2021-09-24 84ad5590bafc58e17ebcf7ebdce2cd70c0c22ea9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<template>
  <div class="container">
    <div class="container-left">
      <div
        class="left-card"
        v-for="(item, i) in menuArr"
        :key="i"
        :class="activePage == i ? 'left-card-active' : ''"
        @click="openMenu(item, i)"
      >
        <span class="icon iconfont" :style="`font-size:${item.size}px`">{{item.icon}}</span>
        <span class="card-text">{{ item.name }}</span>
      </div>
    </div>
    <operationLog v-if="activePage == 0" style="width: 100%"></operationLog>
    <systemLog v-if="activePage == 1" style="width: 100%"></systemLog>
    <pollingLog v-if="activePage == 2" style="width: 100%"></pollingLog>
    <eventPushLog v-if="activePage == 3" style="width: 100%"></eventPushLog>
  </div>
</template>
 
<script>
import operationLog from "../views/operationLog";
import systemLog from "../views/systemLog";
import pollingLog from "../views/pollingLog";
import eventPushLog from "../views/eventPushLog";
export default {
  name: "settings",
  components: {
    operationLog,
    systemLog,
    pollingLog,
    eventPushLog,
  },
  data() {
    return {
      menuArr: [
        { name: "操作日志",icon:"\ue706",size:19 },
        { name: "系统日志",icon:"\ue730"  ,size:19},
        { name: "轮询日志",icon:"\ue708" ,size:21},
        { name: "事件推送日志",icon:"\ue707" ,size:13 },
      ],
      activePage: 0,
    };
  },
  methods: {
    openMenu(item, i) {
      this.activePage = i;
    },
  },
};
</script>
<style lang="scss">
.container {
  height: 100%;
  display: flex;
  flex-direction: row;
  flex: 1;
  flex-basis: auto;
  box-sizing: border-box;
  background-color: #fff;
  .container-left {
    height: 100%;
    width: 210px;
    overflow: auto;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 10px;
    border-right: 5px solid rgba(248, 248, 248, 1);
    box-sizing: border-box;
    .left-card {
      height: 55px;
      cursor: pointer;
      border-radius: 12px;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      .iconfont {
        margin-left: 15px;
        margin-right: 10px;
        font-size: 20px;
      }
      .card-text {
        font-size: 16px;
      }
    }
    .left-card-active{
        background-color: rgba(61, 104, 225, 1);
        color: #fff;
    }
    .left-card:hover {
      background-color: rgba(61, 104, 225, 1);
      color: #fff;
    }
  }
}
</style>