refactor: show "row data" tab only when user is super admin
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmKeyboardResultVO } from '@/apis/models';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { NCard, NFlex, NTabPane, NTabs } from 'naive-ui';
|
||||
import { ref, toRefs } from 'vue';
|
||||
|
||||
@@ -11,6 +12,8 @@ const props = defineProps<{
|
||||
ndmKeyboard: NdmKeyboardResultVO;
|
||||
}>();
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
const { stationCode, ndmKeyboard } = toRefs(props);
|
||||
|
||||
const selectedTab = ref('设备状态');
|
||||
@@ -29,7 +32,7 @@ const selectedTab = ref('设备状态');
|
||||
<KeyboardHistoryDiagCard :station-code="stationCode" :ndm-keyboard="ndmKeyboard" :key="ndmKeyboard.id" />
|
||||
</NTabPane>
|
||||
<!-- <NTabPane name="设备配置" tab="设备配置"></NTabPane> -->
|
||||
<NTabPane name="原始数据" tab="原始数据">
|
||||
<NTabPane v-if="userStore.isSuperAdmin" name="原始数据" tab="原始数据">
|
||||
<pre>{{ { ...ndmKeyboard } }}</pre>
|
||||
</NTabPane>
|
||||
</NTabs>
|
||||
|
||||
Reference in New Issue
Block a user