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

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

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

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

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

@ -415,7 +415,7 @@ class GraduationTaskssettingapp extends Component{
Topval:"发布设置均可修改",
Botvalleft:"点击修改",
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),
typs:"start",
endtime:endtime,
@ -1164,7 +1164,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"h20 mb30 ml30"} >
<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>
<DatePicker
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}>
<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"}>
<span className={"color-blue"}>答辩组设置</span></Link></span></Radio>
<Radio style={radioStyle} value={4}>答辩组间老师互评 <span className={"font-14 color-grey-c ml10"}>由系统按照设置在答辩组之间自动分配:
<a href={"/courses/"+courseId+"/teachers"} target="_blank">
<span className={"color-blue"}>答辩组设置</span></a>
</span></Radio>
</RadioGroup>
</span>

@ -332,7 +332,7 @@ class GraduationTaskssettinglist extends Component{
Topval:"发布设置均可修改",
Botvalleft:"点击修改",
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),
typs:"start",
endtime:endtime,
@ -544,6 +544,7 @@ class GraduationTaskssettinglist extends Component{
axios.get(url).then((result)=>{
if(result.data.status===0){
this.searchValue()
this.setState({
Modalstype:true,
Modalstopval:result.data.message,
@ -730,7 +731,7 @@ class GraduationTaskssettinglist extends Component{
其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
{tag.name}
</a>
:
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
@ -863,7 +864,7 @@ class GraduationTaskssettinglist extends Component{
其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
{tag.name}
</a>
:
<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/>
其它历史评分将全部失效</pre>:""}>
{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'}}
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/>
其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
tag.name
{tag.name}
</a>
:
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
@ -1256,6 +1258,7 @@ class GraduationTaskssettinglist extends Component{
visible={visibles}
Cancel={this.Cancel}
taskid={taskslistdata&&taskslistdata.task_id}
funlist={this.searchValue()}
/>:""}
{taskslistdata&&taskslistdata?
@ -1551,7 +1554,7 @@ class GraduationTaskssettinglist extends Component{
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(
<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>:""}

@ -81,7 +81,7 @@ class GraduationTasksquestions extends Component{
Topval:"发布设置均可修改",
Botvalleft:"点击修改",
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),
typs:"start",
endtime:endtime,

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

Loading…
Cancel
Save