Commit a93d22486fc89241f74e276b13a61776a72ddbf4
Merge branch 'dev-fix-ww' into 'main_dev'
fix: DEFECT-1271 修复创建设备设备无别名时显示为设备id See merge request yunteng/thingskit-front!584
Showing
1 changed file
with
9 additions
and
1 deletions
@@ -154,7 +154,15 @@ export const step1Schemas: FormSchema[] = [ | @@ -154,7 +154,15 @@ export const step1Schemas: FormSchema[] = [ | ||
154 | const { organizationId, transportType } = formModel; | 154 | const { organizationId, transportType } = formModel; |
155 | if (![organizationId, transportType].every(Boolean)) return {}; | 155 | if (![organizationId, transportType].every(Boolean)) return {}; |
156 | return { | 156 | return { |
157 | - api: getGatewayDevice, | 157 | + api: async (params: Recordable) => { |
158 | + try { | ||
159 | + const result = await getGatewayDevice(params as any); | ||
160 | + return result.map((item) => ({ ...item, alias: item.alias || item.name })); | ||
161 | + } catch (e) { | ||
162 | + console.error(e); | ||
163 | + return []; | ||
164 | + } | ||
165 | + }, | ||
158 | showSearch: true, | 166 | showSearch: true, |
159 | params: { | 167 | params: { |
160 | organizationId, | 168 | organizationId, |