Commit 36abd69f74241c73f9877aa9787a52716aedd682
1 parent
cfbe72ed
fix: map component history data bind modal device select echo problem
Showing
2 changed files
with
8 additions
and
3 deletions
@@ -79,6 +79,7 @@ export interface DataSource { | @@ -79,6 +79,7 @@ export interface DataSource { | ||
79 | componentInfo: ComponentInfo; | 79 | componentInfo: ComponentInfo; |
80 | deviceName: string; | 80 | deviceName: string; |
81 | deviceProfileId: string; | 81 | deviceProfileId: string; |
82 | + tbDeviceId: string; | ||
82 | 83 | ||
83 | // front usage | 84 | // front usage |
84 | uuid?: string; | 85 | uuid?: string; |
@@ -27,15 +27,19 @@ | @@ -27,15 +27,19 @@ | ||
27 | const { dataSource = [] } = params; | 27 | const { dataSource = [] } = params; |
28 | const deviceRecord = dataSource?.at(0) || ({} as DataSource); | 28 | const deviceRecord = dataSource?.at(0) || ({} as DataSource); |
29 | if (!deviceRecord.organizationId) return; | 29 | if (!deviceRecord.organizationId) return; |
30 | - const deviceList = await getAllDeviceByOrg(deviceRecord.organizationId); | 30 | + const deviceList = await getAllDeviceByOrg( |
31 | + deviceRecord.organizationId, | ||
32 | + deviceRecord.deviceProfileId | ||
33 | + ); | ||
31 | const options = deviceList | 34 | const options = deviceList |
32 | - .filter((item) => item.id === deviceRecord.deviceId) | ||
33 | - .map((item) => ({ ...item, label: item.name, value: item.id })); | 35 | + .filter((item) => item.tbDeviceId === deviceRecord.deviceId) |
36 | + .map((item) => ({ ...item, label: item.name, value: item.tbDeviceId })); | ||
34 | const attKey = dataSource.map((item) => ({ | 37 | const attKey = dataSource.map((item) => ({ |
35 | ...item, | 38 | ...item, |
36 | label: item.attribute, | 39 | label: item.attribute, |
37 | value: item.attribute, | 40 | value: item.attribute, |
38 | })); | 41 | })); |
42 | + console.log(options); | ||
39 | updateSchema([ | 43 | updateSchema([ |
40 | { | 44 | { |
41 | field: SchemaFiled.DEVICE_ID, | 45 | field: SchemaFiled.DEVICE_ID, |