dev_forum
parent
83937f4304
commit
05a22b7e9c
@ -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;
|
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
|
Loading…
Reference in new issue