|
@@ -1,21 +1,30 @@
|
|
<template>
|
|
<template>
|
|
- <div class="mainContentBox">
|
|
|
|
|
|
+ <div class="mainContentBox" style="padding: 0 24px">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="4" class="elColClasss">
|
|
<el-col :span="4" class="elColClasss">
|
|
<!-- 侧边栏盒子 -->
|
|
<!-- 侧边栏盒子 -->
|
|
<Jiluxiang />
|
|
<Jiluxiang />
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="20" class="elColClasss">
|
|
<el-col :span="20" class="elColClasss">
|
|
- <div class="typeContainer">
|
|
|
|
- <div
|
|
|
|
- v-for="(item, index) in stepComponents"
|
|
|
|
- :key="index"
|
|
|
|
- :class="getNameClass(index)"
|
|
|
|
- class="typeBox"
|
|
|
|
- @click="clickToolCom(item, index)"
|
|
|
|
- >
|
|
|
|
- <svg-icon :icon-class="item.compentType" size="30" />
|
|
|
|
- <div class="name">{{ item.compentName }}</div>
|
|
|
|
|
|
+ <div class="container">
|
|
|
|
+ <div class="typeContainer">
|
|
|
|
+ <div v-for="(item, index) in stepComponents" :key="index" :class="getNameClass(index)" class="typeBox">
|
|
|
|
+ <router-link :to="{ name: item.path }">
|
|
|
|
+ <div class="svgIcon">
|
|
|
|
+ <svg-icon :icon-class="item.compentType" size="30" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="name">{{ item.compentName }}</div>
|
|
|
|
+ </router-link>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 二级路由盒子 -->
|
|
|
|
+ <div class="routerView">
|
|
|
|
+ <router-view v-slot="{ Component, route }">
|
|
|
|
+ <keep-alive v-if="route.meta.keepAlive == true">
|
|
|
|
+ <component :is="Component" :key="route.name" />
|
|
|
|
+ </keep-alive>
|
|
|
|
+ <component v-else :is="Component" :key="route.name" />
|
|
|
|
+ </router-view>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -26,65 +35,102 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted } from "vue";
|
|
import { onMounted } from "vue";
|
|
import Jiluxiang from "@/views/pro-steps/Jiluxiang.vue";
|
|
import Jiluxiang from "@/views/pro-steps/Jiluxiang.vue";
|
|
-
|
|
|
|
|
|
+import { processViewStore } from "@/store";
|
|
|
|
+const store = processViewStore();
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
+//配置标签信息Data
|
|
const stepComponents = ref([
|
|
const stepComponents = ref([
|
|
{
|
|
{
|
|
compentName: "记录项",
|
|
compentName: "记录项",
|
|
compentType: "jiluxiang",
|
|
compentType: "jiluxiang",
|
|
- route: "",
|
|
|
|
|
|
+ path: "Jiluxiang",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "物料采集",
|
|
compentName: "物料采集",
|
|
compentType: "wuliaocaiji",
|
|
compentType: "wuliaocaiji",
|
|
|
|
+ path: "wuliaocaiji",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "ESOP",
|
|
compentName: "ESOP",
|
|
compentType: "ESOP",
|
|
compentType: "ESOP",
|
|
|
|
+ path: "esop",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "点检",
|
|
compentName: "点检",
|
|
compentType: "dianjian",
|
|
compentType: "dianjian",
|
|
|
|
+ path: "dianjian",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "设备记录",
|
|
compentName: "设备记录",
|
|
compentType: "shebeijilu",
|
|
compentType: "shebeijilu",
|
|
|
|
+ path: "shebeijilu",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "紧固",
|
|
compentName: "紧固",
|
|
compentType: "jingu",
|
|
compentType: "jingu",
|
|
|
|
+ path: "jingu",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "调试配对",
|
|
compentName: "调试配对",
|
|
compentType: "tiaoshipipei",
|
|
compentType: "tiaoshipipei",
|
|
|
|
+ path: "tiaoshipipei",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "铭牌绑定",
|
|
compentName: "铭牌绑定",
|
|
compentType: "mingpai",
|
|
compentType: "mingpai",
|
|
|
|
+ path: "mingpaibangding",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
compentName: "多媒体采集",
|
|
compentName: "多媒体采集",
|
|
compentType: "duomeiticaiji",
|
|
compentType: "duomeiticaiji",
|
|
|
|
+ path: "duomeiticaiji",
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
|
|
+//当前路由在setpComponents中的index
|
|
const selectIndex = ref(-1);
|
|
const selectIndex = ref(-1);
|
|
-const currentCom = ref({});
|
|
|
|
|
|
|
|
-const clickToolCom = (com, index) => {
|
|
|
|
- selectIndex.value = index;
|
|
|
|
- currentCom.value = com;
|
|
|
|
-};
|
|
|
|
const getNameClass = (index) => {
|
|
const getNameClass = (index) => {
|
|
return index === selectIndex.value ? "typeBoxSelected" : "typeBoxNormal";
|
|
return index === selectIndex.value ? "typeBoxSelected" : "typeBoxNormal";
|
|
};
|
|
};
|
|
|
|
+//设置标签是否被选中
|
|
|
|
+const setSelectIndex = () => {
|
|
|
|
+ stepComponents.value.forEach((item, index) => {
|
|
|
|
+ if (item.path == route.name) {
|
|
|
|
+ selectIndex.value = index;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+onMounted(() => {
|
|
|
|
+ setSelectIndex();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.typeContainer {
|
|
|
|
|
|
+.container {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex: 1;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ background-color: aqua;
|
|
width: 100%;
|
|
width: 100%;
|
|
- overflow-x: auto;
|
|
|
|
|
|
+ height: calc(100vh - 80px);
|
|
|
|
+
|
|
|
|
+ .typeContainer {
|
|
|
|
+ width: 100%;
|
|
|
|
+ overflow-x: auto;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+
|
|
|
|
+ .svgIcon {
|
|
|
|
+ @include flex;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.routerView {
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: flex-start;
|
|
|
|
|
|
+ flex: 1;
|
|
|
|
+ background-color: red;
|
|
|
|
+ overflow-y: auto;
|
|
}
|
|
}
|
|
|
|
|
|
.typeBox {
|
|
.typeBox {
|