fix:[穿梭框] 默认设置项的回填效果 amis-saas-6031

Change-Id: I512f442dba6524233b9b109f73bc82f68b50a4f7
This commit is contained in:
zhou999 2022-08-18 15:30:18 +08:00
parent ab614c7d74
commit 7f70f61ea5
2 changed files with 12 additions and 18 deletions

View File

@ -35,24 +35,9 @@ export class TransferPlugin extends BasePlugin {
{ {
label: '曹操', label: '曹操',
value: 'caocao' value: 'caocao'
},
{
label: '钟无艳',
value: 'zhongwuyan'
},
{
label: '李白',
value: 'libai'
},
{
label: '韩信',
value: 'hanxin'
},
{
label: '云中君',
value: 'yunzhongjun'
} }
] ],
selectMode: 'list'
}; };
previewSchema: any = { previewSchema: any = {
type: 'form', type: 'form',
@ -187,6 +172,14 @@ export class TransferPlugin extends BasePlugin {
required: true required: true
}), }),
getSchemaTpl('label'), getSchemaTpl('label'),
getSchemaTpl('valueFormula', {
rendererSchema: {
...context?.schema,
type: 'select',
multiple: true
},
visibleOn: 'data.options.length > 0',
}),
getSchemaTpl('labelRemark'), getSchemaTpl('labelRemark'),
getSchemaTpl('remark'), getSchemaTpl('remark'),
getSchemaTpl('placeholder'), getSchemaTpl('placeholder'),
@ -221,6 +214,7 @@ export class TransferPlugin extends BasePlugin {
], ],
onChange: (value: any, origin: any, item: any, form: any) => { onChange: (value: any, origin: any, item: any, form: any) => {
form.setValueByName('options', undefined); form.setValueByName('options', undefined);
form.setValueByName('value', "");
} }
}, },

View File

@ -300,7 +300,7 @@ const renderInput = (
export default class TransferTableOption extends React.Component<OptionControlProps, {}> { export default class TransferTableOption extends React.Component<OptionControlProps, {}> {
addColumns() { addColumns() {
const { columns = [{ type: 'text' }] } = this.props.data; const { columns = [{ type: 'text', name: 'label' }] } = this.props.data;
return { return {
type: 'action', type: 'action',
actionType: 'dialog', actionType: 'dialog',