From 35f79be6bd6de0a10bf07ccfc0f465f7b2fdf87f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 30 Aug 2019 16:07:30 +0800 Subject: [PATCH 1/2] if(file.response!=undefined){ --- .../modules/courses/busyWork/NewWorkForm.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 5b6d94a69..179e3df52 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -191,18 +191,18 @@ class NewWorkForm extends Component{ } onAttachmentRemove = (file, stateName) => { - this.props.confirm({ - content: '是否确认删除?', - - onOk: () => { - this.deleteAttachment(file, stateName) - }, - onCancel() { - console.log('Cancel'); - }, - }); - - + if(file.response!=undefined){ + this.props.confirm({ + content: '是否确认删除?', + + onOk: () => { + this.deleteAttachment(file, stateName) + }, + onCancel() { + console.log('Cancel'); + }, + }); + } return false; } deleteAttachment = (file, stateName) => { From 32d8421781a5d33c240f79419b928b4b9475a623 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 30 Aug 2019 16:22:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=99=AE=E9=80=9A=20=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/usersInfo/banks/BanksIndex.js | 14 ++++++++++++-- .../user/usersInfo/banks/HomeworkBanksEdit.js | 13 ++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 6b636dca2..6af94a58d 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -79,10 +79,20 @@ class BanksIndex extends Component{

- { - return () + return () + } + }> + { + return () } }> diff --git a/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js b/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js index c94e8d740..42a402266 100644 --- a/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js +++ b/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js @@ -9,7 +9,7 @@ class HomeworkBanksEdit extends Component { super(props); this.state = { isPublic: undefined, - isGroup: false + // isGroup: false } } componentDidMount = () =>{ @@ -26,14 +26,14 @@ class HomeworkBanksEdit extends Component { title:'编辑', is_public:result && result.data && result.data.is_public, crumbArray:[ - {to:`/banks/homework/${workId}/edit`,content:'详情'}, + {to:`/banks/${this.getModuleName()}/${workId}/edit`,content:'详情'}, {content:'编辑'} ] } this.props.initPublic(crumbData); result.data.isEdit = true; result.data.ref_attachments = result.data.reference_attachments - this.setState({ isGroup: result.data.min_num || result.data.max_num }) + // this.setState({ isGroup: result.data.min_num || result.data.max_num }) this.newWorkFormRef.initValue(result.data); } }).catch((error)=>{ @@ -60,14 +60,17 @@ class HomeworkBanksEdit extends Component { console.log(error); }); } + getModuleName = () => { + return this.props.isGroup ? 'group' : 'normal' + } toWorkDetail = () => { - this.props.history.push(`/banks/homework/${this.props.match.params.workId}`) + this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}`) } onCancel = () => { this.toWorkDetail() } isGroup = () => { - return this.state.isGroup; + return this.props.isGroup; } render(){ let { bankId } = this.props.match.params