|
@@ -12,25 +12,29 @@ const menus = ref<MenuItem[]>([
|
|
|
route: "/main/home",
|
|
|
},
|
|
|
{
|
|
|
- name: "工作台",
|
|
|
- icon: "work-bench",
|
|
|
- route: "/main/work-bench",
|
|
|
+ name: "测试执行",
|
|
|
+ icon: "run-test",
|
|
|
+ route: "/main/run-test",
|
|
|
},
|
|
|
{
|
|
|
- name: "设备",
|
|
|
- name: "设备",
|
|
|
- icon: "devices",
|
|
|
- route: "/main/devices",
|
|
|
+ name: "数据管理",
|
|
|
+ icon: "data-manager",
|
|
|
+ route: "/main/data-manager",
|
|
|
},
|
|
|
{
|
|
|
- name: "应用",
|
|
|
- icon: "apps",
|
|
|
- route: "/main/apps",
|
|
|
+ name: "工程配置",
|
|
|
+ icon: "project-config",
|
|
|
+ route: "/main/project-config",
|
|
|
},
|
|
|
{
|
|
|
- name: "车间",
|
|
|
- icon: "work-shop",
|
|
|
- route: "/main/work-shop",
|
|
|
+ name: "报告魔板",
|
|
|
+ icon: "report-template",
|
|
|
+ route: "/main/report-template",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "人员管理",
|
|
|
+ icon: "person-manager",
|
|
|
+ route: "/main/person-manager",
|
|
|
},
|
|
|
]);
|
|
|
const currentMenu = ref<MenuItem>(menus.value[0]);
|
|
@@ -53,12 +57,19 @@ const handleMenuClick = (menu: MenuItem) => {
|
|
|
@click="handleMenuClick(menu)"
|
|
|
>
|
|
|
<!-- 这里的图标可以用可变色的svg 传过去一个color属性,然后根据当前路由的颜色来显示不同的颜色-->
|
|
|
- <div class="icon">{{ menu.icon }}</div>
|
|
|
+
|
|
|
+ <svg-icon
|
|
|
+ :icon-class="menu.icon"
|
|
|
+ :size="24"
|
|
|
+ :style="{
|
|
|
+ color: menu.route === currentMenu.route ? 'white' : '#AFB9D0',
|
|
|
+ }"
|
|
|
+ />
|
|
|
<div
|
|
|
class="name"
|
|
|
:class="[menu.route === currentMenu.route ? 'selected' : 'normal']"
|
|
|
>
|
|
|
- {{ menu.name }} {{ menu.route === currentMenu.route ? "▲" : "" }}
|
|
|
+ {{ menu.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -66,37 +77,39 @@ const handleMenuClick = (menu: MenuItem) => {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.menu {
|
|
|
- height: 100%;
|
|
|
- width: 150px;
|
|
|
- border: 2px solid blue;
|
|
|
+ height: calc(100vh - $main-header-height);
|
|
|
+ width: 79px;
|
|
|
+
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- justify-content: space-around;
|
|
|
+ justify-content: start;
|
|
|
align-items: center;
|
|
|
- padding: 150px 45px;
|
|
|
+ padding: 12px 6px;
|
|
|
+ background-color: $hj-black-3;
|
|
|
|
|
|
.menu-box {
|
|
|
- width: 60px;
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
|
|
|
- .icon {
|
|
|
- width: 60px;
|
|
|
- height: 60px;
|
|
|
- border: 1px solid #0a84ff;
|
|
|
- }
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
|
.name {
|
|
|
margin-top: 10px;
|
|
|
font-weight: bold;
|
|
|
- font-size: 16px;
|
|
|
+ font-size: 12px;
|
|
|
line-height: 19px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
.normal {
|
|
|
- color: $hj-white-1;
|
|
|
+ color: #afb9d0;
|
|
|
}
|
|
|
.selected {
|
|
|
- color: $hj-blue-1;
|
|
|
+ color: $hj-white-1;
|
|
|
}
|
|
|
}
|
|
|
}
|