dev_forum
杨树明 5 years ago
parent 620dbd461e
commit 486d025809

@ -18,7 +18,8 @@ function locationurl(list){
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : const debugType =""
window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {

@ -82,7 +82,6 @@ class ShixunModal extends Component{
//勾选实训 //勾选实训
shixunhomeworkedit=(list)=>{ shixunhomeworkedit=(list)=>{
debugger
let newpatheditarry=[]; let newpatheditarry=[];
if (this.props.singleChoose == true) { if (this.props.singleChoose == true) {
if (list.length > 0) { if (list.length > 0) {

@ -117,7 +117,6 @@ class GraduationTasksSubmitnew extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
debugger
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });

@ -1,309 +1,307 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import '../../css/members.css' import '../../css/members.css'
import '../../css/busyWork.css' import '../../css/busyWork.css'
import '../style.css' import '../style.css'
import { WordsBtn } from 'educoder' import { WordsBtn } from 'educoder'
import NoneData from '../../coursesPublic/NoneData' import NoneData from '../../coursesPublic/NoneData'
import Modals from "../../../modals/Modals" import Modals from "../../../modals/Modals"
import axios from 'axios' import axios from 'axios'
import { Modal,Select,Input } from "antd"; import { Modal,Select,Input } from "antd";
const Option = Select.Option const Option = Select.Option
class GraduateTopicDetailTable extends Component{ class GraduateTopicDetailTable extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
modalsType:false, modalsType:false,
modalsTopval:'', modalsTopval:'',
operationId:undefined, operationId:undefined,
agreeFlag:false, agreeFlag:false,
classesId:undefined, classesId:undefined,
agreeCheck:false, agreeCheck:false,
visible:false, visible:false,
un_addClass:undefined, un_addClass:undefined,
un_addClass_notice:"", un_addClass_notice:"",
un_choose_notice:"" un_choose_notice:""
} }
} }
// 拒绝 // 拒绝
aboutTopic=(id)=>{ aboutTopic=(id)=>{
this.setState({ this.setState({
modalsType:true, modalsType:true,
modalsTopval:'是否确认拒绝学生选题?', modalsTopval:'是否确认拒绝学生选题?',
operationId:id operationId:id
}) })
} }
cancelAboutTopic=()=>{ cancelAboutTopic=()=>{
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:'' modalsTopval:''
}) })
} }
sureAboutTopic=()=>{ sureAboutTopic=()=>{
let{operationId}=this.state let{operationId}=this.state
let courseId=this.props.match.params.course_id; let courseId=this.props.match.params.course_id;
let graduation_topic_id=this.props.match.params.graduation_topic_id; let graduation_topic_id=this.props.match.params.graduation_topic_id;
let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/refuse_student_topic.json?student_graduation_topic=`+operationId; let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/refuse_student_topic.json?student_graduation_topic=`+operationId;
axios.post(url).then((result)=>{ axios.post(url).then((result)=>{
if(result.data.status==0){ if(result.data.status==0){
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:'' modalsTopval:''
}) })
//成功后调用列表接口,刷新 //成功后调用列表接口,刷新
this.props.getDetailList(this.props.page); this.props.getDetailList(this.props.page);
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:'' modalsTopval:''
}) })
} }
//同意 //同意
agreeTopic=(id)=>{ agreeTopic=(id)=>{
this.setState({ this.setState({
agreeFlag:true, agreeFlag:true,
operationId:id operationId:id
}) })
} }
hideAgreeTopic=()=>{ hideAgreeTopic=()=>{
this.setState({ this.setState({
agreeFlag:false, agreeFlag:false,
classesId:undefined classesId:undefined
}) })
} }
sureAgreeTopic=(count)=>{ sureAgreeTopic=(count)=>{
if(count > 0){ if(count > 0){
debugger let{tableData}=this.props;
let{tableData}=this.props; let{operationId,classesId}=this.state
let{operationId,classesId}=this.state let courseId=this.props.match.params.course_id;
let courseId=this.props.match.params.course_id; let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name;
let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name; this.agreeChoose(courseId,operationId,classesId,name);
this.agreeChoose(courseId,operationId,classesId,name); }else{
}else{ this.setState({
this.setState({ un_choose_notice:"请先添加分班"
un_choose_notice:"请先添加分班" })
}) }
} }
}
agreeChoose=(courseId,operationId,classesId,courseName)=>{
agreeChoose=(courseId,operationId,classesId,courseName)=>{ let graduation_topic_id=this.props.match.params.graduation_topic_id;
let graduation_topic_id=this.props.match.params.graduation_topic_id; let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/accept_student_topic.json`;
let url =`/courses/${courseId}/graduation_topics/${graduation_topic_id}/accept_student_topic.json`; axios.post(url,{
axios.post(url,{ student_graduation_topic_id:operationId,
student_graduation_topic_id:operationId, group_id:classesId,
group_id:classesId, course_group_name:courseName
course_group_name:courseName }).then((result)=>{
}).then((result)=>{ if(result.data.status==0){
if(result.data.status==0){ this.props.showNotification(`${result.data.message}`);
this.props.showNotification(`${result.data.message}`); this.setState({
this.setState({ agreeFlag:false,
agreeFlag:false, agreeCheck:true,
agreeCheck:true, visible:false
visible:false })
}) //成功后调用列表接口,刷新
//成功后调用列表接口,刷新 this.props.getDetailList(this.props.page);
this.props.getDetailList(this.props.page); }
} }).catch((error)=>{
}).catch((error)=>{ console.log(error);
console.log(error); })
}) }
}
//切换分班
//切换分班 changeClasses=(value)=>{
changeClasses=(value)=>{ this.setState({
debugger classesId:value
this.setState({ })
classesId:value }
})
} //新增分班
topicAddClasses=()=>{
//新增分班 this.setState({
topicAddClasses=()=>{ visible:true,
this.setState({ agreeFlag:false
visible:true, })
agreeFlag:false }
}) hideClasses=()=>{
} this.setState({
hideClasses=()=>{ visible:false,
this.setState({ classesId:undefined
visible:false, })
classesId:undefined }
})
} //新建分班--输入分班
inputClasses=(e)=>{
//新建分班--输入分班 this.setState({
inputClasses=(e)=>{ un_addClass:e.target.value
this.setState({ })
un_addClass:e.target.value }
})
} // 新建分班---确定
sureAddClass=()=>{
// 新建分班---确定 let {un_addClass}=this.state;
sureAddClass=()=>{ if(!un_addClass){
let {un_addClass}=this.state; this.setState({
if(!un_addClass){ un_addClass_notice:"请输入分班名称"
this.setState({ })
un_addClass_notice:"请输入分班名称" return;
}) }
return; console.log(this.props)
} let{operationId}=this.state
console.log(this.props) let courseId=this.props.match.params.course_id;
let{operationId}=this.state this.agreeChoose(courseId,operationId,-1,un_addClass);
let courseId=this.props.match.params.course_id; }
this.agreeChoose(courseId,operationId,-1,un_addClass);
} render(){
let {page,tableData}=this.props
render(){ let { modalsType,modalsTopval,agreeFlag,classesId,visible
let {page,tableData}=this.props ,un_addClass_notice
let { modalsType,modalsTopval,agreeFlag,classesId,visible ,un_addClass,
,un_addClass_notice un_choose_notice
,un_addClass, } = this.state
un_choose_notice const isAdmin =this.props.isAdmin();
} = this.state const isStudent =this.props.isStudent();
const isAdmin =this.props.isAdmin(); const isNotMember=this.props.isNotMember();
const isStudent =this.props.isStudent(); console.log(un_addClass_notice)
const isNotMember=this.props.isNotMember(); return(
console.log(un_addClass_notice) <div className="minH-560 edu-back-white">
return( <div className="TopicDetailTable">
<div className="minH-560 edu-back-white"> <div className="topHead edu-txt-center">
<div className="TopicDetailTable"> <span style={{"width":"5%"}}>序号</span>
<div className="topHead edu-txt-center"> <span style={{"width":"12%"}}>姓名</span>
<span style={{"width":"5%"}}>序号</span> {isNotMember ?"" :<span style={{"width":"13%"}}>学号</span>}
<span style={{"width":"12%"}}>姓名</span> <span style={{"width":"15%"}}>分班</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>学号</span>} <span style={{"width":"15%"}}>选题时间</span>
<span style={{"width":"15%"}}>分班</span> <span style={{"width":"12%"}} className="fr">操作</span>
<span style={{"width":"15%"}}>选题时间</span> {
<span style={{"width":"12%"}} className="fr">操作</span> isAdmin &&
{ <span style={{"width":"12%"}} className="fr">确认结果</span>
isAdmin && }
<span style={{"width":"12%"}} className="fr">确认结果</span>
} </div>
{/* 拒绝弹框 */}
</div> <Modals
{/* 拒绝弹框 */} modalsType={modalsType}
<Modals modalsTopval={modalsTopval}
modalsType={modalsType} modalsBottomval=""
modalsTopval={modalsTopval} modalCancel={this.cancelAboutTopic}
modalsBottomval="" modalSave={this.sureAboutTopic}
modalCancel={this.cancelAboutTopic} ></Modals>
modalSave={this.sureAboutTopic} {/* 同意弹框 */}
></Modals> <Modal
{/* 同意弹框 */} title="同意选题"
<Modal visible={agreeFlag}
title="同意选题" closable={false}
visible={agreeFlag} footer={null}
closable={false} destroyOnClose={true}
footer={null} centered={true}
destroyOnClose={true} keyboard={false}
centered={true} >
keyboard={false} <div className="newupload_conbox">
> <p className="color-grey-9 mb15 edu-txt-center">确认同意学生的选题将学生加入我的分班</p>
<div className="newupload_conbox"> <div className="df">
<p className="color-grey-9 mb15 edu-txt-center">确认同意学生的选题将学生加入我的分班</p> <span className="lineh-40 mr10">选择</span>
<div className="df"> <div className="flex1">
<span className="lineh-40 mr10">选择</span> <Select placeholder="请选择分班" style={{"width":"100%"}} value={classesId} onChange={this.changeClasses}>
<div className="flex1"> {
<Select placeholder="请选择分班" style={{"width":"100%"}} value={classesId} onChange={this.changeClasses}> tableData.group_list && tableData.group_list.map((item,key)=>{
{ return(
tableData.group_list && tableData.group_list.map((item,key)=>{ <Option value={item.group_id} key={key}>{item.group_name}</Option>
return( )
<Option value={item.group_id} key={key}>{item.group_name}</Option> })
) }
}) <Option key="0"><a onClick={this.topicAddClasses} style={{display:"block"}}>添加分班</a></Option>
} </Select>
<Option key="0"><a onClick={this.topicAddClasses} style={{display:"block"}}>添加分班</a></Option> <p style={{height:"20px",lineHeight:"20px"}}><span className="color-orange-tip">{un_choose_notice}</span></p>
</Select> </div>
<p style={{height:"20px",lineHeight:"20px"}}><span className="color-orange-tip">{un_choose_notice}</span></p> </div>
</div> <div className="mt20 clearfix edu-txt-center">
</div> <a onClick={this.hideAgreeTopic} className="pop_close task-btn mr30">取消</a>
<div className="mt20 clearfix edu-txt-center"> <a className="task-btn task-btn-orange" onClick={()=>this.sureAgreeTopic(tableData.group_list.length)}>确定</a>
<a onClick={this.hideAgreeTopic} className="pop_close task-btn mr30">取消</a> </div>
<a className="task-btn task-btn-orange" onClick={()=>this.sureAgreeTopic(tableData.group_list.length)}>确定</a> </div>
</div> </Modal>
</div> <Modal
</Modal> visible={visible}
<Modal title="新建分班"
visible={visible} closable={false}
title="新建分班" footer={null}
closable={false} destroyOnClose={true}
footer={null} centered={true}
destroyOnClose={true} keyboard={false}
centered={true} >
keyboard={false} <div className="newupload_conbox">
> <div className="df">
<div className="newupload_conbox"> <span className="lineh-40 mr10">分班</span>
<div className="df"> <div className="flex1">
<span className="lineh-40 mr10">分班</span> <Input className="input-flex-40" value={un_addClass} onInput={this.inputClasses} placeholder="示例:分班(最佳4个字符)"></Input>
<div className="flex1"> <p style={{height:"20px",lineHeight:"20px"}}>
<Input className="input-flex-40" value={un_addClass} onInput={this.inputClasses} placeholder="示例:分班(最佳4个字符)"></Input> <span className="color-orange-tip">{un_addClass_notice}</span>
<p style={{height:"20px",lineHeight:"20px"}}> </p>
<span className="color-orange-tip">{un_addClass_notice}</span> </div>
</p> </div>
</div> <div className="clearfix edu-txt-center">
</div> <a onClick={this.hideClasses} className="pop_close task-btn mr30">取消</a>
<div className="clearfix edu-txt-center"> <a className="task-btn task-btn-orange" onClick={this.sureAddClass}>确定</a>
<a onClick={this.hideClasses} className="pop_close task-btn mr30">取消</a> </div>
<a className="task-btn task-btn-orange" onClick={this.sureAddClass}>确定</a> </div>
</div> </Modal>
</div> <div className="bottomBody">
</Modal> {
<div className="bottomBody"> tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{
{ return(
tableData.users_list && tableData.users_list.length > 0 && tableData.users_list.map((item,key)=>{ <li className="color-grey-9 clearfix" key={key}>
return( <span style={{"width":"5%"}} className="color-grey-6">{parseInt(key+1)+(parseInt(page-1)*15)}</span>
<li className="color-grey-9 clearfix" key={key}> <span style={{"width":"12%"}} className="color-grey-3">{item.student_name}</span>
<span style={{"width":"5%"}} className="color-grey-6">{parseInt(key+1)+(parseInt(page-1)*15)}</span> {isNotMember ?"" :<span style={{"width":"13%"}}>{item.student_id}</span>}
<span style={{"width":"12%"}} className="color-grey-3">{item.student_name}</span> <span style={{"width":"15%"}}>{item.class_group_name || "--"}</span>
{isNotMember ?"" :<span style={{"width":"13%"}}>{item.student_id}</span>} <span style={{"width":"15%"}}>{item.selected_time}</span>
<span style={{"width":"15%"}}>{item.class_group_name || "--"}</span> {
<span style={{"width":"15%"}}>{item.selected_time}</span> isAdmin &&
{ <span style={{"width":"12%"}} className="fr">
isAdmin && {
<span style={{"width":"12%"}} className="fr"> item.result == "待确认" ?
{ <span>
item.result == "待确认" ? <a className="mr20 color-grey-B3" onClick={()=>this.aboutTopic(`${item.id}`)}>拒绝</a>
<span> <a className="color-blue" onClick={()=>this.agreeTopic(`${item.id}`)}>同意</a>
<a className="mr20 color-grey-B3" onClick={()=>this.aboutTopic(`${item.id}`)}>拒绝</a> </span>:
<a className="color-blue" onClick={()=>this.agreeTopic(`${item.id}`)}>同意</a> (
</span>: item.result === "已拒绝" ? <span className="color-grey-B3">--</span>
( :
item.result === "已拒绝" ? <span className="color-grey-B3">--</span> <a className="color-grey-B3" onClick={()=>this.aboutTopic(`${item.id}`)}>拒绝</a>
: )
<a className="color-grey-B3" onClick={()=>this.aboutTopic(`${item.id}`)}>拒绝</a> }
) </span>
} }
</span> {
} isStudent &&
{ <span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-red":"fr"}>{item.result}</span>
isStudent && }
<span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-red":"fr"}>{item.result}</span> {
} isAdmin &&
{ <span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-orange-tip":"fr"}>{item.result=== "待确认"?"--":item.result}</span>
isAdmin && }
<span style={{"width":"12%"}} className={item.result === "已拒绝"?"fr color-orange-tip":"fr"}>{item.result=== "待确认"?"--":item.result}</span> {
} isNotMember && <span style={{"width":"12%"}} className="fr color-grey-9">--</span>
{ }
isNotMember && <span style={{"width":"12%"}} className="fr color-grey-9">--</span>
} </li>
)
</li> })
) }
}) {
} tableData.users_list && tableData.users_list.length == 0 && <NoneData></NoneData>
{ }
tableData.users_list && tableData.users_list.length == 0 && <NoneData></NoneData> </div>
} </div>
</div> </div>
</div> )
</div> }
) }
}
}
export default GraduateTopicDetailTable; export default GraduateTopicDetailTable;

@ -134,9 +134,6 @@ class CoursesNew extends Component {
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let {is_public,datatime} = this.state let {is_public,datatime} = this.state
// console.log(is_public) // console.log(is_public)
debugger
if (coursesId != undefined) { if (coursesId != undefined) {
// 编辑 // 编辑

@ -2074,7 +2074,6 @@ class PollNew extends Component {
//最小值 //最小值
HandleGradationGroupChangee = (value, index, max, length) => { HandleGradationGroupChangee = (value, index, max, length) => {
debugger
var minbool = false; var minbool = false;
var maxbool = false; var maxbool = false;
let arr = this.state.adddom; let arr = this.state.adddom;

@ -993,7 +993,7 @@ class Listofworksstudentone extends Component {
} }
axios.post(urll, datasysl).then((result) => { axios.post(urll, datasysl).then((result) => {
console.log("980000000____________________"); console.log("980000000____________________");
debugger
if(result === undefined){ if(result === undefined){
return return
} }

@ -337,6 +337,7 @@ class LoginDialog extends Component {
} }
loginEDU=()=>{ loginEDU=()=>{
let {loginValue,passValue,regular,isGoingValue}=this.state; let {loginValue,passValue,regular,isGoingValue}=this.state;
if(regular===1){ if(regular===1){
return return
@ -372,14 +373,16 @@ class LoginDialog extends Component {
this.setState({ this.setState({
isRender:false isRender:false
}) })
this.props.Modifyloginvalue();
window.location.reload(); window.location.reload();
} }
} }
try { // try {
this.props.Modifyloginvalue(); // this.props.Modifyloginvalue();
}catch (e) { // }catch (e) {
//
} // }
}).catch((error) => { }).catch((error) => {
console.log("356"); console.log("356");
console.log(error) console.log(error)

@ -298,7 +298,6 @@ class DetailCardsEditAndAdd extends Component{
//滑动到底判断 //滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("到达底部"); // console.log("到达底部");
debugger
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
}) })

@ -487,7 +487,6 @@ submittojoinclass=(value)=>{
} }
showSearchOpen=(e)=>{ showSearchOpen=(e)=>{
debugger
this.setState({ this.setState({
showSearchOpentype:true showSearchOpentype:true
}) })
@ -495,7 +494,6 @@ submittojoinclass=(value)=>{
} }
hideshowSearchOpen=(e)=>{ hideshowSearchOpen=(e)=>{
debugger
let {setevaluatinghides}=this.state; let {setevaluatinghides}=this.state;
if(setevaluatinghides===true){ if(setevaluatinghides===true){
this.setState({ this.setState({
@ -520,7 +518,6 @@ submittojoinclass=(value)=>{
} }
setevaluatinghides=()=>{ setevaluatinghides=()=>{
debugger
this.setState( this.setState(
{ {
setevaluatinghides:true setevaluatinghides:true

Loading…
Cancel
Save