Showing
1 changed file
with
9 additions
and
1 deletions
| ... | ... | @@ -154,7 +154,15 @@ export const step1Schemas: FormSchema[] = [ |
| 154 | 154 | const { organizationId, transportType } = formModel; |
| 155 | 155 | if (![organizationId, transportType].every(Boolean)) return {}; |
| 156 | 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 | 166 | showSearch: true, |
| 159 | 167 | params: { |
| 160 | 168 | organizationId, | ... | ... |