Showing
2 changed files
with
10 additions
and
4 deletions
| ... | ... | @@ -76,20 +76,25 @@ export const formSchemas: FormSchema[] = [ |
| 76 | 76 | try { |
| 77 | 77 | if (isDevices) { |
| 78 | 78 | const result = await getDevicesByDeviceIds(data!); |
| 79 | - return result.data; | |
| 79 | + return result.data.map((item) => ({ | |
| 80 | + label: item.alias || item.name, | |
| 81 | + value: 'tbDeviceId', | |
| 82 | + })); | |
| 80 | 83 | } else { |
| 81 | - return await getMeetTheConditionsDevice({ | |
| 84 | + const result = await getMeetTheConditionsDevice({ | |
| 82 | 85 | organizationId, |
| 83 | 86 | deviceProfileId: data![0], |
| 84 | 87 | }); |
| 88 | + return result.map((item) => ({ | |
| 89 | + label: item.alias || item.name, | |
| 90 | + value: 'tbDeviceId', | |
| 91 | + })); | |
| 85 | 92 | } |
| 86 | 93 | } catch (error) { |
| 87 | 94 | return []; |
| 88 | 95 | } |
| 89 | 96 | }, |
| 90 | 97 | mode: 'multiple', |
| 91 | - labelField: 'name', | |
| 92 | - valueField: 'tbDeviceId', | |
| 93 | 98 | ...createPickerSearch(), |
| 94 | 99 | placeholder: '请选择设备', |
| 95 | 100 | getPopupContainer: () => document.body, | ... | ... |