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] 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(); }