summaryrefslogtreecommitdiff
path: root/src/layout/AppMenu.vue
blob: 7252a89a2198ec4dd5ba63a24898ea704f74915d (plain)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<template>
    <div class="menu" ref="appRef">
        <div  :class="hit==='home'? 'NotesHit':'Notes'" @click="updataHit('home')">
            <div class="nameIframe" >
                <img src="../img/1.png">
                <span>仪表盘</span>
            </div>
        </div>
        <div  :class="hit==='menuSurrogateInformation'? 'NotesHit':'Notes'" @click="updataHit('menuSurrogateInformation')">
            <div class="nameIframe">
                <img src="../img/4.png">
                <span>代理信息</span>
            </div>
        </div>
        <div  :class="hit==='menuMBGZ'? 'NotesHit':'Notes'" v-on:click="updataHit('menuMBGZ')">
            <div class="nameIframe">
                <img src="../img/6.png">
                <span>目标感知</span>
            </div>
        </div>
        <div  :class="hit==='menuTaskManagement'? 'NotesHit':'Notes'"  @click="updataHit('menuTaskManagement')">
            <div class="nameIframe">
                <img src="../img/7.png">
                <span>任务管理</span>
            </div>
        </div>
        <div  :class="hit==='menuSysManagement'? 'NotesHit':'Notes'" @click="updataHit('menuSysManagement')">
            <div class="nameIframe">
                <img src="../img/6.png">
                <span>系统管理</span>
            </div>
        </div>
        <div  :class="hit==='menuSysIntroduce'? 'NotesHit':'Notes'" @click="updataHit('menuSysIntroduce')">
            <div class="nameIframe">
                <img src="../img/8.png">
                <span>系统介绍</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "AppMenu",
        // props:['menuDict'],
        // components:{
        //     router
        // },
        data(){
            return{
                menuDict: localStorage.getItem('menuDict'),
                hit:'home',
                bcSysState:false,
            };
        },
        mounted() {
        },
        watch: {
            '$store.state.globalAttrs.checkMenu': {
                handler(newVal, oldVal) {
                    if (newVal !== '') {
                        this.bcSysState = true
                        this.updataHit(newVal)
                        this.$store.commit('globalAttrs/setCheckMenu', '')
                    }
                }
            }            
        },
        created() {
        },
        methods:{
            updataHit(name){
                this.$router.push({ name })
                this.hit=name
                let title = ''
                switch (name) {
                    case 'home':
                        title = 'Dashboard'
                        break
                    case 'menuSurrogateInformation':
                        title = '代理管理'
                        break
                    case 'menuMBGZ':
                        title = '目标感知'
                        break
                    case 'menuSysManagement':
                        title = '系统管理'
                        break
                    case 'menuTaskManagement':
                        title = '任务管理'
                        break
                    case 'menuSysIntroduce':
                        title = '系统介绍'
                        break             
                    default:
                        title = '仪表盘'
                        break
                }
                this.$emit('parent-func',title)
            },
            onOff(event){
                event.stopPropagation()
                if(this.bcSysState===true){
                    this.bcSysState=false
                }else {
                    this.bcSysState=true
                }
            }
        }
    }

</script>

<style lang='less' scoped>
.menu{
    display: flex;
    flex-direction: column;
    width: 10%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
}
.NotesHit{
    background-image:url(../img/2.png) ;
    background-repeat: no-repeat; /* 可选,防止图像重复 */
    background-size: 90% auto; /* 宽度为100%,高度自适应保持宽高比 */
    background-position: center center; /* 设置背景图片水平、垂直居中 */
    float: right;
    margin-right: 2%;
    margin-top: 5%;

    width: 95%;
    /*height: 50%;*/
    color: #ffffff;
    font-family: "PingFang SC";
    font-weight: 500;
    .nameIframe{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 8%;
        padding-bottom: 8%;
        font-size: 18px;
        margin-left: 10%;
        img {
            height: 10%;
            width: 10%;
            color: #ffffff;
        }
        span {
            margin-left: 8%;
        }
    }
    .nameIframe2{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 8%;
        padding-bottom: 8%;
        font-size: 15px;
        margin-left: 10%;
        span {
            margin-left: 18%;
        }
    }
}
.Notes{
    /*background-image:url(../img/2.png) ;*/
    /*background-repeat: no-repeat; !* 可选,防止图像重复 *!*/
    /*background-size: 100% auto; !* 宽度为100%,高度自适应保持宽高比 *!*/
    /*background-position: center center; !* 设置背景图片水平、垂直居中 *!*/
    float: left;
    margin-right: 2%;
    margin-top: 5%;
    width: 95%;
    // color: #faf8ff;
    color: #cccccc;
    font-family: "PingFang HK";
    .nameIframe{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 8%;
        padding-bottom: 8%;
        font-size: 14px;
        margin-left: 20%;
        img {
            height: 10%;
            width: 10%;
            color: #ffffff;
        }
        span {
            margin-left: 8%;
        }
    }
    .nameIframe2{
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 8%;
        padding-bottom: 8%;
        font-size: 14px;
        margin-left: 10%;
        span {
            margin-left: 18%;
        }
    }
}
</style>