97 lines
2.3 KiB
Vue
97 lines
2.3 KiB
Vue
<template>
|
|
<!-- style=" height: calc(100vh - 120px) !important;" -->
|
|
<div class="homeView">
|
|
<model v-if="!authStore.showMenuFlag"></model>
|
|
<dashboard v-if="authStore.showMenuFlag"></dashboard>
|
|
</div>
|
|
|
|
<!-- <div class="main">
|
|
<div class="main_container">
|
|
<div class="mode" v-for="(item, index) in modeList" :key="index">
|
|
<div class="mode_top">
|
|
<div class="mode_name">
|
|
<p>
|
|
{{ item.name }}
|
|
</p>
|
|
</div>
|
|
<div class="test_button">
|
|
<el-button
|
|
size="small"
|
|
dictType="primary"
|
|
@click="handelOpen(item.isActive)"
|
|
>进入检测</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
<div class="mode_img">
|
|
<img :src="item.img" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { useRouter } from "vue-router";
|
|
import { ElMessage } from "element-plus";
|
|
import { useAuthStore } from "@/stores/modules/auth";
|
|
|
|
import model from "./tabs/model.vue";
|
|
import dashboard from "./tabs/dashboard.vue";
|
|
import { onMounted, ref } from "vue";
|
|
// defineOptions({
|
|
// name: 'home'
|
|
// })
|
|
const authStore = useAuthStore();
|
|
|
|
const activeIndex = ref("1-1");
|
|
const router = useRouter();
|
|
const modeList = [
|
|
{
|
|
name: "模拟式模式",
|
|
code:"模拟式",
|
|
img: new URL('/src/assets/images/dashboard/1.svg', import.meta.url).href,
|
|
isActive: true,
|
|
},
|
|
{
|
|
name: "数字式模式",
|
|
code:"数字式",
|
|
subName: "启用数字检测计划",
|
|
img: new URL('/src/assets/images/dashboard/2.svg', import.meta.url).href,
|
|
isActive: false,
|
|
},
|
|
{
|
|
name: "比对式模式",
|
|
code:"比对式",
|
|
subName: "启用比对式检测计划",
|
|
img: new URL('/src/assets/images/dashboard/3.svg', import.meta.url).href,
|
|
isActive: false,
|
|
},
|
|
];
|
|
const handelOpen = async (isActive: any) => {
|
|
await authStore.setShowMenu();
|
|
return;
|
|
if (isActive) {
|
|
router.push({ path: "/static" });
|
|
} else {
|
|
ElMessage({
|
|
message: "当前模式未配置",
|
|
type: "warning",
|
|
});
|
|
}
|
|
};
|
|
const handleSelect = (key: string, keyPath: string[]) => {
|
|
//console.log(key, keyPath);
|
|
};
|
|
onMounted(() => {
|
|
//console.log(111);
|
|
|
|
});
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.homeView{
|
|
width: 100%;
|
|
// height: calc(100vh - 120px);
|
|
height: 100%;
|
|
}
|
|
</style>
|