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