2024-08-23 13:19:20 +08:00
|
|
|
|
<!-- 模式切换页面 -->
|
|
|
|
|
|
<template>
|
2025-01-14 19:26:22 +08:00
|
|
|
|
<div class="main_container box">
|
2024-10-10 17:47:55 +08:00
|
|
|
|
<!-- :style="{
|
|
|
|
|
|
height: authStore?.showMenuFlag
|
|
|
|
|
|
? 'calc(100vh - 165px)'
|
|
|
|
|
|
: 'calc(100vh - 125px)',
|
|
|
|
|
|
}" -->
|
2025-01-14 19:26:22 +08:00
|
|
|
|
|
|
|
|
|
|
<el-carousel :interval="5000" type="card" style="width: 60%;margin-left: 20%;height: 70%;">
|
|
|
|
|
|
<el-carousel-item class="mode" :class="{ modeBG: index != 0 }" v-for="(item, index) in modeList" :key="index">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mode_top">
|
|
|
|
|
|
<div class="mode_name">
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mode_img">
|
|
|
|
|
|
<img :src="item.img" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="test_button">
|
|
|
|
|
|
<el-button size="large" type="primary" @click="handelOpen(item)"
|
|
|
|
|
|
:disabled="item.isActive == false">进入检测</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-carousel-item>
|
|
|
|
|
|
</el-carousel>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="mode" :class="{ modeBG: index != 0 }" v-for="(item, index) in modeList" :key="index">
|
2024-10-10 17:47:55 +08:00
|
|
|
|
<div class="mode_top">
|
|
|
|
|
|
<div class="mode_name">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
</p>
|
2024-08-23 13:19:20 +08:00
|
|
|
|
</div>
|
2024-10-10 17:47:55 +08:00
|
|
|
|
<div class="test_button">
|
2025-01-14 16:19:15 +08:00
|
|
|
|
<el-button size="small" type="primary" @click="handelOpen(item)"
|
|
|
|
|
|
:disabled="item.isActive == false">进入检测</el-button>
|
2024-08-23 13:19:20 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2024-10-10 17:47:55 +08:00
|
|
|
|
<div class="mode_img">
|
|
|
|
|
|
<img :src="item.img" />
|
|
|
|
|
|
</div>
|
2025-01-14 19:26:22 +08:00
|
|
|
|
</div> -->
|
2024-08-23 13:19:20 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
|
import { ElMessage } from "element-plus";
|
2024-10-09 20:03:07 +08:00
|
|
|
|
import { useAuthStore } from "@/stores/modules/auth";
|
2025-01-14 16:19:15 +08:00
|
|
|
|
import { useModeStore, useAppSceneStore } from "@/stores/modules/mode"; // 引入模式 store
|
2025-01-13 18:12:36 +08:00
|
|
|
|
import { ref } from "vue";
|
2024-08-23 13:19:20 +08:00
|
|
|
|
const authStore = useAuthStore();
|
2024-11-20 11:02:50 +08:00
|
|
|
|
const modeStore = useModeStore(); // 使用模式 store
|
2025-01-13 18:12:36 +08:00
|
|
|
|
const AppSceneStore = useAppSceneStore();
|
2024-08-23 13:19:20 +08:00
|
|
|
|
const activeIndex = ref("1-1");
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
const modeList = [
|
|
|
|
|
|
{
|
2024-08-27 18:37:46 +08:00
|
|
|
|
name: "模拟式模块",
|
2025-01-14 16:19:15 +08:00
|
|
|
|
code: "模拟式",
|
2024-08-23 13:19:20 +08:00
|
|
|
|
subName: "未启用模拟式检测计划",
|
|
|
|
|
|
img: "/src/assets/images/dashboard/1.svg",
|
|
|
|
|
|
isActive: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-08-27 18:37:46 +08:00
|
|
|
|
name: "数字式模块",
|
2025-01-14 16:19:15 +08:00
|
|
|
|
code: "数字式",
|
2024-08-23 13:19:20 +08:00
|
|
|
|
subName: "启用数字检测计划",
|
|
|
|
|
|
img: "/src/assets/images/dashboard/2.svg",
|
2025-01-14 16:19:15 +08:00
|
|
|
|
isActive: false,
|
2024-08-23 13:19:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-11-20 15:13:50 +08:00
|
|
|
|
name: "比对式模块",
|
2025-01-14 16:19:15 +08:00
|
|
|
|
code: "比对式",
|
2024-11-20 15:13:50 +08:00
|
|
|
|
subName: "启用比对式检测计划",
|
2024-08-23 13:19:20 +08:00
|
|
|
|
img: "/src/assets/images/dashboard/3.svg",
|
2025-01-14 16:19:15 +08:00
|
|
|
|
isActive: false,
|
2024-08-23 13:19:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
];
|
2024-11-20 11:02:50 +08:00
|
|
|
|
const handelOpen = async (item: any) => {
|
2024-11-21 10:05:44 +08:00
|
|
|
|
modeStore.setCurrentMode(item.code); // 将模式code存入 store
|
2025-01-13 18:12:36 +08:00
|
|
|
|
AppSceneStore.setCurrentMode('1');//0:省级平台,1:设备出厂,2:研发自测
|
2024-12-17 11:12:21 +08:00
|
|
|
|
await authStore.setShowMenu();
|
2024-08-23 13:19:20 +08:00
|
|
|
|
return;
|
2024-12-17 11:12:21 +08:00
|
|
|
|
// if (isActive) {
|
|
|
|
|
|
// router.push({ path: "/static" });
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// ElMessage({
|
|
|
|
|
|
// message: "当前模式未配置",
|
|
|
|
|
|
// type: "warning",
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
2024-08-23 13:19:20 +08:00
|
|
|
|
};
|
|
|
|
|
|
const handleSelect = (key: string, keyPath: string[]) => {
|
|
|
|
|
|
console.log(key, keyPath);
|
|
|
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
console.log();
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
2025-01-14 19:26:22 +08:00
|
|
|
|
.box {
|
|
|
|
|
|
background: #ededed;
|
|
|
|
|
|
// background-image: url("/src/assets/images/dashboard/DT.jpg");
|
|
|
|
|
|
// /* 背景图垂直、水平均居中 */
|
|
|
|
|
|
// // background-position: center center;
|
|
|
|
|
|
// /* 背景图不平铺 */
|
|
|
|
|
|
// background-repeat: no-repeat;
|
|
|
|
|
|
// /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
|
|
|
|
|
|
// background-attachment: fixed;
|
|
|
|
|
|
// /* 让背景图基于容器大小伸缩 */
|
|
|
|
|
|
// background-size: cover;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.main_container {
|
2025-01-14 19:26:22 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
width: 100%;
|
2024-10-10 17:47:55 +08:00
|
|
|
|
// height: calc(100vh - 165px);
|
|
|
|
|
|
height: 100%;
|
2024-08-23 13:19:20 +08:00
|
|
|
|
// overflow-y: auto;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
align-items: center;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode {
|
2025-01-14 19:26:22 +08:00
|
|
|
|
|
2024-10-10 17:47:55 +08:00
|
|
|
|
height: 99.5% !important;
|
2024-08-23 13:19:20 +08:00
|
|
|
|
border: 1px solid #eee;
|
|
|
|
|
|
border-radius: 6px;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
background: linear-gradient(180deg,
|
|
|
|
|
|
rgba(0, 153, 255, 1) 0%,
|
|
|
|
|
|
rgba(0, 153, 255, 1) 0%,
|
|
|
|
|
|
rgba(0, 102, 255, 1) 65%,
|
|
|
|
|
|
rgba(0, 51, 255, 1) 100%,
|
|
|
|
|
|
rgba(0, 51, 255, 1) 100%);
|
|
|
|
|
|
|
2025-01-14 19:26:22 +08:00
|
|
|
|
position: absolute;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
// padding: 40px 0;
|
|
|
|
|
|
.mode_top {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
display: flex;
|
2025-01-14 19:26:22 +08:00
|
|
|
|
justify-content: center;
|
2024-08-23 13:19:20 +08:00
|
|
|
|
align-items: center;
|
|
|
|
|
|
background: #008aff;
|
|
|
|
|
|
border-radius: 6px 6px 0 0;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_name {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 40px;
|
2025-01-14 19:26:22 +08:00
|
|
|
|
font-family: "微软雅黑 Bold", "微软雅黑", "微软雅黑", sans-serif;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
font-style: normal;
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
// margin-top: 20px;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_subName {
|
|
|
|
|
|
font-family: "微软雅黑", sans-serif;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-style: normal;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding: 5px 0 0 10px;
|
|
|
|
|
|
// margin-top: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.test_button {
|
2025-01-14 19:26:22 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
width: 100%;
|
2024-08-23 13:19:20 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
padding-right: 5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_img {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
// padding: 30px 0 50px;
|
|
|
|
|
|
margin-top: 100px;
|
2025-01-14 19:26:22 +08:00
|
|
|
|
// margin-bottom: 100px;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
img:nth-child(1) {
|
|
|
|
|
|
width: 60%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
img:nth-child(2) {
|
|
|
|
|
|
width: 70%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
img:nth-child(3) {
|
|
|
|
|
|
width: 60%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_test {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
margin-bottom: 20px;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.test_button:hover {
|
|
|
|
|
|
background: rgba(0, 0, 0, 0.2);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-14 19:26:22 +08:00
|
|
|
|
.test_button {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 30px;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
|
font-family: "微软雅黑", sans-serif;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-style: normal;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode:nth-child(3n + 3) {
|
2025-01-14 16:19:15 +08:00
|
|
|
|
background: linear-gradient(180deg,
|
|
|
|
|
|
rgba(0, 153, 255, 1) 0%,
|
|
|
|
|
|
rgba(0, 153, 255, 1) 0%,
|
|
|
|
|
|
rgba(0, 102, 255, 1) 39%,
|
|
|
|
|
|
rgba(102, 51, 204, 1) 100%,
|
|
|
|
|
|
rgba(102, 51, 204, 1) 100%);
|
|
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_off {
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.mode_name,
|
|
|
|
|
|
.mode_subName,
|
|
|
|
|
|
.test_button {
|
|
|
|
|
|
color: #fff !important;
|
2025-01-14 19:26:22 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-08-23 13:19:20 +08:00
|
|
|
|
.test_button:hover {
|
|
|
|
|
|
// background: rgba(0, 0, 0, 0.2) !important;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2024-10-09 20:03:07 +08:00
|
|
|
|
:deep(.el-sub-menu__title) {
|
2024-08-23 13:19:20 +08:00
|
|
|
|
border-bottom: 0 !important;
|
|
|
|
|
|
outline: none !important;
|
|
|
|
|
|
}
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
2025-01-14 19:26:22 +08:00
|
|
|
|
// .modeBG {
|
|
|
|
|
|
// &::before {
|
|
|
|
|
|
// content: "";
|
|
|
|
|
|
// position: absolute;
|
|
|
|
|
|
// top: 0;
|
|
|
|
|
|
// left: 0;
|
|
|
|
|
|
// width: 100%;
|
|
|
|
|
|
// height: 100%;
|
|
|
|
|
|
// background-color: #70707080;
|
|
|
|
|
|
// ;
|
|
|
|
|
|
// }
|
2025-01-14 16:19:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-01-14 19:26:22 +08:00
|
|
|
|
// }
|
|
|
|
|
|
:deep(.el-carousel__container) {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-carousel__item) {
|
|
|
|
|
|
position: relative;
|
2025-01-14 16:19:15 +08:00
|
|
|
|
}
|
2024-08-23 13:19:20 +08:00
|
|
|
|
</style>
|