diff --git a/src/routes/Forms/AdvancedForm.js b/src/routes/Forms/AdvancedForm.js index a83f7bb3b8240e1fc7a74d155929fffa76cb9939..144374cf7fa40dedcbf28216b7560d8cc1329fc8 100644 --- a/src/routes/Forms/AdvancedForm.js +++ b/src/routes/Forms/AdvancedForm.js @@ -101,7 +101,7 @@ function AdvancedForm({ form, dispatch, submitting }) {
- + {getFieldDecorator('name', { rules: [{ required: true, message: '请输入仓库名称' }], @@ -110,7 +110,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('url', { rules: [{ required: true, message: '请选择' }], @@ -124,7 +124,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('owner', { rules: [{ required: true, message: '请选择管理员' }], @@ -138,7 +138,7 @@ function AdvancedForm({ form, dispatch, submitting }) { - + {getFieldDecorator('approver', { rules: [{ required: true, message: '请选择审批员' }], @@ -150,7 +150,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('dateRange', { rules: [{ required: true, message: '请选择生效日期' }], @@ -159,7 +159,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('type', { rules: [{ required: true, message: '请选择仓库类型' }], @@ -177,7 +177,7 @@ function AdvancedForm({ form, dispatch, submitting }) { - + {getFieldDecorator('name2', { rules: [{ required: true, message: '请输入' }], @@ -186,7 +186,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('url2', { rules: [{ required: true, message: '请选择' }], @@ -195,7 +195,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('owner2', { rules: [{ required: true, message: '请选择管理员' }], @@ -209,7 +209,7 @@ function AdvancedForm({ form, dispatch, submitting }) { - + {getFieldDecorator('approver2', { rules: [{ required: true, message: '请选择审批员' }], @@ -221,7 +221,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('dateRange2', { rules: [{ required: true, message: '请输入' }], @@ -230,7 +230,7 @@ function AdvancedForm({ form, dispatch, submitting }) { )} - + {getFieldDecorator('type2', { rules: [{ required: true, message: '请选择仓库类型' }], @@ -252,7 +252,6 @@ function AdvancedForm({ form, dispatch, submitting }) { {getErrorInfo()} - diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js index 5be2baaeb1c8571e69bf12907fef0bb1b442a3ce..27694131bd423c78fff093c19ce9e12b4c13bd1a 100644 --- a/src/routes/Forms/TableForm.js +++ b/src/routes/Forms/TableForm.js @@ -59,6 +59,7 @@ export default class TableForm extends PureComponent { name: '', department: '', editable: true, + isNew: true, }); this.index += 1; this.setState({ data: newData }); @@ -73,6 +74,7 @@ export default class TableForm extends PureComponent { } saveRow(e, key) { const target = this.getRowByKey(key); + delete target.isNew; if (!target.workId || !target.name || !target.department) { message.error('请填写完整成员信息。'); return; @@ -148,7 +150,7 @@ export default class TableForm extends PureComponent { key: 'action', render: (text, record) => { if (record.editable) { - if (record.key.indexOf('NEW_TEMP_ID_') >= 0) { + if (record.isNew) { return ( this.saveRow(e, record.key)}>保存 diff --git a/src/routes/Forms/style.less b/src/routes/Forms/style.less index 18f256b22bc463be7fc517186932d4726b4def3b..b74d8a64465e096de3f306fb2dde99b3afd578ab 100644 --- a/src/routes/Forms/style.less +++ b/src/routes/Forms/style.less @@ -69,10 +69,13 @@ } // 避免表格编辑模式切换时抖动 +:global(.ant-table) td { + transition: none !important; +} + .editable { td { - transition: none !important; - padding-top: 12.5px !important; + padding-top: 13px !important; padding-bottom: 12.5px !important; } }