dev_forum
杨树明 5 years ago
parent 1de8282c8d
commit ffd13e728a

@ -13,10 +13,11 @@ import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss'; import '@icedesign/base/index.scss';
import LoginDialog from './modules/login/LoginDialog' import LoginDialog from './modules/login/LoginDialog';
import Notcompletedysl from './modules/user/Notcompletedysl' import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl' import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview' import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import Trialapplication from './modules/login/Trialapplication' import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage' import NotFoundPage from './NotFoundPage'
@ -41,6 +42,7 @@ import {initAxiosInterceptors} from './AppConfig'
// tpi需要这个来加载css // tpi需要这个来加载css
import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC'; import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC';
const theme = createMuiTheme({ const theme = createMuiTheme({
palette: { palette: {
primary: { primary: {
@ -259,7 +261,7 @@ class App extends Component {
render() { render() {
// let {isRenders} = this.state;
return ( return (
<LocaleProvider locale={zhCN}> <LocaleProvider locale={zhCN}>
@ -270,6 +272,7 @@ class App extends Component {
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl> <Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl> <Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
{/*{*/} {/*{*/}
{/* isRender === true?*/} {/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/} {/* <LoginDialog></LoginDialog> : ""*/}

@ -28,6 +28,20 @@ class Addcourses extends Component{
} }
componentDidMount() { componentDidMount() {
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 409) {
this.setState({
Addcoursestypes: true
})
}
return response;
}, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
});
let {Addcoursestype}=this.props; let {Addcoursestype}=this.props;
this.setState({ this.setState({
@ -102,7 +116,7 @@ class Addcourses extends Component{
hidetojoinclass=()=>{ hidetojoinclass=()=>{
this.props.hideAddcoursestype();
// console.log(this.props) // console.log(this.props)
this.setState({ this.setState({
invite_code:undefined, invite_code:undefined,
@ -114,9 +128,10 @@ class Addcourses extends Component{
Checkboxteachingtype:false, Checkboxteachingtype:false,
professor:null, professor:null,
assistant_professor:null, assistant_professor:null,
student:null student:null,
Addcoursestypes:false
}) })
this.props.hideAddcoursestype();
} }
submitasyn=(course_id)=>{ submitasyn=(course_id)=>{
@ -285,7 +300,8 @@ class Addcourses extends Component{
loadtype, loadtype,
modalsType, modalsType,
modalsTopval, modalsTopval,
modalSave modalSave,
Addcoursestypes
}=this.state; }=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
@ -301,7 +317,7 @@ class Addcourses extends Component{
keyboard={false} keyboard={false}
className={"HomeworkModal"} className={"HomeworkModal"}
title="加入课堂" title="加入课堂"
visible={Addcoursestype} visible={Addcoursestype===undefined?Addcoursestypes:Addcoursestype}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}

@ -91,7 +91,7 @@ class PathModal extends Component{
this.setState({ this.setState({
type:types, type:types,
page:1, page:1,
newshixunmodallist:undefined newshixunmodallist:[]
}) })
this.funshixunpathlist(Searchvalue,types,true,1) this.funshixunpathlist(Searchvalue,types,true,1)
} }
@ -103,10 +103,11 @@ class PathModal extends Component{
}) })
} }
SenttotheSearch=(value)=>{ SenttotheSearch=(value)=>{
this.setState({
page:1,
newshixunmodallist:[]
})
let{type}=this.state; let{type}=this.state;
this.setState({
page:1,
})
this.funshixunpathlist(value,type,true,1) this.funshixunpathlist(value,type,true,1)
} }
@ -269,7 +270,7 @@ class PathModal extends Component{
`} `}
</style> </style>
<div className="over210 pl20 pr20" { newshixunmodallist&&newshixunmodallist.length===0?"":<div className="over210 pl20 pr20"
onScroll={this.contentViewScrolledit} onScroll={this.contentViewScrolledit}
style={{"Height":"204px"}}> style={{"Height":"204px"}}>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
@ -298,7 +299,7 @@ class PathModal extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</div> </div>}
{ this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""} { this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>

@ -142,11 +142,15 @@ class DetailCardsEditAndAdd extends Component{
//打开选择实训弹框初始化tag标签和列表 //打开选择实训弹框初始化tag标签和列表
changeTag=(id,search)=>{ changeTag=(id,search)=>{
this.setState({
hometypepvisible:true, this.setState({
}) ChooseShixunListshixun_list:[],
let pathId=this.props.pathid; page:1,
let {page}=this.state; hometypepvisible:true,
})
let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){ if(search!="" && search!=undefined){
url+="&search="+search; url+="&search="+search;
@ -157,11 +161,6 @@ class DetailCardsEditAndAdd extends Component{
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.status===200){ if(result.status===200){
this.setState({
ChooseShixunListshixun_list:[],
page:1
})
this.setState({ this.setState({
ChooseShixunList:result.data, ChooseShixunList:result.data,
hometypepvisible:false, hometypepvisible:false,
@ -296,11 +295,10 @@ class DetailCardsEditAndAdd extends Component{
contentViewScrolladd=(e)=>{ contentViewScrolladd=(e)=>{
let {page}=this.state;
//滑动到底判断 //滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("到达底部"); // console.log("到达底部");
if(page!=1){ debugger
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
}) })
@ -334,7 +332,7 @@ class DetailCardsEditAndAdd extends Component{
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
}
} }
@ -493,7 +491,7 @@ class DetailCardsEditAndAdd extends Component{
` `
} }
</style> </style>
<div className="over180 pl20 pr20" {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
onScroll={this.contentViewScrolladd} onScroll={this.contentViewScrolladd}
> >
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
@ -520,7 +518,7 @@ class DetailCardsEditAndAdd extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</div> </div>}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>

@ -392,10 +392,12 @@ export default class TPMsettings extends Component {
let departmentsUrl = `/shixuns/departments.json`; let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.setState({ if (response.data.message === undefined) {
departmentslist: response.data.shools_name this.setState({
}); departmentslist: response.data.shools_name
} });
}
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

@ -251,9 +251,11 @@ class Newshixuns extends Component {
let departmentsUrl = `/shixuns/departments.json`; let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.setState({ if (response.data.message===undefined) {
departmentslist: response.data.shools_name this.setState({
}); departmentslist: response.data.shools_name
});
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -496,7 +498,9 @@ class Newshixuns extends Component {
function fake() { function fake() {
let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; let departmentsUrl = `/shixuns/departments.json?q=` + currentValue;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
callback(response.data.shools_name); if (response.data.message===undefined) {
callback(response.data.shools_name);
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

Loading…
Cancel
Save