diff --git a/app/forms/users/update_password_form.rb b/app/forms/users/update_password_form.rb index 023caa40f..4da341839 100644 --- a/app/forms/users/update_password_form.rb +++ b/app/forms/users/update_password_form.rb @@ -4,5 +4,4 @@ class Users::UpdatePasswordForm attr_accessor :password, :old_password validates :password, presence: true - validates :old_password, presence: true end \ No newline at end of file diff --git a/app/queries/admins/laboratory_query.rb b/app/queries/admins/laboratory_query.rb index 21020216b..8667bb8ed 100644 --- a/app/queries/admins/laboratory_query.rb +++ b/app/queries/admins/laboratory_query.rb @@ -15,7 +15,7 @@ class Admins::LaboratoryQuery < ApplicationQuery keyword = strip_param(:keyword) if keyword.present? like_sql = 'schools.name LIKE :keyword OR laboratories.identifier LIKE :keyword' - laboratories = laboratories.joins(:school).where(like_sql, keyword: "%#{keyword}%") + laboratories = laboratories.left_joins(:school).where(like_sql, keyword: "%#{keyword}%") end custom_sort laboratories, params[:sort_by], params[:sort_direction] diff --git a/app/services/oauth/create_or_find_qq_account_service.rb b/app/services/oauth/create_or_find_qq_account_service.rb index 958b04810..691764ea2 100644 --- a/app/services/oauth/create_or_find_qq_account_service.rb +++ b/app/services/oauth/create_or_find_qq_account_service.rb @@ -8,16 +8,16 @@ class Oauth::CreateOrFindQqAccountService < ApplicationService end def call + new_user = false # 存在该用户 open_user = OpenUsers::QQ.find_by(uid: params['uid']) - return open_user.user if open_user.present? + return [open_user.user, new_user] if open_user.present? - new_user = false if user.blank? || !user.logged? new_user = true # 新用户 login = User.generate_login('q') - @user = User.new(login: login, nickname: params.dig('info', 'nickname')) + @user = User.new(login: login, nickname: params.dig('info', 'nickname'), type: 'User', status: User::STATUS_ACTIVE) end ActiveRecord::Base.transaction do diff --git a/app/services/oauth/create_or_find_wechat_account_service.rb b/app/services/oauth/create_or_find_wechat_account_service.rb index 4b3dd4f75..0313054b7 100644 --- a/app/services/oauth/create_or_find_wechat_account_service.rb +++ b/app/services/oauth/create_or_find_wechat_account_service.rb @@ -11,20 +11,20 @@ class Oauth::CreateOrFindWechatAccountService < ApplicationService def call code = params['code'].to_s.strip raise Error, 'Code不能为空' if code.blank? + new_user = false result = WechatOauth::Service.access_token(code) result = WechatOauth::Service.user_info(result['access_token'], result['openid']) # 存在该用户 open_user = OpenUsers::Wechat.find_by(uid: result['unionid']) - return open_user.user if open_user.present? + return [open_user.user, new_user] if open_user.present? - new_user = false if user.blank? || !user.logged? new_user = true # 新用户 login = User.generate_login('w') - @user = User.new(login: login, nickname: result['nickname']) + @user = User.new(login: login, nickname: result['nickname'], type: 'User', status: User::STATUS_ACTIVE) end ActiveRecord::Base.transaction do diff --git a/app/views/courses/students.json.jbuilder b/app/views/courses/students.json.jbuilder index 0b5d7fe71..5788b44f2 100644 --- a/app/views/courses/students.json.jbuilder +++ b/app/views/courses/students.json.jbuilder @@ -1,7 +1,7 @@ json.students do json.array! @students do |student| json.user_id student.user_id - # json.login student.user.try(:login) + json.login student.user.try(:login) json.name student.user.try(:real_name) json.name_link user_path(student.user) json.student_id student.user.try(:student_id) diff --git a/public/react/src/App.js b/public/react/src/App.js index 9b85acfa8..34b5d1a4f 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -64,6 +64,18 @@ const EducoderLogin = Loadable({ loader: () => import('./modules/login/EducoderLogin'), loading: Loading, }) + +//微信登录 +const Otherlogin=Loadable({ + loader: () => import('./modules/login/Otherlogin'), + loading: Loading, +}) + +const Otherloginstart=Loadable({ + loader: () => import('./modules/login/Otherloginstart'), + loading: Loading, +}) + const TestIndex = Loadable({ loader: () => import('./modules/test'), loading: Loading, @@ -406,6 +418,12 @@ class App extends Component { + + { diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index e1d5da561..98571d818 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js index a001e6d86..ee19745c9 100644 --- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js +++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js @@ -46,10 +46,16 @@ class HomeworkModal extends Component{ } if(this.props.starttimes!=undefined&&this.props.starttimes!=""){ + if(this.props.starttimesend!=undefined&&this.props.starttimesend!=""){ + this.setState({ + endtime:this.props.starttimesend, + }) + }else { + this.setState({ + endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") + }) + } - this.setState({ - endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") - }) } } componentDidUpdate=(prevProps)=>{ @@ -69,9 +75,16 @@ class HomeworkModal extends Component{ if(prevProps.starttimes!=this.props.starttimes){ if(this.props.starttimes!=undefined&&this.props.starttimes!=""){ - this.setState({ - endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") - }) + if(this.props.starttimesend!=undefined&&this.props.starttimesend!=""){ + this.setState({ + endtime:this.props.starttimesend, + }) + }else{ + this.setState({ + endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") + }) + } + } } } diff --git a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js new file mode 100644 index 000000000..d706bf2ee --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js @@ -0,0 +1,310 @@ +import React,{ Component } from "react"; +import { Modal,Checkbox,DatePicker} from "antd"; +import { handleDateString } from 'educoder'; +import locale from 'antd/lib/date-picker/locale/zh_CN'; +import moment from 'moment'; +const CheckboxGroup = Checkbox.Group; +const dateFormat = 'YYYY-MM-DD HH:mm'; + +function range(start, end) { + const result = []; + for (let i = start; i < end; i++) { + result.push(i); + } + return result; +} +function disabledDateTime() { + return { + // disabledHours: () => range(0, 24).splice(4, 20), + disabledMinutes: () => range(1, 30).concat(range(31, 60)), + // disabledSeconds: () => [55, 56], + }; +} + + +function disabledDate(current) { + return current && current < moment().endOf('day').subtract(1, 'days'); +} + + + +class OneSelfOrderModal extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + endtime:"" + } + } + componentDidMount() { + + + if(this.props.course_groups!=undefined&&this.props.course_groups.length!=0){ + + let arr=this.props.course_groups.map(item => item.id); + this.shixunhomeworkedit(arr); + } + + if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ + this.setState({ + endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") + }) + }else{ + this.setState({ + endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") + }) + } + } + componentDidUpdate=(prevProps)=>{ + // if(prevProps.visible!=this.props.visible){ + // + // if(this.props.course_groups!=undefined){ + // let arr=this.props.course_groups.map(item => item.id); + // this.shixunhomeworkedit(arr); + // } + // } + if(prevProps.course_groups!=this.props.course_groups){ + if(this.props.course_groups!=undefined){ + let arr=this.props.course_groups.map(item => item.id); + this.shixunhomeworkedit(arr); + } + } + if(prevProps.starttimes!=this.props.starttimes){ + + if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){ + this.setState({ + endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'months')).format("YYYY-MM-DD HH:mm") + }) + }else{ + this.setState({ + endtime:moment(handleDateString(this.props.starttimes)).format("YYYY-MM-DD HH:mm") + }) + } + } + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + this.setState({ + group_ids:list + }) + this.props.getcourse_groupslist && this.props.getcourse_groupslist(list) + } + + onChangeTimeend= (date, dateString) => { + // console.log('startValue',dateString); + + this.setState({ + endtime: date===null?"":handleDateString(dateString), + }) + + } + + propsSaves=(ds,endtime)=>{ + + if(ds.length ===0&&endtime === ""){ + this.props.Saves() + }else{ + if(this.props.typs!="end"){ + if(endtime === ""||endtime===undefined||endtime===null){ + + this.setState({ + endtimetype:true, + endtimetypevalue:"截止时间不能为空" + }) + return + } + + if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){ + this.setState({ + endtimetype:true, + endtimetypevalue:"必须晚于发布时间" + }) + return + } + } + this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm")) + } + + + } + + render(){ + let {group_ids,endtime}=this.state; + let {course_groups}=this.props; + + // console.log(this.props.starttimes) + // console.log(endtime) + // console.log(this.props.starttimes) + // console.log(this.state.endtime) + + // console.log(this.props.starttime,this.props.endtime) + // TODO course_groups为空时的处理 + + // let endtimelist=this.props.starttimes===undefined||this.props.starttimes===""?"":moment(handleDateString(endtime)).add(1,'months') + return( +
+ { + this.props.OneSelftype===true?:"" + } + { + this.props.OneSelftype===true? +
+ + + { this.props.usingCheckBeforePost ? + +

+ 发布设置均可修改, + + 点击修改 + +

+

+ 此设置将对所有分班生效 +

+
: + +

+ {this.props.Topval} + {this.props.Topvalright} +

+

+ {this.props.Botvalleft===undefined?"":"{this.props.Botvalleft}"} + {this.props.Botval} +

+
} + + + {this.props.starttime===undefined|| + this.props.starttime===""?"" + :

+ + 发布时间: + {this.props.starttime} + {this.props.modaltype===undefined||this.props.modaltype===2? + {/*{this.props.endtime}*/} + 截止时间: + + {this.state.endtimetype===true?

{this.state.endtimetypevalue}
:""} + :""} +

} + {/* usingCheckBeforePost 为true的时候 全选所有分班 */} + + + {this.props.modaltype===undefined||this.props.modaltype===2 + || this.props.usingCheckBeforePost ?"":
+
  • + 分班名称 + + 截止时间 +
  • +
    } + {this.props.modaltype===undefined||this.props.modaltype===2 + || this.props.usingCheckBeforePost ?"":
      + + { + { + course_groups.map((item,key)=>{ + + return( +
      +
    • + + {item.name} + + +
    • + +
      + ) + }) + } +
      } + +
    + } + + + +
    +
    :""} +
    + ) + } +} +export default OneSelfOrderModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 12c4e8d3e..160104920 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1701,4 +1701,47 @@ input.ant-input-number-input:focus { /*}*/ .yslinputcourput .ant-form-explain{ padding-left: 0px !important; +} +.wechatloginfont{ + font-size: 14px; + font-family: PingFangSC-Regular,PingFangSC; + font-weight: 400; + color: #555555; + line-height: 20px; + margin-top: 10px; +} + +.wechatdiv{ + margin-top: 40px !important; + width: 800px !important; +} + +.wechatContent{ + padding: 0px 50px; +} + +.wechatpass{ + width: 300px; + height: 46px; +} + +.wechatnewchat{ + width: 62px; + height: 62px; + background: rgba(255,170,170,1); + border-radius: 50%; + text-align: center; + line-height: 62px; + color: #fff; + margin: 0 auto; +} +.wechatweoldchat{ + width: 62px; + height: 62px; + background:rgba(164,211,255,1); + border-radius: 50%; + text-align: center; + line-height: 62px; + color: #fff; + margin: 0 auto; } \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index b9830d1fc..66e4ccb8d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -20,89 +20,89 @@ import Modals from '../../../modals/Modals'; //毕设描述 const GraduationTasksquestions= Loadable({ - loader: () => import('./GraduationTaskssettingquestions'), - loading: Loading, + loader: () => import('./GraduationTaskssettingquestions'), + loading: Loading, }) //毕设任务设置 const GraduationTaskssetting=Loadable({ - loader: () => import('./GraduationTaskssetting'), - loading: Loading, + loader: () => import('./GraduationTaskssetting'), + loading: Loading, }) //毕设任务列表 const GraduationTaskslist=Loadable({ - loader: () => import('./GraduationTaskssettinglist'), - loading: Loading, + loader: () => import('./GraduationTaskssettinglist'), + loading: Loading, }) class GraduationTaskDetail extends Component{ - constructor(props){ - super(props); - this.state={ - modalname:undefined, - visible:false, + constructor(props){ + super(props); + this.state={ + modalname:undefined, + visible:false, Topval:undefined, starttime:undefined, starttimes:undefined, typs:undefined, - endtime:undefined, - Cancelname:undefined, - Savesname:undefined, - Cancel:undefined, - Saves:undefined, - Topvalright:undefined, - Botvalleft:undefined, - course_groupslist:undefined, - course_groups:undefined, - questionslist:undefined, - tab:"list", - visibles:undefined, - Modalstype:undefined, - Modalstopval:undefined, - ModalCancel:undefined, - ModalSave:undefined, - acrossVisible:undefined - } - } - componentDidMount(){ - this.getdatas() - } - getdatas=()=>{ - const task_Id = this.props.match.params.task_Id; - let url="/graduation_tasks/"+task_Id+".json"; - - axios.get(url).then((result)=>{ - if(result.status===200){ - this.setState({ - questionslist:result.data - }) - - } - }).catch((error)=>{ - console.log(error) - }) - } - - - // 交叉评阅设置弹框 - openAcross=()=>{ - this.setState({ - acrossVisible:true - }) - } - closeAcross=()=>{ - this.setState({ - acrossVisible:false - }) + endtime:undefined, + Cancelname:undefined, + Savesname:undefined, + Cancel:undefined, + Saves:undefined, + Topvalright:undefined, + Botvalleft:undefined, + course_groupslist:undefined, + course_groups:undefined, + questionslist:undefined, + tab:"list", + visibles:undefined, + Modalstype:undefined, + Modalstopval:undefined, + ModalCancel:undefined, + ModalSave:undefined, + acrossVisible:undefined + } + } + componentDidMount(){ this.getdatas() - } + } + getdatas=()=>{ + const task_Id = this.props.match.params.task_Id; + let url="/graduation_tasks/"+task_Id+".json"; + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + questionslist:result.data + }) + + } + }).catch((error)=>{ + console.log(error) + }) + } - //返回 - goback=()=>{ - // let courseId=this.props.match.params.coursesId; - // let category_id=this.props.match.params.category_id; - // window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; + // 交叉评阅设置弹框 + openAcross=()=>{ + this.setState({ + acrossVisible:true + }) + } + closeAcross=()=>{ + this.setState({ + acrossVisible:false + }) + this.getdatas() + } + + + + //返回 + goback=()=>{ + // let courseId=this.props.match.params.coursesId; + // let category_id=this.props.match.params.category_id; + // window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; // let courseId = this.props.match.params.coursesId; // if(courseId===undefined){ // this.props.history.push("/courses"); @@ -112,66 +112,66 @@ class GraduationTaskDetail extends Component{ // this.props.history.goBack() this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`); - } - //立即发布 - publish=()=>{ - let starttime= this.props.getNowFormatDates(1,1); - let endtime=this.props.getNowFormatDates(2,1); - // this.homeworkstart() - this.setState({ - modalname:"立即发布", - visible:true, + } + //立即发布 + publish=()=>{ + let starttime= this.props.getNowFormatDates(1,1); + let endtime=this.props.getNowFormatDates(2,1); + // this.homeworkstart() + this.setState({ + modalname:"立即发布", + visible:true, Topval:"学生将立即收到毕设任务", - // Botvalleft:"点击修改", + // Botvalleft:"点击修改", // Botval:`本操作只对"未发布"的分班有效`, starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") , starttimes:this.props.getNowFormatDates(1), typs:"start", - endtime:endtime, - Cancelname:"暂不发布", - Savesname:"立即发布", - Cancel:this.cancelmodel, - Saves:this.homepublish, - }) - } - // 确定立即发布 - homepublish=(ids,endtime)=>{ - this.cancelmodel(); - let task_Id=this.props.match.params.task_Id; - const cid = this.props.match.params.coursesId; - // let url = `/courses/${cid}/graduation_tasks/publish_task.json`; - - let url="/courses/"+cid+"/graduation_tasks/publish_task.json" - axios.post(url,{ - task_ids:[task_Id], - group_ids: this.state.course_groupslist, + endtime:endtime, + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.cancelmodel, + Saves:this.homepublish, + }) + } + // 确定立即发布 + homepublish=(ids,endtime)=>{ + this.cancelmodel(); + let task_Id=this.props.match.params.task_Id; + const cid = this.props.match.params.coursesId; + // let url = `/courses/${cid}/graduation_tasks/publish_task.json`; + + let url="/courses/"+cid+"/graduation_tasks/publish_task.json" + axios.post(url,{ + task_ids:[task_Id], + group_ids: this.state.course_groupslist, end_time:endtime, - }).then((response)=>{ - if (response.data.status == 0) { + }).then((response)=>{ + if (response.data.status == 0) { this.getdatas() - this.props.showNotification(response.data.message); - - this.setState({ - // Modalstopval:response.data.message, - // ModalSave:this.cancelmodel, - // Loadtype:true, - course_groupslist:[], - checkAllValue:false - }) - } - }).catch((error)=>{ - - }) - } - - // 刷新 - resetList=()=>{ - this.getdatas(); - this.child && this.child.searchValue(); - } - - // 立即截止 - end=()=>{ + this.props.showNotification(response.data.message); + + this.setState({ + // Modalstopval:response.data.message, + // ModalSave:this.cancelmodel, + // Loadtype:true, + course_groupslist:[], + checkAllValue:false + }) + } + }).catch((error)=>{ + + }) + } + + // 刷新 + resetList=()=>{ + this.getdatas(); + this.child && this.child.searchValue(); + } + + // 立即截止 + end=()=>{ // this.homeworkstart() this.setState({ modalname:"立即截止", @@ -185,74 +185,74 @@ class GraduationTaskDetail extends Component{ Saves:this.coursetaskend, typs:"end", }) - } - coursetaskend=()=>{ - const coursesId = this.props.match.params.coursesId; - const task_Id = this.props.match.params.task_Id; - - let url = `/courses/${coursesId}/graduation_tasks/end_task.json`; - axios.post(url,{ - task_ids:[task_Id], - group_ids: this.state.course_groupslist, - }).then((response)=>{ - if (response.data.status == 0) { - this.props.showNotification(response.data.message); - this.cancelmodel(); - this.getdatas(); - this.child && this.child.reInit(); - } - - }).catch((error)=>{ - - }) - } - // 取消 - cancelmodel=()=>{ - this.setState({ - Modalstype:false, - Loadtype:false, - visible:false, - Modulationtype:false, - Allocationtype:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - }) - } - - getcourse_groupslist=(id)=>{ - this.setState({ - course_groupslist:id - }) - } - - setTab = (tab) =>{ - this.setState({ - tab - }) - } - - // 关联项目 - AssociationItems=()=>{ + } + coursetaskend=()=>{ + const coursesId = this.props.match.params.coursesId; + const task_Id = this.props.match.params.task_Id; + + let url = `/courses/${coursesId}/graduation_tasks/end_task.json`; + axios.post(url,{ + task_ids:[task_Id], + group_ids: this.state.course_groupslist, + }).then((response)=>{ + if (response.data.status == 0) { + this.props.showNotification(response.data.message); + this.cancelmodel(); + this.getdatas(); + this.child && this.child.reInit(); + } + + }).catch((error)=>{ + + }) + } + // 取消 + cancelmodel=()=>{ + this.setState({ + Modalstype:false, + Loadtype:false, + visible:false, + Modulationtype:false, + Allocationtype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + }) + } + + getcourse_groupslist=(id)=>{ + this.setState({ + course_groupslist:id + }) + } + + setTab = (tab) =>{ + this.setState({ + tab + }) + } + + // 关联项目 + AssociationItems=()=>{ this.setState({ visibles:true }) - } - Cancel=()=>{ + } + Cancel=()=>{ this.setState({ visibles:false }) - } - // 取消关联 - cannelAssociation=()=>{ + } + // 取消关联 + cannelAssociation=()=>{ this.setState({ Modalstype:true, Modalstopval:"确定要取消该项目关联?", ModalCancel:this.cannerassocition, ModalSave:this.savetassociton }) - } - savetassociton=()=>{ + } + savetassociton=()=>{ this.cannerassocition(); let {questionslist}=this.state; let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json"; @@ -266,7 +266,7 @@ class GraduationTaskDetail extends Component{ }) } - cannerassocition=()=>{ + cannerassocition=()=>{ this.setState({ Modalstype:false, Modalstopval:"", @@ -275,10 +275,10 @@ class GraduationTaskDetail extends Component{ loadtype:false, visibles:false }) - } - // 补交附件 - handaccessory=()=>{ - // let {taskslistdata}=this.state; + } + // 补交附件 + handaccessory=()=>{ + // let {taskslistdata}=this.state; // let courseId=this.props.match.params.coursesId; // // let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise" @@ -292,129 +292,129 @@ class GraduationTaskDetail extends Component{ this.setState({ avisible:false }) - } - - - bindRef = ref => { this.child = ref } ; - render(){ - - let courseId=this.props.match.params.coursesId; - let category_id=this.props.match.params.category_id; - let task_Id=this.props.match.params.task_Id; - let { - questionslist , - tab , - visibles , - Modalstype, - Modalstopval, - ModalCancel, - ModalSave, - acrossVisible - } = this.state - - const commom = { - setTab:this.setTab, - getdatas:this.getdatas - } - return( -
    - { - questionslist && -
    - this.getcourse_groupslist(id)} - /> - {/*关联项目*/} - {visibles===true? - this.Cancel()} - taskid={ questionslist && questionslist.task_id } - funlist={this.resetList} - /> - :""} - - {this.state.avisible===true?:""} - {/*提示*/} - - - { - acrossVisible && - - } - -

    - {questionslist.course_name} - > - {questionslist.graduation_name} - > - 任务详情 -

    -
    -

    - {questionslist.task_name} -

    - - 返回 -
    -
    -
    - - 任务列表 - 毕设描述 - 设置 - - {/*导出成绩*/} - {/*{this.props.isAdmin()?导出成绩:""}*/} - {/*{this.props.isAdmin()?导出作品附件:""}*/} - - - {this.props.isAdmin()?
  • - 导出 - -
  • :""} - {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ - return( - + + {this.props.isAdmin()?
  • + 导出 + +
  • :""} + {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ + return( + {item==="提交作品"?提交作品:""} - {item==="补交作品"?补交作品:""} - {item==="修改作品"?修改作品:""} - {item==="查看作品"?查看作品 :""} - {item==="创建项目"?创建项目:""} - {item==="关联项目"?关联项目:""} - {item==="取消关联"?取消关联:""} - {item==="补交附件"?补交附件:""} + {item==="补交作品"?补交作品:""} + {item==="修改作品"?修改作品:""} + {item==="查看作品"?查看作品 :""} + {item==="创建项目"?创建项目:""} + {item==="关联项目"?关联项目:""} + {item==="取消关联"?取消关联:""} + {item==="补交附件"?补交附件:""} - ) - })} - - {/*项目在线质量检测*/} - { this.props.isAdmin() ? questionslist.status===1 ? { this.end()} }>立即截止 : "" : "" } - { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } - { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } - { this.props.isAdmin() ? 编辑任务 : "" } -
    -
    - - - () - } - > - - () - } - > - - () - }> - - -
    - } - -
    - ) - } + ) + })} + + {/*项目在线质量检测*/} + { this.props.isAdmin() ? questionslist.status===1 ? { this.end()} }>立即截止 : "" : "" } + { this.props.isAdmin() ? questionslist.status===0 ? { this.publish()} }>立即发布 : "" : "" } + { this.props.isAdmin() && questionslist.cross_comment ? 交叉评阅设置 : "" } + { this.props.isAdmin() ? 编辑任务 : "" } + + + + + () + } + > + + () + } + > + + () + }> + + + + } + + + ) + } } // CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC)) export default (GraduationTaskDetail) ; \ No newline at end of file diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 9dac05a36..0660d9c2f 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -473,7 +473,7 @@ class GraduationTasks extends Component{ checkAllValue:false }) this.publishcanner(); - debugger + let {search,page,order} = this.state this.fetchAll(search,page,order); } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 5eed392d5..926e1b023 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -80,6 +80,7 @@ class Listofworksstudentone extends Component { teacherdata: undefined, task_status: [], visibles: false, + starttimesend:undefined, course_group_info: [], styletable: { "display": "none" @@ -2789,6 +2790,7 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { if (response.status === 200) { + const dataformat = 'YYYY-MM-DD HH:mm'; let starttime = this.props.getNowFormatDates(1); let endtime = this.props.getNowFormatDates(2); this.setState({ @@ -2801,6 +2803,7 @@ class Listofworksstudentone extends Component { starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime: "截止时间:" + endtime, starttimes:starttime, + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, typs:"start", Cancelname: "暂不发布", Savesname: "立即发布", @@ -2949,6 +2952,7 @@ class Listofworksstudentone extends Component { course_groupyslstwo: undefined, typs:undefined, starttimes:undefined, + starttimesend:undefined, }) } @@ -3170,6 +3174,7 @@ class Listofworksstudentone extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id) => this.getcourse_groupslist(id)} starttimes={this.state.starttimes} + starttimesend={this.state.starttimesend} typs={this.state.typs} /> { diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 9b0353b9e..32dd3a4ee 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -61,9 +61,9 @@ class ShixunHomeworkPage extends Component { } Getdataback = (jobsettingsdata, teacherdata) => { - // console.log("56"); - // console.log(jobsettingsdata); - // console.log(teacherdata); + console.log("ShixunHomeworkPage56"); + console.log(jobsettingsdata); + console.log(teacherdata); this.setState({ jobsettingsdatapage: jobsettingsdata.data.message===undefined?jobsettingsdata:undefined, diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 3caa63ac3..95de82445 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -74,6 +74,7 @@ class ShixunStudentWork extends Component { DownloadType:false, DownloadMessageval:undefined, lunxun:true, + starttimesend:undefined, } } @@ -415,6 +416,7 @@ class ShixunStudentWork extends Component { axios.get(url).then((response) => { if(response.status===200){ + const dataformat = 'YYYY-MM-DD HH:mm'; let starttime= this.props.getNowFormatDates(1); let endtime=this.props.getNowFormatDates(2); this.setState({ @@ -432,6 +434,7 @@ class ShixunStudentWork extends Component { Saves:this.homeworkstartend, course_groups:response.data.course_groups, starttimes:starttime, + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, typs:"start", }) } @@ -754,6 +757,7 @@ class ShixunStudentWork extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} starttimes={this.state.starttimes} + starttimesend={this.state.starttimesend} typs={this.state.typs} />
    diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index da1408d4a..5d2462ec0 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -120,7 +120,7 @@ class Trainingjobsetting extends Component { showmodel:false, code_review:false, testscripttiptype:false, - + starttimesend:undefined, end_timebool:false, late_timesbool:false, work_efficiencys:false, @@ -1525,6 +1525,7 @@ class Trainingjobsetting extends Component { axios.get(url).then((response) => { if (response.status === 200) { + const dataformat = 'YYYY-MM-DD HH:mm'; let starttime = this.props.getNowFormatDates(1); let endtime = this.props.getNowFormatDates(2); this.setState({ @@ -1536,7 +1537,8 @@ class Trainingjobsetting extends Component { Botval:`本操作只对"未发布"的分班有效`, starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), starttimes:starttime, - typs:"start", + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, + typs:"start", endtime: "截止时间:" + endtime, Cancelname: "暂不发布", Savesname: "立即发布", @@ -1668,6 +1670,7 @@ class Trainingjobsetting extends Component { addnametab: undefined, typs:undefined, starttimes:undefined, + starttimesend:undefined, }) } cancelBox=()=>{ @@ -2120,7 +2123,8 @@ class Trainingjobsetting extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id) => this.getcourse_groupslist(id)} starttimes={this.state.starttimes} - typs={this.state.typs} + starttimesend={this.state.starttimesend} + typs={this.state.typs} /> { if (response.status === 200) { + const dataformat = 'YYYY-MM-DD HH:mm'; let starttime = this.props.getNowFormatDates(1); let endtime = this.props.getNowFormatDates(2); this.setState({ @@ -173,6 +175,7 @@ class Workquestionandanswer extends Component { Saves: this.homeworkstartend, course_groups: response.data.course_groups, starttimes: starttime, + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, typs: "start", }) } @@ -441,6 +444,7 @@ class Workquestionandanswer extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id) => this.getcourse_groupslist(id)} starttimes={this.state.starttimes} + starttimesend={this.state.starttimesend} typs={this.state.typs} />
    diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 8e68a7398..cbfdaf72b 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -4,6 +4,7 @@ import { WordsBtn,on, off, trigger } from 'educoder'; import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom'; import axios from'axios'; import HomeworkModal from "../coursesPublic/HomeworkModal"; +import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; import ShixunModal from "../coursesPublic/ShixunModal"; import PathModal from "../coursesPublic/PathModal"; import NewShixunModel from '../coursesPublic/NewShixunModel'; @@ -227,10 +228,11 @@ class ShixunHomework extends Component{ addnametab:undefined, typs:undefined, starttimes:undefined, + OneSelftype:false }) + this.cancelmodel() + this.homeworkupdatalist(Coursename,page,order); this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); - this.cancelmodel() } @@ -272,6 +274,48 @@ class ShixunHomework extends Component{ }); } + + + //立即发布 + homeworkOneSelfstart=()=>{ + let selectnum= this.testonSelect(); + if(selectnum===true){ + this.noSelect(); + return + } + let coursesId=this.props.match.params.coursesId; + let url="/courses/"+coursesId+"/all_course_groups.json"; + + axios.get(url).then((response) => { + + if(response.status===200){ + let starttime= this.props.getNowFormatDates(1); + let endtime=this.props.getNowFormatDates(2); + this.setState({ + modalname:"立即发布", + modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1, + OneSelftype:true, + typs:"start", + Topval:"学生将立即收到作业", + // Botvalleft:"暂不发布", + Botval:`本操作只对"未发布"的分班有效`, + starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), + starttimes:starttime, + endtime:"截止时间:"+endtime, + Cancelname:"暂不发布", + Savesname:"立即发布", + Cancel:this.homeworkhide, + Saves:this.homeworkstartend, + course_groups:response.data.course_groups, + }) + } + }).catch((error) => { + console.log(error) + }); + + } + + cancelmodels=()=>{ this.setState({ Modalstype:false, @@ -316,10 +360,12 @@ class ShixunHomework extends Component{ }) } - this.props.showNotification(result.data.message) + + this.homeworkupdatalist(Coursename,page,order); + this.cancelmodel() + this.props.showNotification(result.data.message) this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); - this.cancelmodel() + } }).catch((error)=>{ console.log(error); @@ -414,11 +460,11 @@ class ShixunHomework extends Component{ Loadtype:false, course_groups:[] }) - + this.homeworkupdatalist(Coursename,page,order); + this.cancelmodel() this.props.showNotification(response.data.message) this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); - this.cancelmodel() + } }) .catch(function (error) { @@ -722,8 +768,8 @@ class ShixunHomework extends Component{ checkedtype:false, antIcon:false }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification(response.data.message) - this.homeworkupdatalist(Coursename,page,order); this.props.updataleftNavfun() }else{ this.setState({ @@ -782,6 +828,7 @@ class ShixunHomework extends Component{ this.setState({ Modalstype:false, + OneSelftype:false, Loadtype:false, visible:false, Modalstopval:"", @@ -834,9 +881,10 @@ class ShixunHomework extends Component{ Loadtype:false, checkBoxValues:[] }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification(response.data.message) - this.homeworkupdatalist(Coursename,page,order); + } }) .catch(function (error) { @@ -886,9 +934,10 @@ class ShixunHomework extends Component{ checkBoxValues:[], checkAllValue:false }) + this.homeworkupdatalist(Coursename,page,order); this.props.showNotification('已完成') this.props.updataleftNavfun() - this.homeworkupdatalist(Coursename,page,order); + } }) } @@ -1022,7 +1071,7 @@ class ShixunHomework extends Component{ loadtype={this.state.Loadtype} antIcon={this.state.antIcon} />:""} - {/*立即发布*/} + {/*批量立即发布*/} {visible===true?this.getcourse_groupslist(id)} />:""} - + {/*{单个立即发布}*/} + {/*this.getcourse_groupslist(id)}*/} + {/*/>*/} {shixunmodal===true||shixunpath===true? + +
    +
    +
    + +
    + +
    +
    + 为了更好的为您服务,请关联一个EduCoder账号 +
    +
    + +
    + +

    + + +

    + 新用户 +
    + + +
    欢迎来到EduCoder,新用户登录EduCoder可以到“账号管理-安全设置”中绑定手机/邮箱,以后可以用绑定的手机/邮箱,设置的密码登录EduCoder了。
    + 立即体验表示您已经同意我们的 服务协议条款 +
    + +
    +
    + +

    + +

    + + +

    + 老用户 +
    + + +
    已有EduCoder账号,可以输入您的账号和密码,将您的微信账号与EduCoder账号进行绑定。
    + + + + + + + {this.state.logintypes==="username"?请填写账号:this.state.logintypes==="password"?请填写密码:""} +
    + +
    +
    + +

    +
    + +
    +
    +
    © 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
    +
    +
    + +
    + ) + } + +} + +export default Otherlogin; diff --git a/public/react/src/modules/login/Otherloginstart.js b/public/react/src/modules/login/Otherloginstart.js new file mode 100644 index 000000000..9b38ea2b9 --- /dev/null +++ b/public/react/src/modules/login/Otherloginstart.js @@ -0,0 +1,52 @@ +import React, { Component } from 'react'; + +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; + +import { Spin } from 'antd'; +import axios from 'axios'; +class Otherloginstart extends Component { + + componentDidMount() { + let query=this.props.location.search; + const type = query.split('?code='); + const types = type[1].split('&state='); + let codeurl = `/auth/wechat/callback.json` + axios.get(codeurl,{params:{ + code:types[0] + }}).then((result)=> { + if(result){ + if(result.data.status===0){ + if(result.data.new_user===true){ + window.location.href="/otherlogin" + }else{ + // this.getinfo() + window.location.href="/" + } + } + } + }).catch((error)=>{ + + }) + + } + + render() { + // Loading + return ( +
    + + +
    + ); + } +} + +export default Otherloginstart; \ No newline at end of file diff --git a/public/react/src/modules/modals/SendTopics.js b/public/react/src/modules/modals/SendTopics.js index 265bcc7d7..94f134f3f 100644 --- a/public/react/src/modules/modals/SendTopics.js +++ b/public/react/src/modules/modals/SendTopics.js @@ -10,7 +10,8 @@ class SendTopics extends Component{ search:null, Radiolist:undefined, showcheck:false, - smallisSpin:false + smallisSpin:false, + yslbanksMenu:undefined } } @@ -18,8 +19,13 @@ class SendTopics extends Component{ componentDidMount(){ - let{search}=this.state; - this.onupdatalist(search) + // console.log("SendTopicssssssssssss"); + // console.log(this.props); + let{search}=this.state; + this.onupdatalist(search) + this.setState({ + yslbanksMenu:this.props.banksMenu, + }) } onupdatalist=(search)=>{ @@ -49,6 +55,8 @@ class SendTopics extends Component{ onChange=(e)=>{ + console.log("SendTopics"); + console.log(e); this.setState({ Radiolist:e.target.value }) @@ -78,9 +86,60 @@ class SendTopics extends Component{ smallisSpin:false }) if(result.data.status===0){ - this.props.showNotification(result.data.message) - this.props.topicscancelmodel() - this.props.updataslist() + this.props.showNotification(result.data.message); + this.props.topicscancelmodel(); + // result.data.task_ids; + + try { + this.props.updataslist() + }catch (e) { + + } +debugger + if(this.props.mysendall===true){ + //详情页面跳过来的 + try { + var rurls=""; + if(this.state.yslbanksMenu.category==="normal"){ + //普通作业 + rurls=`/courses/${this.state.Radiolist}/common_homeworks/${result.data.task_ids}/setting`; + }else if(this.state.yslbanksMenu.category==="group"){ + //分组作业 + rurls=`/courses/${this.state.Radiolist}/group_homeworks/${result.data.task_ids}/setting`; + }else if(this.state.yslbanksMenu.category==="exercise"){ + // 试卷 + rurls=`/courses/${this.state.Radiolist}/exercises/${result.data.task_ids}/student_exercise_list?tab=3`; + }else if(this.state.yslbanksMenu.category==="poll") { + //问卷 + rurls=`/courses/${this.state.Radiolist}/polls/${result.data.task_ids}/detail?tab=3` + } + window.open(rurls,'_blank'); + }catch (e) { + + } + }else{ + //外部多个列表页跳过来的 + debugger + try { + var rurls=""; + if(this.props.category==="normal"){ + //普通作业 + rurls=`/courses/${this.state.Radiolist}/common_homeworks/${result.data.category_id}`; + }else if(this.props.category==="group"){ + //分组作业 + rurls=`/courses/${this.state.Radiolist}/group_homeworks/${result.data.category_id}`; + }else if(this.props.category==="exercise"){ + // 试卷 + rurls=`/courses/${this.state.Radiolist}/exercises/${result.data.category_id}`; + }else if(this.props.category==="poll") { + //问卷 + rurls=`/courses/${this.state.Radiolist}/polls/${result.data.category_id}` + } + window.open(rurls,'_blank'); + }catch (e) { + console.log(e); + } + } }else{ this.props.showNotification(result.data.message) } diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index b6e9dda22..e95ea2b7f 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -594,7 +594,10 @@ class LoginRegisterComponent extends Component { }) } - + gobackshowbool=()=>{ + this.props.history.push("/login"); + this.props.Setshowbool(1) + } render() { const { // 登录 @@ -621,7 +624,7 @@ class LoginRegisterComponent extends Component { // height: 346px; return ( -
    +
    this.StudyMakeMoney()} @@ -801,6 +804,9 @@ class LoginRegisterComponent extends Component { +

    + this.gobackshowbool()}>返回登录注册 +

    diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 8b7df2e02..978682e0b 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -67,7 +67,7 @@ class LoginRegisterComponent extends Component { MyEduCoderModals:false, registered:undefined, Phonenumberisnotcodmms:undefined, - + weixinlogin:false, } } if(props.loginstatus === false){ @@ -105,6 +105,7 @@ class LoginRegisterComponent extends Component { MyEduCoderModals:false, registered:undefined, Phonenumberisnotcodmms:undefined, + weixinlogin:false, } } @@ -135,15 +136,22 @@ class LoginRegisterComponent extends Component { let pcipns=this.IsPC(); if (this.props.match.url === "/login") { console.log("11111111111111111111111111"); - this.state = { - tab:["0"], - - } + // this.state = { + // tab:["0"], + // + // } + this.setState({ + tab:["0"] + }) } else if (this.props.match.url === "/register") { - this.state = { - tab:["1"], - - } + console.log("11111111111111111111111111"); + // this.state = { + // tab:["1"], + // + // } + this.setState({ + tab:["1"] + }) } this.setState({ pciphone:pcipns, @@ -857,6 +865,18 @@ class LoginRegisterComponent extends Component { registered:"注册成功" }) }; + + openweixinlogin=()=>{ + this.setState({ + weixinlogin:true + }) + } + hideweixinlogin=()=>{ + this.setState({ + weixinlogin:false, + tab:["0"] + }) + } render() { const { // 登录 @@ -881,16 +901,19 @@ class LoginRegisterComponent extends Component { readAgreement, pciphone, Phonenumberisnotcodmms, + weixinlogin } = this.state // height: 346px; if (this.state.seconds === 0) { // window.location.href='http://www.cnblogs.com/a-cat/'; } - console.log(classpass); + return ( -
    +
    - + {weixinlogin===false? 登录 注册 - + :""} - { - parseInt(tab[0])==0 && + { + weixinlogin===false&&parseInt(tab[0])==0 &&