refactor: show "row data" tab only when user is super admin
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmDecoderDiagInfo } from '@/apis/domains';
|
||||
import type { NdmCameraResultVO } 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';
|
||||
@@ -13,6 +14,8 @@ const props = defineProps<{
|
||||
ndmCamera: NdmCameraResultVO;
|
||||
}>();
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const { stationCode, ndmCamera } = toRefs(props);
|
||||
|
||||
const lastDiagInfo = computed(() => {
|
||||
@@ -39,7 +42,7 @@ const selectedTab = ref('设备状态');
|
||||
<CameraHistoryDiagCard :station-code="stationCode" :ndm-camera="ndmCamera" :key="ndmCamera.id" />
|
||||
</NTabPane>
|
||||
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
|
||||
<NTabPane name="原始数据" tab="原始数据">
|
||||
<NTabPane v-if="userStore.isSuperAdmin" name="原始数据" tab="原始数据">
|
||||
<pre>{{ { ...ndmCamera, lastDiagInfo } }}</pre>
|
||||
</NTabPane>
|
||||
</NTabs>
|
||||
|
||||
Reference in New Issue
Block a user