From 7cd6587d43dfda47b043c775ea9e67ee4c1bbd08 Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Tue, 14 Apr 2020 14:09:55 +0800 Subject: [PATCH] 跳转问题 --- src/components/page/DocumentEditPage/index.jsx | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/page/DocumentEditPage/index.jsx b/src/components/page/DocumentEditPage/index.jsx index ba3c510..1e4bcc1 100644 --- a/src/components/page/DocumentEditPage/index.jsx +++ b/src/components/page/DocumentEditPage/index.jsx @@ -44,7 +44,7 @@ _this.setState({ loading: true, disabled: id ? true : false - }) + }) fetch({ url: 'api/document/findDetail', params: { @@ -58,6 +58,7 @@ documentType: res.documentType || 'DT00002' }, loading: false, + fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix})) || [] }); }); } @@ -100,7 +101,8 @@ iconLoading: false, }); message.success("提交成功!"); - this.props.history.goBack() + this.props.history.push("/index/rules") + // this.props.history.goBack() }); // Fetch.savePatrolCom(savedate) // .then(res => { @@ -140,6 +142,10 @@ this.setState({ fileList }); }, fileList: fileList, + onPreview: (file) => { + console.log(file) + }, + showUploadList: { showPreviewIcon: true, showDownloadIcon: true, showRemoveIcon: disabled ? false : true } // onDownload: (file) => { // console.log(file) // Fetch.attachmentDownload(file.uid) @@ -233,8 +239,8 @@ {savedate.documentType == 'DT00001' && <Row gutter={16} > <Col className="gutter-row" > - <Upload {...props}> - <Button disabled={disabled}> + <Upload {...props} > + <Button disabled={disabled} style={{ display: disabled ? 'none' : 'inline-block' }}> <Icon type="upload" />上传文件</Button> </Upload> </Col> -- Gitblit v1.8.0