feat: device cards

This commit is contained in:
yangsy
2025-09-02 23:35:54 +08:00
parent ced07b17ff
commit 9bf8229bf6
16 changed files with 2211 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ import ServerCard from '@/components/device-page/server-card.vue';
import SwitchCard from '@/components/device-page/switch-card.vue';
import { useDeviceSelection } from '@/composables/device';
import { useLineDevicesQuery } from '@/composables/query';
import { DeviceType, getDeviceTypeVal, type DeviceTypeVal } from '@/enums/device-type';
import { DeviceType, type DeviceTypeVal } from '@/enums/device-type';
import { useLineDevicesStore } from '@/stores/line-devices';
import { useStationStore } from '@/stores/station';
import { ChevronBack } from '@vicons/ionicons5';
@@ -93,28 +93,27 @@ watch(
<!-- 内容区域 -->
<template v-if="selectedDevice && selectedStationCode">
<NScrollbar x-scrollable style="height: 100%; padding-right: 24px">
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.Camera">
<template v-if="selectedDeviceType === DeviceType.Camera">
<CameraCard :station-code="selectedStationCode" :ndm-camera="selectedDevice" />
</template>
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.Decoder">
<template v-if="selectedDeviceType === DeviceType.Decoder">
<DecoderCard :station-code="selectedStationCode" :ndm-decoder="selectedDevice" />
</template>
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.Keyboard">
<template v-if="selectedDeviceType === DeviceType.Keyboard">
<KeyboardCard :station-code="selectedStationCode" :ndm-keyboard="selectedDevice" />
</template>
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.Nvr">
<template v-if="selectedDeviceType === DeviceType.Nvr">
<NvrCard :station-code="selectedStationCode" :ndm-nvr="selectedDevice" />
</template>
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.SecurityBox">
<template v-if="selectedDeviceType === DeviceType.SecurityBox">
<SecurityBoxCard :station-code="selectedStationCode" :ndm-security-box="selectedDevice" />
</template>
<template v-if="([DeviceType.MediaServer, DeviceType.VideoServer] as DeviceTypeVal[]).includes(getDeviceTypeVal(selectedDevice.deviceType))">
<template v-if="([DeviceType.MediaServer, DeviceType.VideoServer] as DeviceTypeVal[]).includes(selectedDeviceType)">
<ServerCard :station-code="selectedStationCode" :ndm-server="selectedDevice" />
</template>
<template v-if="getDeviceTypeVal(selectedDevice.deviceType) === DeviceType.Switch">
<template v-if="selectedDeviceType === DeviceType.Switch">
<SwitchCard :station-code="selectedStationCode" :ndm-switch="selectedDevice" />
</template>
<!-- <pre style="width: 500px; height: 300px; overflow: scroll">{{ selectedDevice }}</pre> -->
</NScrollbar>
</template>
<template v-else>