longyvfengyun
2024-03-28 c9edc21dac11a334c1a49aec5cb829760def34c2
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<script setup>
import slideMenu from "@/views/mainLayout/js/slideMenu";
import {useRoute} from "vue-router";
import PageHeader from "@/views/mainLayout/components/pageHeader.vue";
import logoImg from '@/assets/images/logo1.png';
import {computed} from "vue";
import usePageMenuStore from "@/stores/pageMenu";
const route = useRoute();
const {isCollapse, menuActive, menuData} = slideMenu();
menuActive.value = route.path;
menuData.value = [
    {
        title: "首页",
        path: "/home",
        icon: "HomeFilled"
    },
    // {
    //     title: "视频监控",
    //     path: "/videoShow",
    //     icon: "VideoCameraFilled"
    // },
    // {
    //     title: "驾驶行为分析图",
    //     path: "/user/drivingAnalysis",
    //     icon: "Van"
    // },
  {
    title: "原始数据",
    path: "/battShow",
    icon: "TrendCharts"
  },
    {
        title: "故障分析",
        path: "/analysis",
        icon: "Monitor",
        children: [
            {
                title: "局部离群因子LOF算法",
                path: "/analysis/lof",
            },
            {
                title: "融合FEF和DTW算法",
                path: "/analysis/fusion",
            },
            {
                title: "Hausdorff距离算法",
                path: "/analysis/hd",
            },
            {
                title: "Frechet距离算法",
                path: "/analysis/fh",
            },
        ],
    },
    {
        title: "设备管理",
        path: "/user",
        icon: "OfficeBuilding",
        children: [
            {
                title: "汽车列表",
                path: "/user/boxList",
            },
            // {
            //     title: "摄像头列表",
            //     path: "/user/videoList",
            // },
        ]
    }
];
 
const pageMenuStore = usePageMenuStore();
const isTechPage = computed(()=>{
    return pageMenuStore.isTechPage;
});
</script>
 
<template>
    <div class="main-layout">
        <div class="full-height">
            <div class="main-layout-left" v-show="!isCollapse">
                <div class="slide-header">
                    <div class="logo-wrapper">
                        <img :src="logoImg" alt="" />
                    </div>
                    <div class="sys-name" v-if="!isCollapse">动力电池大数据安全监测平台</div>
                </div>
                <div class="slide-menu">
                    <el-menu
                        :router="true"
                        text-color="#FFFFFF"
                        active-text-color="#FFFFFF"
                        background-color="#01182c"
                        :default-active="menuActive"
                        :unique-opened="true"
                        class="el-menu-vertical"
                        :collapse="isCollapse">
                        <template v-for="menu in menuData" :key="menu.path">
                            <el-sub-menu :index="menu.path" v-if="menu.children">
                                <template #title>
                                    <el-icon>
                                        <component :is="menu.icon"></component>
                                    </el-icon>
                                    <span>{{menu.title}}</span>
                                </template>
                                <el-menu-item
                                    v-for="children in menu.children"
                                    :key="children.path"
                                    :index="children.path">{{children.title}}</el-menu-item>
                            </el-sub-menu>
                            <el-menu-item :index="menu.path" v-else>
                                <el-icon>
                                    <component :is="menu.icon"></component>
                                </el-icon>
                                <template #title>{{menu.title}}</template>
                            </el-menu-item>
                        </template>
                    </el-menu>
                </div>
                <div class="slide-footer"></div>
            </div>
        </div>
        <div class="main-layout-content" :class="{'is-tech-page': isTechPage}">
            <div class="full-height" style="overflow-x: hidden">
                <div class="main-layout-content-wrapper">
                    <div class="main-layout-content-header">
                        <page-header :is-collapse="isCollapse"></page-header>
                    </div>
                    <div class="main-layout-content-body">
                        <div class="body-absolute">
                            <router-view></router-view>
                        </div>
                    </div>
                    <div class="main-layout-content-footer" :class="{'is-tech-page': isTechPage}">
                        <span style="margin-right: 16px">湖北工业大学</span><span>智能通信与大数据分析团队</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
 
<style lang="less" scoped>
.main-layout {
    display: flex;
    height: 100%;
    .main-layout-left {
        position: relative;
        display: flex;
        flex-direction: column;
        height: 100%;
        background-color: #01182c;
        .slide-header {
            padding: 8px 0;
            color: #FFFFFF;
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            white-space: nowrap;
            .logo-wrapper {
                display: inline-block;
                vertical-align: middle;
                padding: 0 12px;
                img {
                    width: auto;
                    height: 40px;
                }
            }
            .sys-name {
                display: inline-block;
                padding-right: 16px;
            }
        }
        .slide-menu {
            flex: 1;
            overflow-y: auto;
        }
    }
    .main-layout-content {
        flex: 1;
        overflow-y: auto;
        &.is-tech-page {
            background: url("@/assets/images/dw_bg.jpg") no-repeat;
            background-size: 100% 100%;
        }
    }
}
.main-layout-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    .main-layout-content-body {
        position: relative;
        flex: 1;
        .body-absolute {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    }
}
.el-menu-vertical {
    font-size: 40px;
    border-right: 0;
    .el-menu-item.is-active{
        background-color: #1677ff;
        .el-sub-menu__title {
            color: #FFFFFF;
        }
    }
}
.make-group {
    padding: 4px;
    font-size: 14px;
    text-align: center;
}
.slide-footer {
    text-align: center;
    color: #00FEFF;
    font-size: 14px;
}
.main-layout-content-footer {
    text-align: center;
    padding: 4px;
    font-size: 14px;
    color: #000;
    &.is-tech-page {
        color: #00FEFF;
    }
}
</style>