refactor(stores): simplify stores

This commit is contained in:
yangsy
2025-11-25 16:51:20 +08:00
parent 2dd599d2eb
commit 5e464f6e80
39 changed files with 195 additions and 212 deletions

View File

@@ -1,18 +1,19 @@
<script setup lang="ts">
import type { NdmCameraDiagInfo, NdmCameraResultVO } from '@/apis';
import { useDebugModeStore } from '@/stores';
import destr from 'destr';
import { CameraHistoryDiagCard, DeviceCommonCard, DeviceHeaderCard } from '@/components';
import { useSettingStore } from '@/stores';
import { destr } from 'destr';
import { NCard, NFlex, NTabPane, NTabs } from 'naive-ui';
import { computed, ref, toRefs } from 'vue';
import { DeviceCommonCard, DeviceHeaderCard } from './current-diag-card';
import { CameraHistoryDiagCard } from './history-diag-card';
import { storeToRefs } from 'pinia';
const props = defineProps<{
stationCode: string;
ndmCamera: NdmCameraResultVO;
}>();
const debugModeStore = useDebugModeStore();
const settingStore = useSettingStore();
const { debugModeEnabled } = storeToRefs(settingStore);
const { stationCode, ndmCamera } = toRefs(props);
@@ -74,7 +75,7 @@ const selectedTab = ref('设备状态');
<CameraHistoryDiagCard :station-code="stationCode" :ndm-camera="ndmCamera" :key="ndmCamera.id" />
</NTabPane>
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
<NTabPane v-if="debugModeStore.debugEnabled" name="原始数据" tab="原始数据">
<NTabPane v-if="debugModeEnabled" name="原始数据" tab="原始数据">
<pre class="raw-data">{{ { ...ndmCamera, lastDiagInfo } }}</pre>
</NTabPane>
</NTabs>