Commit 4c0e8d0e46f04df3b85066396d5e69555c32b286

Authored by fengtao
1 parent 8353a1e2

perf: DEFECT-1710 优化场景联动选择下拉框时,还可以继续滚动界面下拉,下拉列表跟随界面滚动了

... ... @@ -229,7 +229,7 @@ export const trigger_condition_schema: FormSchema[] = [
229 229 placeholder: '请选择类型',
230 230 labelField: 'itemText',
231 231 valueField: 'itemValue',
232   - getPopupContainer: () => document.body,
  232 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
233 233 onChange(e) {
234 234 if (e) {
235 235 setFieldsValue({ deviceProfileId: '' });
... ... @@ -256,7 +256,7 @@ export const trigger_condition_schema: FormSchema[] = [
256 256 placeholder: '请选择产品',
257 257 labelField: 'name',
258 258 valueField: 'id',
259   - getPopupContainer: () => document.body,
  259 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
260 260 onChange: async (e) => {
261 261 if (e) {
262 262 setFieldsValue({ type2: '', entityId: [] });
... ... @@ -315,7 +315,7 @@ export const trigger_condition_schema: FormSchema[] = [
315 315 return [];
316 316 },
317 317 placeholder: '请选择设备',
318   - getPopupContainer: () => document.body,
  318 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
319 319 filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => {
320 320 let { label, value } = option;
321 321 label = label.toLowerCase();
... ... @@ -450,7 +450,7 @@ export const actionSchema: FormSchema[] = [
450 450 placeholder: '请选择类型',
451 451 labelField: 'itemText',
452 452 valueField: 'itemValue',
453   - getPopupContainer: () => document.body,
  453 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
454 454 onChange(e) {
455 455 if (e) {
456 456 setFieldsValue({ deviceProfileId: '' });
... ... @@ -482,7 +482,7 @@ export const actionSchema: FormSchema[] = [
482 482 placeholder: '请选择产品',
483 483 labelField: 'name',
484 484 valueField: 'id',
485   - getPopupContainer: () => document.body,
  485 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
486 486 onChange: (_value: string, options = {} as DeviceProfileModel) => {
487 487 const oldType = formModel['transportType'];
488 488
... ... @@ -556,7 +556,7 @@ export const actionSchema: FormSchema[] = [
556 556 return [];
557 557 },
558 558 placeholder: '请选择设备',
559   - getPopupContainer: () => document.body,
  559 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
560 560 };
561 561 },
562 562 ifShow: ({ values }) => isPart(values.device) && isDeviceOut(values.outTarget),
... ... @@ -593,7 +593,7 @@ export const actionSchema: FormSchema[] = [
593 593 dictCode: 'custom_define',
594 594 },
595 595 numberToString: true,
596   - getPopupContainer: () => document.body,
  596 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
597 597 onChange: () => {
598 598 setFieldsValue({ doContext: null, thingsModelId: null });
599 599 },
... ... @@ -619,7 +619,7 @@ export const actionSchema: FormSchema[] = [
619 619 },
620 620 labelField: 'itemText',
621 621 valueField: 'itemValue',
622   - getPopupContainer: () => document.body,
  622 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
623 623 },
624 624 ifShow: ({ values }) =>
625 625 isDeviceOut(values.outTarget) && isPartOrAll(values.device) && isDefine(values.commandType),
... ... @@ -688,7 +688,7 @@ export const actionSchema: FormSchema[] = [
688 688 },
689 689 labelField: 'functionName',
690 690 valueField: 'id',
691   - getPopupContainer: () => document.body,
  691 + getPopupContainer: (triggerNode) => triggerNode.parentNode,
692 692 onChange: (_, options: ModelOfMatterParams) => {
693 693 if (options) {
694 694 // setFieldsValue({ doContext: { ...options.functionJson, callType: options.callType } });
... ...