Commit 36abd69f74241c73f9877aa9787a52716aedd682

Authored by ww
1 parent cfbe72ed

fix: map component history data bind modal device select echo problem

... ... @@ -79,6 +79,7 @@ export interface DataSource {
79 79 componentInfo: ComponentInfo;
80 80 deviceName: string;
81 81 deviceProfileId: string;
  82 + tbDeviceId: string;
82 83
83 84 // front usage
84 85 uuid?: string;
... ...
... ... @@ -27,15 +27,19 @@
27 27 const { dataSource = [] } = params;
28 28 const deviceRecord = dataSource?.at(0) || ({} as DataSource);
29 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 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 37 const attKey = dataSource.map((item) => ({
35 38 ...item,
36 39 label: item.attribute,
37 40 value: item.attribute,
38 41 }));
  42 + console.log(options);
39 43 updateSchema([
40 44 {
41 45 field: SchemaFiled.DEVICE_ID,
... ...