Commit c5681a9d5742f73bd0240753d547cd40c219c167

Authored by ww
1 parent 4521c621

fix: DEFECT-1024 data flow select data source device thorw error

... ... @@ -307,6 +307,7 @@
307 307 if (keys === Active.PENDING) {
308 308 reloadPending();
309 309 } else {
  310 + reloadSelected();
310 311 setProps({
311 312 dataSource: unref(selectedRows),
312 313 });
... ...
... ... @@ -278,6 +278,7 @@
278 278 if (isApiHeaders && Object.values(isApiHeaders).includes('')) {
279 279 return createMessage.error('请填写属性');
280 280 }
  281 + Object.assign(allPostForm, { clientProperties: {} });
281 282 const res = await postAddConvertApi(allPostForm);
282 283 if (res) {
283 284 closeModalAfterSuccess && closeModal();
... ... @@ -303,6 +304,7 @@
303 304 }
304 305 }
305 306 Object.assign(noEditObj, getTypeObj, {
  307 + clientProperties: {},
306 308 datasourceType: allPostForm.datasourceType,
307 309 datasourceContent: allPostForm.datasourceContent,
308 310 });
... ...
... ... @@ -240,7 +240,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => {
240 240 const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT);
241 241 const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID);
242 242 if (convertConfigId) {
243   - Object.assign(params, { convertConfigId, selected: true });
  243 + Object.assign(params, { convertConfigId, selected: false });
244 244 }
245 245 return { ...params, deviceProfileIds };
246 246 },
... ... @@ -254,7 +254,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => {
254 254 const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT);
255 255 const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID);
256 256 if (convertConfigId) {
257   - Object.assign(params, { convertConfigId, selected: false });
  257 + Object.assign(params, { convertConfigId, selected: true });
258 258 }
259 259 return { ...params, deviceProfileIds };
260 260 },
... ... @@ -270,7 +270,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => {
270 270 pageSize: 10,
271 271 convertConfigId: values[BasicInfoFormField.CONVERT_CONFIG_ID],
272 272 deviceProfileIds,
273   - selected: false,
  273 + selected: true,
274 274 });
275 275 setSelectedTotal(total);
276 276 return items;
... ...
... ... @@ -69,10 +69,11 @@
69 69 ...record,
70 70 [BasicInfoFormField.DATA_SOURCE_PRODUCT]:
71 71 record?.datasourceContent?.convertProducts || [],
72   - [BasicInfoFormField.DATA_SOURCE_DEVICE]:
73   - (record?.datasourceContent?.convertDevices || []).reduce((prev, next) => {
74   - return [...prev, ...(next?.devices || [])];
75   - }, []) || [],
  72 + [BasicInfoFormField.DATA_SOURCE_DEVICE]: record?.datasourceContent?.convertDevices,
  73 + // [BasicInfoFormField.DATA_SOURCE_DEVICE]:
  74 + // (record?.datasourceContent?.convertDevices || []).reduce((prev, next) => {
  75 + // return [...prev, ...(next?.devices || [])];
  76 + // }, []) || [],
76 77 };
77 78 setFieldsValue(value);
78 79 };
... ...