dev_forum
杨树明 6 years ago
parent 83937f4304
commit 05a22b7e9c

@ -421,7 +421,7 @@ class CommonWorkSetting extends Component{
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:starttime, starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime:endtime, endtime:endtime,
Cancelname:"暂不发布", Cancelname:"暂不发布",
Savesname:"立即发布", Savesname:"立即发布",

@ -1,239 +1,239 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd";
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const Search = Input.Search; const Search = Input.Search;
class Associationmodel extends Component{ class Associationmodel extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
group_ids:[], group_ids:[],
fileList:[], fileList:[],
Modalstype:false, Modalstype:false,
Modalstopval:"", Modalstopval:"",
ModalCancel:"", ModalCancel:"",
ModalSave:"", ModalSave:"",
loadtype:false, loadtype:false,
search:undefined, search:undefined,
page:1, page:1,
limit:"", limit:"",
projects:undefined, projects:undefined,
projectvalue:undefined, projectvalue:undefined,
projectvaluetype:false, projectvaluetype:false,
} }
} }
componentDidMount() { componentDidMount() {
this.searchValue(); this.searchValue();
} }
searchValue=()=>{ searchValue=()=>{
let {search}=this.state; let {search}=this.state;
let url="/users/search_user_projects.json"; let url="/users/search_user_projects.json";
axios.get(url, { axios.get(url, {
params: { params: {
search: search search: search
} }
}).then((result)=>{ }).then((result)=>{
console.log(result) console.log(result)
if(result.status===200){ if(result.status===200){
this.setState({ this.setState({
projects:result.data.projects projects:result.data.projects
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
} }
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{
this.setState({ this.setState({
search:e.target.value search:e.target.value
}) })
} }
goback=()=>{ goback=()=>{
this.props.funlist() this.props.funlist()
this.props.Cancel() this.props.Cancel()
console.log(this.props) console.log(this.props)
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
} }
setSaves=()=>{ setSaves=()=>{
let {projectvalue}=this.state; let {projectvalue}=this.state;
let taskid=this.props.taskid; let taskid=this.props.taskid;
let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json"; let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json";
axios.post(url, { axios.post(url, {
project_id: projectvalue project_id: projectvalue
}).then((result)=>{ }).then((result)=>{
if(result.status===200){ if(result.status===200){
if(result.data.status===0){ if(result.data.status===0){
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:result.data.message, Modalstopval:result.data.message,
ModalSave:this.goback, ModalSave:this.goback,
loadtype:true loadtype:true
}) })
this.props.funlist()
} }
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
} }
Saves=()=>{ Saves=()=>{
let {projectvalue}=this.state; let {projectvalue}=this.state;
if(projectvalue===undefined||projectvalue===""){ if(projectvalue===undefined||projectvalue===""){
this.setState({ this.setState({
projectvaluetype:true, projectvaluetype:true,
}) })
}else{ }else{
this.setState({ this.setState({
projectvaluetype:false, projectvaluetype:false,
}) })
} }
let taskid=this.props.taskid; let taskid=this.props.taskid;
console.log(this.props) console.log(this.props)
let url="/graduation_tasks/"+taskid+"/graduation_works/check_project.json"; let url="/graduation_tasks/"+taskid+"/graduation_works/check_project.json";
axios.get(url, { axios.get(url, {
params: { params: {
project_id: projectvalue project_id: projectvalue
} }
}).then((result)=>{ }).then((result)=>{
if(result.status===200){ if(result.status===200){
if(result.data.is_relate===false){ if(result.data.is_relate===false){
this.setSaves() this.setSaves()
}else{ }else{
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:"该项目已被"+result.data.relate_user+"关联", Modalstopval:"该项目已被"+result.data.relate_user+"关联",
ModalSave:this.ModalSave, ModalSave:this.ModalSave,
loadtype:true loadtype:true
}) })
} }
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
} }
onChange = (e) => { onChange = (e) => {
this.setState({ this.setState({
projectvalue: e.target.value, projectvalue: e.target.value,
}); });
} }
ModalSave=()=>{ ModalSave=()=>{
this.setState({ this.setState({
Modalstype:false Modalstype:false
}) })
} }
render(){ render(){
let { let {
Modalstype, Modalstype,
Modalstopval, Modalstopval,
ModalCancel, ModalCancel,
ModalSave, ModalSave,
loadtype, loadtype,
search, search,
projects, projects,
projectvalue, projectvalue,
projectvaluetype projectvaluetype
}=this.state; }=this.state;
return( return(
<div> <div>
{/*提示*/} {/*提示*/}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalCancel={ModalCancel} modalCancel={ModalCancel}
modalSave={ModalSave} modalSave={ModalSave}
loadtype= {loadtype} loadtype= {loadtype}
/> />
<Modal <Modal
className={"HomeworkModal"} className={"HomeworkModal"}
title={this.props.modalname} title={this.props.modalname}
// visible={this.props.visible} // visible={this.props.visible}
visible={this.props.visible} visible={this.props.visible}
closable={false} closable={false}
footer={null} footer={null}
keyboard={false} keyboard={false}
destroyOnClose={true} destroyOnClose={true}
> >
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16"> <p className="task-popup-text-center font-16">
<Search <Search
placeholder="请输入项目名称进行搜索" placeholder="请输入项目名称进行搜索"
id="subject_search_input" id="subject_search_input"
value={search} value={search}
onInput={this.inputSearchValue} onInput={this.inputSearchValue}
onSearch={this.searchValue} onSearch={this.searchValue}
autoComplete="off" autoComplete="off"
></Search> ></Search>
</p> </p>
<div className={"Association mb20"}> <div className={"Association mb20"}>
<RadioGroup onChange={this.onChange} value={projectvalue}> <RadioGroup onChange={this.onChange} value={projectvalue}>
{projects&&projects.map((item,key)=>{ {projects&&projects.map((item,key)=>{
return( return(
<div key={key} style={{ <div key={key} style={{
width: '375px', width: '375px',
height: '30px' height: '30px'
}}> }}>
<Radio value={item.project_id} className="fl "></Radio> <Radio value={item.project_id} className="fl "></Radio>
<div className={"fl ml5"}>{item.project_name}</div> <div className={"fl ml5"}>{item.project_name}</div>
</div> </div>
) )
})} })}
</RadioGroup> </RadioGroup>
</div> </div>
{projectvaluetype===true?<span className={"color-red ml20 "}>请先选择项目</span>:""} {projectvaluetype===true?<span className={"color-red ml20 "}>请先选择项目</span>:""}
<div className="clearfix mt30 edu-txt-center mb10"> <div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr80" onClick={this.props.Cancel}>取消</a> <a className="task-btn color-white mr80" onClick={this.props.Cancel}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>确认</a> <a className="task-btn task-btn-orange" onClick={this.Saves}>确认</a>
</div> </div>
</div> </div>
</Modal> </Modal>
</div> </div>
) )
} }
} }
export default Associationmodel; export default Associationmodel;

@ -213,7 +213,7 @@ class Exercise extends Component{
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+this.props.getNowFormatDates(1), starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2), endtime:"截止时间:"+this.props.getNowFormatDates(2),
Cancelname:"暂不发布", Cancelname:"暂不发布",

@ -65,6 +65,7 @@ class GraduateTaskItem extends Component{
cardsModalsavetype:this.cannerassocition, cardsModalsavetype:this.cannerassocition,
loadtype:true loadtype:true
}) })
this.props.funlist()
} }
}).catch((error)=>{ }).catch((error)=>{

@ -415,7 +415,7 @@ class GraduationTaskssettingapp extends Component{
Topval:"发布设置均可修改", Topval:"发布设置均可修改",
Botvalleft:"点击修改", Botvalleft:"点击修改",
Botval:"此设置将对所有分班生效", Botval:"此设置将对所有分班生效",
starttime:moment(moment(handleDateString(this.props.getNowFormatDates(1)))).format("YYYY-MM-DD HH:mm") , starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:endtime, endtime:endtime,
@ -1164,7 +1164,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"h20 mb30 ml30"} > <div className={"h20 mb30 ml30"} >
<span>截止时间</span> <span>截止时间</span>
<Tooltip placement="bottom" title={this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}> <Tooltip placement="bottom" title={this.props.isSuperAdmin()===true?"":this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}>
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}
@ -1301,8 +1301,10 @@ class GraduationTaskssettingapp extends Component{
<RadioGroup onChange={this.funcommentstatus} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} value={crosscomment===false?undefined:commentstatus===0?2:commentstatus===2?2:commentstatus===4?4:undefined}> <RadioGroup onChange={this.funcommentstatus} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} value={crosscomment===false?undefined:commentstatus===0?2:commentstatus===2?2:commentstatus===4?4:undefined}>
<Radio style={radioStyle} value={2}>指导老师手动分配 <span className={"font-14 color-grey-c ml10"}>由指导老师在作品列表中手动选择每个作品被分配的评阅老师</span></Radio> <Radio style={radioStyle} value={2}>指导老师手动分配 <span className={"font-14 color-grey-c ml10"}>由指导老师在作品列表中手动选择每个作品被分配的评阅老师</span></Radio>
<Radio style={radioStyle} value={4}>答辩组间老师互评 <span className={"font-14 color-grey-c ml10"}>由系统按照设置在答辩组之间自动分配:<Link to={"/courses/"+courseId+"/teachers"}> <Radio style={radioStyle} value={4}>答辩组间老师互评 <span className={"font-14 color-grey-c ml10"}>由系统按照设置在答辩组之间自动分配:
<span className={"color-blue"}>答辩组设置</span></Link></span></Radio> <a href={"/courses/"+courseId+"/teachers"} target="_blank">
<span className={"color-blue"}>答辩组设置</span></a>
</span></Radio>
</RadioGroup> </RadioGroup>
</span> </span>

@ -332,7 +332,7 @@ class GraduationTaskssettinglist extends Component{
Topval:"发布设置均可修改", Topval:"发布设置均可修改",
Botvalleft:"点击修改", Botvalleft:"点击修改",
Botval:"此设置将对所有分班生效", Botval:"此设置将对所有分班生效",
starttime:moment(new Date()).format('YYYY-MM-DD 00:00'), starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:endtime, endtime:endtime,
@ -544,6 +544,7 @@ class GraduationTaskssettinglist extends Component{
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.data.status===0){ if(result.data.status===0){
this.searchValue()
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:result.data.message, Modalstopval:result.data.message,
@ -730,7 +731,7 @@ class GraduationTaskssettinglist extends Component{
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name {tag.name}
</a> </a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
@ -863,7 +864,7 @@ class GraduationTaskssettinglist extends Component{
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name {tag.name}
</a> </a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
@ -1012,7 +1013,8 @@ class GraduationTaskssettinglist extends Component{
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> <Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name</a> {tag.name}
</a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""} onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}
@ -1145,7 +1147,7 @@ class GraduationTaskssettinglist extends Component{
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/> <Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}> 其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} > {tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name {tag.name}
</a> </a>
: :
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}} <a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
@ -1256,6 +1258,7 @@ class GraduationTaskssettinglist extends Component{
visible={visibles} visible={visibles}
Cancel={this.Cancel} Cancel={this.Cancel}
taskid={taskslistdata&&taskslistdata.task_id} taskid={taskslistdata&&taskslistdata.task_id}
funlist={this.searchValue()}
/>:""} />:""}
{taskslistdata&&taskslistdata? {taskslistdata&&taskslistdata?
@ -1551,7 +1554,7 @@ class GraduationTaskssettinglist extends Component{
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting"}>设置</Link> to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting"}>设置</Link>
{taskslistdata.work_status===undefined?"":taskslistdata.work_status.map((item,key)=>{ {taskslistdata.work_status===undefined||taskslistdata.work_status===null||taskslistdata.work_status.length===0?"":taskslistdata.work_status.map((item,key)=>{
return( return(
<span key={key}> <span key={key}>
{item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""} {item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}

@ -81,7 +81,7 @@ class GraduationTasksquestions extends Component{
Topval:"发布设置均可修改", Topval:"发布设置均可修改",
Botvalleft:"点击修改", Botvalleft:"点击修改",
Botval:"此设置将对所有分班生效", Botval:"此设置将对所有分班生效",
starttime:moment(new Date()).format('YYYY-MM-DD 00:00'), starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:endtime, endtime:endtime,

@ -413,7 +413,7 @@ class GraduationTasks extends Component{
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+starttime, starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
typs:"start", typs:"start",
endtime:"截止时间:"+endtime, endtime:"截止时间:"+endtime,

File diff suppressed because it is too large Load Diff

@ -1,282 +1,282 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import Modals from '../../../modals/Modals' import Modals from '../../../modals/Modals'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
import axios from 'axios' import axios from 'axios'
import moment from 'moment'; import moment from 'moment';
class Immediatelypublish extends Component{ class Immediatelypublish extends Component{
constructor(props){ constructor(props){
super(props) super(props)
this.state={ this.state={
modalname:undefined, modalname:undefined,
modaltype:undefined, modaltype:undefined,
visible:false, visible:false,
Topval:undefined, Topval:undefined,
Topvalright:undefined, Topvalright:undefined,
Botvalleft:undefined, Botvalleft:undefined,
Botval:undefined, Botval:undefined,
starttime:undefined, starttime:undefined,
starttimes:undefined, starttimes:undefined,
endtime:undefined, endtime:undefined,
Cancelname:undefined, Cancelname:undefined,
Savesname:undefined, Savesname:undefined,
Cancel:undefined, Cancel:undefined,
Saves:undefined, Saves:undefined,
course_groups:undefined, course_groups:undefined,
modalsType:false, modalsType:false,
modalsTopval:"", modalsTopval:"",
loadtype:false, loadtype:false,
chooseId:undefined chooseId:undefined
} }
} }
//立即发布 //立即发布
homeworkstart=()=>{ homeworkstart=()=>{
let {checkBoxValues}=this.props let {checkBoxValues}=this.props
// console.log(this.props.Exercisetype==="exercise") // console.log(this.props.Exercisetype==="exercise")
if(checkBoxValues.length==0){ if(checkBoxValues.length==0){
this.props.showNotification("请先在列表中选择数据"); this.props.showNotification("请先在列表中选择数据");
// this.setState({ // this.setState({
// modalsType:true, // modalsType:true,
// modalsTopval:"请先在列表中选择数据", // modalsTopval:"请先在列表中选择数据",
// loadtype:true // loadtype:true
// }) // })
}else{ }else{
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
if(this.props.Exercisetype==="exercise"){ if(this.props.Exercisetype==="exercise"){
let url=`/courses/${coursesId}/exercises/publish_modal.json`; let url=`/courses/${coursesId}/exercises/publish_modal.json`;
axios.get(url,{ axios.get(url,{
params:{ params:{
check_ids:checkBoxValues check_ids:checkBoxValues
} }
}).then((response) => { }).then((response) => {
if(response.status===200){ if(response.status===200){
let list=[]; let list=[];
if(response.data.course_info){ if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){ for(var i=0;i<response.data.course_info.length;i++){
list.push({ list.push({
id:response.data.course_info[i].course_group_id, id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name, name:response.data.course_info[i].course_group_name,
}) })
} }
} }
this.setState({ this.setState({
course_groups:list, course_groups:list,
}) })
this.setState({ this.setState({
modalname:"立即发布", modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2, modaltype:response.data.un_publish > 0 ? 1 : 2,
visible:true, visible:true,
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+this.props.getNowFormatDates(1), starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2), endtime:"截止时间:"+this.props.getNowFormatDates(2),
Cancelname:"暂不发布", Cancelname:"暂不发布",
Savesname:"立即发布", Savesname:"立即发布",
Cancel:this.homeworkhide, Cancel:this.homeworkhide,
Saves:this.homeworkstartend, Saves:this.homeworkstartend,
}) })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
}else{ }else{
let url=`/courses/${coursesId}/polls/publish_modal.json`; let url=`/courses/${coursesId}/polls/publish_modal.json`;
axios.get(url,{ axios.get(url,{
params:{ params:{
check_ids:checkBoxValues check_ids:checkBoxValues
} }
}).then((response) => { }).then((response) => {
if(response){ if(response){
let list=[]; let list=[];
if(response.data.course_info){ if(response.data.course_info){
for(var i=0;i<response.data.course_info.length;i++){ for(var i=0;i<response.data.course_info.length;i++){
list.push({ list.push({
id:response.data.course_info[i].course_group_id, id:response.data.course_info[i].course_group_id,
name:response.data.course_info[i].course_group_name, name:response.data.course_info[i].course_group_name,
}) })
} }
} }
this.setState({ this.setState({
course_groups:list, course_groups:list,
}) })
this.setState({ this.setState({
modalname:"立即发布", modalname:"立即发布",
modaltype:response.data.un_publish > 0 ? 1 : 2, modaltype:response.data.un_publish > 0 ? 1 : 2,
visible:true, visible:true,
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+this.props.getNowFormatDates(1), starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1), starttimes:this.props.getNowFormatDates(1),
endtime:"截止时间:"+this.props.getNowFormatDates(2), endtime:"截止时间:"+this.props.getNowFormatDates(2),
Cancelname:"暂不发布", Cancelname:"暂不发布",
Savesname:"立即发布", Savesname:"立即发布",
Cancel:this.homeworkhide, Cancel:this.homeworkhide,
Saves:this.homeworkstartend, Saves:this.homeworkstartend,
}) })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
} }
} }
//取消提示弹框 //取消提示弹框
modalCancel=()=>{ modalCancel=()=>{
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:"", modalsTopval:"",
loadtype:false loadtype:false
}) })
} }
//暂不发布 //暂不发布
homeworkhide=()=>{ homeworkhide=()=>{
this.setState({ this.setState({
modalname:undefined, modalname:undefined,
modaltype:undefined, modaltype:undefined,
visible:false, visible:false,
Topval:undefined, Topval:undefined,
Topvalright:undefined, Topvalright:undefined,
Botvalleft:undefined, Botvalleft:undefined,
Botval:undefined, Botval:undefined,
starttime:undefined, starttime:undefined,
starttimes:undefined, starttimes:undefined,
endtime:undefined, endtime:undefined,
Cancelname:undefined, Cancelname:undefined,
Savesname:undefined, Savesname:undefined,
Cancel:undefined, Cancel:undefined,
Saves:undefined, Saves:undefined,
StudentList_value:undefined, StudentList_value:undefined,
addname:undefined, addname:undefined,
addnametype:false, addnametype:false,
addnametab:undefined addnametab:undefined
}) })
} }
// 确定立即发布 // 确定立即发布
homeworkstartend=(ids,endtime)=>{ homeworkstartend=(ids,endtime)=>{
let {checkBoxValues}=this.props let {checkBoxValues}=this.props
let {chooseId}=this.state; let {chooseId}=this.state;
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
if(this.props.Exercisetype==="exercise"){ if(this.props.Exercisetype==="exercise"){
let url=`/courses/${coursesId}/exercises/publish.json` let url=`/courses/${coursesId}/exercises/publish.json`
axios.post(url,{ axios.post(url,{
check_ids:checkBoxValues, check_ids:checkBoxValues,
group_ids:chooseId, group_ids:chooseId,
end_time:endtime end_time:endtime
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.homeworkhide(); this.homeworkhide();
// 调用父级公共头部的接口刷新 // 调用父级公共头部的接口刷新
this.props.action() this.props.action()
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
}else{ }else{
let url=`/courses/${coursesId}/polls/publish.json` let url=`/courses/${coursesId}/polls/publish.json`
axios.post(url,{ axios.post(url,{
check_ids:checkBoxValues, check_ids:checkBoxValues,
group_ids:chooseId, group_ids:chooseId,
end_time:endtime end_time:endtime
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.homeworkhide(); this.homeworkhide();
// 调用父级公共头部的接口刷新 // 调用父级公共头部的接口刷新
this.props.action() this.props.action()
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
} }
getcourse_groupslist=(id)=>{ getcourse_groupslist=(id)=>{
this.setState({ this.setState({
chooseId:id chooseId:id
}) })
} }
render(){ render(){
let{ let{
modalname, modalname,
modaltype, modaltype,
visible, visible,
Topval, Topval,
Topvalright, Topvalright,
Botvalleft, Botvalleft,
Botval, Botval,
starttime, starttime,
starttimes, starttimes,
endtime, endtime,
Cancelname, Cancelname,
Savesname, Savesname,
Cancel, Cancel,
Saves, Saves,
course_groups, course_groups,
modalsType, modalsType,
modalsTopval, modalsTopval,
loadtype, loadtype,
}=this.state }=this.state
return( return(
<React.Fragment> <React.Fragment>
<HomeworkModal <HomeworkModal
modaltype={modaltype} modaltype={modaltype}
modalname={modalname} modalname={modalname}
visible={visible} visible={visible}
Topval={Topval} Topval={Topval}
Topvalright={Topvalright} Topvalright={Topvalright}
Botvalleft={Botvalleft} Botvalleft={Botvalleft}
Botval={Botval} Botval={Botval}
starttime={starttime} starttime={starttime}
starttimes={starttimes} starttimes={starttimes}
endtime={endtime} endtime={endtime}
Cancelname={Cancelname} Cancelname={Cancelname}
Savesname={Savesname} Savesname={Savesname}
Cancel={Cancel} Cancel={Cancel}
Saves={Saves} Saves={Saves}
course_groups={course_groups} course_groups={course_groups}
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/> />
{/* 公用的提示弹框 */} {/* 公用的提示弹框 */}
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
modalsTopval={modalsTopval} modalsTopval={modalsTopval}
modalsBottomval="" modalsBottomval=""
loadtype={loadtype} loadtype={loadtype}
modalCancel={this.modalCancel} modalCancel={this.modalCancel}
modalSave={this.modalCancel} modalSave={this.modalCancel}
></Modals> ></Modals>
<WordsBtn style={this.props.style} className={this.props.className} onClick={this.homeworkstart}>立即发布</WordsBtn> <WordsBtn style={this.props.style} className={this.props.className} onClick={this.homeworkstart}>立即发布</WordsBtn>
</React.Fragment> </React.Fragment>
) )
} }
} }
export default Immediatelypublish export default Immediatelypublish

@ -821,7 +821,7 @@ class Listofworks extends Component {
Topval: "本操作只对“未发布”的对象生效", Topval: "本操作只对“未发布”的对象生效",
Botvalleft: "暂不发布", Botvalleft: "暂不发布",
Botval: "则通过后续手动设置,定时发布", Botval: "则通过后续手动设置,定时发布",
starttime: "发布时间:" + starttime, starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime: "截止时间:" + endtime, endtime: "截止时间:" + endtime,
starttimes:starttime, starttimes:starttime,
typs:"start", typs:"start",

@ -304,7 +304,7 @@ class ShixunStudentWork extends Component {
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+starttime, starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime:"截止时间:"+endtime, endtime:"截止时间:"+endtime,
Cancelname:"暂不发布", Cancelname:"暂不发布",
Savesname:"立即发布", Savesname:"立即发布",

@ -1237,7 +1237,7 @@ class Trainingjobsetting extends Component {
Topval: "本操作只对“未发布”的对象生效", Topval: "本操作只对“未发布”的对象生效",
Botvalleft: "暂不发布", Botvalleft: "暂不发布",
Botval: "则通过后续手动设置,定时发布", Botval: "则通过后续手动设置,定时发布",
starttime: "发布时间:" + starttime, starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:starttime, starttimes:starttime,
typs:"start", typs:"start",
endtime: "截止时间:" + endtime, endtime: "截止时间:" + endtime,

@ -148,7 +148,7 @@ class Workquestionandanswer extends Component {
Topval: "本操作只对“未发布”的对象生效", Topval: "本操作只对“未发布”的对象生效",
Botvalleft: "暂不发布", Botvalleft: "暂不发布",
Botval: "则通过后续手动设置,定时发布", Botval: "则通过后续手动设置,定时发布",
starttime: "发布时间:" + starttime, starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime: "截止时间:" + endtime, endtime: "截止时间:" + endtime,
Cancelname: "暂不发布", Cancelname: "暂不发布",
Savesname: "立即发布", Savesname: "立即发布",

@ -209,7 +209,7 @@ class ShixunHomework extends Component{
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+starttime, starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:starttime, starttimes:starttime,
endtime:"截止时间:"+endtime, endtime:"截止时间:"+endtime,
Cancelname:"暂不发布", Cancelname:"暂不发布",
@ -403,7 +403,7 @@ class ShixunHomework extends Component{
Topval:"本操作只对“未发布”的对象生效", Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布", Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布", Botval:"则通过后续手动设置,定时发布",
starttime:"发布时间:"+ starttime, starttime:"发布时间:"+ moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes:starttime, starttimes:starttime,
typs:"start", typs:"start",
endtime:"截止时间:"+ endtime, endtime:"截止时间:"+ endtime,

Loading…
Cancel
Save