amis-saas-7949 fix: input-table 文案调整;表单项校验逻辑;新增按钮区分

Change-Id: I32cb7f2e3c3378847c946fc64e18ff0851d53868
This commit is contained in:
zhangzhulei 2023-02-17 10:25:22 +08:00
parent 68dc4137bb
commit 2a2c087a0f
3 changed files with 197 additions and 19 deletions

View File

@ -3696,5 +3696,81 @@ extendLocale('en-US', {
'a3221d2d224767df4afa7a8653ded8fe': 'Internal alignment',
'e8bb313fb86cf474c0e264794bc85896': 'Whether to fix the header',
'8e903bee4578f72bbecf9eb62d7b875c': 'Display level',
'c17fef27ea1d970fc66f4c4c3d442129': 'Default inner spacing'
'c17fef27ea1d970fc66f4c4c3d442129': 'Default inner spacing',
'236b0cdd2e18418fd17d3cdfcace239e': 'plug-in unit',
'defe851634125bb16e762f26dbb6555f':
'see https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/ file',
'df025e01cbbae804f7d720e6b932e8e8': 'Show menu bar',
'b74c3bbb8ec4f18896cd3b5a20ee9e2c': 'Toolbar - Large Screen',
'e08c3505f9779bf919628166a77d0d77':
'Screen width ≥ 1200px, reference document: https://froala.com/wysiwyg-editor/docs/options/',
'04f91b84d48285162d3e29205a194143': 'Toolbar - middle screen',
'9ac0e46a361565f0b8be2228bef4b679':
'Screen width ≥ 992px, if not configured, it will be consistent with the toolbar set for the large screen. Refer to the document: https://froala.com/wysiwyg-editor/docs/options/',
'70d3894aaed305d2fc67f91122d77759': 'Toolbar - small screen',
'a3133ac3b34da77e612bcb1763adae1e':
'Screen width ≥ 768px, if not configured, it is consistent with the toolbar set for large screen. Refer to the document: https://froala.com/wysiwyg-editor/docs/options/',
'194ab42ad1ca7fca9a6ef84fadf99490': 'Quick Insert',
'94621f44f98c996e49d5b214aebefffc': 'word count ',
'b720ed498f054a2539d496d0da68f85b': 'Picture receiving interface',
'376496a8918c57220159951e24d3b72d': 'Video receiving interface',
'555a9859e2c34b015438bdfb59a57c5b':
'${vendor==="tinymce"? "Editor": "edit area"}',
'afccc17d5d672b10a1292dcd671ef534': 'Quickly build a table edit box',
'1711a82f9b0825015c2c49d9659c9837': 'Display type',
'63bb911d6392cb2740140d406ab83d37': 'Edit Type',
'6530334ebf5ca810e576858eba168685': 'Selection box',
'f25cb224e4543c1dc0228fca8dbfaf1c': 'Color selection box',
'1145703a07e11b6e680ee2ec8afae0b4': 'Checkbox ',
'a877779dc422c5321057b638d6d520e5': 'City selector',
'e2c59e63f751088ad8b43a1439e4322a': 'Add single line data',
'41c1e36d5d202588511710ff0ccb9e8d': 'Delete single line data',
'f38b7eb6f78af9ae86c449153de2fe1f': 'Clear component data',
'5e2eb93cf353f5bfa0920553fc8a0087': 'Trigger table data update',
'efc47e9829b5831e4d0424191049b880': 'Delete data of a row',
'383c125a11b0dd070b04194b9e2e78fb':
'It takes effect when a single line of data is added or edited. When opening, after entering the content, you need to click the "Save" button on the right side of the form before submitting to the data field. If it is not enabled, the data field can be submitted after the content is entered.',
'1d96dc9b36793e242322dd1e092a010c': 'Confirm button name',
'c507f40ae40ad10fd0b99ac025a6e5d4': 'Confirm icon',
'e0698c2a2d5c568edfc5a0b1a1d298eb': 'Cancel button name',
'08f06b06a0db0e978e3acdf7741ccd86': 'Cancel icon',
'ffa655818f7dd46fb2a767c51618741b': 'Empty data prompt',
'd173fb23320acba326a4424133969256': 'Show sequence number',
'26eb498526ba909386befc43466db79d': 'Number of displays per page',
'078f9734eeef4ff8c06e0b639ce6bd8f':
'If it is empty, no paging will be performed',
'52029187eaa09f55193b6a15387e45ca': 'Minimum number of rows',
'3d99d1f17ebf865877e681397c61dc9d': 'Maximum number of rows',
'aa8b2a821e8e32196a720eaaa41b64d3':
'For performance, the default change of other form item values will not update the current table. Sometimes, in order to obtain other form item fields synchronously, you need to enable this.',
'2aa56a9b94ee3fde76a15711c94fdabc':
'Whether the parent data, that is, the peer data in the form, can be accessed, usually needs to be used with the "Strict Mode" attribute.',
'53a9db06d0b7e3482dc21e53f150e257': 'Row style',
'd679aea3aae1201e38c4baaaeef86efe': 'In operation',
'e5ac1d2029adff17ec123b86ea07ce26': 'Queuing',
'f406ef0ea3f09572835a9b1ec61f576a': 'Scheduling',
'acd5cb847a4aff235c9a01ddeb6f9770': 'fail',
'391299a1c1722a777991a182a44bccbf':
'The following states are supported by default and can be used without configuration. The custom state is merged with the default state.',
'33563f1d3d203bc682069a8c85506b86': 'Default icon value',
'2cc90d2f2cd9ba213f9aace88c386f3f': 'Default label',
'aad245582dc9f55cf71e3934bb3b1709': 'Default value value',
'2634cea5a95ece79e05b5a68c38cbd4d': 'Required ',
'2464e9d13bfc84169eb8333b6996203c':
'Update the data value of the target component or variable',
'c85c8d61a67014c4b5d44f25e49e87fc': 'Set variable',
'df24d894cd3331f53964bc75f5c192e2': '"',
'9e1bafbb00018beacc8f579c8ddfaa36': 'Set component',
'6c6e12c54723170f214527bedaf81f7d': 'Action type',
'1b7e6b2dbf3b7f4b1baf2c42e49a995d': 'Component variables',
'2eb4c7ac45befad0f1f9c750bda57166': 'Apply temporary variables',
'844a7a7aacc5be82d0fd6225edc6bf63': 'Please select a variable',
'85451d2eb59327a23e8f745161066d4a': 'Please enter variable value',
'3d4d83f05a12364e2522fcfb265d8ce8':
'When it is enabled, you need to click the "Save" button on the right side of the table to add or edit component data. When not enabled, add, edit and delete operations directly change component data.',
'c18169dd6fceab2f023216fa6f7d22c1': 'Confirm button icon',
'5720057e62e80f7a04489dc4c035b4f1': 'Cancel button icon',
'8985ea173dce8f9bee667b3cdf0b7bdf':
'This configuration item only applies to the "Add" button in the table operation bar',
'3f64a567662a24714768237a3a6d0de7': 'New button below the table'
});

View File

@ -3283,5 +3283,78 @@ extendLocale('zh-CN', {
'a3221d2d224767df4afa7a8653ded8fe': '内部对齐方式',
'e8bb313fb86cf474c0e264794bc85896': '是否固定表头',
'8e903bee4578f72bbecf9eb62d7b875c': '显示层级',
'c17fef27ea1d970fc66f4c4c3d442129': '默认内间距'
'c17fef27ea1d970fc66f4c4c3d442129': '默认内间距',
'236b0cdd2e18418fd17d3cdfcace239e': '插件',
'defe851634125bb16e762f26dbb6555f':
'查看 https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/ 文档',
'df025e01cbbae804f7d720e6b932e8e8': '显示菜单栏',
'b74c3bbb8ec4f18896cd3b5a20ee9e2c': '工具栏-大屏',
'e08c3505f9779bf919628166a77d0d77':
'屏幕宽度≥1200px参考文档https://froala.com/wysiwyg-editor/docs/options/',
'04f91b84d48285162d3e29205a194143': '工具栏-中屏',
'9ac0e46a361565f0b8be2228bef4b679':
'屏幕宽度≥992px如果不配置就和大屏设置的工具栏一致参考文档https://froala.com/wysiwyg-editor/docs/options/',
'70d3894aaed305d2fc67f91122d77759': '工具栏-小屏',
'a3133ac3b34da77e612bcb1763adae1e':
'屏幕宽度≥768px如果不配置就和大屏设置的工具栏一致参考文档https://froala.com/wysiwyg-editor/docs/options/',
'194ab42ad1ca7fca9a6ef84fadf99490': '快速插入',
'94621f44f98c996e49d5b214aebefffc': '字数统计',
'b720ed498f054a2539d496d0da68f85b': '图片接收接口',
'376496a8918c57220159951e24d3b72d': '视频接收接口',
'555a9859e2c34b015438bdfb59a57c5b':
'${vendor === "tinymce" ? "编辑器" : "编辑区域"}',
'afccc17d5d672b10a1292dcd671ef534': '快速构建表格编辑框',
'1711a82f9b0825015c2c49d9659c9837': '展示类型',
'63bb911d6392cb2740140d406ab83d37': '编辑类型',
'6530334ebf5ca810e576858eba168685': '选择框',
'f25cb224e4543c1dc0228fca8dbfaf1c': '颜色选择框',
'1145703a07e11b6e680ee2ec8afae0b4': '多选框',
'a877779dc422c5321057b638d6d520e5': '城市选择器',
'e2c59e63f751088ad8b43a1439e4322a': '新增单行数据',
'41c1e36d5d202588511710ff0ccb9e8d': '删除单行数据',
'f38b7eb6f78af9ae86c449153de2fe1f': '清除组件数据',
'5e2eb93cf353f5bfa0920553fc8a0087': '触发表格数据更新',
'efc47e9829b5831e4d0424191049b880': '删除某行的数据',
'383c125a11b0dd070b04194b9e2e78fb':
'在新增或编辑单行数据时生效。开启时,输入完内容后需要点击表格右侧的“保存”按钮后才能提交到数据域。未开启时,输入完内容后就能提交数据域。',
'1d96dc9b36793e242322dd1e092a010c': '确认按钮名称',
'c507f40ae40ad10fd0b99ac025a6e5d4': '确认图标',
'e0698c2a2d5c568edfc5a0b1a1d298eb': '取消按钮名称',
'08f06b06a0db0e978e3acdf7741ccd86': '取消图标',
'ffa655818f7dd46fb2a767c51618741b': '空数据提示',
'd173fb23320acba326a4424133969256': '显示序号',
'26eb498526ba909386befc43466db79d': '每页展示条数',
'078f9734eeef4ff8c06e0b639ce6bd8f': '如果为空,则不进行分页',
'52029187eaa09f55193b6a15387e45ca': '最小行数',
'3d99d1f17ebf865877e681397c61dc9d': '最大行数',
'aa8b2a821e8e32196a720eaaa41b64d3':
'为了性能,默认其他表单项项值变化不会让当前表格更新,有时候为了同步获取其他表单项字段,需要开启这个。',
'2aa56a9b94ee3fde76a15711c94fdabc':
'是否可以访问父级数据,也就是表单中的同级数据,通常需要跟 “严格模式”属性搭配使用。',
'53a9db06d0b7e3482dc21e53f150e257': '行样式',
'd679aea3aae1201e38c4baaaeef86efe': '运行中',
'e5ac1d2029adff17ec123b86ea07ce26': '排队中',
'f406ef0ea3f09572835a9b1ec61f576a': '调度中',
'acd5cb847a4aff235c9a01ddeb6f9770': '失败',
'391299a1c1722a777991a182a44bccbf':
'默认支持如下几种状态,无需配置即可使用。自定义状态会和默认状态合并。',
'33563f1d3d203bc682069a8c85506b86': '默认icon值',
'2cc90d2f2cd9ba213f9aace88c386f3f': '默认label',
'aad245582dc9f55cf71e3934bb3b1709': '默认value值',
'2634cea5a95ece79e05b5a68c38cbd4d': '必填项',
'2464e9d13bfc84169eb8333b6996203c': '更新目标组件或变量的数据值',
'c85c8d61a67014c4b5d44f25e49e87fc': '设置变量「',
'df24d894cd3331f53964bc75f5c192e2': '」的数据',
'9e1bafbb00018beacc8f579c8ddfaa36': '设置组件「',
'6c6e12c54723170f214527bedaf81f7d': '动作类型',
'1b7e6b2dbf3b7f4b1baf2c42e49a995d': '组件变量',
'2eb4c7ac45befad0f1f9c750bda57166': '应用临时变量',
'844a7a7aacc5be82d0fd6225edc6bf63': '请选择变量',
'85451d2eb59327a23e8f745161066d4a': '请输入变量值',
'3d4d83f05a12364e2522fcfb265d8ce8':
'开启时,新增、编辑需要点击表格右侧的“保存”按钮才能变更组件数据。未开启时,新增、编辑、删除操作直接改变组件数据。',
'c18169dd6fceab2f023216fa6f7d22c1': '确认按钮图标',
'5720057e62e80f7a04489dc4c035b4f1': '取消按钮图标',
'8985ea173dce8f9bee667b3cdf0b7bdf': '此配置项只作用于表格操作栏的“新增”按钮',
'3f64a567662a24714768237a3a6d0de7': '表格下方新增按钮'
});

View File

@ -226,7 +226,8 @@ export class TableControlPlugin extends BasePlugin {
...column,
type: column.type,
quickEdit: {
type: column.quickEdit.type
type: column.quickEdit.type,
name: column.name
}
};
rawColumns.push(rawColumn);
@ -573,12 +574,13 @@ export class TableControlPlugin extends BasePlugin {
getSchemaTpl('formItemName', {
required: true
}),
getSchemaTpl('label'),
{
type: 'ae-Switch-More',
name: 'needConfirm',
label: tipedLabel(
'确认模式',
'在新增或编辑单行数据时生效。开启时,输入完内容后需要点击表格右侧的“保存”按钮后才能提交到数据域。未开启时,输入完内容后就能提交数据域。'
'开启时,新增、编辑需要点击表格右侧的“保存”按钮才能变更组件数据。未开启时,新增、编辑、删除操作直接改变组件数据。'
),
mode: 'normal',
formType: 'extend',
@ -593,7 +595,7 @@ export class TableControlPlugin extends BasePlugin {
},
getSchemaTpl('icon', {
name: 'confirmBtnIcon',
label: '确认图标'
label: '确认按钮图标'
}),
{
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
@ -603,7 +605,7 @@ export class TableControlPlugin extends BasePlugin {
},
getSchemaTpl('icon', {
name: 'cancelBtnIcon',
label: '取消图标'
label: '取消按钮图标'
})
]
},
@ -619,20 +621,18 @@ export class TableControlPlugin extends BasePlugin {
},
getSchemaTpl('creatable', {
name: 'addable',
label: '可新增',
formType: 'extend',
hiddenOnDefault: true,
form: {
body: [
{
label: '按钮名称',
label: tipedLabel('按钮名称', '此配置项只作用于表格操作栏的“新增”按钮'),
name: 'addBtnLabel',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
placeholder: '新增'
type: i18nEnabled ? 'input-text-i18n' : 'input-text'
},
getSchemaTpl('icon', {
name: 'addBtnIcon',
label: '按钮图标'
label: tipedLabel('按钮图标', '此配置项只作用于表格操作栏的“新增”按钮')
}),
getSchemaTpl('apiControl', {
label: '新增接口',
@ -649,6 +649,39 @@ export class TableControlPlugin extends BasePlugin {
return !!value;
}
}),
{
type: 'ae-switch-more',
name: 'showFooterAddBtn',
label: '表格下方新增按钮',
mode: 'normal',
formType: 'extend',
hiddenOnDefault: true,
value: true,
visibleOn: 'this.addable',
form: {
body: [
{
label: '按钮名称',
name: 'footerAddBtnLabel',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
pipeIn: defaultValue('新增')
},
getSchemaTpl('icon', {
name: 'footerAddBtnIcon',
label: '按钮图标'
}),
]
},
pipeIn: (value: any, form: any, props: any) => {
if (!!value) {
const icon = form.data.footerAddBtnIcon !== undefined
? form.data.footerAddBtnIcon
: 'plus';
form.setValueByName('footerAddBtnIcon', icon);
}
return !!value;
}
},
{
type: 'ae-switch-more',
name: 'copyable',
@ -661,8 +694,7 @@ export class TableControlPlugin extends BasePlugin {
{
label: '按钮名称',
name: 'copyBtnLabel',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
placeholder: '复制'
type: i18nEnabled ? 'input-text-i18n' : 'input-text'
},
getSchemaTpl('icon', {
name: 'copyBtnLabel',
@ -687,8 +719,7 @@ export class TableControlPlugin extends BasePlugin {
{
label: '按钮名称',
name: 'editBtnLabel',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
placeholder: '编辑'
type: i18nEnabled ? 'input-text-i18n' : 'input-text'
},
getSchemaTpl('icon', {
name: 'editBtnIcon',
@ -703,7 +734,7 @@ export class TableControlPlugin extends BasePlugin {
},
pipeIn: (value: any, form: any) => {
if (!!value) {
const icon = form.data.editBtnIcon !== undefined ? form.data.editBtnIcon : 'edit';
const icon = form.data.editBtnIcon !== undefined ? form.data.editBtnIcon : 'pencil';
form.setValueByName('editBtnIcon', icon);
}
return !!value;
@ -718,8 +749,7 @@ export class TableControlPlugin extends BasePlugin {
{
label: '按钮名称',
name: 'deleteBtnLabel',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
placeholder: '删除'
type: i18nEnabled ? 'input-text-i18n' : 'input-text'
},
getSchemaTpl('icon', {
name: 'deleteBtnIcon',
@ -736,7 +766,6 @@ export class TableControlPlugin extends BasePlugin {
return !!value;
}
}),
getSchemaTpl('label'),
getSchemaTpl('description'),
getSchemaTpl('placeholder', {
label: '空数据提示'