Commit ec709a73e91134453228a9e307dbcbcf37a91ff3

Authored by ww
1 parent b3566f3b

fix: DEFECT-1253 修复地理位置显示设备名称问题

... ... @@ -82,7 +82,7 @@ export const columns: BasicColumn[] = [
82 82 dataIndex: 'name',
83 83 width: 120,
84 84 format: (_text: string, record: Recordable) => {
85   - return record?.alias ? record?.alias : record?.name;
  85 + return record?.alias || record?.name;
86 86 },
87 87 },
88 88 {
... ...
... ... @@ -150,6 +150,7 @@
150 150 deviceProfile: { default: boolean; enabled: boolean; name: string; transportType: string };
151 151 deviceInfo: { longitude: string; latitude: string; address: string };
152 152 deviceType?: string;
  153 + alias?: string;
153 154 deviceProfileId: string;
154 155 }
155 156 type MarkerList = DeviceInfo & { marker: any; label: any };
... ... @@ -376,7 +377,7 @@
376 377 width: 330, // 信息窗口宽度
377 378 height: 0, // 信息窗口高度
378 379 };
379   - const { name, organizationDTO, deviceState, deviceProfile, deviceType } = record;
  380 + const { name, alias, organizationDTO, deviceState, deviceProfile, deviceType } = record;
380 381 const { address, longitude, latitude } = record.deviceInfo;
381 382
382 383 // 创建信息窗口对象
... ... @@ -387,7 +388,7 @@
387 388 let infoWindow = new BMap.InfoWindow(
388 389 `
389 390 <div style="display:flex;justify-content:space-between; margin:20px 0px;">
390   - <div style="font-size:16px;font-weight:bold">${name}</div>
  391 + <div style="font-size:16px;font-weight:bold">${alias || name}</div>
391 392 ${
392 393 deviceState === 'INACTIVE'
393 394 ? `<div style="display:flex;align-items:center;"><img style="width:15px;height:15px" src="${djh}" class="mr-1">待激活</div>`
... ...