Commit 23ccfde9f06fec085db3d5f34870a61b4d566f79
1 parent
ab2cc5fb
fix: rule data flow selected datasource device carry params iincorrect
Showing
1 changed file
with
6 additions
and
3 deletions
@@ -231,6 +231,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | @@ -231,6 +231,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | ||
231 | return { | 231 | return { |
232 | labelField: 'name', | 232 | labelField: 'name', |
233 | valueField: 'tbDeviceId', | 233 | valueField: 'tbDeviceId', |
234 | + primaryKey: 'tbDeviceId', | ||
234 | pendingTableProps: { | 235 | pendingTableProps: { |
235 | ...TransferTableProps, | 236 | ...TransferTableProps, |
236 | api: devicePage, | 237 | api: devicePage, |
@@ -239,7 +240,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | @@ -239,7 +240,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | ||
239 | const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); | 240 | const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); |
240 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); | 241 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); |
241 | if (convertConfigId) { | 242 | if (convertConfigId) { |
242 | - Object.assign(params, { convertConfigId, selected: false }); | 243 | + Object.assign(params, { convertConfigId, selected: true }); |
243 | } | 244 | } |
244 | return { ...params, deviceProfileIds }; | 245 | return { ...params, deviceProfileIds }; |
245 | }, | 246 | }, |
@@ -253,7 +254,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | @@ -253,7 +254,7 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | ||
253 | const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); | 254 | const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); |
254 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); | 255 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); |
255 | if (convertConfigId) { | 256 | if (convertConfigId) { |
256 | - Object.assign(params, { convertConfigId, selected: true }); | 257 | + Object.assign(params, { convertConfigId, selected: false }); |
257 | } | 258 | } |
258 | return { ...params, deviceProfileIds }; | 259 | return { ...params, deviceProfileIds }; |
259 | }, | 260 | }, |
@@ -261,13 +262,15 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | @@ -261,13 +262,15 @@ export const modeForm = (submitFn?: Function): FormSchema[] => { | ||
261 | initSelectedOptions: async ({ setSelectedTotal }) => { | 262 | initSelectedOptions: async ({ setSelectedTotal }) => { |
262 | const values = getFieldsValue(); | 263 | const values = getFieldsValue(); |
263 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); | 264 | const convertConfigId = Reflect.get(values, BasicInfoFormField.CONVERT_CONFIG_ID); |
265 | + const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); | ||
264 | const devices = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_DEVICE); | 266 | const devices = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_DEVICE); |
265 | if (convertConfigId && devices) { | 267 | if (convertConfigId && devices) { |
266 | const { items, total } = await devicePage({ | 268 | const { items, total } = await devicePage({ |
267 | page: 1, | 269 | page: 1, |
268 | pageSize: 10, | 270 | pageSize: 10, |
269 | convertConfigId: values[BasicInfoFormField.CONVERT_CONFIG_ID], | 271 | convertConfigId: values[BasicInfoFormField.CONVERT_CONFIG_ID], |
270 | - selected: true, | 272 | + deviceProfileIds, |
273 | + selected: false, | ||
271 | }); | 274 | }); |
272 | setSelectedTotal(total); | 275 | setSelectedTotal(total); |
273 | return items; | 276 | return items; |