From da0caba73bad6973fc80fafb35b519b1abbfba0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Wed, 18 May 2022 16:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/student/index.jsx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 42888d9a..98aeeb68 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -4,6 +4,7 @@ import { getUploadActionUrl, getUrl, appendFileSizeToUploadFileAll } from 'educo import { locData } from '../../forge/Utils/locData'; import { getStudentApplyInfo, taskList, studentApply, studentApplyEdit } from '../api'; import TextArea from 'antd/lib/input/TextArea'; +import { httpUrl } from '../fetch'; import banner from "../img/banner.png"; import studentSvg from "../img/student.png"; import './index.scss'; @@ -93,13 +94,13 @@ function Apply(props) { if (i == 0) { setFiles([{ - name: item.memoAttachment || '已上传文件', + name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件', id: item.memoAttachmentId, uid: item.memoAttachmentId }]); } else { setFiles1([{ - name: item.memoAttachment || '已上传文件', + name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件', id: item.memoAttachmentId, uid: item.memoAttachmentId, }]); @@ -163,7 +164,7 @@ function Apply(props) { } if (userApplyInfo) { - params.id=userApplyInfo.id; + params.id = userApplyInfo.id; studentApplyEdit(params).then(response => { if (response && response.message === "success") { showNotification("修改信息成功"); @@ -226,8 +227,11 @@ function Apply(props) { if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { setLoading(true); if (info.file.status === "done") { - changeTaskItem('memoAttachmentId', info.fileList[0].response.id, i) - // changeTaskItem('memoAttachment', info.fileList[0].name, i) + changeTaskItem('memoAttachmentId', info.fileList[0].response && info.fileList[0].response.data.id, i) + } + if (info.file.status === 'removed') { + console.log(1111) + changeTaskItem('memoAttachmentId', '', i); } console.log(info.fileList); if (i) { @@ -236,6 +240,7 @@ function Apply(props) { setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1)); } } + if (info.file.status === "done" || info.file.status === 'removed') { setLoading(false); } @@ -243,8 +248,8 @@ function Apply(props) { // 支持文件下载 function download(file) { - const fileId = file.id || file.response.id; - window.open(`${getUrl()}/api/attachments/${fileId}`); + const fileId = file.id || file.response.data.id; + window.open(`${httpUrl}/busiAttachments/download/${fileId}`); } function addTask(List) { @@ -426,8 +431,8 @@ function Apply(props) { 'memoAttachmentId' + i, [], { bookChange(info, i) }} onDownload={download}