Commit a2b3a533c02a9cd268191ced4c42acfa9ba2c386

Authored by fengtao
1 parent 8a5dc05f

pref:优化报表配置设备别名

@@ -81,6 +81,9 @@ export const columns: BasicColumn[] = [ @@ -81,6 +81,9 @@ export const columns: BasicColumn[] = [
81 title: '名称', 81 title: '名称',
82 dataIndex: 'name', 82 dataIndex: 'name',
83 width: 120, 83 width: 120,
  84 + format: (_text: string, record: Recordable) => {
  85 + return record?.alias ? record?.alias : record?.name;
  86 + },
84 }, 87 },
85 { 88 {
86 title: '设备状态', 89 title: '设备状态',
@@ -131,7 +131,7 @@ @@ -131,7 +131,7 @@
131 selectOptions.value = items.map((item) => { 131 selectOptions.value = items.map((item) => {
132 if (item.deviceType !== 'GATEWAY') 132 if (item.deviceType !== 'GATEWAY')
133 return { 133 return {
134 - label: item.name, 134 + label: item.alias ? item.alias : item.name,
135 value: item.tbDeviceId, 135 value: item.tbDeviceId,
136 id: item.id, 136 id: item.id,
137 deviceProfileId: item.deviceProfileId, 137 deviceProfileId: item.deviceProfileId,
@@ -291,7 +291,7 @@ @@ -291,7 +291,7 @@
291 selectOptions.value = items.map((item) => { 291 selectOptions.value = items.map((item) => {
292 if (item.deviceType !== 'GATEWAY') 292 if (item.deviceType !== 'GATEWAY')
293 return { 293 return {
294 - label: item.name, 294 + label: item.alias ? item.alias : item.name,
295 value: item.tbDeviceId, 295 value: item.tbDeviceId,
296 id: item.id, 296 id: item.id,
297 deviceProfileId: item.deviceProfileId, 297 deviceProfileId: item.deviceProfileId,
@@ -316,7 +316,7 @@ @@ -316,7 +316,7 @@
316 }); 316 });
317 return { 317 return {
318 ...T, 318 ...T,
319 - label: item.name, 319 + label: item.alias ? item.alias : item.name,
320 value: item.device, 320 value: item.device,
321 attributes: item.attributes, 321 attributes: item.attributes,
322 }; 322 };