From 0f79daefced8980fa571dd3d2c781a0e3646614f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 24 十一月 2020 16:57:19 +0800 Subject: [PATCH] 2020-11-24 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx | 47 +++++++++++++---------------------------------- 1 files changed, 13 insertions(+), 34 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx index 221bf91..bba6819 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx @@ -11,46 +11,25 @@ uniqueChange: PropTypes.func // 淇敼鍑芥暟 } - state = { - editItem: null // 缂栬緫鍏冪礌 - } - - edit = (record) => { - this.setState({ - editItem: record - }) - - this.props.form.setFieldsValue({ - field: record.field.split(','), - errorCode: record.errorCode, - verifyType: record.verifyType || 'physical' - }) - } - - handleConfirm = () => { const { fields } = this.props + let change = {} + + fields.forEach(col => { + change[col.Column] = col.Text + }) + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - values.uuid = this.state.editItem ? this.state.editItem.uuid : '' values.fieldlabel = values.field.map(field => { - let item = fields.filter(cell => cell.Column === field)[0] - let label = '' - if (item) { - label = item.Text - } - return label + return change[field] || '' }) values.fieldlabel = values.fieldlabel.join(',') values.field = values.field.join(',') - this.setState({ - editItem: null - }, () => { - this.props.uniqueChange(values) - }) + this.props.uniqueChange(values) this.props.form.setFieldsValue({ field: [], }) @@ -76,7 +55,7 @@ return ( <Form {...formItemLayout} className="verify-form" id="verifycard1"> <Row gutter={24}> - <Col span={8}> + <Col span={7}> <Form.Item label={'鍒楀悕'}> {getFieldDecorator('field', { initialValue: [], @@ -98,7 +77,7 @@ )} </Form.Item> </Col> - <Col span={6}> + <Col span={7}> <Form.Item label={'鎶ラ敊缂栫爜'}> {getFieldDecorator('errorCode', { initialValue: 'E', @@ -118,7 +97,7 @@ )} </Form.Item> </Col> - <Col span={6}> + <Col span={7}> <Form.Item label={'楠岃瘉绫诲瀷'}> {getFieldDecorator('verifyType', { initialValue: 'physical', @@ -136,9 +115,9 @@ )} </Form.Item> </Col> - <Col span={4} className="add"> + <Col span={3} className="add"> <Button onClick={this.handleConfirm} className="mk-green"> - 淇濆瓨 + 娣诲姞 </Button> </Col> </Row> -- Gitblit v1.8.0