From d9283419c09ae6a63f22b322c05adf043947ff63 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 29 Aug 2017 15:39:48 +0800 Subject: [PATCH] Fix details --- src/routes/Forms/AdvancedForm.js | 25 ++++++++++++------------- src/routes/Forms/TableForm.js | 4 +++- src/routes/Forms/style.less | 7 +++++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/routes/Forms/AdvancedForm.js b/src/routes/Forms/AdvancedForm.js index a83f7bb3..144374cf 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 5be2baae..27694131 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 18f256b2..b74d8a64 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; } } -- GitLab