fix: 使用设备名称和IP地址组合作为设备树中设备节点的key
This commit is contained in:
@@ -352,7 +352,7 @@ const lineDeviceTreeData = computed<Record<Station['code'], TreeOption[]>>(() =>
|
||||
const device = dev as NdmDeviceResultVO;
|
||||
return {
|
||||
label: `${device.name}`,
|
||||
key: `${device.id}`,
|
||||
key: `${device.name}${device.ipAddress}`,
|
||||
prefix: () => renderDeviceNodePrefix(device, stationCode),
|
||||
suffix: () => `${device.ipAddress}`,
|
||||
// 当选择设备时,能获取到设备的所有信息,以及设备所属的车站
|
||||
@@ -386,13 +386,13 @@ const stationDeviceTreeData = computed<TreeOption[]>(() => {
|
||||
children: clusters.map<TreeOption>((device) => {
|
||||
return {
|
||||
label: `${device.name}`,
|
||||
key: `${device.id}`,
|
||||
key: `${device.name}${device.ipAddress}`,
|
||||
prefix: () => renderDeviceNodePrefix(device, stationCode),
|
||||
suffix: () => `${device.ipAddress}`,
|
||||
children: singletons.map<TreeOption>((device) => {
|
||||
return {
|
||||
label: `${device.name}`,
|
||||
key: `${device.id}`,
|
||||
key: `${device.name}${device.ipAddress}`,
|
||||
prefix: () => renderDeviceNodePrefix(device, stationCode),
|
||||
suffix: () => `${device.ipAddress}`,
|
||||
stationCode,
|
||||
@@ -414,7 +414,7 @@ const stationDeviceTreeData = computed<TreeOption[]>(() => {
|
||||
children: stationDevices[deviceType].map<TreeOption>((device) => {
|
||||
return {
|
||||
label: `${device.name}`,
|
||||
key: `${device.id}`,
|
||||
key: `${device.name}${device.ipAddress}`,
|
||||
prefix: () => renderDeviceNodePrefix(device, stationCode),
|
||||
suffix: () => `${device.ipAddress}`,
|
||||
stationCode,
|
||||
|
||||
Reference in New Issue
Block a user