refactor: tryGetDeviceTypeVal
This commit is contained in:
@@ -12,7 +12,7 @@ const deviceTabPanes = Object.keys(DeviceType).map((key) => {
|
||||
import type { Station } from '@/apis/domains';
|
||||
import type { NdmDeviceResultVO, NdmNvrResultVO } from '@/apis/models';
|
||||
import type { LineDevices } from '@/composables/query';
|
||||
import { DeviceType, DeviceTypeName, getDeviceTypeVal, type DeviceTypeKey, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { DeviceType, DeviceTypeName, tryGetDeviceTypeVal, type DeviceTypeKey, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { destr } from 'destr';
|
||||
import {
|
||||
NButton,
|
||||
@@ -216,8 +216,9 @@ const onClickLocateDeviceTree = () => {
|
||||
const stationCode = selectedStationCode.value;
|
||||
const device = selectedDevice.value;
|
||||
if (!stationCode || !device?.id) return;
|
||||
if (device.deviceType) {
|
||||
activeTab.value = getDeviceTypeVal(device.deviceType);
|
||||
const deviceTypeVal = tryGetDeviceTypeVal(device.deviceType);
|
||||
if (!!deviceTypeVal) {
|
||||
activeTab.value = deviceTypeVal;
|
||||
}
|
||||
|
||||
const expanded = [stationCode];
|
||||
|
||||
Reference in New Issue
Block a user