diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 7a6f0fc04..a38489385 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -35,7 +35,7 @@ if (isDev) { // 老师 // debugType="teacher"; // 学生 -//debugType="student"; +// debugType="student"; window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/modals/Modals.js b/public/react/src/modules/modals/Modals.js index 859e54784..e241f379a 100644 --- a/public/react/src/modules/modals/Modals.js +++ b/public/react/src/modules/modals/Modals.js @@ -29,6 +29,9 @@ render() { body{ overflow: hidden !important; } + .ant-modal-body { + padding: 20px 40px; + } ` } :""} diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 2998ab0a8..74016634f 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -1,14 +1,10 @@ import React, {Component} from 'react'; -import {Redirect} from 'react-router'; - import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; -import PropTypes from 'prop-types'; - import {Rating, Progress} from "@icedesign/base"; -import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Rate} from 'antd'; +import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Button,Popover} from 'antd'; import AccountProfile from "../user/AccountProfile"; @@ -298,7 +294,10 @@ class TPMBanner extends Component { ModalCancel = () => { this.setState({ - Modalstype: false + Modalstype: false, + Modalstopval: "", + modalsMidval:undefined, + ModalsBottomval:"", }) } ModalSave = () => { @@ -316,12 +315,48 @@ class TPMBanner extends Component { this.setState({ Modalstype: true, Modalstopval: "是否确认撤销发布?", + modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关", + ModalsBottomval:"卡,学员需要重新体验课程", ModalCancel: this.ModalCancel, ModalSave: this.ModalSave, }) } + openpublic=()=>{ + let id = this.props.match.params.shixunId; + let url = `/shixuns/${id}/apply_public.json`; + axios.get(url).then((response) => { + if(response.data.status===0){ + window.location.reload() + } + }).catch((error) => { + console.log(error) + }); + } + + ModalhidenpublicSave=()=>{ + let id = this.props.match.params.shixunId; + let url = `/shixuns/${id}/cancel_apply_public.json`; + axios.get(url).then((response) => { + if(response.data.status===0){ + window.location.reload() + } + }).catch((error) => { + console.log(error) + }); + } + + hidenpublic=()=>{ + this.setState({ + Modalstype: true, + Modalstopval: "是否确认撤销公开?", + modalsMidval:" ", + ModalsBottomval:" ", + ModalCancel: this.ModalCancel, + ModalSave: this.ModalhidenpublicSave, + }) + } /* * 申请发布按钮 * */ @@ -335,12 +370,17 @@ class TPMBanner extends Component { } else { evaluation_set_position = response.data.evaluation_set_position } - this.setState({ - Issuevisible: true, - tag_position: response.data.tag_position, - evaluation_set_position: evaluation_set_position, - publishboxstatus: response.data.status, - }) + if(response.data.status===0){ + window.location.reload() + }else{ + this.setState({ + Issuevisible: true, + tag_position: response.data.tag_position, + evaluation_set_position: evaluation_set_position, + publishboxstatus: response.data.status, + }) + } + }).catch((error) => { console.log(error) }); @@ -449,7 +489,7 @@ class TPMBanner extends Component { }) // this.shixunexec(response.data.message+".json") } else if (response.data.status === -1) { - console.log(response) + } else if (response.data.status === -3) { this.setState({ shixunsmessage: response.data.message, @@ -521,7 +561,7 @@ class TPMBanner extends Component { }) // this.shixunexec(response.data.message+".json") } else if (response.data.status === -1) { - console.log(response) + } else if (response.data.status === -3) { this.setState({ shixunsmessage: response.data.message, @@ -700,6 +740,7 @@ class TPMBanner extends Component { modalCancel={this.state.ModalCancel} modalSave={this.state.ModalSave} modalsBottomval={this.state.ModalsBottomval} + modalsMidval={this.state.modalsMidval} loadtype={this.state.Loadtype} /> : ""} @@ -908,8 +949,22 @@ class TPMBanner extends Component { {/*}*/} {shixunsDetails.shixun_status === 0 && this.props.identity < 5 ? - 发布 : "" + +
您编辑完成后,可以马上使用到自
+
己的课堂和实训课程哦
+ Close + + } + trigger="click" + placement="bottom" + visible={false} + onVisibleChange={this.handleVisibleChange} + > + 发布 +
: "" } + {shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ? + : "" + } + + {shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ? + : "" + } + {shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ? 撤销发布 : "" diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index dfe6af833..1b2dad166 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -713,7 +713,7 @@ class Shixuninformation extends Component { } render() { - let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.props.data.shixun.status == 0 ? true : false; + // console.log(operateauthority) const {getFieldDecorator} = this.props.form; const { fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state; @@ -754,7 +754,7 @@ class Shixuninformation extends Component { return isLt150M; }, } - + let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.props.data.shixun&&this.props.data.shixun.status == 0 ? true : false; return (
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index f15141480..8e7b0b93a 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -41,17 +41,16 @@ export default class TPMsettings extends Component { axios.get(Url).then((response) => { // alert(response.data.shixun.choice_standard_scripts) if (response.status === 200) { - + if (response.data.shixun.scope_partment) { + if (response.data.shixun.scope_partment.length > 0) { + this.setState({ + scopetype: true + }) + } + } this.setState({ data: response.data }) - - if (response.data.shixun.scope_partment.length > 0) { - this.setState({ - scopetype: true - }) - } - } }); @@ -96,7 +95,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - window.location.href = "/shixuns"; + // window.location.href = "/shixuns"; + this.props.history.replace( "/shixuns/"); } }).catch((error) => { console.log(error) @@ -113,7 +113,8 @@ export default class TPMsettings extends Component { operateshixunstype: false, }); - window.location.href = "/shixuns/" + id + "/challenges"; + // window.location.href = "/shixuns/" + id + "/challenges"; + this.props.history.replace( "/shixuns/" + id + "/challenges"); } }).catch((error) => { console.log(error) @@ -128,7 +129,7 @@ export default class TPMsettings extends Component { render() { - let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置" + let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置" // let a="isvnc"; // let b="isVNC"; @@ -197,7 +198,7 @@ export default class TPMsettings extends Component { getdatas={(key) => this.getdatas(key)} /> - {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ? + {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false ?