Commit 4c0e8d0e46f04df3b85066396d5e69555c32b286
1 parent
8353a1e2
perf: DEFECT-1710 优化场景联动选择下拉框时,还可以继续滚动界面下拉,下拉列表跟随界面滚动了
Showing
1 changed file
with
9 additions
and
9 deletions
@@ -229,7 +229,7 @@ export const trigger_condition_schema: FormSchema[] = [ | @@ -229,7 +229,7 @@ export const trigger_condition_schema: FormSchema[] = [ | ||
229 | placeholder: '请选择类型', | 229 | placeholder: '请选择类型', |
230 | labelField: 'itemText', | 230 | labelField: 'itemText', |
231 | valueField: 'itemValue', | 231 | valueField: 'itemValue', |
232 | - getPopupContainer: () => document.body, | 232 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
233 | onChange(e) { | 233 | onChange(e) { |
234 | if (e) { | 234 | if (e) { |
235 | setFieldsValue({ deviceProfileId: '' }); | 235 | setFieldsValue({ deviceProfileId: '' }); |
@@ -256,7 +256,7 @@ export const trigger_condition_schema: FormSchema[] = [ | @@ -256,7 +256,7 @@ export const trigger_condition_schema: FormSchema[] = [ | ||
256 | placeholder: '请选择产品', | 256 | placeholder: '请选择产品', |
257 | labelField: 'name', | 257 | labelField: 'name', |
258 | valueField: 'id', | 258 | valueField: 'id', |
259 | - getPopupContainer: () => document.body, | 259 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
260 | onChange: async (e) => { | 260 | onChange: async (e) => { |
261 | if (e) { | 261 | if (e) { |
262 | setFieldsValue({ type2: '', entityId: [] }); | 262 | setFieldsValue({ type2: '', entityId: [] }); |
@@ -315,7 +315,7 @@ export const trigger_condition_schema: FormSchema[] = [ | @@ -315,7 +315,7 @@ export const trigger_condition_schema: FormSchema[] = [ | ||
315 | return []; | 315 | return []; |
316 | }, | 316 | }, |
317 | placeholder: '请选择设备', | 317 | placeholder: '请选择设备', |
318 | - getPopupContainer: () => document.body, | 318 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
319 | filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => { | 319 | filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => { |
320 | let { label, value } = option; | 320 | let { label, value } = option; |
321 | label = label.toLowerCase(); | 321 | label = label.toLowerCase(); |
@@ -450,7 +450,7 @@ export const actionSchema: FormSchema[] = [ | @@ -450,7 +450,7 @@ export const actionSchema: FormSchema[] = [ | ||
450 | placeholder: '请选择类型', | 450 | placeholder: '请选择类型', |
451 | labelField: 'itemText', | 451 | labelField: 'itemText', |
452 | valueField: 'itemValue', | 452 | valueField: 'itemValue', |
453 | - getPopupContainer: () => document.body, | 453 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
454 | onChange(e) { | 454 | onChange(e) { |
455 | if (e) { | 455 | if (e) { |
456 | setFieldsValue({ deviceProfileId: '' }); | 456 | setFieldsValue({ deviceProfileId: '' }); |
@@ -482,7 +482,7 @@ export const actionSchema: FormSchema[] = [ | @@ -482,7 +482,7 @@ export const actionSchema: FormSchema[] = [ | ||
482 | placeholder: '请选择产品', | 482 | placeholder: '请选择产品', |
483 | labelField: 'name', | 483 | labelField: 'name', |
484 | valueField: 'id', | 484 | valueField: 'id', |
485 | - getPopupContainer: () => document.body, | 485 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
486 | onChange: (_value: string, options = {} as DeviceProfileModel) => { | 486 | onChange: (_value: string, options = {} as DeviceProfileModel) => { |
487 | const oldType = formModel['transportType']; | 487 | const oldType = formModel['transportType']; |
488 | 488 | ||
@@ -556,7 +556,7 @@ export const actionSchema: FormSchema[] = [ | @@ -556,7 +556,7 @@ export const actionSchema: FormSchema[] = [ | ||
556 | return []; | 556 | return []; |
557 | }, | 557 | }, |
558 | placeholder: '请选择设备', | 558 | placeholder: '请选择设备', |
559 | - getPopupContainer: () => document.body, | 559 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
560 | }; | 560 | }; |
561 | }, | 561 | }, |
562 | ifShow: ({ values }) => isPart(values.device) && isDeviceOut(values.outTarget), | 562 | ifShow: ({ values }) => isPart(values.device) && isDeviceOut(values.outTarget), |
@@ -593,7 +593,7 @@ export const actionSchema: FormSchema[] = [ | @@ -593,7 +593,7 @@ export const actionSchema: FormSchema[] = [ | ||
593 | dictCode: 'custom_define', | 593 | dictCode: 'custom_define', |
594 | }, | 594 | }, |
595 | numberToString: true, | 595 | numberToString: true, |
596 | - getPopupContainer: () => document.body, | 596 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
597 | onChange: () => { | 597 | onChange: () => { |
598 | setFieldsValue({ doContext: null, thingsModelId: null }); | 598 | setFieldsValue({ doContext: null, thingsModelId: null }); |
599 | }, | 599 | }, |
@@ -619,7 +619,7 @@ export const actionSchema: FormSchema[] = [ | @@ -619,7 +619,7 @@ export const actionSchema: FormSchema[] = [ | ||
619 | }, | 619 | }, |
620 | labelField: 'itemText', | 620 | labelField: 'itemText', |
621 | valueField: 'itemValue', | 621 | valueField: 'itemValue', |
622 | - getPopupContainer: () => document.body, | 622 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
623 | }, | 623 | }, |
624 | ifShow: ({ values }) => | 624 | ifShow: ({ values }) => |
625 | isDeviceOut(values.outTarget) && isPartOrAll(values.device) && isDefine(values.commandType), | 625 | isDeviceOut(values.outTarget) && isPartOrAll(values.device) && isDefine(values.commandType), |
@@ -688,7 +688,7 @@ export const actionSchema: FormSchema[] = [ | @@ -688,7 +688,7 @@ export const actionSchema: FormSchema[] = [ | ||
688 | }, | 688 | }, |
689 | labelField: 'functionName', | 689 | labelField: 'functionName', |
690 | valueField: 'id', | 690 | valueField: 'id', |
691 | - getPopupContainer: () => document.body, | 691 | + getPopupContainer: (triggerNode) => triggerNode.parentNode, |
692 | onChange: (_, options: ModelOfMatterParams) => { | 692 | onChange: (_, options: ModelOfMatterParams) => { |
693 | if (options) { | 693 | if (options) { |
694 | // setFieldsValue({ doContext: { ...options.functionJson, callType: options.callType } }); | 694 | // setFieldsValue({ doContext: { ...options.functionJson, callType: options.callType } }); |