Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit 7b83f0c604

@ -179,7 +179,7 @@ class CommonWorkAppraise extends Component{
{/* <div className="padding40 memoContent new_li">
</div> */}
<div className={" "} style={{}}>
<div className={"appraise "} style={{}}>
<style>{`
.workAppraise>div:last-child {
border-bottom: none !important;

@ -259,7 +259,7 @@ class CommonWorkAppraiseReply extends Component{
<span className="labal">全部评阅</span>
<span className="count">{comment_scores.length}</span>
</div>)} */}
<div className={`padding10-20 ${comment_scores.length ? 'bor-bottom-greyE' : ''}`}>
<div className={`padding20-30 ${comment_scores.length ? 'bor-bottom-greyE' : ''}`}>
{!!comment_scores.length && <div className={"color-grey-6 font-16"}>
全部评阅<span className="count">{comment_scores.length===0?"":`(${comment_scores.length})`}</span>

@ -33,7 +33,8 @@ class GraduationTasksSubmitedit extends Component{
Loadtype:false,
description: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";
}
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) => {
console.log(value);
@ -414,10 +324,126 @@ class GraduationTasksSubmitedit extends Component{
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(){
const { getFieldDecorator } = this.props.form;
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 category_id=this.props.match.params.category_id;
@ -460,6 +486,24 @@ class GraduationTasksSubmitedit extends Component{
modalSave={ModalSave}
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={"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>
</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">
<style>{`
.uploadBtn.ant-btn {
@ -708,11 +754,13 @@ class GraduationTasksSubmitedit extends Component{
<Form.Item>
<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>
</div>
</Form.Item>
</Form>:""}
{/*</Form>*/}
</div>
:""}
</div>
</div>

@ -89,7 +89,7 @@ class GraduationTasksSubmitnew extends Component{
if(fileList.length === 0){
this.setState({
tshixunsreplace:true,
shixunsreplace:true,
})
return
}
@ -355,9 +355,7 @@ class GraduationTasksSubmitnew extends Component{
for(var list of fileList){
listid.push(list.response.id)
}
// e.preventDefault();
if( GraduationTasksnewtype===true){
// if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
@ -403,27 +401,30 @@ class GraduationTasksSubmitnew extends Component{
this.setState({
spinnings:false
})
if(response.status===200) {
GraduationTasksnewtype=false;
if(response.data.status===0){
if(response!==undefined){
this.setedit(response.data.work_id)
}
// if(response.status===200) {
// GraduationTasksnewtype=false;
// if(response.data.status===0){
// this.setState({
// Modalstype:true,
// Modalstopval:response.data.message,
// ModalSave:()=>this.setedit(response.data.work_id),
// Loadtype:true
// })
this.setedit(response.data.work_id)
}else{
GraduationTasksnewtype=true;
}
}
// }else{
// GraduationTasksnewtype=true;
// }
// }
}).catch((error) => {
console.log(error)
})
}
});
}
// }
}
@ -739,7 +740,7 @@ render(){
<Form.Item>
<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>
</div>
</Form.Item>

@ -159,7 +159,7 @@ class GraduationTasksappraise extends Component{
categoryid={category_id}
setupdate={this.setupdate}
/>
<div className="newMain clearfix">
<div className="newMain clearfix appraise ">
<div className={"educontent mb20"}>
<p className="clearfix mt10">

@ -18,8 +18,8 @@
color: #999999;
}
.panel-comment_item .t_info {
width: 100%;
.appraise .panel-comment_item .t_info {
width: 1062px;
}
.course-message .panel-comment_item .comment_orig_content {
width: 980px;

@ -158,7 +158,7 @@ class GraduationTasksappraiseReply extends Component{
return(
<React.Fragment>
{comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "": <div className="edu-back-white padding20-30" style={{marginTop: '16px'}}>
{comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "": <div className="edu-back-white" style={{marginTop: '16px'}}>
{isStudent===true?
<GraduationTasksappraiseReplyChild
{...this.props}

@ -30,7 +30,8 @@ class GraduationTasksappraiseReplyChild extends Component{
return(
<React.Fragment>
<div className={"stud-class-set pd20 edu-back-white mb10"} style={{height:"100%"}}>
<div className={`${comment_scores && comment_scores.length && 'bor-bottom-greyE'} stud-class-set edu-back-white mb10 padding20-30 `}
style={{height:"100%"}}>
<Modals
modalsType={this.props.Modalstype}
@ -70,24 +71,23 @@ class GraduationTasksappraiseReplyChild extends Component{
{this.props.ultimate===true?"":<div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span>
{ !!comment_scores.length && <span className="count">
{comment_scores.length===0?"":(comment_scores.length)}
{comment_scores.length===0?"":`(${comment_scores.length})`}
</span> }
</div>}
<div className="padding20 bor-bottom-greyE memoReplies commentsDelegateParent course-message"
{this.props.ultimate===true ? "": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()}
></GraduationTasksappraiseMainEditor> }
</div>
<div className={"stud-class-set edu-back-white mb10"} style={{height:"100%"}}>
<div className="padding20 memoReplies commentsDelegateParent course-message"
style={{ paddingTop: '0px', paddingBottom: '0px' }}
>
{/* style={{ display: (comments && !!comments.length) ? 'block' : 'none' }} */}
{/* <div className="replies_count">
</div> */}
{this.props.ultimate===true?"": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()}
></GraduationTasksappraiseMainEditor> }
<style>{`
`}</style>
<div className="panel-comment_item">
{ comment_scores.map(item => {

@ -27,6 +27,7 @@ class GraduationTasksedit extends Component{
tasktype:undefined,
name:"",
description:undefined,
shixunsreplace:false,
}
}
@ -73,74 +74,7 @@ class GraduationTasksedit extends Component{
}
handleSubmit=(e)=>{
let {fileList}=this.state;
let listid=[]
let graduation_id=this.state.data.graduation_id;
for(var list of fileList){
if(list.response!=undefined){
listid.push(list.response.id)
}else{
listid.push(list.uid)
}
}
// console.log(listid)
e.preventDefault();
if(GraduationTasksedittype===true){
this.props.form.validateFields((err, values) => {
if (!err) {
if(values.tasktype===undefined){
this.scrollToAnchors("tasktypes");
return
}
if(values.name===undefined){
this.scrollToAnchors("nametypes");
return
}
if(values.description===undefined){
this.scrollToAnchors("descriptiontypes");
return
}else if(values.description.length>5000){
this.scrollToAnchors("descriptiontypes");
return
}
console.log('Received values of form: ', values);
// console.log(fileList);
let tasksid=this.props.match.params.category_id;
let url="/graduation_tasks/"+tasksid+".json"
axios.put(url, {
task_type:parseInt(values.tasktype),
name:values.name,
description:values.description,
attachment_ids:listid,
}
).then((response) => {
if(response.status===200) {
// console.log(response)
GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
}
}).catch((error) => {
console.log(error)
})
}
});
}
}
goback=()=>{
// let courseId=this.props.match.params.coursesId;
@ -239,10 +173,100 @@ class GraduationTasksedit extends Component{
});
}
Commoninterface=(fileList)=>{
let listid=[]
let graduation_id=this.state.data.graduation_id;
for(var list of fileList){
if(list.response!=undefined){
listid.push(list.response.id)
}else{
listid.push(list.uid)
}
}
// console.log(listid)
// if(GraduationTasksedittype===true){
this.props.form.validateFields((err, values) => {
if (!err) {
if(values.tasktype===undefined){
this.scrollToAnchors("tasktypes");
return
}
if(values.name===undefined){
this.scrollToAnchors("nametypes");
return
}
if(values.description===undefined){
this.scrollToAnchors("descriptiontypes");
return
}else if(values.description.length>5000){
this.scrollToAnchors("descriptiontypes");
return
}
console.log('Received values of form: ', values);
// console.log(fileList);
let tasksid=this.props.match.params.category_id;
let url="/graduation_tasks/"+tasksid+".json"
axios.put(url, {
task_type:parseInt(values.tasktype),
name:values.name,
description:values.description,
attachment_ids:listid,
}
).then((response) => {
if(response.status===200) {
// console.log(response)
// GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
}
}).catch((error) => {
console.log(error)
})
}
});
// }
}
handleSubmit=(e)=>{
let {fileList}=this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
this.Commoninterface(fileList);
}
//确认
hidestartshixunsreplace = ()=>{
let {fileList}=this.state;
this.Commoninterface(fileList);
}
//取消
hidestartshixunsreplacetwo=()=>{
this.setState({
shixunsreplace:false,
})
}
render(){
const { getFieldDecorator } = this.props.form;
let {title_num,pageType,name,description,Loadtype,
Modalstype,Modalstopval,ModalCancel,ModalSave} =this.state;
Modalstype,Modalstopval,ModalCancel,ModalSave,shixunsreplace} =this.state;
let {coursedata}=this.props;
let courseId=this.props.match.params.coursesId;
@ -280,6 +304,24 @@ class GraduationTasksedit extends Component{
modalSave={ModalSave}
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={"educontent mb20"}>
@ -302,7 +344,11 @@ class GraduationTasksedit extends Component{
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</div>
{description===undefined?"":<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} onSubmit={this.handleSubmit} >
{description===undefined?"":
<div>
{/*<Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} >*/}
{/* <Form labelCol={{ span: 5 }} wrapperCol={{ span: 12 }} >*/}
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 pb0 edu-back-white">
@ -406,11 +452,13 @@ class GraduationTasksedit extends Component{
<Form.Item>
<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.goback} className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>}
{/*</Form>*/}
</div>
}
</div>
</div>

@ -23,7 +23,8 @@ class GraduationTasksnew extends Component {
title_value: "",
fileList: [],
contents: [{val: "", id: 1}],
type: true
type: true,
shixunsreplace:false,
}
}
@ -47,15 +48,13 @@ class GraduationTasksnew extends Component {
})
}
Commoninterface =(fileList)=>{
handleSubmit = (e) => {
let {fileList} = this.state;
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) {
@ -76,8 +75,8 @@ class GraduationTasksnew extends Component {
this.scrollToAnchors("descriptiontypes");
return
}
console.log('Received values of form: ', values);
console.log(fileList);
// console.log('Received values of form: ', values);
// console.log(fileList);
const course_id = this.props.match.params.coursesId;
let url = "/courses/" + course_id + "/graduation_tasks.json"
@ -100,9 +99,9 @@ class GraduationTasksnew extends Component {
});
}
}
}
goback = () => {
@ -210,11 +209,38 @@ class GraduationTasksnew extends Component {
}
}
// 提交按钮
handleSubmit = (e) => {
let {fileList} = this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
this.Commoninterface(fileList);
}
//确认
hidestartshixunsreplace =()=>{
let {fileList} = this.state;
this.Commoninterface(fileList);
}
//取消
hidestartshixunsreplacetwo=()=>{
this.setState({
shixunsreplace:false,
})
}
render() {
const {getFieldDecorator} = this.props.form;
let {
coursename, coursesearch, title_num, title_value, pageType, fileList, contents, type,
Modalstype, Modalstopval, ModalCancel, ModalSave
Modalstype, Modalstopval, ModalCancel, ModalSave,shixunsreplace
} = this.state;
let {coursedata} = this.props;
@ -254,6 +280,24 @@ class GraduationTasksnew extends Component {
modalCancel={ModalCancel}
modalSave={ModalSave}
/>
<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={"educontent mb20"}>
@ -273,8 +317,8 @@ class GraduationTasksnew extends Component {
</div>
<Form labelCol={{span: 5}} wrapperCol={{span: 12}}
onSubmit={GraduationTasksnewtype === true ? this.handleSubmit : ""}>
{/*<Form labelCol={{span: 5}} wrapperCol={{span: 12}}*/}
{/* onSubmit={GraduationTasksnewtype === true ? this.handleSubmit : ""}>*/}
<style>
{
`.ant-form-item-label{
@ -369,11 +413,11 @@ class GraduationTasksnew extends Component {
<Form.Item>
<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.goback} className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
</Form>
{/*</Form>*/}
</div>
</div>

@ -36,7 +36,7 @@ class Graduationtaskitem extends Component{
</a>
<span className="t_area fl">{item.time}</span>
{/* 分数 */}
{item.score && <span className="score_area fl">{item.score}</span>}
{item.score >= 0 && <span className="score_area fl">{item.score}</span>}
{ !item.is_invalid && item.delete && <Tooltip title={ "删除" } >
<i className="iconfont icon-shanchu mr5 fr" style={{marginLeft: '6px'}}

@ -84,8 +84,9 @@ function md_elocalStorage(editor,mdu,id){
var textStart = " 数据已于 "
var text = textStart + h + ':' + m + ':' + s +" 保存 ";
// 占位符
if ($(id2).html() && $(id2).html() != ' ' && $(id2).html().startWith(textStart) == false) {
$(id2).html( $(id2).html().split(' (')[0] + ` (${text})`);
var oldHtml = $(id2).html();
if (oldHtml && oldHtml != ' ' && oldHtml.startsWith(textStart) == false) {
$(id2).html( oldHtml.split(' (')[0] + ` (${text})`);
} else {
$(id2).html(text);
}

Loading…
Cancel
Save