chromesetting
杨树明 5 years ago
parent 026747fc73
commit 817309387d

@ -35,7 +35,7 @@ if (isDev) {
// 老师
// debugType="teacher";
// 学生
//debugType="student";
// debugType="student";
window._debugType = debugType;
export function initAxiosInterceptors(props) {

@ -29,6 +29,9 @@ render() {
body{
overflow: hidden !important;
}
.ant-modal-body {
padding: 20px 40px;
}
`
}
</style>:""}

@ -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 ?
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">发布</a> : ""
<Popover
content={
<pre>
<div>您编辑完成后可以马上使用到自</div>
<div>己的课堂和实训课程哦</div>
<a onClick={this.hide}>Close</a>
</pre>
}
trigger="click"
placement="bottom"
visible={false}
onVisibleChange={this.handleVisibleChange}
>
<a onClick={this.applyrelease} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">发布</a>
</Popover>: ""
}
<Modal
@ -972,6 +1027,18 @@ class TPMBanner extends Component {
</Modal>
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
<Button type="primary" ghost id="challenge_begin" onClick={this.openpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39">
申请公开
</Button>: ""
}
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ?
<Button type="primary" ghost id="challenge_begin" onClick={this.hidenpublic} className="fr user_default_btn user_blue_btn mr20 font-18 height39">
撤销公开
</Button>: ""
}
{shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ?
<a onClick={this.cancel_publish} className="fr user_default_btn user_blue_btn mr20 font-18 height39"
id="challenge_begin">撤销发布</a> : ""

@ -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 (
<div>
<div className="educontent mb50 edu-back-white padding10-20">

@ -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)}
/>
</TabPane>
{this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ?
{this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false ?
<TabPane tab={showtabs} key="3">
<LearningSettings
{...this.state}

Loading…
Cancel
Save