Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

schedule_job
cxt 5 years ago
commit beffb6bf83

@ -36,7 +36,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
start_time:"", start_time:"",
end_time:"", end_time:"",
attendance_date:"", attendance_date:"",
newmode:null newmode:null,
groupstype:false
} }
} }
@ -54,7 +55,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
end_time: date end_time: date
}); });
} }
componentDidMount() { getgroup_idss=(course_groups)=>{
let newcourse_groups=course_groups;
if(this.props.type==="edit"){ if(this.props.type==="edit"){
let newlist=[] let newlist=[]
if(this.props.attendancesdata.groups.length>0){ if(this.props.attendancesdata.groups.length>0){
@ -63,15 +65,26 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
}) })
} }
console.log(this.props.attendancesdata.start_time) newlist.map((item,key)=>{
// console.log() newcourse_groups.map((i,k)=>{
if(i.id===item){
i.disabled=true
}
})
})
// console.log(newlist)
// this.setState({
//
// })
this.setState({ this.setState({
attendance_date: this.props.attendancesdata.attendance_date, attendance_date: this.props.attendancesdata.attendance_date,
start_time:new Date(this.props.attendancesdata.start_time), start_time:new Date(this.props.attendancesdata.start_time),
end_time:new Date(this.props.attendancesdata.end_time), end_time:new Date(this.props.attendancesdata.end_time),
newmode:this.props.attendancesdata.mode, newmode:this.props.attendancesdata.mode,
course_groups:newcourse_groups,
groupstype:newlist.length===0?true:false
}) })
@ -85,6 +98,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
}else{ }else{
this.setState({ this.setState({
start_time: new Date("2000-01-01T09:00:00.000+08:00"), start_time: new Date("2000-01-01T09:00:00.000+08:00"),
course_groups:newcourse_groups,
groupstype:false
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -92,15 +107,15 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
}); });
} }
}
componentDidMount() {
const coursesId=this.props.match.params.coursesId; const coursesId=this.props.match.params.coursesId;
let newurl=`/courses/${coursesId}/all_course_groups.json`; let newurl=`/courses/${coursesId}/all_course_groups.json`;
axios.get(newurl).then((response) => { axios.get(newurl).then((response) => {
this.getgroup_idss(response.data.course_groups)
this.setState({
course_groups:response.data.course_groups
}) })
})
} }
@ -226,7 +241,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
} }
render() { render() {
const { visible,form ,setRadio,Radiolist,hideCreatesign,editvisible} = this.props; const { visible,form ,setRadio,Radiolist,hideCreatesign,editvisible} = this.props;
let {course_groups,newmode}=this.state; let {course_groups,newmode,groupstype}=this.state;
const { getFieldDecorator } = form; const { getFieldDecorator } = form;
const { Option } = Select; const { Option } = Select;
const formItemLayout = { const formItemLayout = {
@ -268,13 +283,13 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
<Form.Item label="签到班级:"> <Form.Item label="签到班级:">
{getFieldDecorator('group_ids')( {getFieldDecorator('group_ids')(
<Select mode="multiple" placeholder={course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode} <Select mode="multiple" placeholder={this.props&&this.props.type==="edit"&&this.state.groupstype===true?"已选择全部分班":course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}
disabled={this.props&&this.props.type==="edit"?true:false} disabled={this.props&&this.props.type==="edit"&&this.state.groupstype===true?true:false}
> >
{course_groups.map((item,key)=>{ {course_groups.map((item,key)=>{
return( return(
<Option value={item.id} key={key}>{item.name}</Option> <Option value={item.id} key={key} disabled={item.disabled?item.disabled:false}>{item.name}</Option>
) )
})} })}

@ -441,6 +441,40 @@ class DetailTop extends Component{
}) })
} }
setCollect=()=>{
let pathid=this.props.match.params.pathId;
let url ="/collections.json";
axios.post(url,{
container_id:pathid,
container_type:"Subject"
}).then((result)=>{
const status = result.data.status
if(status===0){
this.props.getlistdatas()
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
console.log(error);
})
}
cancelCollect=()=>{
let pathid=this.props.match.params.pathId;
let url=`/collections/cancel.json`;
axios.delete(url,{ data:{
container_id:pathid,
container_type:"Subject"
}}).then((response) => {
const status = response.data.status
if(status===0){
this.props.getlistdatas()
this.props.showNotification(response.data.message);
}
}).catch((error) => {
console.log(error)
})
}
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics,applyissuePaths}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics,applyissuePaths}=this.state;
@ -628,6 +662,8 @@ class DetailTop extends Component{
style={{'width':'65px'}} style={{'width':'65px'}}
>删除</a>:""} >删除</a>:""}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true? {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
<Link to={"/paths/"+this.props.match.params.pathId+"/edit"} <Link to={"/paths/"+this.props.match.params.pathId+"/edit"}
style={{'width':'65px'}} style={{'width':'65px'}}
@ -636,6 +672,20 @@ class DetailTop extends Component{
</Link> </Link>
:"" :""
} }
{this.props&&this.props.user.login=== ""?"":detailInfoList&&detailInfoList.is_collect===false?<a onClick={()=>this.setCollect()}
style={{'width':'65px'}}
className="fr font-18 color-white kaike mr20 kkbths" >
收藏
</a>:""}
{
this.props&&this.props.user.login=== ""?"":detailInfoList&&detailInfoList.is_collect===true?
<a className="fr font-18 color-white kaike mr20 kkbths" onClick={()=>this.cancelCollect()}> 取消收藏
</a>:""
}
</div> </div>

@ -116,9 +116,9 @@ class PathDetailIndex extends Component{
members:items, members:items,
items items
}); });
console.log(this.state.members) // console.log(this.state.members)
console.log("items 数组数组数组数组") // console.log("items 数组数组数组数组")
console.log(items) // console.log(items)
} }
cardsModalcancel=()=>{ cardsModalcancel=()=>{
this.setState({ this.setState({

@ -806,6 +806,43 @@ class TPMBanner extends Component {
} }
} }
setCollect=()=>{
let id = this.props.match.params.shixunId;
let url ="/collections.json";
axios.post(url,{
container_id:id,
container_type:"Shixun"
}).then((result)=>{
const status = result.data.status
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
console.log(error);
})
}
cancelCollect=()=>{
let id = this.props.match.params.shixunId;
let url=`/collections/cancel.json`;
axios.delete(url,{ data:{
container_id:id,
container_type:"Shixun"
}}).then((response) => {
const status = response.data.status
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(response.data.message);
}
}).catch((error) => {
console.log(error)
})
}
render() { render() {
let { let {
Forkvisible, Forkvisible,
@ -1235,6 +1272,23 @@ class TPMBanner extends Component {
</Tooltip> </Tooltip>
</a> </a>
} }
{console.log(this.props)}
{this.props&&this.props.user&&this.props.user.login=== ""?"":shixunsDetails&&shixunsDetails.is_collect===false?
<a onClick={()=>this.setCollect()}
className="fr kaike kkbths mr20 font-18"
// style={{'width':'65px'}}
>
收藏
</a>:""
}
{this.props&&this.props.user&&this.props.user.login=== ""?"":shixunsDetails&&shixunsDetails.is_collect===true?
<a onClick={()=>this.cancelCollect()}
className="fr kaike kkbths mr20 font-18"
>
取消收藏
</a>:""
}
<Modal <Modal
keyboard={false} keyboard={false}
@ -1326,7 +1380,7 @@ class TPMBanner extends Component {
onClick={this.copyForkvisible} onClick={this.copyForkvisible}
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "inline-block"}} style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "inline-block"}}
> >
Fork 复制实训
</span> </span>
</Tooltip> </Tooltip>
@ -1357,7 +1411,7 @@ class TPMBanner extends Component {
} }
{Forkvisible===true?<Modal {Forkvisible===true?<Modal
keyboard={false} keyboard={false}
title="Fork原因" title="复制原因"
visible={Forkvisible} visible={Forkvisible}
closable={false} closable={false}
footer={null} footer={null}
@ -1420,7 +1474,7 @@ class TPMBanner extends Component {
</div> </div>
</Modal> </Modal>
{!!shixunsDetails.fork_num && {!!shixunsDetails.fork_num &&
<Link to={"/shixuns/" + shixunId + "/fork_list"} className="forkNumst" data-tip-down="Fork实训列表"> <Link to={"/shixuns/" + shixunId + "/fork_list"} className="forkNumst" data-tip-down="复制实训列表">
{shixunsDetails.fork_num} {shixunsDetails.fork_num}
</Link> </Link>
} }

@ -192,6 +192,7 @@ class TPMIndex extends Component {
} }
getcomponentdidmount=()=>{ getcomponentdidmount=()=>{
let userid=this.props.user&&this.props.user.user_id; let userid=this.props.user&&this.props.user.user_id;
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)

@ -222,6 +222,9 @@ class InfosPath extends Component{
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("study")} href="javascript:void(0)" onClick={() => this.changeCategory("study")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
<li className={category == "collect" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("collect")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}收藏的</a></li>
</div> </div>
<style> <style>
@ -268,6 +271,20 @@ class InfosPath extends Component{
href="javascript:void(0)" onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li> href="javascript:void(0)" onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li>
</div> </div>
} }
{
category && category == "collect" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "unfinished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("unfinished")} className="w60">未完成</a></li>
<li className={status == "finished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li>
</div>
}
<div className="clearfix font-12 " style={{ <div className="clearfix font-12 " style={{
lineHeight: "41px", lineHeight: "41px",
marginTop: "10px", marginTop: "10px",

@ -240,6 +240,10 @@ class InfosShixun extends Component{
onClick={() => this.changeCategory("study")} onClick={() => this.changeCategory("study")}
href="javascript:void(0)" href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
<li className={category == "collect" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("collect")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div> </div>
<style> <style>
{ {
@ -275,6 +279,7 @@ class InfosShixun extends Component{
onClick={() => this.changeStatus("closed")} className="w60" href="javascript:void(0)">已关闭</a></li> onClick={() => this.changeStatus("closed")} className="w60" href="javascript:void(0)">已关闭</a></li>
</div> </div>
} }
{ {
category && category == "study" && is_current && category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
@ -287,6 +292,19 @@ class InfosShixun extends Component{
onClick={() => this.changeStatus("passed")} className="w60" href="javascript:void(0)">已通关</a></li> onClick={() => this.changeStatus("passed")} className="w60" href="javascript:void(0)">已通关</a></li>
</div> </div>
} }
{
category && category == "collect" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("processing")} className="w60" href="javascript:void(0)">未通关</a></li>
<li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("passed")} className="w60" href="javascript:void(0)">已通关</a></li>
</div>
}
<div className=" clearfix font-12 " style={{ <div className=" clearfix font-12 " style={{
lineHeight: "41px", lineHeight: "41px",
marginTop: "10px", marginTop: "10px",

Loading…
Cancel
Save