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,9 +1,10 @@
<script setup lang="ts">
import type { NdmDecoderDiagInfo, NdmDecoderResultVO } from '@/apis';
import { DecoderHistoryDiagCard, DeviceCommonCard, DeviceHardwareCard, DeviceHeaderCard } from '@/components';
import { useDebugModeStore } from '@/stores';
import { useSettingStore } from '@/stores';
import { destr } from 'destr';
import { NCard, NFlex, NTabPane, NTabs } from 'naive-ui';
import { storeToRefs } from 'pinia';
import { computed, ref, toRefs } from 'vue';
const props = defineProps<{
@@ -11,7 +12,8 @@ const props = defineProps<{
ndmDecoder: NdmDecoderResultVO;
}>();
const debugModeStore = useDebugModeStore();
const settingStore = useSettingStore();
const { debugModeEnabled } = storeToRefs(settingStore);
const { stationCode, ndmDecoder } = toRefs(props);
@@ -53,7 +55,7 @@ const selectedTab = ref('设备状态');
<DecoderHistoryDiagCard :station-code="stationCode" :ndm-decoder="ndmDecoder" :key="ndmDecoder.id" />
</NTabPane>
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
<NTabPane v-if="debugModeStore.debugEnabled" name="原始数据" tab="原始数据">
<NTabPane v-if="debugModeEnabled" name="原始数据" tab="原始数据">
<pre class="raw-data">{{ { ...ndmDecoder, lastDiagInfo } }}</pre>
</NTabPane>
</NTabs>