refactor: show "row data" tab only when user is super admin

This commit is contained in:
yangsy
2025-09-05 17:47:25 +08:00
parent 3140539fa4
commit 2d0cbcab63
8 changed files with 32 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { NdmSecurityBoxDiagInfo } from '@/apis/domains';
import type { NdmSecurityBoxResultVO } from '@/apis/models';
import { useUserStore } from '@/stores/user';
import { destr } from 'destr';
import { NCard, NFlex, NTabPane, NTabs } from 'naive-ui';
import { computed, ref, toRefs } from 'vue';
@@ -17,6 +18,8 @@ const props = defineProps<{
ndmSecurityBox: NdmSecurityBoxResultVO;
}>();
const userStore = useUserStore();
const { stationCode, ndmSecurityBox } = toRefs(props);
const lastDiagInfo = computed(() => {
@@ -66,7 +69,7 @@ const selectedTab = ref('设备状态');
<SecurityBoxHistoryDiagCard :station-code="stationCode" :ndm-security-box="ndmSecurityBox" :key="ndmSecurityBox.id" />
</NTabPane>
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
<NTabPane name="原始数据" tab="原始数据">
<NTabPane v-if="userStore.isSuperAdmin" name="原始数据" tab="原始数据">
<pre>{{ { ...ndmSecurityBox, lastDiagInfo } }}</pre>
</NTabPane>
</NTabs>