课程 实训 试卷 选用实训over

dev_cs
杨树明 6 years ago
parent 4946fb3045
commit d9badc2d95

@ -1,6 +1,7 @@
import React,{Component} from 'react'; import React,{Component} from 'react';
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button} from "antd"; import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button,notification} from "antd";
import axios from'axios'; import axios from'axios';
import NoneData from "../coursesPublic/NoneData";
import './Newshixunmodel.css'; import './Newshixunmodel.css';
const Search = Input.Search; const Search = Input.Search;
class NewShixunModel extends Component{ class NewShixunModel extends Component{
@ -10,6 +11,7 @@ class NewShixunModel extends Component{
shixun_list:undefined, shixun_list:undefined,
shixuns_count:undefined, shixuns_count:undefined,
Grouplist:[], Grouplist:[],
allGrouplist:[{page:1,list:[]}],
page:1, page:1,
type:'all', type:'all',
status:'all', status:'all',
@ -20,11 +22,18 @@ class NewShixunModel extends Component{
} }
} }
componentDidMount() { componentDidMount() {
let{page,type,status,search,order,diff,limit}=this.state; let{page,type,search,order,diff,limit}=this.state;
let status=this.props.statustype===undefined?'all':'published';
this.setState({
status:status
})
this.getdatalist(page,type,status,search,order,diff,limit) this.getdatalist(page,type,status,search,order,diff,limit)
} }
getdatalist=(page,type,status,search,order,diff,limit)=>{ getdatalist=(page,type,status,search,order,diff,limit)=>{
this.setState({
isspinning:true
})
let url="/shixuns/shixun_list.json" let url="/shixuns/shixun_list.json"
axios.get(url,{params:{ axios.get(url,{params:{
page, page,
@ -39,9 +48,13 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
shixun_list:response.data.shixun_list, shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count, shixuns_count:response.data.shixuns_count,
isspinning:false
}) })
} }
}).catch((error) => {
this.setState({
isspinning:false
})
}) })
} }
@ -66,17 +79,54 @@ class NewShixunModel extends Component{
} }
getGrouplist=(Grouplist)=>{ getGrouplist=(Grouplist)=>{
let {page,allGrouplist}=this.state;
let newallGrouplist=allGrouplist;
var a=newallGrouplist.find((value,index,arr)=>{
return value.page==page
});
if(a!=undefined){
newallGrouplist.map((item,key)=>{
if(item.page===page){
item.list=Grouplist
}
})
}
let newGrouplist=[];
newallGrouplist.map((item,key)=>{
item.list.map((items,ke)=>{
newGrouplist.push(items)
})
})
this.setState({ this.setState({
Grouplist: Grouplist, Grouplist: newGrouplist,
allGrouplist:newallGrouplist
}) })
} }
PaginationCourse=(pageNumber)=>{ PaginationCourse=(pageNumber)=>{
this.setState({ let {allGrouplist}=this.state;
page:pageNumber let newallGrouplist=allGrouplist;
}) var v=newallGrouplist.find((value,index,arr)=>{
return value.page==pageNumber
});
if(v===undefined){
newallGrouplist.push({page:pageNumber,list:[]})
}
let{type,status,search,order,diff,limit}=this.state; let{type,status,search,order,diff,limit}=this.state;
this.getdatalist(pageNumber,type,status,search,order,diff,limit) this.getdatalist(pageNumber,type,status,search,order,diff,limit)
this.setState({
page:pageNumber,
allGrouplist:newallGrouplist
})
} }
belongto=(value)=>{ belongto=(value)=>{
@ -117,7 +167,16 @@ class NewShixunModel extends Component{
let{type,page,status,diff,order,limit}=this.state; let{type,page,status,diff,order,limit}=this.state;
this.getdatalist(page,type,status,value,order,diff,limit) this.getdatalist(page,type,status,value,order,diff,limit)
} }
showNotification = (description, message = "提示", icon) => {
const data = {
message,
description
}
if (icon) {
data.icon = icon;
}
notification.open(data);
}
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
this.setState({ this.setState({
@ -129,11 +188,32 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
hometypepvisible:false hometypepvisible:false
}) })
this.props.showNotification("请先选择实训") this.showNotification("请先选择实训")
return return
} }
if (this.props.chooseShixun) {
if(Grouplist.length>1){
this.setState({
hometypepvisible:false
})
this.showNotification("试卷选择的实训数不能大于1")
return
}
this.props.chooseShixun(Grouplist)
this.setState({
hometypepvisible:false
})
return;
}
if (this.props.pathShixun) {
this.setState({
hometypepvisible:false
})
this.props.pathShixun(Grouplist)
return;
}
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, { axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
@ -145,7 +225,7 @@ class NewShixunModel extends Component{
}else{ }else{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.props.showNotification("选择成功") this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType() this.props.hideNewShixunModelType()
@ -157,14 +237,48 @@ class NewShixunModel extends Component{
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175] // homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({
hometypepvisible:false
})
})
}
poststatus=(status)=>{
this.setState({
status:status
}) })
let{page,type,search,order,diff,limit}=this.state;
this.getdatalist(page,type,status,search,order,diff,limit)
} }
render() { render() {
let {diff,Grouplist,shixun_list,shixuns_count,page,type,order}=this.state; let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state;
// let {visible,patheditarry}=this.props; // let {visible,patheditarry}=this.props;
// console.log(Grouplist)
// console.log(allGrouplist)
const statusmenus=(
<Menu className="menus">
<Menu.Item>
<a className={status==="all"?"color-blue":""} onClick={()=>this.poststatus("all")}>
所有
</a>
</Menu.Item>
<Menu.Item >
<a className={status==="published"?"color-blue":""} onClick={()=>this.poststatus("published")} >
已发布
</a>
</Menu.Item>
<Menu.Item>
<a className={status==="unpublished"?"color-blue":""} onClick={()=>this.poststatus("unpublished")}>
未发布
</a>
</Menu.Item>
</Menu>
);
const menus = ( const menus = (
<Menu className="menus"> <Menu className="menus">
<Menu.Item> <Menu.Item>
@ -202,6 +316,7 @@ class NewShixunModel extends Component{
return( return(
<div> <div>
<style> <style>
{ {
@ -219,6 +334,7 @@ class NewShixunModel extends Component{
visible={this.props.NewShixunModelType} visible={this.props.NewShixunModelType}
height={'100%'} height={'100%'}
> >
<Spin spinning={this.state.isspinning}>
<div className={"clearfix educontent pr"}> <div className={"clearfix educontent pr"}>
<div className={"square-list clearfix"}> <div className={"square-list clearfix"}>
@ -237,7 +353,7 @@ class NewShixunModel extends Component{
<div className="clearfix font-12 mt30"> <div className="clearfix font-12 mt30">
<p className="font-12 ml5 fl"> <div className="font-12 ml5 fl">
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> </span> <span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> </span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> </span> <span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> </span>
@ -250,22 +366,28 @@ class NewShixunModel extends Component{
</sapn> </sapn>
</span> </span>
{this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
<a className="ant-dropdown-link color-grey-6 mr20">
{status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>:""}
<Dropdown overlay={menus}> <Dropdown overlay={menus}>
<a className="ant-dropdown-link color-grey-6"> <a className="ant-dropdown-link color-grey-6">
{diff===0?"所有":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/> {diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/>
</a> </a>
</Dropdown> </Dropdown>
</p> </div>
<p className="font-12 alltopiscright ml25 fr"> <div className="font-12 alltopiscright ml25 fr">
<span className={"fr topcsactive pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span> <span className={"fr topcsactive pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span>
<span className={type==="mine"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 topcsactive pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span> <span className={type==="mine"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 topcsactive pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 topcsactive pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span> <span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 topcsactive pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span>
</p> </div>
</div> </div>
<Checkbox.Group onChange={this.getGrouplist} value={Grouplist}> <Checkbox.Group onChange={this.getGrouplist} value={Grouplist} >
{shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{ {shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{
@ -350,16 +472,23 @@ class NewShixunModel extends Component{
onChange={this.PaginationCourse} onChange={this.PaginationCourse}
/> />
</div>:""} </div>:""}
{
shixun_list===undefined?
<div className={"minhegiht300"}>
</div>
:shixun_list.length===0? <NoneData></NoneData>:""
}
<div className={" edu-txt-center padding20-30"}> <div className={" edu-txt-center padding20-30"}>
<Button className={"mr20 newshixunmode"} onClick={()=>this.props.hideNewShixunModelType()}>取消</Button> <Button className={"mr20 newshixunmode"} onClick={()=>this.props.hideNewShixunModelType()}>取消</Button>
<Button className={"newshixunmode"} type="primary" onClick={()=>this.savecouseShixunModal()}>确定</Button> <Button className={"newshixunmode"} type="primary" onClick={()=>this.savecouseShixunModal()} loading={this.state.hometypepvisible}>确定</Button>
</div> </div>
</div> </div>
</div> </div>
</Spin>
</Drawer> </Drawer>
</div> </div>

@ -214,4 +214,14 @@
.newshixunmodelbotfont span{ .newshixunmodelbotfont span{
display: inline-block; display: inline-block;
margin-right: 34px; margin-right: 34px;
}
.minhegiht300{
min-height: 300px;
}
.newshixunlist:hover{
box-shadow: 1px 6px 16px rgba(156,156,156,0.16);
opacity: 1;
border-radius: 2px;
} }

@ -1,120 +1,122 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip} from "antd"; import { Modal,Checkbox,Select,Input,Tooltip} from "antd";
import axios from'axios'; import axios from'axios';
import ShixunModal from './ShixunModal' import NewShixunModel from '../coursesPublic/NewShixunModel';
const Option = Select.Option; const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
class ShixunChooseModal extends Component{ class ShixunChooseModal extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
shixunmodal: false, shixunmodal: false,
hometypepvisible: false, hometypepvisible: false,
} }
} }
setVisible = (visible) => { setVisible = (visible) => {
if (visible) { // if (visible) {
this.createCommonWork() // this.createCommonWork()
} else { // } else {
this.setState({ shixunmodal: visible }) //
} // }
} this.setState({ shixunmodal: visible })
hidecouseShixunModal = () => { }
this.setVisible(false) hidecouseShixunModal = () => {
} this.setVisible(false)
componentDidMount() { }
componentDidMount() {
}
funshixunmodallist=(search,type,loading,page)=>{ }
let{newshixunmodallist}=this.state; funshixunmodallist=(search,type,loading,page)=>{
let newshixunmodallists=[] let{newshixunmodallist}=this.state;
if(page>1){ let newshixunmodallists=[]
newshixunmodallists=newshixunmodallist; if(page>1){
} newshixunmodallists=newshixunmodallist;
this.setState({ }
hometypepvisible:loading this.setState({
}) hometypepvisible:loading
let coursesId=this.props.match.params.coursesId; })
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json"; let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url, {
params: { axios.get(url, {
search: search, params: {
type:type, search: search,
page:page type:type,
} page:page
}).then((result)=>{ }
if(result.status===200){ }).then((result)=>{
if(result.status===200){
let shixun_list=result.data.shixun_list;
for(var i=0; i<shixun_list.length;i++){ let shixun_list=result.data.shixun_list;
newshixunmodallists.push(shixun_list[i]) for(var i=0; i<shixun_list.length;i++){
} newshixunmodallists.push(shixun_list[i])
this.setState({ }
shixunmodal:true, this.setState({
shixunmodallist:result.data, shixunmodal:true,
newshixunmodallist:newshixunmodallists, shixunmodallist:result.data,
hometypepvisible:false newshixunmodallist:newshixunmodallists,
}) hometypepvisible:false
} })
}).catch((error)=>{ }
console.log(error); }).catch((error)=>{
}) console.log(error);
} })
funpatheditarry=(list)=>{ }
this.setState({ funpatheditarry=(list)=>{
patheditarry:list this.setState({
}) patheditarry:list
} })
createCommonWork=()=>{ }
createCommonWork=()=>{
this.setState({
hometypepvisible:true, this.setState({
patheditarry:[] hometypepvisible:true,
}) patheditarry:[]
})
let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json"; let coursesId=this.props.match.params.coursesId;
let url = this.props.shixunsUrl || "/courses/"+coursesId+"/homework_commons/shixuns.json";
axios.get(url).then((result)=>{
if(result.status===200){ axios.get(url).then((result)=>{
this.setState({ if(result.status===200){
shixunmodal:true, this.setState({
shixunmodallist:result.data, shixunmodal:true,
hometypepvisible:false, shixunmodallist:result.data,
newshixunmodallist:result.data.shixun_list, hometypepvisible:false,
}) newshixunmodallist:result.data.shixun_list,
} })
}).catch((error)=>{ }
console.log(error); }).catch((error)=>{
}) console.log(error);
} })
render(){ }
let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist render(){
, hometypepvisible, newshixunmodallist, patheditarry }=this.state; let {Searchvalue,type,category_id, datas, shixunmodal, shixunmodallist
let {visible}=this.props; , hometypepvisible, newshixunmodallist, patheditarry }=this.state;
let {visible}=this.props;
// console.log(patheditarry)
return( // console.log(patheditarry)
<ShixunModal return(
datas={datas} shixunmodal===true?<NewShixunModel
category_id={this.props.match.params.category_id} statustype={'published'}
visible={shixunmodal} datas={datas}
shixunmodallist={shixunmodallist} category_id={this.props.match.params.category_id}
funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)} NewShixunModelType={shixunmodal}
hometypepvisible={hometypepvisible} shixunmodallist={shixunmodallist}
hidecouseShixunModal={this.hidecouseShixunModal} funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
newshixunmodallist={newshixunmodallist} hometypepvisible={hometypepvisible}
coursesId={this.props.match.params.coursesId} hideNewShixunModelType={this.hidecouseShixunModal}
courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart newshixunmodallist={newshixunmodallist}
&& this.props.newhomeworkstart(category_id,homework_ids)} coursesId={this.props.match.params.coursesId}
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)} courseshomeworkstart={(category_id,homework_ids)=> this.props.newhomeworkstart
patheditarry={patheditarry} && this.props.newhomeworkstart(category_id,homework_ids)}
{...this.props} funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}
></ShixunModal> patheditarry={patheditarry}
) {...this.props}
} ></NewShixunModel>:""
} )
}
}
export default ShixunChooseModal; export default ShixunChooseModal;

@ -966,6 +966,7 @@ class ShixunHomework extends Component{
Coursename={Coursename} Coursename={Coursename}
page={page} page={page}
order={order} order={order}
statustype={'published'}
/>:""} />:""}
@ -1002,23 +1003,23 @@ class ShixunHomework extends Component{
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""} />:""}
{/*选择实训*/} {/*/!*选择实训*!/*/}
{shixunmodal===true?<ShixunModal {/*{shixunmodal===true?<ShixunModal*/}
{...this.props} {/*{...this.props}*/}
{...this.state} {/*{...this.state}*/}
datas={datas} {/*datas={datas}*/}
category_id={this.props.match.params.category_id} {/*category_id={this.props.match.params.category_id}*/}
visible={shixunmodal} {/*visible={shixunmodal}*/}
shixunmodallist={shixunmodallist} {/*shixunmodallist={shixunmodallist}*/}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)} {/*homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}*/}
hometypepvisible={hometypepvisible} {/*hometypepvisible={hometypepvisible}*/}
hidecouseShixunModal={this.hidecouseShixunModal} {/*hidecouseShixunModal={this.hidecouseShixunModal}*/}
newshixunmodallist={newshixunmodallist} {/*newshixunmodallist={newshixunmodallist}*/}
coursesId={this.props.match.params.coursesId} {/*coursesId={this.props.match.params.coursesId}*/}
courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)} {/*courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}*/}
funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)} {/*funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}*/}
patheditarry={patheditarry} {/*patheditarry={patheditarry}*/}
/>:""} {/*/>:""}*/}
{shixunmodal===true||shixunpath===true?<style> {shixunmodal===true||shixunpath===true?<style>
{ {

@ -1,10 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd"; import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd";
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
const $ = window.$; const $ = window.$;
const Search = Input.Search; const Search = Input.Search;
@ -60,36 +61,34 @@ class DetailCardsEditAndAdd extends Component{
this.setState({ this.setState({
selectShixun:true, selectShixun:true,
patheditarry:[], patheditarry:[],
page:1
}) })
this.changeTag(0,""); // this.changeTag(0,"");
} }
//关闭选择实训弹框 //关闭选择实训弹框
cloasShixunBox =()=>{ cloasShixunBox =()=>{
this.setState({ this.setState({
selectShixun:false, selectShixun:false,
page:1,
patheditarry:[] patheditarry:[]
}) })
} }
clickShixunchoose=()=>{ showNotification = (description, message = "提示", icon) => {
const data = {
let{patheditarry,shixuns_listeditlist,shixuns_listedit}=this.state message,
description
}
if (icon) {
data.icon = icon;
}
notification.open(data);
}
clickShixunchoose=(patheditarry)=>{
let{shixuns_listeditlist,shixuns_listedit}=this.state
let newshixuns_listedit=shixuns_listedit; let newshixuns_listedit=shixuns_listedit;
let list=shixuns_listeditlist let list=shixuns_listeditlist
if(patheditarry.length===0){
this.setState({
Modalstype:true,
Modalstopval:'请选择实训',
cardsModalsave:this.cardsModalsave
})
return
}
let url='/paths/append_to_stage.json' let url='/paths/append_to_stage.json'
axios.post(url,{ axios.post(url,{
shixun_id:patheditarry shixun_id:patheditarry
@ -98,6 +97,19 @@ class DetailCardsEditAndAdd extends Component{
if(response.data){ if(response.data){
let newshixun_lists=response.data.shixun_lists; let newshixun_lists=response.data.shixun_lists;
for(var j=0; j<newshixuns_listedit.length; j++){
for(var a=0; a<newshixun_lists.length; a++){
if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){
// this.setState({
// Modalstype:true,
// Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
// })
this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训')
return
}
}
}
for(var z=0; z<newshixun_lists.length; z++){ for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]); newshixuns_listedit.push(newshixun_lists[z]);
} }
@ -147,38 +159,7 @@ class DetailCardsEditAndAdd extends Component{
}) })
} }
//打开选择实训弹框初始化tag标签和列表
changeTag=(id,search)=>{
this.setState({
ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true,
})
let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(id!=0){
url+="&type="+id;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:id,
ChooseShixunListshixun_list:result.data.shixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
//勾选实训 //勾选实训
shixunhomeworkedit=(list)=>{ shixunhomeworkedit=(list)=>{
@ -307,57 +288,7 @@ class DetailCardsEditAndAdd extends Component{
} }
contentViewScrolladd=(e)=>{
const {ChooseShixunList}=this.state;
//滑动到底判断
let newscrollTop=parseInt(e.currentTarget.scrollTop);
let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
if(ChooseShixunList.shixun_list.length===0){
return
}else{
// console.log("到达底部");
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
}
}
onDragEnd (result) { onDragEnd (result) {
let {shixuns_listedit,shixuns_listeditlist} =this.state; let {shixuns_listedit,shixuns_listeditlist} =this.state;
@ -456,99 +387,13 @@ class DetailCardsEditAndAdd extends Component{
` `
} }
</style>:""} </style>:""}
{selectShixun===true?<NewShixunModel
NewShixunModelType={selectShixun}
hideNewShixunModelType={this.cloasShixunBox}
pathShixun={this.clickShixunchoose}
{...this.props}
></NewShixunModel>:""}
<Modal
keyboard={false}
title="选择实训"
visible={selectShixun}
closable={false}
footer={null}
width="840px"
destroyOnClose={true}
>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(
<li className="fl mr5 mt5" key={key}>
<a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
</li>
)
})
}
</div>
<div className="clearfix mb20" id="shixun_search_form_div">
<span className="fl color-grey-9 font-16 mt3">
<span></span>
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>
<ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
<li className="fl with40 paddingleft22">实训名称</li>
<li className="fl with30 edu-txt-left">使用院校</li>
<li className="fl with10">使用人数</li>
<li className="fl with10">评价等级</li>
<li className="fl with10"></li>
</ul>
<style>
{
`
.over180{min-height: 180px;max-height: 180px;overflow-y: auto}
`
}
</style>
{ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
onScroll={this.contentViewScrolladd}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
</Checkbox>
</li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</div>
)
})
}
</Checkbox.Group>
</div>}
<div className="mt20 marginauto clearfix edu-txt-center">
<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>
</div>
</div>
</Spin>
</Modal>
</div> </div>
{/* 可拖拽选择实训列表*/} {/* 可拖拽选择实训列表*/}
@ -650,4 +495,185 @@ class DetailCardsEditAndAdd extends Component{
) )
} }
} }
export default DetailCardsEditAndAdd; export default DetailCardsEditAndAdd;
//
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolladd}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <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>
// </div>
// </div>
// </Spin>
// </Modal>
// contentViewScrolladd=(e)=>{
// const {ChooseShixunList}=this.state;
// //滑动到底判断
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// // console.log("到达底部");
// this.setState({
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let {search,page,type,ChooseShixunListshixun_list}=this.state;
// let newpage=page+1;
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// search:search,
// page:newpage,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
// }
//
// }
//
// }
//
// //打开选择实训弹框初始化tag标签和列表
// changeTag=(id,search)=>{
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true,
// })
//
// let pathId=this.props.pathid;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
//
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }

@ -1,8 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd"; import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd";
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import NewShixunModel from '../../courses/coursesPublic/NewShixunModel';
import '../ShixunPaths.css'; import '../ShixunPaths.css';
import axios from 'axios'; import axios from 'axios';
const $ = window.$; const $ = window.$;
@ -63,7 +64,7 @@ class DetailCardsEditAndEdit extends Component{
selectShixun:true, selectShixun:true,
patheditarry:[] patheditarry:[]
}) })
this.changeTag(0,""); // this.changeTag(0,"");
} }
//关闭选择实训弹框 //关闭选择实训弹框
cloasShixunBox =()=>{ cloasShixunBox =()=>{
@ -79,36 +80,7 @@ class DetailCardsEditAndEdit extends Component{
}) })
} }
//打开选择实训弹框初始化tag标签和列表
changeTag(id,search){
this.setState({
ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true
})
let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(id!=0){
url+="&type="+id;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:id,
search:search,
ChooseShixunListshixun_list:result.data.shixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
shixunhomeworkedit=(list)=>{ shixunhomeworkedit=(list)=>{
@ -158,22 +130,12 @@ class DetailCardsEditAndEdit extends Component{
} }
clickShixunchoose=()=>{ clickShixunchoose=(patheditarry)=>{
let{patheditarry,shixuns_listedit,shixuns_listeditlist}=this.state let{shixuns_listedit,shixuns_listeditlist}=this.state
let newshixuns_listedit=shixuns_listedit; let newshixuns_listedit=shixuns_listedit;
let list=shixuns_listeditlist let list=shixuns_listeditlist
if(patheditarry.length===0){
this.setState({
Modalstype:true,
Modalstopval:'请选择实训',
})
return
}
let url='/paths/append_to_stage.json' let url='/paths/append_to_stage.json'
axios.post(url,{ axios.post(url,{
shixun_id:patheditarry shixun_id:patheditarry
@ -184,10 +146,11 @@ class DetailCardsEditAndEdit extends Component{
for(var j=0; j<newshixuns_listedit.length; j++){ for(var j=0; j<newshixuns_listedit.length; j++){
for(var a=0; a<newshixun_lists.length; a++){ for(var a=0; a<newshixun_lists.length; a++){
if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){ if(newshixuns_listedit[j].shixun_id===newshixun_lists[a].shixun_id){
this.setState({ // this.setState({
Modalstype:true, // Modalstype:true,
Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训', // Modalstopval:'请勿重复选择'+newshixun_lists[a].shixun_name+'实训',
}) // })
this.showNotification('请勿重复选择:'+newshixun_lists[a].shixun_name+'实训')
return return
} }
} }
@ -338,69 +301,16 @@ class DetailCardsEditAndEdit extends Component{
}) })
} }
contentViewScrolledit=(e)=>{ showNotification = (description, message = "提示", icon) => {
//滑动到底判断 const data = {
const {ChooseShixunList}=this.state; message,
let newscrollTop=parseInt(e.currentTarget.scrollTop); description
let allclientHeight=e.currentTarget.clientHeight+newscrollTop; }
if (icon) {
if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ data.icon = icon;
}
if(ChooseShixunList.shixun_list.length===0){ notification.open(data);
return }
}else{
this.setState({
hometypepvisible:true
})
// console.log("到达底部");
let {page,type,search,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let pathId=this.props.pathid;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
page:newpage,
search:search,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
}
}
render(){ render(){
let {selectShixun, let {selectShixun,
@ -483,99 +393,13 @@ class DetailCardsEditAndEdit extends Component{
} }
</style>:""} </style>:""}
{selectShixun===true?<NewShixunModel
NewShixunModelType={selectShixun}
hideNewShixunModelType={this.cloasShixunBox}
pathShixun={this.clickShixunchoose}
{...this.props}
></NewShixunModel>:""}
<Modal
keyboard={false}
title="选择实训"
visible={selectShixun}
closable={false}
footer={null}
width="840px"
destroyOnClose={true}
>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(
<li className="fl mr5 mt5" key={key}>
<a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
</li>
)
})
}
</div>
<div className="clearfix mb20" id="shixun_search_form_div">
<span className="fl color-grey-9 font-16 mt3">
<span></span>
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>
<ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
<li className="fl with40 paddingleft22">实训名称</li>
<li className="fl with30 edu-txt-left">使用院校</li>
<li className="fl with10">使用人数</li>
<li className="fl with10">评价等级</li>
<li className="fl with10"></li>
</ul>
<style>
{
`
.over180{min-height: 180px;max-height: 180px;overflow-y: auto}
`
}
</style>
{ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
onScroll={this.contentViewScrolledit}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40">
<Checkbox
id={"shixun_input_"+item.shixun_id}
value={item.shixun_id}
key={item.shixun_id}
className="fl task-hide edu-txt-left"
style={{"width":"298px"}}
name="shixun_homework[]"
>
<label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
</Checkbox>
</li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</div>
)
})
}
</Checkbox.Group>
</div>}
<div className="mt20 marginauto clearfix edu-txt-center">
<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>
</div>
</div>
</Spin>
</Modal>
</div> </div>
{/* 可拖拽选择实训列表*/} {/* 可拖拽选择实训列表*/}
@ -716,4 +540,191 @@ export default DetailCardsEditAndEdit;
// </div> // </div>
// ) // )
// }) // })
// } // }
// <Modal
// keyboard={false}
// title="选择实训"
// visible={selectShixun}
// closable={false}
// footer={null}
// width="840px"
// destroyOnClose={true}
// >
// <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
// <div className="newupload_conbox">
// <div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
// <li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
// {
// ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
// return(
// <li className="fl mr5 mt5" key={key}>
// <a onClick={()=>this.changeTag(`${item.tag_id}`,`${search}`)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
// </li>
// )
// })
// }
//
//
// </div>
// <div className="clearfix mb20" id="shixun_search_form_div">
// <span className="fl color-grey-9 font-16 mt3">
// <span>共</span>
// <span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
// <span>个实训</span>
// </span>
// <div className="fr search-new mb0">
// <Search
// placeholder="请输入创建者或者实训名称进行搜索"
// onInput={this.searchNameInput}
// onSearch={()=>this.changeTag(`${type}`,`${search}`)}
// style={{width: '115%'}}
// ></Search>
// </div>
// </div>
// <ul className="clearfix greybackHead edu-txt-center" style={{marginBottom: '0px'}}>
// <li className="fl with40 paddingleft22">实训名称</li>
// <li className="fl with30 edu-txt-left">使用院校</li>
// <li className="fl with10">使用人数</li>
// <li className="fl with10">评价等级</li>
// <li className="fl with10"></li>
// </ul>
//
// <style>
// {
// `
// .over180{min-height: 180px;max-height: 180px;overflow-y: auto}
// `
// }
// </style>
// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":<div className="over180 pl20 pr20"
// onScroll={this.contentViewScrolledit}
// >
// <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
// {
// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{
// return(
// <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
// <li className="fl with40">
// <Checkbox
// id={"shixun_input_"+item.shixun_id}
// value={item.shixun_id}
// key={item.shixun_id}
// className="fl task-hide edu-txt-left"
// style={{"width":"298px"}}
// name="shixun_homework[]"
// >
// <label style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name" title={item.shixun_name}>{item.shixun_name}</label>
// </Checkbox>
// </li>
// <li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
// <li className="fl with10 paddingl10">{item.myshixuns_count}</li>
// <li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
// <li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
// </div>
// )
// })
// }
// </Checkbox.Group>
// </div>}
// <div className="mt20 marginauto clearfix edu-txt-center">
// <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>
// </div>
// </div>
// </Spin>
// </Modal>
// //打开选择实训弹框初始化tag标签和列表
// changeTag(id,search){
//
// this.setState({
// ChooseShixunListshixun_list:[],
// page:1,
// hometypepvisible:true
// })
// let pathId=this.props.pathid;
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
// if(id!=0){
// url+="&type="+id;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:id,
// search:search,
// ChooseShixunListshixun_list:result.data.shixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
// contentViewScrolledit=(e)=>{
// //滑动到底判断
// const {ChooseShixunList}=this.state;
// let newscrollTop=parseInt(e.currentTarget.scrollTop);
// let allclientHeight=e.currentTarget.clientHeight+newscrollTop;
//
// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){
//
// if(ChooseShixunList.shixun_list.length===0){
// return
// }else{
// this.setState({
// hometypepvisible:true
// })
// // console.log("到达底部");
//
// let {page,type,search,ChooseShixunListshixun_list}=this.state;
//
// let newpage=page+1;
//
// let pathId=this.props.pathid;
//
// let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
//
// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
//
// if(search!="" && search!=undefined){
// url+="&search="+search;
// }
//
// if(type!=0){
// url+="&type="+type;
// }
// axios.get(encodeURI(url)).then((result)=>{
// if(result.status===200){
//
// let list =result.data.shixun_list;
//
// for(var i=0; i<list.length; i++){
// newChooseShixunListshixun_list.push(list[i])
// }
// this.setState({
// ChooseShixunList:result.data,
// hometypepvisible:false,
// type:type,
// page:newpage,
// search:search,
// ChooseShixunListshixun_list:newChooseShixunListshixun_list
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
//
//
// }
//
//
//
// }
//
// }
Loading…
Cancel
Save