新增数据,开始安全巡检模块

This commit is contained in:
Zy
2026-04-17 19:39:21 +08:00
parent 4184f1c55d
commit 9a95e2b7e3
74 changed files with 1942 additions and 403 deletions

View File

@@ -1,6 +1,6 @@
<template>
<el-config-provider :locale="appStore.locale" :size="appStore.size">
<router-view />
<router-view ref="wrapRef" />
</el-config-provider>
</template>
@@ -17,4 +17,33 @@ onMounted(() => {
handleThemeStyle(useSettingsStore().theme);
});
});
const scale = ref(1);
// 设计稿宽度(你是多少就写多少,一般 1920
const DESIGN_WIDTH = 1920;
// 计算缩放
const setScale = () => {
const clientWidth = document.documentElement.clientWidth;
let ratio = clientWidth / DESIGN_WIDTH;
// 最小缩到 0.7(防止太小看不清)
if (ratio < 0.7) ratio = 0.7;
// 最大不超过 1
if (ratio > 1) ratio = 1;
scale.value = ratio;
};
// 监听窗口变化
const resizeListener = () => {
setScale();
};
onMounted(() => {
setScale();
window.addEventListener('resize', resizeListener);
});
onUnmounted(() => {
window.removeEventListener('resize', resizeListener);
});
</script>