Merge "amis-saas-7044 [Improvement.] 「抽屉」外观的宽度、高度应跟随位置变化做清除处理" into feat-optimize-5

This commit is contained in:
zhangzhulei 2022-09-19 16:24:00 +08:00 committed by iCode
commit 53f9805b81

View File

@ -123,7 +123,19 @@ export class DrawerPlugin extends BasePlugin {
}
],
pipeIn: defaultValue('right'),
pipeOut: (value: any) => (value ? value : 'right')
pipeOut: (value: any) => (value ? value : 'right'),
onChange: (
value: string,
oldValue: string,
model: any,
form: any
) => {
if(value === 'left' || value === 'right') {
form.deleteValueByName('height');
} else if (value === 'top' || value === 'bottom') {
form.deleteValueByName('width');
}
}
},
getSchemaTpl('switch', {
name: 'overlay',
@ -196,16 +208,14 @@ export class DrawerPlugin extends BasePlugin {
'宽度',
'位置为 "左" 或 "右" 时生效。 默认宽度为"尺寸"字段配置的宽度,值单位默认为 px也支持百分比等单位 100%'
),
disabledOn:
'this.position === "top" || this.position === "bottom"'
disabledOn: 'this.position === "top" || this.position === "bottom"'
},
heightSchema: {
label: tipedLabel(
'高度',
'位置为 "上" 或 "下" 时生效。 默认宽度为"尺寸"字段配置的高度,值单位默认为 px也支持百分比等单位 100%'
),
disabledOn:
'this.position === "left" || this.position === "right" || !this.position'
disabledOn: 'this.position === "left" || this.position === "right" || !this.position'
}
})
]