mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 03:28:20 +08:00
amis-saas-7256 [Improvement.] 城市选择组件无必填配置项问题修复
Change-Id: I889822f9104511e48940310a738c345ee67b4fbc
This commit is contained in:
parent
f543c7027e
commit
245ce48853
@ -10,6 +10,8 @@ import {
|
||||
|
||||
import {formItemControl} from '../../component/BaseControl';
|
||||
import {RendererPluginAction, RendererPluginEvent} from 'amis-editor-core';
|
||||
import {ValidatorTag} from '../../validator';
|
||||
import {getEventControlConfig} from '../../renderer/event-control/helper';
|
||||
|
||||
export class CityControlPlugin extends BasePlugin {
|
||||
// 关联渲染器名字
|
||||
@ -84,41 +86,24 @@ export class CityControlPlugin extends BasePlugin {
|
||||
}
|
||||
];
|
||||
|
||||
panelJustify = true;
|
||||
panelBodyCreator = (context: BaseEventContext) => {
|
||||
return formItemControl(
|
||||
return getSchemaTpl('tabs', [
|
||||
{
|
||||
common: {
|
||||
replace: true,
|
||||
title: '属性',
|
||||
body: getSchemaTpl('collapseGroup', [
|
||||
{
|
||||
title: '基本',
|
||||
body: [
|
||||
getSchemaTpl('formItemName', {
|
||||
required: true
|
||||
}),
|
||||
getSchemaTpl('label'),
|
||||
// getSchemaTpl('switchDefaultValue'),
|
||||
|
||||
/*
|
||||
{
|
||||
name: 'value',
|
||||
type: 'input-city',
|
||||
label: '默认值',
|
||||
visibleOn: 'typeof data.value !== "undefined"',
|
||||
validations: 'isNumeric',
|
||||
labelRemark: {
|
||||
trigger: 'click',
|
||||
className: 'm-l-xs',
|
||||
rootClose: true,
|
||||
content: '城市编码',
|
||||
placement: 'left'
|
||||
}
|
||||
},
|
||||
*/
|
||||
|
||||
getSchemaTpl('valueFormula', {
|
||||
rendererSchema: context?.schema,
|
||||
rendererWrapper: true,
|
||||
mode: 'vertical' // 改成上下展示模式
|
||||
}),
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'allowDistrict',
|
||||
label: '允许选择区域',
|
||||
@ -135,15 +120,33 @@ export class CityControlPlugin extends BasePlugin {
|
||||
name: 'searchable',
|
||||
label: '是否出搜索框',
|
||||
pipeIn: defaultValue(false)
|
||||
}),
|
||||
|
||||
getSchemaTpl('extractValue')
|
||||
})
|
||||
]
|
||||
},
|
||||
status: {}
|
||||
getSchemaTpl('status', {isFormItem: true}),
|
||||
getSchemaTpl('validation', {tag: ValidatorTag.MultiSelect})
|
||||
])
|
||||
},
|
||||
context
|
||||
);
|
||||
{
|
||||
title: '外观',
|
||||
body: [
|
||||
getSchemaTpl('collapseGroup', [
|
||||
getSchemaTpl('style:formItem', {renderer: context.info.renderer}),
|
||||
getSchemaTpl('style:classNames')
|
||||
])
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '事件',
|
||||
className: 'p-none',
|
||||
body: [
|
||||
getSchemaTpl('eventControl', {
|
||||
name: 'onEvent',
|
||||
...getEventControlConfig(this.manager, context)
|
||||
})
|
||||
]
|
||||
}
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user