毕业内容调整

dev_aliyun_beta
杨树林 6 years ago
parent e502aa43e1
commit 1142457509

@ -1,21 +1,20 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch,Link, NavLin} from 'react-router-dom';
import {WordsBtn, ActionBtn,MarkdownToHtml} from 'educoder'; import {WordsBtn, ActionBtn,getImageUrl} from 'educoder';
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Button,Form } from "antd";
import axios from 'axios'; import axios from 'axios';
import { import BanksMenu from '../../user/usersInfo/banks/banksMenu'
notification import Loadable from 'react-loadable';
} from "antd"; import Loading from '../../../Loading';
import SendTopics from '../../modals/SendTopics';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType';
import Completetaskdetails from './Completetaskdetails';
import '../css/members.css'; import '../css/members.css';
import "../common/formCommon.css"; import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import '../css/busyWork.css'; import '../css/busyWork.css';
import '../poll/pollStyle.css'; import '../poll/pollStyle.css';
const Completetaskdetails = Loadable({
loader: () => import('./Completetaskdetails'),
loading: Loading,
})
class Completetaskpage extends Component { class Completetaskpage extends Component {
@ -27,7 +26,8 @@ class Completetaskpage extends Component {
workid:1, workid:1,
isSpin:false, isSpin:false,
datas:[], datas:[],
visible:false visible:false,
banksMenu:undefined
} }
} }
@ -71,7 +71,19 @@ class Completetaskpage extends Component {
crumbArray:[ crumbArray:[
{content:'详情'} {content:'详情'}
] ]
};
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtask/${workids}/${this.props.match.params.type}/details`,content:'内容详情'},
],
category:'gtask',//毕设选题
tos:`/banks/gtask/${workids}/edit/${this.props.match.params.type}`,
id:workids,
} }
this.setState({
banksMenu:menuData
})
this.props.initPublic(crumbData); this.props.initPublic(crumbData);
}catch (e) { }catch (e) {
@ -100,130 +112,31 @@ class Completetaskpage 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:"gtask"
}})
.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() { render() {
let{datas,visible}=this.state; let {datas} = this.state;
let{
// console.log(119) banksMenu
}=this.state;
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;
return ( return (
<div className="newMain clearfix "> <React.Fragment>
{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}
/>:""}
{/*发送至弹窗*/}
{ {
visible&&visible===true? banksMenu &&
<SendTopics <BanksMenu
{...this.state} banksMenu={banksMenu}
{...this.props} {...this.props}
visible={visible} {...this.state}
category={"gtask"} ></BanksMenu>
checkBoxValues={[this.props.match.params.workid]}
topicscancelmodel={()=>this.topicscancelmodel()}
/>:""
} }
<Switch {...this.props}>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}> <Route path={`/banks/gtask/:workid/${this.props.match.params.type}`}
render={
{/*<div className="educontent mb20">*/} (props) => {
{/* <p className="clearfix mb20 mt10">*/} return (<Completetaskdetails {...this.props} {...props} {...this.state} datas={datas} />)
{/* <a className="btn colorgrey fl hovercolorblue ">题库</a>*/} }
{/* <span className="color-grey-9 fl ml3 mr3">&gt;</span>*/} }></Route>
{/* <a*/} </Switch>
{/* className=" btn colorgrey fl hovercolorblue "*/} </React.Fragment>
{/* >详情</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/gtask/${this.props.match.params.workid}/edit`} >编辑</Link>
<a className="fr color-blue font-16 pointer" onClick={()=>this.deletecheckBoxValues()}>删除</a>
</div>
</div>
</div>
<Completetaskdetails {...this.state} {...this.props} datas={datas}/>
</div>
</div>
) )
} }
} }

Loading…
Cancel
Save