Commit 849339bfcccf589b134205507f14c9bce7a6e529
1 parent
1e83fe7e
feat: data board history trend set default search first device trend
Showing
1 changed file
with
15 additions
and
0 deletions
... | ... | @@ -203,6 +203,21 @@ |
203 | 203 | }, |
204 | 204 | }); |
205 | 205 | |
206 | + if (options.length && options.at(0)?.value) { | |
207 | + const value = options.at(0)!.value; | |
208 | + getDeviceDataKey(value); | |
209 | + try { | |
210 | + deviceAttrs.value = (await getDeviceAttributes({ deviceId: value })) || []; | |
211 | + method.updateSchema({ | |
212 | + field: SchemaFiled.KEYS, | |
213 | + componentProps: { | |
214 | + options: unref(deviceAttrs).map((item) => ({ label: item, value: item })), | |
215 | + }, | |
216 | + }); | |
217 | + await method.setFieldsValue({ [SchemaFiled.DEVICE_ID]: value }); | |
218 | + } catch (error) {} | |
219 | + } | |
220 | + | |
206 | 221 | await handleModalOpen(); |
207 | 222 | }); |
208 | 223 | </script> | ... | ... |