From 137fb8ea6af2789b3238b22bac31d80bced41dfe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 28 七月 2021 11:39:39 +0800 Subject: [PATCH] 2021-07-28 --- src/templates/zshare/modalform/datatable/index.jsx | 44 +++++++++----------------------------------- 1 files changed, 9 insertions(+), 35 deletions(-) diff --git a/src/templates/zshare/modalform/datatable/index.jsx b/src/templates/zshare/modalform/datatable/index.jsx index 50e0cc6..21ae904 100644 --- a/src/templates/zshare/modalform/datatable/index.jsx +++ b/src/templates/zshare/modalform/datatable/index.jsx @@ -70,9 +70,14 @@ class EditableCell extends Component { getInput = (form) => { - const { inputType } = this.props + const { inputType, record } = this.props if (inputType === 'file') { - return <FileUpload maxFile={1} fileType="picture-card"/> + return <FileUpload config={{ + initval: record ? (record.$url || '') : '', + suffix: '', + maxfile: 1, + fileType: 'picture-card' + }}/> } else { return <Input onPressEnter={() => this.getValue(form)} /> } @@ -85,15 +90,6 @@ return } - if (row.$url && Array.isArray(row.$url)) { - if (!row.$url[0]) { - row.$url = '' - } else if (row.$url[0].origin) { - row.$url = row.$url[0].url || '' - } else if (!row.$url[0].origin && row.$url[0].status === 'done' && row.$url[0].response) { - row.$url = row.$url[0].response - } - } this.props.onSave({...record, ...row}) }) } @@ -116,18 +112,6 @@ if (record && dataIndex) { _val = record[dataIndex] - } - - if (dataIndex === '$url' && _val) { - _val = [{ - uid: `10086`, - name: _val.slice(_val.lastIndexOf('/') + 1), - status: 'done', - url: _val, - origin: true - }] - } else if (dataIndex === '$url') { - _val = [] } return ( @@ -291,16 +275,6 @@ return; } - if (row.$url && Array.isArray(row.$url)) { - if (!row.$url[0]) { - row.$url = '' - } else if (row.$url[0].origin) { - row.$url = row.$url[0].url || '' - } else if (!row.$url[0].origin && row.$url[0].status === 'done' && row.$url[0].response) { - row.$url = row.$url[0].response - } - } - const newData = [...this.state.data] const index = newData.findIndex(item => key === item.key) if (index > -1) { @@ -323,10 +297,10 @@ handleAdd = () => { const { fields, type } = this.props - if (this.state.data.length >= 20) { + if (this.state.data.length >= 100) { notification.warning({ top: 92, - message: '鏈�澶氬彲娣诲姞20椤癸紒', + message: '鏈�澶氬彲娣诲姞100椤癸紒', duration: 5 }) return -- Gitblit v1.8.0