Commit ec709a73e91134453228a9e307dbcbcf37a91ff3

Authored by ww
1 parent b3566f3b

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

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