Commit 07ba88f5ca24d7138ef9847eebe96de896966aa8

Authored by ww
1 parent 122b41a0

fix: DEFECT-1236 修复任务中心回显设备名称首选别名

@@ -161,18 +161,21 @@ @@ -161,18 +161,21 @@
161 api: async () => { 161 api: async () => {
162 try { 162 try {
163 if (!organizationId) return []; 163 if (!organizationId) return [];
164 - return await getMeetTheConditionsDevice({ 164 + const result = await getMeetTheConditionsDevice({
165 deviceProfileId, 165 deviceProfileId,
166 deviceType, 166 deviceType,
167 organizationId, 167 organizationId,
168 }); 168 });
  169 + return result.map((item) => ({
  170 + ...item,
  171 + value: item.tbDeviceId,
  172 + label: item.alias || item.name,
  173 + }));
169 } catch (error) { 174 } catch (error) {
170 return []; 175 return [];
171 } 176 }
172 }, 177 },
173 mode: props.multiple ? 'multiple' : 'combobox', 178 mode: props.multiple ? 'multiple' : 'combobox',
174 - labelField: 'name',  
175 - valueField: 'tbDeviceId',  
176 placeholder: '请选择设备', 179 placeholder: '请选择设备',
177 maxTagCount: 3, 180 maxTagCount: 3,
178 maxTagTextLength: 4, 181 maxTagTextLength: 4,