From cde78d7603cbf0074c57e7b80e9cfcca58b658b9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 15:33:52 +0800 Subject: [PATCH 1/2] noti --- public/react/src/common/educoder.js | 1 + public/react/src/modules/paths/Index.js | 4 ++-- .../src/modules/paths/PathDetail/PathDetailIndex.js | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 194d5ff89..ca1596c54 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -64,3 +64,4 @@ export { default as ImageLayerHook } from './hooks/ImageLayerHook' // 外部 export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb' +export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/CNotificationHOC' diff --git a/public/react/src/modules/paths/Index.js b/public/react/src/modules/paths/Index.js index a7efc43bc..0f3bd349b 100644 --- a/public/react/src/modules/paths/Index.js +++ b/public/react/src/modules/paths/Index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; +import { SnackbarHOC, CNotificationHOC } from 'educoder'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; @@ -55,4 +55,4 @@ class Index extends Component{ ) } } -export default SnackbarHOC() ( TPMIndexHOC(Index) ); \ No newline at end of file +export default CNotificationHOC() (SnackbarHOC() ( TPMIndexHOC(Index) )); \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 302af3d52..a7db6f200 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -112,6 +112,10 @@ class PathDetailIndex extends Component{ this.setState({ Modalstype:false, }) + // TODO 这个是临时处理,还需要优化,这里要看怎么区分处理 + if (this.state.Modalstopval == '你确定要删除该成员吗?') { + return; + } this.props.history.goBack() } @@ -248,11 +252,12 @@ class PathDetailIndex extends Component{ let param={user_id:user_id}; axios.delete(url,{data:param}).then((response) => { if(response.data.status===1){ + this.props.showNotification(response.data.message) this.setState({ - Modalstype:true, - Modalstopval:response.data.message, - loadtype:true, - cardsModalsave:this.cardsModalsave, + Modalstype:false, + // Modalstopval:response.data.message, + loadtype:false, + // cardsModalsave:this.cardsModalsave, }) this.updatadetailInfoList(); } From faefeff99bb2288535aea4ffad7ce6b0c18fe30b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 13 Aug 2019 15:44:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9Eallow=5Fdelete=20?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E8=83=BD=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index a7db6f200..69be22f81 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -484,8 +484,9 @@ class PathDetailIndex extends Component{

{item.name} + {/* 新增allow_delete 判断是否能删除 */} { - detailInfoList===undefined?"":detailInfoList.allow_add_member===true? + item.allow_delete===true? this.shanchuallow(item.id)}>:"" }