From faf99ae37eea8905ef181eaddae48d9a1457d92a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 07 七月 2020 16:19:32 +0800 Subject: [PATCH] 2020-07-07 --- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 6621ff3..2712d53 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -27,24 +27,17 @@ { title: this.props.dict['model.form.field'], dataIndex: 'Column', - width: '20%' + width: '25%' }, { title: this.props.dict['model.name'], dataIndex: 'Text', - width: '20%' - }, - { - title: this.props.dict['model.export'], - dataIndex: 'export', - width: '20%', - editable: true, - render: (text, record) => record.export !== 'false' ? this.props.dict['model.true'] : this.props.dict['model.false'] + width: '25%' }, { title: this.props.dict['model.form.columnWidth'], dataIndex: 'Width', - width: '20%' + width: '25%' }, { title: '鎿嶄綔', @@ -163,6 +156,15 @@ } }) } else { + let fields = verify.columns.map(item => item.Column) + if (fields.includes(values.Column)) { + notification.warning({ + top: 92, + message: values.Column + '瀛楁宸插瓨鍦紒', + duration: 5 + }) + return + } values.uuid = Utils.getuuid() verify.columns.push(values) } @@ -373,6 +375,30 @@ }) } + columnFieldInput = () => { + const { config } = this.props + const { verify } = this.state + + let columns = fromJS(verify.columns).toJS() + let fields = columns.map(item => item.Column) + + config.columns.forEach(item => { + if (fields.includes(item.field)) return + fields.push(item.field) + + columns.push({ + Column: item.field, + Text: item.label, + Width: 20, + uuid: Utils.getuuid() + }) + }) + + this.setState({ + verify: {...verify, columns: columns} + }) + } + render() { const { card } = this.props const { verify, excelColumns, defaultscript } = this.state @@ -397,6 +423,9 @@ columnChange={this.columnChange} wrappedComponentRef={(inst) => this.columnForm = inst} /> + <Button className="excel-col-add mk-green" title="娣诲姞鏄剧ず鍒楀瓧娈�" onClick={this.columnFieldInput}> + 鍚屾鏄剧ず鍒� + </Button> <Table bordered rowKey="uuid" -- Gitblit v1.8.0