refactor: 移除polling-store,重构setting-store

This commit is contained in:
yangsy
2026-01-19 15:15:38 +08:00
parent b7b6b216fb
commit 6771abec31
29 changed files with 197 additions and 185 deletions

View File

@@ -16,7 +16,7 @@ const route = useRoute();
const router = useRouter();
const settingStore = useSettingStore();
const { debugModeEnabled } = storeToRefs(settingStore);
const { showDeviceRawData } = storeToRefs(settingStore);
const { ndmDevice, station } = toRefs(props);
@@ -31,7 +31,7 @@ const activeTabName = ref('当前诊断');
const onTabChange = (name: string) => {
activeTabName.value = name;
};
watch([ndmDevice, debugModeEnabled], ([newDevice, enabled], [oldDevice]) => {
watch([ndmDevice, showDeviceRawData], ([newDevice, enabled], [oldDevice]) => {
if (newDevice.id !== oldDevice.id || !enabled) {
activeTabName.value = '当前诊断';
}
@@ -46,7 +46,7 @@ watch([ndmDevice, debugModeEnabled], ([newDevice, enabled], [oldDevice]) => {
<NTab name="当前诊断">当前诊断</NTab>
<NTab name="历史诊断">历史诊断</NTab>
<NTab name="修改设备">修改设备</NTab>
<NTab v-if="debugModeEnabled" name="原始数据">原始数据</NTab>
<NTab v-if="showDeviceRawData" name="原始数据">原始数据</NTab>
</NTabs>
</template>
<template #default>