Commit a2b3a533c02a9cd268191ced4c42acfa9ba2c386

Authored by fengtao
1 parent 8a5dc05f

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

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