jesting0
2022-04-06 4a0fb138f5670809507c6483074622630e59eef3
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<template>
  <div class="monitor-menu">
    <div class="bg">
      <div
        class="item"
        v-for="item in items"
        :key="item.name"
        :class="{ active: item.name == currentMenu }"
        @click="onClick(item)"
      >
        <Icon :type="item.icon" size="18" />
        <br />
        <span>{{ item.title }}</span>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  name: "MonitorMenu",
  props: {
    menu: Object,
  },
  data() {
    return {
      items: [
        {
          name: "agv",
          icon: "md-git-compare",
          title: "AGV",
        },
        {
          name: "order",
          icon: "md-list-box",
          title: "订单",
        },
        // {
        //   name: "task",
        //   icon: "md-paper",
        //   title: "任务",
        // },
        // {
        //   name: "tray",
        //   icon: "md-document",
        //   title: "托盘",
        // },
        // {
        //   name: "tary-task",
        //   icon: "ios-paper",
        //   title: "托盘任务",
        // },
        // {
        //   name: "agvTrace",
        //   icon: "md-code",
        //   title: "AgvTrace",
        // },
        // {
        //   name: "command",
        //   icon: "md-code-working",
        //   title: "命令",
        // },
        // {
        //   name: "io",
        //   icon: "ios-radio",
        //   title: "IO",
        // },
        // {
        //   name: "location",
        //   icon: "md-radio",
        //   title: "库位",
        // },
        // {
        //   name: "station",
        //   icon: "ios-radio-outline",
        //   title: "站台",
        // },
      ],
    };
  },
  computed: {
    currentMenu() {
      return this.menu.name;
    },
  },
  methods: {
    onClick(item) {
      if (this.currentMenu == item.name)
        this.$emit("on-select-change", {
          name: "",
          icon: "",
          title: "",
        });
      else this.$emit("on-select-change", item);
    },
  },
};
</script>
 
<style lang="less" scoped>
.monitor-menu {
  height: 100%;
  overflow-y: auto;
  .bg {
    background-color: #f1f1f1;
  }
  .item {
    background-color: #fff;
    margin-bottom: 6px;
    padding-top: 12px;
    border-radius: 5px;
    width: 70px;
    height: 60px;
    text-align: center;
    color: #2d8cf0;
    font-size: 12px;
    cursor: pointer;
    &.active {
      border: 2px solid #2d8cf0;
    }
  }
  &::-webkit-scrollbar {
    display: none;
  }
}
</style>