毕业选题调整

dev_aliyun_beta
杨树林 6 years ago
parent 0ca1cee69f
commit e502aa43e1

@ -1,21 +1,20 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder';
import {BrowserRouter as Router,Route,Switch,Link, NavLin} from 'react-router-dom';
import {WordsBtn, ActionBtn,getImageUrl} from 'educoder';
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import axios from 'axios';
import {
notification
} from "antd";
import CoursesListType from '../coursesPublic/CoursesListType';
import Completetopicdetails from './Completetopicdetails';
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import BanksMenu from '../../user/usersInfo/banks/banksMenu'
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
import '../css/busyWork.css';
import '../poll/pollStyle.css';
const Completetopicdetails = Loadable({
loader: () => import('./Completetopicdetails'),
loading: Loading,
})
class CompletetopicdePage extends Component {
//毕设选题内容详情
constructor(props) {
@ -25,8 +24,8 @@ class CompletetopicdePage extends Component {
workid:1,
isSpin:false,
datas:[],
visible:false
visible:false,
banksMenu:undefined
}
}
@ -68,6 +67,18 @@ class CompletetopicdePage extends Component {
{content:'详情'}
]
}
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtopic/${workids}/${this.props.match.params.type}/details`,content:'内容详情'},
],
category:'gtopic',//毕设选题
tos:`/banks/gtopic/${workids}/edit/${this.props.match.params.type}`,
id:workids,
}
this.setState({
banksMenu:menuData
})
this.props.initPublic(crumbData);
}catch (e) {
@ -97,127 +108,35 @@ class CompletetopicdePage extends Component {
});
}
//发送至相关
sendTopics=()=>{
this.setState({
visible:true
})
}
topicscancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
checkBoxValues:[],
checkedtype:false
})
}
//删除相关
deletecheckBoxValues=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.topicscancelmodel,
ModalSave:this.topicssavedelete,
})
}
topicssavedelete=()=>{
const url = `/question_banks/multi_delete.json`;
axios.delete(url, { data: {
object_id: [this.props.match.params.workid],
object_type:"gtopic"
}})
.then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
window.location.href=`/users/${this.props.current_user.login}/topics/personal`;
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
this.topicscancelmodel()
}
render() {
let{datas,visible}=this.state;
// console.log(119)
let user_id=this.props.current_user&&this.props.current_user.user_id;
let user_type=this.props.current_user&&this.props.current_user.user_identity;
let targetuserid=this.props.data&&this.props.data.id;
let {tab,datas,visible} = this.state;
let{
banksMenu
}=this.state
//
// const common={
// initPublic:this.initPublic,
// }
return (
<div className="newMain clearfix ">
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>:""}
{/*发送至弹窗*/}
<React.Fragment>
{
visible&&visible===true?
<SendTopics
{...this.state}
{...this.props}
visible={visible}
category={"gtopic"}
checkBoxValues={[this.props.match.params.workid]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
banksMenu &&
<BanksMenu
banksMenu={banksMenu}
{...this.props}
{...this.state}
></BanksMenu>
}
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
{/*<div className="educontent mb20">*/}
{/* <p className="clearfix mb20 mt10">*/}
{/* <a className="btn colorgrey fl hovercolorblue ">题库</a>*/}
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
{/* <a*/}
{/* className=" btn colorgrey fl hovercolorblue "*/}
{/* >详情</a>*/}
{/* </p>*/}
{/*</div>*/}
{/*<div className="educontent mb20">*/}
{/* <p className=" fl color-black summaryname" style={{heigth: "33px"}}>*/}
{/* {datas&&datas.name}*/}
{/* </p>*/}
{/* <CoursesListType*/}
{/* typelist={datas&&datas.is_public?["公开"]:["私有"]}*/}
{/* />*/}
{/*</div>*/}
<div className="edu-back-white ">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
<a className="active ml12" >内容详情</a>
<a className="fr color-blue font-16 pointer" onClick={()=>this.sendTopics()}>发送</a>
<Link className="fr color-blue font-16 pointer" to={`/banks/gtopic/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div>
</div>
</div>
<Completetopicdetails {...this.state} {...this.props} datas={datas}/>
{/*{parseInt(tab) === 1 ? <Completetopicdeswer/>:""}*/}
</div>
</div>
<Switch {...this.props}>
<Route path={`/banks/gtopic/:workid/${this.props.match.params.type}`}
render={
(props) => {
return (<Completetopicdetails {...this.props} {...props} {...this.state} datas={datas} />)
}
}></Route>
</Switch>
</React.Fragment>
)
}
}

Loading…
Cancel
Save