hjm 6 years ago
commit d0e5aaa11c

@ -33,7 +33,8 @@ class GraduationTasksSubmitedit extends Component{
Loadtype:false, Loadtype:false,
description:undefined, description:undefined,
attachments:undefined, attachments:undefined,
spinnings:false spinnings:false,
shixunsreplace:false,
} }
} }
@ -84,98 +85,7 @@ class GraduationTasksSubmitedit extends Component{
window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise"; window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise";
} }
handleSubmit=(e) => {
let {fileList,selectmemberslist,workslist}=this.state;
let userids=[];
for(var list of selectmemberslist){
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
}
let listid=[];
for(var list of fileList){
listid.push(list.response.id)
}
e.preventDefault();
if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
// console.log(fileList);
if(values.description===undefined||values.description===""){
return
}
if(workslist.task_type===2){
if(userids.length<2){
this.setState({
minvalue:2,
setvalue:"小于",
minmaxtype:true
})
return
}else if(userids.length>5){
this.setState({
minvalue:5,
setvalue:"大于",
minmaxtype:true
})
return
}
}
this.setState({
spinnings:true
})
let workId=this.props.match.params.work_Id;
let url="/graduation_works/"+workId+".json";
axios.put(url, {
description:values.description,
attachment_ids:listid,
user_ids:userids
}
).then((response) => {
this.setState({
spinnings:false
})
if(response.status===200) {
GraduationTasksnewtype=false;
if(response.data.status===0){
// this.setState({
// Modalstype:true,
// Modalstopval:response.data.message,
// ModalSave:this.setedit,
// Loadtype:true
// })
this.setedit()
}else{
GraduationTasksnewtype=true;
}
}
}).catch((error) => {
console.log(error)
})
}
});
}
// setTimeout(function () {
// GraduationTasksnewtype=true
// },10000)
}
handleSelectChange = (value) => { handleSelectChange = (value) => {
console.log(value); console.log(value);
@ -414,10 +324,126 @@ class GraduationTasksSubmitedit extends Component{
window.history.go(-1) window.history.go(-1)
} }
handleSubmit=(e) => {
let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
this.Commoninterface(fileList,selectmemberslist,workslist);
// setTimeout(function () {
// GraduationTasksnewtype=true
// },10000)
}
Commoninterface =(fileList,selectmemberslist,workslist)=>{
let userids=[];
for(var list of selectmemberslist){
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
}
let listid=[];
for(var list of fileList){
listid.push(list.response.id)
}
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
// console.log(fileList);
if(values.description===undefined||values.description===""){
return
}
if(workslist.task_type===2){
if(userids.length<2){
this.setState({
minvalue:2,
setvalue:"小于",
minmaxtype:true
})
return
}else if(userids.length>5){
this.setState({
minvalue:5,
setvalue:"大于",
minmaxtype:true
})
return
}
}
this.setState({
spinnings:true
})
let workId=this.props.match.params.work_Id;
let url="/graduation_works/"+workId+".json";
axios.put(url, {
description:values.description,
attachment_ids:listid,
user_ids:userids
}
).then((response) => {
this.setState({
spinnings:false
})
if(response!== undefined){
this.setedit()
}
// if(response.status===200) {
// GraduationTasksnewtype=false;
// if(response.data.status===0){
// // this.setState({
// // Modalstype:true,
// // Modalstopval:response.data.message,
// // ModalSave:this.setedit,
// // Loadtype:true
// // })
// }else{
// GraduationTasksnewtype=true;
// }
// }
}).catch((error) => {
console.log(error)
})
}
});
}
hidestartshixunsreplace = ()=>{
let {fileList,selectmemberslist,workslist}=this.state;
this.Commoninterface(fileList,selectmemberslist,workslist);
}
hidestartshixunsreplacetwo= ()=>{
this.setState({
shixunsreplace:false,
})
}
render(){ render(){
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
let {search,fileList, workslist,setvalue,minvalue,minmaxtype,Loadtype,description,attachments, let {search,fileList, workslist,setvalue,minvalue,minmaxtype,Loadtype,description,attachments,
Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist} =this.state; Modalstype,Modalstopval,ModalCancel,ModalSave,memberslist,task_status,selectmemberslist,shixunsreplace} =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
@ -460,6 +486,24 @@ class GraduationTasksSubmitedit extends Component{
modalSave={ModalSave} modalSave={ModalSave}
loadtype={Loadtype} loadtype={Loadtype}
/> />
<Modal
keyboard={false}
title="提示"
visible={shixunsreplace}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 ">还未上传附件</p>
<p className="task-popup-text-center font-16 pb20">是否确认提交作品?</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr "
onClick={() => this.hidestartshixunsreplace()}>确认</a>
<a className="task-btn fr mr50"
onClick={() => this.hidestartshixunsreplacetwo()}>取消</a>
</div>
</Modal>
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
@ -482,7 +526,9 @@ class GraduationTasksSubmitedit extends Component{
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a> <a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</div> </div>
{description&&description?<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={GraduationTasksnewtype===true?this.handleSubmit:""} > {description&&description?
<div>
{/*<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={this.handleSubmit} >*/}
<div className="stud-class-set pd20 coursenavbox edu-back-white"> <div className="stud-class-set pd20 coursenavbox edu-back-white">
<style>{` <style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
@ -708,11 +754,13 @@ class GraduationTasksSubmitedit extends Component{
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>
</Form>:""} {/*</Form>*/}
</div>
:""}
</div> </div>
</div> </div>

@ -355,7 +355,7 @@ class GraduationTasksSubmitnew extends Component{
for(var list of fileList){ for(var list of fileList){
listid.push(list.response.id) listid.push(list.response.id)
} }
if( GraduationTasksnewtype===true){ // if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log(values.description); console.log(values.description);
@ -401,27 +401,30 @@ class GraduationTasksSubmitnew extends Component{
this.setState({ this.setState({
spinnings:false spinnings:false
}) })
if(response.status===200) { if(response!==undefined){
GraduationTasksnewtype=false; this.setedit(response.data.work_id)
if(response.data.status===0){ }
// if(response.status===200) {
// GraduationTasksnewtype=false;
// if(response.data.status===0){
// this.setState({ // this.setState({
// Modalstype:true, // Modalstype:true,
// Modalstopval:response.data.message, // Modalstopval:response.data.message,
// ModalSave:()=>this.setedit(response.data.work_id), // ModalSave:()=>this.setedit(response.data.work_id),
// Loadtype:true // Loadtype:true
// }) // })
this.setedit(response.data.work_id)
}else{ // }else{
GraduationTasksnewtype=true; // GraduationTasksnewtype=true;
} // }
} // }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
}); });
} // }
} }
@ -737,7 +740,7 @@ render(){
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>

@ -186,7 +186,7 @@ class GraduationTasksedit extends Component{
} }
// console.log(listid) // console.log(listid)
if(GraduationTasksedittype===true){ // if(GraduationTasksedittype===true){
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
@ -224,7 +224,7 @@ class GraduationTasksedit extends Component{
).then((response) => { ).then((response) => {
if(response.status===200) { if(response.status===200) {
// console.log(response) // console.log(response)
GraduationTasksedittype=false; // GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback() // this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
@ -235,7 +235,7 @@ class GraduationTasksedit extends Component{
} }
}); });
} // }
} }
handleSubmit=(e)=>{ handleSubmit=(e)=>{

@ -75,8 +75,8 @@ class GraduationTasksnew extends Component {
this.scrollToAnchors("descriptiontypes"); this.scrollToAnchors("descriptiontypes");
return return
} }
console.log('Received values of form: ', values); // console.log('Received values of form: ', values);
console.log(fileList); // console.log(fileList);
const course_id = this.props.match.params.coursesId; const course_id = this.props.match.params.coursesId;
let url = "/courses/" + course_id + "/graduation_tasks.json" let url = "/courses/" + course_id + "/graduation_tasks.json"
@ -413,7 +413,7 @@ class GraduationTasksnew extends Component {
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={GraduationTasksnewtype === true ? ()=>this.handleSubmit() : ""} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.goback} className="defalutCancelbtn fl">取消</a> <a onClick={this.goback} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>

@ -151,7 +151,8 @@ class CommitSummary extends Component{
<Form labelCol={{span: 5}}layout='vertical' onSubmit={this.handleSubmit} wrapperCol={{span: 12}}> <Form labelCol={{span: 5}}layout='vertical' onSubmit={this.handleSubmit} wrapperCol={{span: 12}}>
<Form.Item <Form.Item
> >
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}> <div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}
className="mdInForm">
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请输入帖子内容', required: true, message: '请输入帖子内容',

@ -245,7 +245,9 @@ class TPMBanner extends Component {
Searchvalue:"", Searchvalue:"",
pages:1 pages:1
}) })
window.location.href = response.data.url; // window.location.href = response.data.url;
// response.data.course_id
this.props.history.replace("/courses");
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -17,6 +17,7 @@ import { getImageUrl, toPath } from 'educoder'
import axios from 'axios'; import axios from 'axios';
import './Collaborators.css'; import './Collaborators.css';
import SchoolSelect from "../../../courses/members/modal/AddStudentModal";
const $ = window.$; const $ = window.$;
@ -40,7 +41,9 @@ class Collaborators extends Component {
collaborators_deletevalue: null, collaborators_deletevalue: null,
onSearchcalue:"", onSearchcalue:"",
collaboratorListsum:10, collaboratorListsum:10,
collaboratorListsumtype:true collaboratorListsumtype:true,
user_name:undefined,
school_name:undefined
} }
} }
componentDidMount() { componentDidMount() {
@ -151,16 +154,21 @@ class Collaborators extends Component {
}) })
} }
onSearchadmin = (value) => { onSearchadmin = (value) => {
let {collaboratorList} = this.state; let {collaboratorList,user_name,school_name} = this.state;
if (value === "") { // if (value === "") {
this.setState({ // this.setState({
Searchadmin: [], // Searchadmin: [],
collaboratorList: collaboratorList // collaboratorList: collaboratorList
}) // })
} else { // } else {
//
// }
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/add_collaborators.json?search=" + value; let url = "/shixuns/" + id + "/add_collaborators.json";
axios.get(url).then((response) => { axios.get(url,{params:{
user_name:user_name ,
school_name:school_name,
}}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{ }else{
@ -179,8 +187,6 @@ class Collaborators extends Component {
}); });
} }
}
selectChangenickname = (e, key) => { selectChangenickname = (e, key) => {
let {Searchadmin} = this.state; let {Searchadmin} = this.state;
let newlist = Searchadmin; let newlist = Searchadmin;
@ -342,7 +348,9 @@ class Collaborators extends Component {
collaborators_deletetype, collaborators_deletetype,
onSearchcalue, onSearchcalue,
collaboratorListsum, collaboratorListsum,
collaboratorListsumtype collaboratorListsumtype,
user_name,
school_name
} = this.state; } = this.state;
let {loadingContent} = this.props; let {loadingContent} = this.props;
const radioStyle = { const radioStyle = {
@ -415,20 +423,33 @@ class Collaborators extends Component {
closable={false} closable={false}
footer={null} footer={null}
> >
<Search {/*<Search*/}
placeholder="输入用户的姓名、昵称、邮箱进行搜索" {/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/}
value={onSearchcalue} {/*value={onSearchcalue}*/}
onSearch={(value) => this.onSearchadmin(value)} {/*onSearch={(value) => this.onSearchadmin(value)}*/}
onInput={this.onSearchadmins} {/*onInput={this.onSearchadmins}*/}
style={{width: '100%'}} {/*style={{width: '100%'}}*/}
/> {/*/>*/}
<span className="mr10">姓名:</span>
<div className="mt20" style={{background: '#f7f9fd'}}>
<p className="clearfix pl35"> <Input allowClear placeholder="请输入真实姓名" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
<span className="fl edu-txt-w80 task-hide font-bd ml30">姓名</span> style={{ width: '130px'}}
<span className="fl edu-txt-w80 task-hide font-bd">职位</span> ></Input>
<span className="fl edu-txt-w180 task-hide font-bd">单位</span> <span className="label ml10 " style={{ minWidth: '36px' }}>单位:</span>
<Input allowClear placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '135px'}}>
</Input>
<a className="task-btn task-btn-orange" onClick={() => this.onSearchadmin()}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
>搜索</a>
<p className="clearfix pl35 mt20">
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w80 task-hide font-bd">呢称</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span>
</p> </p>
<div className="mt5" style={{background: '#f7f9fd'}}>
<div className="clearfix"> <div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list"> <ul className="upload_select_box fl" id="search_not_teachers_list">
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}> {Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
@ -454,7 +475,7 @@ class Collaborators extends Component {
<div className="mt10 clearfix"> <div className="mt10 clearfix">
<span className="fl mr15 ml10"> <span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox> <Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}> <div className="fl" style={{height: '27px'}}>
<span className="color-orange fl" id="add_teacher_notice" <span className="color-orange fl" id="add_teacher_notice"

Loading…
Cancel
Save