From e5253f8c8be9479c638276919ca28eb88792aca9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 20 Feb 2020 16:38:46 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E4=B8=8D=E5=90=8C=E7=8A=B6=E6=80=81=E5=8F=91=E5=B8=83?=
=?UTF-8?q?=EF=BC=8C=E5=85=AC=E5=BC=80=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/paths/PathDetail/DetailTop.js | 230 +++++++++++++-----
.../src/modules/paths/PathDetail/sendPanel.js | 16 +-
2 files changed, 179 insertions(+), 67 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index a246fecb9..5d115f174 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -30,6 +30,9 @@ class DetailTop extends Component{
OpenCourseTypes:false,
putappointmenttype:false,
getappointmenttype:false,
+ openpathss:false,
+ cancel_publics:false,
+ cancel_has_publics:false
}
}
componentDidMount(){
@@ -104,61 +107,60 @@ class DetailTop extends Component{
})
}
+
+
applyissuePath=()=>{
- this.setState({
- Modalstype:true,
- Modalstopval:"发布申请已提交,请等待管理员的审核",
- Modalsbottomval:"• 我们将在1-2个工作日内完成审核",
- loadtype:true
- })
+ let pathid=this.props.match.params.pathId;
+ let url ="/paths/"+pathid+"/publish.json";
+ axios.post(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+ this.props.showNotification(result.data.message)
+ this.props.getlistdatas();
+ }else if(result.data.status===1){
+ // window.location.reload();
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+
+
}
+ postcancelissuePath=()=>{
+ let pathId=this.props.match.params.pathId;
+ let url ="/paths/"+pathId+"/cancel_publish.json";
+ axios.post(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+
+ }else if(result.data.status===1){
+ this.cardsModalcancel()
+ this.props.showNotification("撤销发布成功")
+ this.props.getlistdatas()
+ // window.location.href = "/paths/" + result.data.subject_id
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
cancelissuePath=()=>{
- let pathId=this.props.match.params.pathId;
- let url ="/paths/"+pathId+"/cancel_publish.json";
- axios.get(url).then((result)=>{
- if(result.status===200){
- if(result.data.status===0){
-
- }else if(result.data.status===1){
- window.location.href = "/paths/" + result.data.subject_id
- }
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
- reovkissuePath=()=>{
+ this.setState({
+ Modalstype: true,
+ Modalstopval: "是否确认撤销发布?",
+ modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关",
+ Modalsbottomval:"卡,学员需要重新体验实训",
+ cardsModalsavetype: true,
+ modalstyles:"848282"
+ })
- this.setState({
- Modalstype:true,
- Modalstopval:"是否确认撤销发布",
- Modalsbottomval:"确认后,回退到编辑状态",
- cardsModalsavetype:true,
- })
}
- reovkissuePaths=()=>{
- let pathId=this.props.match.params.pathId;
- let url ="/paths/"+pathId+"/cancel_has_publish.json";
- axios.get(url).then((result)=>{
- if(result.status===200){
- if(result.data.status===0){
-
- }else if(result.data.status===1){
- this.setState({
- cardsModalsavetype:false,
- loadtype:false,
- deletepathtype:false
- })
- window.location.href = "/paths/" + result.data.subject_id
- }
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
+
+
cardsModalcancel=()=>{
this.setState({
@@ -166,7 +168,14 @@ class DetailTop extends Component{
Modalsbottomval:'',
loadtype:false,
deletepathtype:false,
- putappointmenttype:false
+ putappointmenttype:false,
+ modalsMidval:'',
+ modalstyles:'',
+ cardsModalsavetype:false,
+ applyissuePath:false,
+ openpathss:false,
+ cancel_publics:false,
+ cancel_has_publics:false
})
}
@@ -317,6 +326,7 @@ class DetailTop extends Component{
// this.props.getlistdatas()
this.props.showNotification(response.data.message)
}else{
+ this.cardsModalcancel()
this.props.showNotification(response.data.message)
}
@@ -327,10 +337,93 @@ class DetailTop extends Component{
})
}
+ postopenpaths=()=>{
+ let pathid=this.props.match.params.pathId;
+
+ let url ="/paths/"+pathid+"/apply_public.json";
+ axios.post(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+ this.props.showNotification(result.data.message)
+ this.props.getlistdatas();
+ this.cardsModalcancel()
+ }else if(result.data.status===1){
+ this.props.showNotification(result.data.message)
+ this.props.getlistdatas();
+ this.cardsModalcancel()
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ openpaths=()=>{
+ this.setState({
+ Modalstype: true,
+ openpathss:true,
+ Modalstopval: "公开申请已提交,请等待管理员的审核",
+ modalsMidval:"• 我们将在1-2个工作日内完成审核",
+ Loadtype:true,
+ modalstyles:"848282"
+ })
+ }
+
+ postcancel_public=()=>{
+ let pathid=this.props.match.params.pathId;
+ let url ="/paths/"+pathid+"/cancel_public.json";
+ axios.post(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+ this.cardsModalcancel()
+ this.props.showNotification("撤销申请公开成功")
+ this.props.getlistdatas();
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ cancel_public=()=>{
+ this.setState({
+ cancel_publics:true,
+ Modalstype: true,
+ Modalstopval: "是否确认撤销申请公开?",
+ modalsMidval:" ",
+ ModalsBottomval:" ",
+ })
+ }
+
+ postcancel_has_public=()=>{
+ let pathid=this.props.match.params.pathId;
+ let url ="/paths/"+pathid+"/cancel_has_public.json";
+ axios.post(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+ this.cardsModalcancel()
+ this.props.showNotification("撤消公开成功")
+ this.props.getlistdatas();
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ cancel_has_public=()=>{
+ this.setState({
+ cancel_has_publics:true,
+ Modalstype: true,
+ Modalstopval: "是否确认撤销公开?",
+ modalsMidval:" ",
+ ModalsBottomval:" ",
+ })
+ }
render(){
let{detailInfoList}=this.props;
- let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
+ let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
@@ -367,8 +460,10 @@ class DetailTop extends Component{
modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel}
- modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
+ modalSave={cardsModalsavetype===true?()=>this.postcancelissuePath():openpathss===true?()=>this.postopenpaths():cancel_publics===true?()=>this.postcancel_public():cancel_has_publics===true?()=>this.postcancel_has_public():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
loadtype={loadtype}
+ modalsMidval={this.state.modalsMidval}
+ modalstyles={this.state.modalstyles}
>
{this.state.yslJointhe===true?this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo(this.state.MenuItemskey)}>:""}
@@ -436,7 +531,7 @@ class DetailTop extends Component{
border:1px solid rgba(255,255,255,1);
}
.maxwinth600{
- width:740px;
+ width:730px;
}
`
}
@@ -473,33 +568,48 @@ class DetailTop extends Component{
}
{ detailInfoList.allow_send === true?
- :""
+
+ :""
}
- {this.props.courses===undefined?"":detailInfoList.is_creator===true?this.OpenCoursefun()}>开课:""}
+ {this.props.courses===undefined?"":detailInfoList.is_creator===true?this.OpenCoursefun()}>开课:""}
- {
- detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
- 撤销发布:""
+ { detailInfoList.allow_statistics===true&& detailInfoList.public_status===2?
+ 撤销公开:""
+ }
+
+ {detailInfoList.allow_statistics===true&& detailInfoList.public_status===1?
+ 撤销申请公开:""
+ }
+
+ { detailInfoList.publish_status===2&& detailInfoList.allow_statistics===true&& detailInfoList.public_status===0?
+ 申请公开:""
}
{
- detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true?
- 撤销申请:""
+ detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true&&detailInfoList.public_status===0?
+ 撤销发布:""
}
+
{
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
- 申请发布:""
+ 发布:""
}
+
{detailInfoList===undefined?"":detailInfoList.allow_delete===true?删除:""}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
-
+
编辑
:""
diff --git a/public/react/src/modules/paths/PathDetail/sendPanel.js b/public/react/src/modules/paths/PathDetail/sendPanel.js
index 450afc75e..c43fc4851 100644
--- a/public/react/src/modules/paths/PathDetail/sendPanel.js
+++ b/public/react/src/modules/paths/PathDetail/sendPanel.js
@@ -69,7 +69,7 @@ class sendPanel extends Component{
openSearch:false
})
}
-
+
// 选择课堂获取选中的Id
selectCloseList=(e)=>{
this.setState({
@@ -85,7 +85,7 @@ class sendPanel extends Component{
// shixunNum:list.length
})
}
-
+
//确认提交
submitInfo=()=>{
let {sendToCourseId,sendToShixunArray}=this.state;
@@ -180,7 +180,9 @@ class sendPanel extends Component{
{
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_send===true?
-
+
发送至
:''
@@ -199,8 +201,8 @@ class sendPanel extends Component{
// onMouseLeave={this.closeList}
>