feat: debug mode

This commit is contained in:
yangsy
2025-11-05 15:23:45 +08:00
parent c5f916757e
commit 97e7780277
11 changed files with 104 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { NdmNvrDiagInfo } from '@/apis/domains';
import type { NdmNvrResultVO } from '@/apis/models';
import { useUserStore } from '@/stores/user';
import { useDebugModeStore } from '@/stores/debug-mode';
import { destr } from 'destr';
import { NCard, NFlex, NTabPane, NTabs } from 'naive-ui';
import { computed, ref, toRefs } from 'vue';
@@ -18,7 +18,7 @@ const props = defineProps<{
ndmNvr: NdmNvrResultVO;
}>();
const userStore = useUserStore();
const debugModeStore = useDebugModeStore();
const { stationCode, ndmNvr } = toRefs(props);
@@ -73,7 +73,7 @@ const selectedTab = ref('设备状态');
<NvrHistoryDiagCard :station-code="stationCode" :ndm-nvr="ndmNvr" :key="ndmNvr.id" />
</NTabPane>
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
<NTabPane v-if="userStore.isSuperAdmin" name="原始数据" tab="原始数据">
<NTabPane v-if="debugModeStore.debugEnabled" name="原始数据" tab="原始数据">
<pre class="raw-data">{{ { ...ndmNvr, lastDiagInfo } }}</pre>
</NTabPane>
</NTabs>