Merge branch 'dev_aliyun' into develop

dev_forum
daiao 5 years ago
commit 456c6fc9bd

@ -232,6 +232,14 @@ class ApplicationController < ActionController::Base
User.current = User.find 57703 User.current = User.find 57703
end end
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'
User.current = User.find 8686
elsif params[:debug] == 'admin'
User.current = User.find 1
end
# User.current = User.find 81403 # User.current = User.find 81403
end end

@ -2,8 +2,9 @@
# #
# 文件上传 # 文件上传
class AttachmentsController < ApplicationController class AttachmentsController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth, except: [:show]
before_action :find_file, only: %i[show destroy] before_action :find_file, only: %i[show destroy]
before_action :attachment_candown, only: [:show]
include ApplicationHelper include ApplicationHelper
@ -157,4 +158,33 @@ class AttachmentsController < ApplicationController
end end
edu_setting('public_cdn_host') + "/" + path edu_setting('public_cdn_host') + "/" + path
end end
def attachment_candown
unless current_user.admin? || current_user.business?
candown = true
if @file.container && current_user.logged?
# 课堂资源、作业、毕设相关资源的权限判断
if @file.container.is_a?(Course)
course = @file.container
candown = current_user.member_of_course?(course) || @file.is_public == 1
elsif @file.container.is_a?(HomeworkCommon) || @file.container.is_a?(GraduationTask) || @file.container.is_a?(GraduationTopic)
course = @file.container&.course
candown = current_user.member_of_course?(course)
elsif @file.container.is_a?(StudentWork)
course = @file.container&.homework_common&.course
candown = current_user.member_of_course?(course)
elsif @file.container.is_a?(StudentWorksScore)
course = @file.container&.student_work&.homework_common&.course
candown = current_user.member_of_course?(course)
elsif @file.container.is_a?(GraduationWork)
course = @file.container&.graduation_task&.course
candown = current_user.member_of_course?(course)
elsif @file.container.is_a?(GraduationWorkScore)
course = @file.container&.graduation_work&.graduation_task&.course
candown = current_user.member_of_course?(course)
end
tip_exception(403, "您没有权限进入") if course.present? && !candown
end
end
end
end end

@ -29,10 +29,10 @@ class CoursesController < ApplicationController
:transfer_to_course_group, :delete_from_course, :transfer_to_course_group, :delete_from_course,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher] :search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin, before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :delete_course_teacher, :create_group_by_importing_file] :set_course_group, :create_group_by_importing_file]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group, before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :export_member_scores_excel, :course_group_list, :change_course_teacher, :export_member_scores_excel, :course_group_list,
:teacher_application_review, :apply_teachers] :teacher_application_review, :apply_teachers, :delete_course_teacher]
before_action :validate_course_name, only: [:create, :update] before_action :validate_course_name, only: [:create, :update]
before_action :find_board, only: :board_list before_action :find_board, only: :board_list
before_action :validate_page_size, only: :mine before_action :validate_page_size, only: :mine

@ -250,7 +250,7 @@ class User < ApplicationRecord
# 课堂成员 # 课堂成员
def member_of_course?(course) def member_of_course?(course)
course.course_members.exists?(user_id: id) course&.course_members.exists?(user_id: id)
end end
# 实训路径管理员创建者或admin # 实训路径管理员创建者或admin

@ -14,6 +14,7 @@ if @course
if params[:group_info] if params[:group_info]
json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT
end end
json.first_category_url module_url(@course.none_hidden_course_modules.first, @course)
end end
if params[:school] if params[:school]

@ -4,6 +4,8 @@ Rails.application.routes.draw do
require 'admin_constraint' require 'admin_constraint'
mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new
get 'attachments/download/:id', to: 'attachments#show'
resources :edu_settings resources :edu_settings
scope '/api' do scope '/api' do
get 'home/index' get 'home/index'

@ -1,7 +0,0 @@
class ModifyAttachmentUrlForChallengeAnswer < ActiveRecord::Migration[5.2]
def change
ChallengeChoose.find_each do |cc|
cc.update_column(:subject, cc.subject.gsub("(/attachments/download", "(/api/attachments")) if cc.subject.present?
end
end
end

@ -218,6 +218,20 @@ class Testpapersettinghomepage extends Component{
// DownloadMessageval:undefined // DownloadMessageval:undefined
// }) // })
// } // }
goback=()=>{
// let {datalist}=this.state;
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
//
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render(){ render(){
let {tab,visible,Commonheadofthetestpaper}=this.state; let {tab,visible,Commonheadofthetestpaper}=this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
@ -251,9 +265,9 @@ class Testpapersettinghomepage extends Component{
<div className="educontent mb20" style={{width:"1200px"}}> <div className="educontent mb20" style={{width:"1200px"}}>
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/students}`}>{this.props.coursedata.name}</ActionBtn> <a className=" btn colorgrey fl hovercolorblue " onClick={this.goback} >{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</ActionBtn> <a className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">试卷详情</WordsBtn> <WordsBtn className="fl">试卷详情</WordsBtn>
</p> </p>
@ -274,9 +288,7 @@ class Testpapersettinghomepage extends Component{
<CoursesListType <CoursesListType
typelist={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]} typelist={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}
/> />
<a className="color-grey-6 fr font-16 summaryname mr30" <a className="color-grey-6 fr font-16 summaryname mr30" onClick={this.goback}>返回</a>
href={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`}>返回</a>
<p className="color-grey-6 fr font-16"> </p> <p className="color-grey-6 fr font-16"> </p>
</div> </div>

@ -35,12 +35,13 @@ class single extends Component{
}=this.props }=this.props
let isStudent =this.props.isStudent(); let isStudent =this.props.isStudent();
let isJudge = questionType.question_type == 2
return( return(
<div className="pl30 pr30 singleDisplay"> <div className="pl30 pr30 singleDisplay">
<Radio.Group disabled={ user_exercise_status == 1 ? true : false } defaultValue={questionType.user_answer[0]} onChange={this.changeItem}> <Radio.Group disabled={ user_exercise_status == 1 ? true : false } defaultValue={questionType.user_answer[0]} onChange={this.changeItem}>
{ {
questionType.question_choices && questionType.question_choices.map((item,key)=>{ questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.` let prefix = isJudge ? undefined : `${tagArray[key]}.`
return( return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}> <p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio> <Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio>

@ -78,12 +78,12 @@ class GraduationTasksSubmitedit extends Component{
} }
setedit=()=>{ setedit=()=>{
let coursesId=this.props.match.params.coursesId; // let coursesId=this.props.match.params.coursesId;
let workId=this.props.match.params.work_Id; // let workId=this.props.match.params.work_Id;
let {workslist}=this.state // let {workslist}=this.state
let task_id=workslist&&workslist.task_id; // let task_id=workslist&&workslist.task_id;
// window.location.href="/courses/"+coursesId+"/graduation_tasks/"+task_id+"/"+workId+"/works/edit"; // window.location.href="/courses/"+coursesId+"/graduation_tasks/"+task_id+"/"+workId+"/works/edit";
window.location.href="/courses/"+coursesId+"/graduation_tasks/"+workId+"/appraise"; this.goback()
} }
@ -96,11 +96,13 @@ class GraduationTasksSubmitedit extends Component{
} }
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId;
let work_Id=this.props.match.params.work_Id;
// window.location.href="/courses/"+courseId+"/graduation/graduation_tasks/"+category_id; let courseId=this.props.match.params.coursesId;
window.location.href="/courses/"+courseId+"/graduation_tasks/"+work_Id+"/appraise"; if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
@ -568,7 +570,7 @@ class GraduationTasksSubmitedit extends Component{
<p className="clearfix mt10"> <p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/} {/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/}
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">毕设任务</a></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+work_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+work_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -825,7 +827,7 @@ class GraduationTasksSubmitedit extends Component{
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.goback} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>
{/*</Form>*/} {/*</Form>*/}

@ -100,9 +100,12 @@ class GraduationTasksSubmitnew extends Component{
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
} }
@ -438,7 +441,7 @@ class GraduationTasksSubmitnew extends Component{
spinnings:false spinnings:false
}) })
if(response!==undefined){ if(response!==undefined){
this.setedit(response.data.work_id) this.goback()
} }
// if(response.status===200) { // if(response.status===200) {
// GraduationTasksnewtype=false; // GraduationTasksnewtype=false;
@ -567,7 +570,7 @@ render(){
<p className="clearfix mt10"> <p className="clearfix mt10">
{/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/} {/*<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks"} className="color-grey-6">{workslist&&workslist.course_name}</Link></WordsBtn>*/}
{/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/} {/*<span className="color-grey-9 fl ml3 mr3">&gt;</span>*/}
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">毕设任务</a></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"} className="color-grey-6">任务详情</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -802,7 +805,7 @@ render(){
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.gocannel} className="defalutCancelbtn fl">取消</a> <a onClick={this.goback} className="defalutCancelbtn fl">取消</a>
</div> </div>
</Form.Item> </Form.Item>
{/*</Form>*/} {/*</Form>*/}

@ -70,7 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_id; // let category_id=this.props.match.params.category_id;
// //
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+datalist.graduation_id;
window.history.go(-1) let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
Cancelvisible=()=>{ Cancelvisible=()=>{
@ -164,7 +170,7 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{datalist&&datalist.course_name}</Link> <a onClick={this.goback} className="color-grey-9 fl">{datalist&&datalist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-9 fl">{datalist&&datalist.graduation_name}</Link> <Link to={"/courses/"+courseId+"/graduation_tasks/"+graduation_id} className="color-grey-9 fl">{datalist&&datalist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -81,10 +81,13 @@ class GraduationTasksedit extends Component{
goback=()=>{ goback=()=>{
// let courseId=this.props.match.params.coursesId;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id; let courseId = this.props.match.params.coursesId;
// goback = () => { if(courseId===undefined){
window.history.go(-1) this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
@ -233,8 +236,8 @@ class GraduationTasksedit extends Component{
// console.log(response) // console.log(response)
// GraduationTasksedittype=false; // GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions"; // window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback() this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting"); //this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -333,7 +336,7 @@ class GraduationTasksedit extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/students"} className="color-grey-6">{this.props.current_user&&this.props.current_user.course_name}</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">{this.props.current_user&&this.props.current_user.course_name}</a></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">毕设任务</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -91,7 +91,7 @@ class GraduationTasksnew extends Component {
// GraduationTasksnewtype = false; // GraduationTasksnewtype = false;
// this.goback(); // this.goback();
if(response!==undefined){ if(response!==undefined){
this.props.history.push("/courses/" + this.props.match.params.coursesId + "/graduation_tasks/" + this.props.match.params.category_id + "/" + response.data.task_id + "/setting"); this.goback()
} }
// } // }
}).catch((error) => { }).catch((error) => {
@ -108,9 +108,11 @@ class GraduationTasksnew extends Component {
goback = () => { goback = () => {
let courseId = this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
let category_id = this.props.match.params.category_id; if(courseId===undefined){
this.props.history.push("/courses");
window.location.href = "/courses/" + courseId + "/graduation_tasks/" + category_id; }else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
@ -307,8 +309,7 @@ class GraduationTasksnew extends Component {
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/" + courseId + "/students"} <WordsBtn style="grey" className="fl"> <a onClick={this.goback} className="color-grey-6">{this.props.current_user && this.props.current_user.course_name}</a></WordsBtn>
className="color-grey-6">{this.props.current_user && this.props.current_user.course_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link <WordsBtn style="grey" className="fl"> <Link
to={"/courses/" + courseId + "/graduation_tasks/" + category_id} className="color-grey-6">毕设任务</Link></WordsBtn> to={"/courses/" + courseId + "/graduation_tasks/" + category_id} className="color-grey-6">毕设任务</Link></WordsBtn>

@ -761,9 +761,11 @@ class GraduationTaskssettingapp extends Component{
goback=()=>{ goback=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; if(courseId===undefined){
this.props.history.push("/courses");
window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; }else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
isgoback=()=>{ isgoback=()=>{
@ -1046,7 +1048,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{coursename}</Link> <a onClick={this.goback} className="color-grey-9 fl">{coursename}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+settingdata.graduation_id} className="color-grey-9 fl">毕设任务</Link> <Link to={"/courses/"+courseId+"/graduation_tasks/"+settingdata.graduation_id} className="color-grey-9 fl">毕设任务</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -57,11 +57,15 @@ class GraduationTaskssettinglist extends Component{
let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state;
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page);
} }
goback=()=>{ goback=()=>{
// window.history.back(-1) // window.history.back(-1)
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; if(courseId===undefined){
window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
@ -1058,7 +1062,7 @@ class GraduationTaskssettinglist extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<Link className="color-grey-9 fl" to={"/courses/"+courseId+"/students"}>{taskslistdata.course_name}</Link> <a className="color-grey-9 fl" onClick={this.goback}>{taskslistdata.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link className="color-grey-9 fl" to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}>{taskslistdata.graduation_name}</Link> <Link className="color-grey-9 fl" to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}>{taskslistdata.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -55,7 +55,12 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id; // let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id; // window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
window.history.go(-1) let courseId = this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
} }
end=()=>{ end=()=>{
@ -300,7 +305,7 @@ class GraduationTasksquestions extends Component{
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<Link to={"/courses/"+courseId+"/students"} className="color-grey-9 fl">{questionslist.course_name}</Link> <a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link> <Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -28,6 +28,7 @@ function disabledDateTime() {
}; };
} }
class CoursesNew extends Component { class CoursesNew extends Component {
constructor(props) { constructor(props) {
@ -46,7 +47,8 @@ class CoursesNew extends Component {
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school; let user_school=this.props.current_user&&this.props.current_user.user_school;
this.getschool("")
this.Searchvalue("")
if (coursesId != undefined) { if (coursesId != undefined) {
let url = "/courses/" + coursesId + "/settings.json" let url = "/courses/" + coursesId + "/settings.json"
axios.get(url).then((result) => { axios.get(url).then((result) => {
@ -85,8 +87,7 @@ class CoursesNew extends Component {
}) })
} }
this.getschool("")
this.Searchvalue("")
} }
componentDidUpdate(prevProps){ componentDidUpdate(prevProps){
@ -152,7 +153,7 @@ class CoursesNew extends Component {
} }
if(values.school===""||values.school===undefined){ if(values.school===""||values.school===undefined){
this.scrollToAnchor("isschool") // this.scrollToAnchor("isschool")
return return
} }
@ -191,17 +192,7 @@ class CoursesNew extends Component {
).then((response) => { ).then((response) => {
// debugger // debugger
if (response.data.status === 0) { if (response.data.status === 0) {
// this.setState({ this.goback()
// Modalstype: true,
// Modalstopval: response.data.message,
// ModalSave: this.cancelmodel,
// Loadtype: true,
// checkBoxValues: [],
// checkAllValue: false,
// // Realnamecertification : authentication,
// // professional_certification: values.Professionalcertification
// })
window.location.href = "/courses/" + coursesId+"/students";
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -220,7 +211,7 @@ class CoursesNew extends Component {
return return
} }
if(values.school===""||values.school===undefined){ if(values.school===""||values.school===undefined){
this.scrollToAnchor("isschool") // this.scrollToAnchor("isschool")
return return
} }
@ -244,9 +235,7 @@ class CoursesNew extends Component {
} }
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.course_id != undefined) { this.goback()
window.location.href = "/courses/" + response.data.course_id+"/students";
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -262,7 +251,7 @@ class CoursesNew extends Component {
if(this.props.match.params.coursesId===undefined){ if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses"); this.props.history.push("/courses");
}else{ }else{
this.props.history.push(`/courses/${this.props.match.params.coursesId}`); this.props.history.push(this.props.current_user.first_category_url);
} }
// window.history.go(-1) // window.history.go(-1)
} }
@ -292,7 +281,8 @@ class CoursesNew extends Component {
search:value search:value
}).then((result)=>{ }).then((result)=>{
// console.log(result.data) // console.log(result.data)
if (result.data.status===0) { if (result.data.message===undefined) {
this.setState({ this.setState({
searchlist: result.data.course_lists, searchlist: result.data.course_lists,
// course:value, // course:value,
@ -357,7 +347,9 @@ class CoursesNew extends Component {
}; };
getschool=(value)=>{ getschool=(value)=>{
this.props.form.setFieldsValue({
school: value
})
let url="/schools/school_list.json"; let url="/schools/school_list.json";
axios.get(url,{ axios.get(url,{
params: { params: {
@ -369,9 +361,7 @@ class CoursesNew extends Component {
searchlistscholl: result.data.school_names, searchlistscholl: result.data.school_names,
school: value school: value
}) })
this.props.form.setFieldsValue({
school: value
})
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
@ -389,7 +379,7 @@ class CoursesNew extends Component {
const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>); const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school) // console.log(this.props.current_user.user_school)
// form合并了 // form合并了
// console.log(optionschool)
return ( return (
<React.Fragment> <React.Fragment>

@ -22,169 +22,169 @@ import axios from 'axios'
const map={1:"未发布",2:"提交中",3:"已截止",4:"已结束"} const map={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
class PollDetailIndex extends Component{ class PollDetailIndex extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
tab:["0"], tab:["0"],
pollDetail:undefined, pollDetail:undefined,
user_permission:undefined, user_permission:undefined,
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined, DownloadMessageval:undefined,
} }
} }
getPollInfo=()=>{ getPollInfo=()=>{
console.log(this.props); console.log(this.props);
let pollId=this.props.match.params.pollId; let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json` let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.status==200){ if(result.status==200){
this.setState({ this.setState({
pollDetail:result.data, pollDetail:result.data,
user_permission:result.data.user_permission user_permission:result.data.user_permission
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
componentDidMount(){ componentDidMount(){
const query =this.props.location.search; const query =this.props.location.search;
if(query.indexOf("?")!=-1){ if(query.indexOf("?")!=-1){
const type = query.split('?'); const type = query.split('?');
let name = type[1].split("tab="); let name = type[1].split("tab=");
name = String(name).split(","); name = String(name).split(",");
name = decodeURI(name[1]); name = decodeURI(name[1]);
if(name!=undefined && name!="" && name!="undefined"){ if(name!=undefined && name!="" && name!="undefined"){
this.setState({ this.setState({
tab:[name] tab:[name]
}) })
} }
} }
this.getPollInfo(); this.getPollInfo();
} }
//切换tab //切换tab
changeTab=(e)=>{ changeTab=(e)=>{
this.setState({ this.setState({
tab:e.key tab:e.key
}) })
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url){
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){ if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:true, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:true, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }
}else { }else {
this.props.showNotification(`正在下载中`); this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank'); window.open("/api"+url, '_blank');
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
Downloadcal=()=>{ Downloadcal=()=>{
this.setState({ this.setState({
DownloadType:false, DownloadType:false,
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
render(){ render(){
let {tab,pollDetail,user_permission}=this.state; let {tab,pollDetail,user_permission}=this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent(); const isStudent = this.props.isStudent();
return( return(
<div className="newMain"> <div className="newMain">
<DownloadMessageysl <DownloadMessageysl
{...this.props} {...this.props}
value={this.state.DownloadMessageval} value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal} modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType} modalsType={this.state.DownloadType}
/> />
<div className="educontent mt10 mb50"> <div className="educontent mt10 mb50">
<p className="clearfix mb20"> <p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/students`}>{this.props.coursedata.name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/students`}>{this.props.coursedata.name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn> <WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>问卷详情</span> <span>问卷详情</span>
</p> </p>
<p className="clearfix mb20 lineh-25"> <p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide break-word" style={{maxWidth:"900px",lineHeight:"25px"}} title={`${pollDetail && pollDetail.polls_name}`}>{pollDetail && pollDetail.polls_name}</span> <span className="color-grey-3 font-24 fl task-hide break-word" style={{maxWidth:"900px",lineHeight:"25px"}} title={`${pollDetail && pollDetail.polls_name}`}>{pollDetail && pollDetail.polls_name}</span>
<span className="mt3 fl" style={{height:"25px"}}> <span className="mt3 fl" style={{height:"25px"}}>
<CoursesListType typelist={[`${map[pollDetail && pollDetail.polls_status]}`]} typesylename={""} /> <CoursesListType typelist={[`${map[pollDetail && pollDetail.polls_status]}`]} typesylename={""} />
</span> </span>
<WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn> <WordsBtn className="fr font-16 mt2" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
</p> </p>
<div> <div>
<div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE"> <div className="clearfix edu-back-white pl30 pr30 bor-bottom-greyE">
<div className="fl task_menu_ul"> <div className="fl task_menu_ul">
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item> <Menu.Item key="0">答题列表</Menu.Item>
{ {
(isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && <Menu.Item key="1">统计结果</Menu.Item> (isAdmin || (isStudent && pollDetail && pollDetail.show_result == 1 && pollDetail.polls_status == 3 && user_permission && user_permission.current_status==1)) && <Menu.Item key="1">统计结果</Menu.Item>
} }
{ isAdmin && <Menu.Item key="2">问卷预览</Menu.Item> } { isAdmin && <Menu.Item key="2">问卷预览</Menu.Item> }
<Menu.Item key="3">设置</Menu.Item> <Menu.Item key="3">设置</Menu.Item>
</Menu> </Menu>
</div> </div>
{ {
isAdmin && isAdmin &&
<span className="fr mt22"> <span className="fr mt22">
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/edit`} className="fl mr20 font-16">编辑问卷</WordsBtn> <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/edit`} className="fl mr20 font-16">编辑问卷</WordsBtn>
{/* 立即发布 */} {/* 立即发布 */}
{ {
user_permission && user_permission.poll_unpublish_count > 0 ? user_permission && user_permission.poll_unpublish_count > 0 ?
<li className="fl mr20"> <li className="fl mr20">
<ImmediatelyPublish <ImmediatelyPublish
{...this.props} {...this.props}
{...this.state} {...this.state}
style="blue" style="blue"
className={"font-16"} className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]} checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo} action={this.getPollInfo}
single={true} single={true}
></ImmediatelyPublish> ></ImmediatelyPublish>
</li> </li>
:"" :""
} }
{/* 立即截止、撤销发布 */} {/* 立即截止、撤销发布 */}
{ {
user_permission && user_permission.poll_publish_count > 0 ? user_permission && user_permission.poll_publish_count > 0 ?
<li className="fl mr20"> <li className="fl mr20">
<ImmediatelyEnd <ImmediatelyEnd
{...this.props} {...this.props}
{...this.state} {...this.state}
style="blue" style="blue"
className={"font-16"} className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]} checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo} action={this.getPollInfo}
single={true} single={true}
></ImmediatelyEnd> ></ImmediatelyEnd>
</li> </li>
:"" :""
} }
{/* { {/* {
user_permission && user_permission.poll_publish_count>0 ? user_permission && user_permission.poll_publish_count>0 ?
<li className="fl mr20"> <li className="fl mr20">
<CancelPublish <CancelPublish
@ -197,46 +197,46 @@ class PollDetailIndex extends Component{
</li> </li>
:"" :""
} */} } */}
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a> <a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
</span> </span>
} }
{ {
isStudent && isStudent &&
<span className="fr mt22 font-16"> <span className="fr mt22 font-16">
{ {
user_permission && user_permission.current_status!=3 ? user_permission && user_permission.current_status!=3 ?
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}> <WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}>
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" } { user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" }
</WordsBtn> </WordsBtn>
:"" :""
} }
</span> </span>
} }
</div> </div>
{ {
// 答题列表 // 答题列表
parseInt(tab[0])==0 && <PollTabFirst {...this.props} {...this.state}></PollTabFirst> parseInt(tab[0])==0 && <PollTabFirst {...this.props} {...this.state}></PollTabFirst>
} }
{ {
// 统计结果 // 统计结果
parseInt(tab[0])==1 && <PollTabSecond {...this.props} {...this.state}></PollTabSecond> parseInt(tab[0])==1 && <PollTabSecond {...this.props} {...this.state}></PollTabSecond>
} }
{ {
//问卷预览 //问卷预览
parseInt(tab[0])==2 && <PollTabThird {...this.props} {...this.state}></PollTabThird> parseInt(tab[0])==2 && <PollTabThird {...this.props} {...this.state}></PollTabThird>
} }
{ {
//设置 //设置
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth> parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth>
} }
</div> </div>
</div> </div>
</div> </div>
) )
} }
} }
export default PollDetailIndex export default PollDetailIndex

@ -2319,7 +2319,14 @@ class PollNew extends Component {
} }
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
//试图 //试图
render() { render() {
let { let {
@ -2373,19 +2380,18 @@ class PollNew extends Component {
/> : ""} /> : ""}
<div className="educontent mb50"> <div className="educontent mb50">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
to={`/courses/${this.props.match.params.coursesId}`}>{this.props.coursedata.name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</ActionBtn> to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span> <span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>
</p> </p>
<div className="clearfix mb30"> <div className="clearfix mb30">
<p <p
className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p> className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>
<ActionBtn to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`} <a onClick={()=>this.gotohome()}
className=" fr font-16">返回</ActionBtn> className=" fr font-16">返回</a>
</div> </div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/} {/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}

@ -70,7 +70,14 @@ class CommitSummary extends Component{
const mdContnet = this.refs[`md${1}`].getValue().trim(); const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet) console.log(mdContnet)
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
asdasdsad=()=>{ asdasdsad=()=>{
this.setState({ this.setState({
contents:"" contents:""
@ -123,20 +130,19 @@ class CommitSummary extends Component{
}} > }} >
<div className="educontent mb30"> <div className="educontent mb30">
<p className="clearfix mb20 mt10 ml29"> <p className="clearfix mb20 mt10 ml29">
<WordsBtn className="btn colorgrey fl hovercolorblue " <a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
style="grey">{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" <a style="grey"
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</WordsBtn> className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <a className="fl">作业详情</a>
</p> </p>
</div> </div>
</div> </div>
<div> <div>
<p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>修改总结</p> <p className="ml29 fl color-black mt10 summaryname" onClick={this.asdasdsad}>修改总结</p>
<a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/openlist?tab=0`} className="color-grey-6 fr font-16 ml30 mt10">返回</a> <a onClick={()=>this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div> </div>
{/*educontentbox*/} {/*educontentbox*/}
<div className="stud-class-set pt40 pb40"> <div className="stud-class-set pt40 pb40">

@ -111,7 +111,14 @@ class ShixunHomeworkPage extends Component {
bindRef = ref => { this.child = ref } bindRef = ref => { this.child = ref }
///////////////教师截止 ///////////////教师截止
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render() { render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state; let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
@ -125,12 +132,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20"> <div className="educontent mb20">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue " <a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</ActionBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn <a
className=" btn colorgrey fl hovercolorblue " className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</ActionBtn> href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <WordsBtn className="fl">作业详情</WordsBtn>
</p> </p>
@ -142,8 +148,7 @@ class ShixunHomeworkPage extends Component {
<CoursesListType <CoursesListType
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status} typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/> />
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" <a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>返回</a>
<a className="color-grey-9 fr font-16 mr20" <a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`} href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a> target={"_blank"}>实训详情</a>

@ -101,6 +101,14 @@ class ShixunWorkReport extends Component {
} }
} }
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render() { render() {
let{data} =this.state; let{data} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
@ -119,16 +127,15 @@ class ShixunWorkReport extends Component {
modalsType={this.state.DownloadType} modalsType={this.state.DownloadType}
/> />
<p className="clearfix mt20"> <p className="clearfix mt20">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/students"} className="fl color-grey-9" style="btn colorgrey fl hovercolorblue">
<span className={"color-grey-9"}> {data&&data.course_name}</span> <span className={"color-grey-9"}> {data&&data.course_name}</span>
</WordsBtn> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id} style="grey" className="btn colorgrey fl hovercolorblue "> <a className="btn colorgrey fl hovercolorblue " to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+category_id}>
<span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span> <span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span>
</WordsBtn> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</WordsBtn> <a to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn> <WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p> </p>

@ -875,6 +875,14 @@ class ShixunHomework extends Component{
let data={id:parseInt(datas.category_id),name:name} let data={id:parseInt(datas.category_id),name:name}
trigger('editshixunname', data) trigger('editshixunname', data)
} }
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
render(){ render(){
let { let {
modalname, modalname,

@ -93,7 +93,7 @@ class ShixunsHome extends Component {
const CustomNextArrow = props => { const CustomNextArrow = props => {
return ( return (
<div {...props} id="bannerright" style={arrowStyler}> <div {...props} id="bannerright" style={arrowStyler}>
<img id="bannerrightimg" style={noneStyler} src={"images/educoder/banner-right.png"} /> <img id="bannerrightimg" style={noneStyler} src={"/images/educoder/banner-right.png"} />
</div> </div>
); );
}; };
@ -101,7 +101,7 @@ class ShixunsHome extends Component {
const CustomPrevArrow = props => { const CustomPrevArrow = props => {
return ( return (
<div {...props} id="bannerleft" style={arrowStylel}> <div {...props} id="bannerleft" style={arrowStylel}>
<img id="bannerleftimg" style={noneStyler} src={"images/educoder/banner-left.png"} /> <img id="bannerleftimg" style={noneStyler} src={"/images/educoder/banner-left.png"} />
</div> </div>
); );
}; };
@ -374,7 +374,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}> <li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -388,7 +388,7 @@ class ShixunsHome extends Component {
<li className="pr" key={key}> <li className="pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -402,7 +402,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}> <li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -418,7 +418,7 @@ class ShixunsHome extends Component {
return ( return (
<li key={key}> <li key={key}>
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url}/> <img src={'/images/'+item.image_url}/>
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -450,7 +450,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}> <li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -464,7 +464,7 @@ class ShixunsHome extends Component {
<li className="pr" key={key}> <li className="pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -478,7 +478,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}> <li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'/images/'+item.image_url} />
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
@ -494,7 +494,7 @@ class ShixunsHome extends Component {
return ( return (
<li key={key}> <li key={key}>
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url}/> <img src={'/images/'+item.image_url}/>
<span className="task-hide rankName">{item.username}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>

@ -120,6 +120,9 @@ class EducoderLogin extends Component {
}) })
} }
gohome=()=>{
window.location.href="/"
}
Setshowbool = (e,name,pass) => { Setshowbool = (e,name,pass) => {
if (e===1) { if (e===1) {
this.setState({ this.setState({
@ -146,7 +149,7 @@ class EducoderLogin extends Component {
"width": "100%" "width": "100%"
}}> }}>
<div > <div >
<img src={educodernet}/> <img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/>
</div> </div>

@ -114,7 +114,7 @@ class MainContent extends Component {
? ?
readRepoTimeout === true ? <div className="readRepoFailed"> readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry" 代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a> onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> : </div> :
<React.Fragment> <React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}> <div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>

@ -235,7 +235,10 @@ class MainContentContainer extends Component {
} }
// arg_path 点击文件目录树时传入的点击节点对应的path // arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) { fetchRepositoryCode( props, arg_path, type, isRetry, retryAndRefresh) {
if (retryAndRefresh) {
this.retryAndRefresh = retryAndRefresh
}
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props; const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) { if (shixun.vnc == true) {
// vnc模式下不需要加载代码 // vnc模式下不需要加载代码
@ -293,6 +296,11 @@ class MainContentContainer extends Component {
// that._cancel = c; // that._cancel = c;
// }) // })
}).then((fetchRepositoryCodeResponse) => { }).then((fetchRepositoryCodeResponse) => {
// monaca 需要刷新,不然无法编辑
if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
window.location.reload()
return;
}
// 空字符串还是正常切换 // 空字符串还是正常切换
if (fetchRepositoryCodeResponse.data.status == 0) { if (fetchRepositoryCodeResponse.data.status == 0) {
readingRepoTimes = readingRepoTimes + 1; readingRepoTimes = readingRepoTimes + 1;

@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
<div className="df mb30"> <div className="df mb30">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<input type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称"}/> <input maxLength="60" type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称"}/>
<div className={stage_nametype===true?"red":'none'}>名称不能为空</div> <div className={stage_nametype===true?"red":'none'}>名称不能为空</div>
</div> </div>
<div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div> <div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div>

@ -38,7 +38,7 @@ class ShixunPathCard extends Component{
</div> </div>
<Link to={"/paths/"+item.id} className="square-img" > <Link to={"/paths/"+item.id} className="square-img" >
{/*target="_blank"*/} {/*target="_blank"*/}
<img alt="13?1543211263" src={item.image_url} style={{"display":"block"}}/> <img alt="13?1543211263" src={"/"+item.image_url} style={{"display":"block"}}/>
</Link> </Link>
<div className="square-main"> <div className="square-main">
<p className="task-hide"> <p className="task-hide">

@ -708,7 +708,7 @@ submittojoinclass=(value)=>{
onInput={()=>this.onKeywordSearchKeyDowns()} onInput={()=>this.onKeywordSearchKeyDowns()}
onSearch={(value) => this.onKeywordSearchKeyDown(value)} onSearch={(value) => this.onKeywordSearchKeyDown(value)}
// onPressEnter={this.onKeywordSearchKeyDown} // onPressEnter={this.onKeywordSearchKeyDown}
style={{ width: 300 }} style={{ width: 300,height:32}}
autoFocus={true} autoFocus={true}
/> />
</div>:""} </div>:""}

@ -493,7 +493,7 @@ export default class TPMchallengesnew extends Component {
<p className="color-grey-6 font-16 mb30">过关任务</p> <p className="color-grey-6 font-16 mb30">过关任务</p>
<TPMMDEditor ref={this.exercisememoMDRef} placeholder="请输入选择题的题干内容" mdID={'exercisememoMD'} refreshTimeout={1500} <TPMMDEditor ref={this.exercisememoMDRef} placeholder="请输入选择题的题干内容" mdID={'exercisememoMD'} refreshTimeout={1500}
watch={true} className="courseMessageMD" initValue={this.state.exercisememoMDRefval}></TPMMDEditor> watch={true} className="courseMessageMD" initValue={this.state.exercisememoMDRefval} height={700}></TPMMDEditor>
<p id="e_tip_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tip_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>
<p id="e_tips_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tips_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>

@ -12,6 +12,7 @@ import ReadPassword from './ReadPassword';
import axios from 'axios'; import axios from 'axios';
import './common.css' import './common.css'
import './commontwo.css'
const TabPane = Tabs.TabPane const TabPane = Tabs.TabPane
const loginInputsyl = { const loginInputsyl = {
@ -27,7 +28,7 @@ class LoginRegisterComponent extends Component {
login: "", login: "",
password: "", password: "",
passwords: "", passwords: "",
seconds: 35, seconds: 60,
codes: "", codes: "",
getverificationcodes: true, getverificationcodes: true,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
@ -126,7 +127,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
}); });
@ -144,7 +145,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
@ -600,6 +601,7 @@ class LoginRegisterComponent extends Component {
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}} style={{height: "38px", width: "100%"}}
dragOkCallback={()=>this.dragOkCallback()} dragOkCallback={()=>this.dragOkCallback()}
className="ysllw100"
></DragValidator> ></DragValidator>
: :
"" ""
@ -611,6 +613,7 @@ class LoginRegisterComponent extends Component {
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}} style={{height: "38px", width: "100%"}}
dragOkCallback={()=>this.dragOkCallback()} dragOkCallback={()=>this.dragOkCallback()}
className="ysllw100"
></DragValidatortwo> ></DragValidatortwo>
: :
"" ""

@ -192,6 +192,8 @@ class InterestpageComponent extends Component {
ints.push(this.state.gouxuans4[i].id); ints.push(this.state.gouxuans4[i].id);
} }
} }
console.log("195195");
console.log(ints);
if(ints.length<1){ if(ints.length<1){
this.openNotification("请至少选择一个您感兴趣的内容"); this.openNotification("请至少选择一个您感兴趣的内容");
return return

@ -182,10 +182,6 @@ class InterestpageMax extends Component {
//兴趣页面点击 //兴趣页面点击
Interestcompletionpage(){ Interestcompletionpage(){
this.setState({
setpagecomplet:true
})
if(this.state.gouxuans.length === 0){ if(this.state.gouxuans.length === 0){
this.openNotification("请选择职业"); this.openNotification("请选择职业");
return return
@ -197,6 +193,8 @@ class InterestpageMax extends Component {
ints.push(this.state.gouxuans4[i].id); ints.push(this.state.gouxuans4[i].id);
} }
} }
console.log("200200");
console.log(ints);
if(ints.length<1){ if(ints.length<1){
this.openNotification("请至少选择一个您感兴趣的内容"); this.openNotification("请至少选择一个您感兴趣的内容");
return return
@ -302,7 +300,7 @@ class InterestpageMax extends Component {
) )
})} })}
</div> </div>
<Button className="yslbutton2" size={"large"} type="primary"onClick={this.state.setpagecomplet===true?"":()=>this.Interestcompletionpage()} style={{width:"255px",height: "35px",background: "#4CACFF",marginTop: "17px"} }>完成</Button> <Button className="yslbutton2" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "35px",background: "#4CACFF",marginTop: "17px"} }>完成</Button>
</div> </div>
</div> </div>

@ -9,6 +9,7 @@ import passoff from '../../../src/images/login/passoff.png';
import axios from 'axios'; import axios from 'axios';
import DragValidatortwo from '../../../src/common/components/DragValidatortwo' import DragValidatortwo from '../../../src/common/components/DragValidatortwo'
import './common.css' import './common.css'
import './commontwo.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const loginInputsyl = { const loginInputsyl = {
"width":"434px", "width":"434px",
@ -36,7 +37,7 @@ class LoginRegisterComponent extends Component {
classpass: "text", classpass: "text",
// 登录 // 登录
passopens: passoff, passopens: passoff,
seconds: 35, seconds: 60,
discodeBtn: false, discodeBtn: false,
clearInterval: false, clearInterval: false,
autoLogin: true, autoLogin: true,
@ -45,7 +46,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false, readAgreement: false,
getverificationcodes: true, getverificationcodes: true,
dragOk: false, dragOk: false,
Agreetotheterms: false, Agreetotheterms: true,
login: "", login: "",
password: "", password: "",
logins: "", logins: "",
@ -71,7 +72,7 @@ class LoginRegisterComponent extends Component {
classpass: "text", classpass: "text",
// 登录 // 登录
passopens: passoff, passopens: passoff,
seconds: 35, seconds: 60,
discodeBtn: false, discodeBtn: false,
clearInterval: false, clearInterval: false,
autoLogin: true, autoLogin: true,
@ -80,7 +81,7 @@ class LoginRegisterComponent extends Component {
readAgreement: false, readAgreement: false,
getverificationcodes: true, getverificationcodes: true,
dragOk: false, dragOk: false,
Agreetotheterms: false, Agreetotheterms: true,
login: "", login: "",
password: "", password: "",
logins: "", logins: "",
@ -528,7 +529,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
}); });
@ -546,7 +547,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 35, seconds: 60,
}) })
} }
@ -718,7 +719,7 @@ class LoginRegisterComponent extends Component {
console.log(classpass); console.log(classpass);
return ( return (
<div className="login_register_content login_register_contents" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "490px"}}> <div className="login_register_content login_register_contents" style={ parseInt(tab[0])==0?{height: "366px"} :{height: "510px"}}>
<style> <style>
{ {
` `
@ -731,7 +732,7 @@ class LoginRegisterComponent extends Component {
</style> </style>
<div> <div>
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab} className="mt20">
<Menu.Item key="0" className={tab===0?"active font-18":"font-18"} > 登录</Menu.Item> <Menu.Item key="0" className={tab===0?"active font-18":"font-18"} > 登录</Menu.Item>
<Menu.Item key="1" className={tab===1?"active font-18":"font-18"} >注册</Menu.Item> <Menu.Item key="1" className={tab===1?"active font-18":"font-18"} >注册</Menu.Item>
</Menu> </Menu>
@ -839,8 +840,9 @@ class LoginRegisterComponent extends Component {
Whethertoverify===false&&pciphone===true? Whethertoverify===false&&pciphone===true?
<DragValidator <DragValidator
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px',width: "100%"}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
className="ysllw100"
></DragValidator> ></DragValidator>
: :
"" ""
@ -850,8 +852,9 @@ class LoginRegisterComponent extends Component {
Whethertoverify===true&&pciphone===true? Whethertoverify===true&&pciphone===true?
<DragValidatortwo <DragValidatortwo
height={38} successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px',width: "100%"}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
className="ysllw100"
></DragValidatortwo> ></DragValidatortwo>
: :
"" ""
@ -941,7 +944,7 @@ class LoginRegisterComponent extends Component {
} }
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
value={Agreetotheterms} checked={Agreetotheterms}
><span className="font-14 " style={{ ><span className="font-14 " style={{
color: '#676767', color: '#676767',
}}>我已阅读并同意 }}>我已阅读并同意

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd' import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd'
import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal' import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal'
import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal' import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal'
import axios from 'axios' import axios from 'axios'
@ -70,28 +70,44 @@ class AccountBasic extends Component {
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
}) })
}, 100) }, 100)
//if(basicInfo.nickname){ //if(basicInfo.nickname){
this.setState({ this.setState({
forDisable: true, forDisable: true,
nameLength:basicInfo.nickname?basicInfo.nickname.length:0, nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname, showRealName:basicInfo.show_realname,
realName: basicInfo.name, realName: basicInfo.name,
identity:basicInfo.identity identity:basicInfo.identity,
school_id:basicInfo.school_id,
department_id:basicInfo.department_id
}) })
//} //}
} }
} }
// 获取学校、单位 // 获取学校、单位
getSchoolList=(basicInfo)=>{ getSchoolList=(basicInfo, selectedName)=>{
let url=`/schools/for_option.json`; let url=`/schools/for_option.json`;
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result){ if(result){
this.setState({ this.setState({
schoolList:result.data.schools schoolList:result.data.schools
}) })
if(basicInfo && basicInfo.school_name){ if (selectedName) {
let school_id
result.data.schools.reverse().some( item => {
if (item.name == selectedName) {
school_id = item.id
return true;
}
})
this.props.form.setFieldsValue({
org: selectedName
})
this.setState({
school_id,
school: selectedName
})
} else if(basicInfo && basicInfo.school_name){
this.setState({ this.setState({
school:basicInfo.school_name, school:basicInfo.school_name,
filterSchoolList:this.state.schoolList.filter(function(item){ filterSchoolList:this.state.schoolList.filter(function(item){
@ -119,6 +135,15 @@ class AccountBasic extends Component {
console.log(values); console.log(values);
let {basicInfo}=this.props; let {basicInfo}=this.props;
if(!err ){ if(!err ){
if (!this.state.school_id) {
this.props.showNotification('请先选择学校/单位')
return;
}
if (!this.state.department_id) {
this.props.showNotification('请先选择院系/部门')
return;
}
let url=`/users/accounts/${basicInfo.id}.json` let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{ axios.put((url),{
nickname:values.nickname, nickname:values.nickname,
@ -187,6 +212,10 @@ class AccountBasic extends Component {
school:e, school:e,
filterSchoolList:arr filterSchoolList:arr
}) })
} else {
this.setState({
school: '',
})
} }
// else{ // else{
// let {school}=this.state; // let {school}=this.state;
@ -208,17 +237,30 @@ class AccountBasic extends Component {
filterDepartments:arr, filterDepartments:arr,
departmentsName:e departmentsName:e
}) })
} else {
this.setState({
filterDepartments: this.state.departments
})
} }
} }
// 选择部门、学院 // 选择部门、学院
changeDepartment=(e)=>{ changeDepartment=(e)=>{
let arr= this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
return item.name == e; return item.name == e;
}) : []; }) : [];
if (!arr[0]) {
this.setState({
department_id: '',
departmentsName: e,
})
this.this_department_id = ''
return;
}
this.this_department_id = arr[0].id
this.setState({ this.setState({
departmentsName:e, departmentsName:e,
department_id:arr[0].id department_id: arr[0].id
}) })
} }
@ -231,20 +273,58 @@ class AccountBasic extends Component {
let arr=this.state.schoolList.filter(function(item){ let arr=this.state.schoolList.filter(function(item){
return item.name == e; return item.name == e;
}); });
if (!arr[0]) {
// 没找到学校,清空部门
this.setState({
departments: [],
filterDepartments: [],
departmentsName: '',
school_id: '',
department_id: '',
})
this.this_school_id = ''
this.props.form.setFieldsValue({
org2: ''
})
return;
}
this.props.form.setFieldsValue({
org: arr[0].name
})
this.filterList(e)
// 保存选择的学校id // 保存选择的学校id
this.this_school_id = arr[0].id
this.setState({ this.setState({
school_id:arr[0].id, school_id: arr[0].id,
school:e, school:e,
}) })
let url=`/schools/${arr[0].id}/departments/for_option.json`; this._getDepartments(arr[0].id, flag)
}
_getDepartments = (schoolId, flag, selectedName) => {
let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`;
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result){ if(result){
this.setState({ this.setState({
departments:result.data.departments, departments:result.data.departments,
filterDepartments:result.data.departments filterDepartments:result.data.departments
}) })
// 切换学校后,部门默认选择第一个 if (selectedName) {
if(result.data.departments && result.data.departments.length>0 && flag==true){ let department_id
result.data.departments.reverse().some( item => {
if (item.name == selectedName) {
department_id = item.id
return true;
}
})
this.props.form.setFieldsValue({
org2: selectedName
})
this.setState({
department_id,
// school: selectedName
})
} else if(result.data.departments && result.data.departments.length>0 && flag==true){
// 切换学校后,部门默认选择第一个
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
org2:result.data.departments[0].name org2:result.data.departments[0].name
}) })
@ -273,6 +353,23 @@ class AccountBasic extends Component {
} }
} }
addOrgSuccess = (name) => {
// const schoolList = this.state.schoolList.slice(0)
// schoolList.push({ id: schoolList.length + 2000, name: name})
// this.setState({ schoolList })
this.getSchoolList(this.props.basicInfo, name);
this.props.form.setFieldsValue({
name: name
})
}
addChildOrgSuccess = (deptName) => {
this._getDepartments(this.state.school_id, false, deptName);
}
showApplyForAddOrgModal = () => { showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
@ -309,19 +406,22 @@ class AccountBasic extends Component {
return ( return (
<div> <div>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school} <ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...propsWithoutForm}></ApplyForAddOrgModal> {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess}
></ApplyForAddOrgModal>
<ApplyForAddChildOrgModal ref="applyForAddChildOrgModal" schoolName={school} schoolId={school_id} departmentName={departmentsName} <ApplyForAddChildOrgModal ref="applyForAddChildOrgModal" schoolName={school} schoolId={school_id} departmentName={departmentsName}
{...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form} ></ApplyForAddChildOrgModal> {...propsWithoutForm} wrappedComponentRef={(form) => this.applyForAddChildOrgForm = form}
addChildOrgSuccess={this.addChildOrgSuccess}
></ApplyForAddChildOrgModal>
<div className="basicForm"> <div className="basicForm courseNormalForm">
<style>{` <style>{`
.formItemInline { .formItemInline {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 10px;
position:relative; position:relative;
} }
.formItemInline .ant-form-explain{ .formItemInline .ant-form-explain{
position:absolute; /* position:absolute;*/
bottom:-20px; bottom:-20px;
left:0px; left:0px;
width:100%; width:100%;
@ -349,9 +449,7 @@ class AccountBasic extends Component {
.basicForm .cancelBtn { .basicForm .cancelBtn {
margin-left: 0px; margin-left: 0px;
} }
.basicForm .ant-input-lg {
height: 32px;
}
.basicForm .ant-form-item-label { .basicForm .ant-form-item-label {
width: 100px; width: 100px;
padding-right: 10px; padding-right: 10px;
@ -365,6 +463,10 @@ class AccountBasic extends Component {
.resetCityStyle .ant-form-item-control{ .resetCityStyle .ant-form-item-control{
width:220px; width:220px;
} }
.basicForm .ant-input-suffix {
line-height: 2.2;
background: transparent !important;
}
`}</style> `}</style>
<div className="title">基本信息</div> <div className="title">基本信息</div>
@ -473,6 +575,7 @@ class AccountBasic extends Component {
<Form.Item <Form.Item
label="" label=""
className="formItemInline fl" className="formItemInline fl"
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}} // style={{display:identity && identity=="student" ? "block":"none"}}
> >
{getFieldDecorator('student_No', { {getFieldDecorator('student_No', {
@ -544,28 +647,40 @@ class AccountBasic extends Component {
// type: 'array', // type: 'array',
required: true, required: true,
message: '请先选择学校/单位', message: '请先选择学校/单位',
// 做不了输入时和submit时都会执行这里
// validator: (rule, value, callback) => {
// if (this.this_school_id) {
// callback();
// return;
// }
// callback('请先选择学校/单位');
// }
}], }],
})( })(
<Select width={400} showSearch onSearch={this.filterList} onChange={this.changeList}> <AutoComplete width={400} showSearch onSearch={this.filterList} onChange={this.changeList}>
{ {
filterSchoolList && filterSchoolList.map((item,key)=>{ filterSchoolList && filterSchoolList.map((item,key)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>) return(<Option value={item.name} key={item.id}>{item.name}</Option>)
}) })
} }
</Select> </AutoComplete>
)} )}
</Form.Item> </Form.Item>
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<span> <div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span> <span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span> <span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
</span> <span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
</span>
</div>
} }
</div>
<Form.Item <Form.Item
label="院系/部门" label="院系/部门"
className="formItemInline mb0" className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
> >
{getFieldDecorator('org2', { {getFieldDecorator('org2', {
rules: [{ rules: [{
@ -573,9 +688,16 @@ class AccountBasic extends Component {
// type: 'array', // type: 'array',
required: true, required: true,
message: '请先选择院系/部门', message: '请先选择院系/部门',
// validator: (rule, value, callback) => {
// if (this.this_department_id) {
// callback();
// return;
// }
// callback('请先选择院系/部门');
// }
}], }],
})( })(
<Select width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment}> <AutoComplete width={400} showSearch onSearch={this.searchDepartment} onChange={this.changeDepartment}>
{ {
filterDepartments && filterDepartments.map((item,key)=>{ filterDepartments && filterDepartments.map((item,key)=>{
return( return(
@ -583,18 +705,20 @@ class AccountBasic extends Component {
) )
}) })
} }
</Select> </AutoComplete>
)} )}
</Form.Item> </Form.Item>
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
{ {
!filterDepartments || (filterDepartments && filterDepartments.length==0 )&& !filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName &&
<span> <div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
<span style={{color: '#CDCDCD'}}>未找到包含{departmentsName}的院系/部门</span> <span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span> <span style={{color: '#CDCDCD'}}>未找到包含{departmentsName}的院系/部门</span>
</span> <span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span>
</span>
</div>
} }
</div>
{/* htmlType="submit" */} {/* htmlType="submit" */}
{/* <Form.Item> {/* <Form.Item>
@ -607,7 +731,7 @@ class AccountBasic extends Component {
</Form.Item> */} </Form.Item> */}
</Form> </Form>
</div> </div>
<div style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</div> <div style={{color: '#989898', marginLeft: '20px', marginBottom: '10px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</div>
</div> </div>
); );
} }

@ -15,7 +15,7 @@ class AccountCertification extends Component {
} }
checkBasicInfo = (index) => { checkBasicInfo = (index) => {
if (this.props.basicInfo.base_info_completed == true) { if ( this.props.basicInfo.base_info_completed == true) {
this.showRealNameCertificationModal(index) this.showRealNameCertificationModal(index)
} else { } else {
this.props.confirm({ this.props.confirm({
@ -26,25 +26,31 @@ class AccountCertification extends Component {
} }
}) })
} }
} }
showRealNameCertificationModal = (index) => { showRealNameCertificationModal = (index) => {
this.setState({ this.setState({
certification:index, certification:index,
}, () => {
if (index == 1) {
this.realNameCertificationModal1.setVisible(true)
} else if (index == 2) {
this.realNameCertificationModal2.setVisible(true)
}
}) })
this.realNameCertificationModal.setVisible(true)
} }
render() { render() {
let {certification}=this.state let {certification}=this.state
let {basicInfo} = this.props; let {basicInfo} = this.props;
return ( return (
<div> <div>
{this.state.certification===1?<RealNameCertificationModal ref="realNameCertificationModal" {...this.props} {this.state.certification===1?<RealNameCertificationModal {...this.props}
wrappedComponentRef={(form) => this.realNameCertificationModal = form} certification={certification} wrappedComponentRef={(form) => this.realNameCertificationModal1 = form} certification={certification}
></RealNameCertificationModal>:""} ></RealNameCertificationModal>:""}
{this.state.certification===2?<RealNameCertificationModal ref="realNameCertificationModal" {...this.props} {this.state.certification===2?<RealNameCertificationModal {...this.props}
wrappedComponentRef={(form) => this.realNameCertificationModal = form} certification={certification} wrappedComponentRef={(form) => this.realNameCertificationModal2 = form} certification={certification}
></RealNameCertificationModal>:""} ></RealNameCertificationModal>:""}
<div className="basicForm"> <div className="basicForm">
<style>{` <style>{`

@ -335,7 +335,7 @@ class AccountSecure extends Component {
</Button> </Button>
</Form.Item> </Form.Item>
<div className="mb20" style={{ marginLeft: '118px' }}> <div className="mb20" style={{ marginLeft: '204px' }}>
<Button type="primary" onClick={this.onPhoneSubmit}>确定</Button> <Button type="primary" onClick={this.onPhoneSubmit}>确定</Button>
<Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button> <Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button>
</div> </div>
@ -398,7 +398,7 @@ class AccountSecure extends Component {
{ !secondsFlag ? "获取验证码":`重新发送${seconds}s`}</Button> { !secondsFlag ? "获取验证码":`重新发送${seconds}s`}</Button>
</Form.Item> </Form.Item>
<div className="mb20" style={{ marginLeft: '118px' }}> <div className="mb20" style={{ marginLeft: '204px' }}>
<Button type="primary" onClick={this.onEmailSubmit}>确定</Button> <Button type="primary" onClick={this.onEmailSubmit}>确定</Button>
<Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button> <Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button>
</div> </div>
@ -471,7 +471,7 @@ class AccountSecure extends Component {
)} )}
</Form.Item> </Form.Item>
<div className="mb20" style={{ marginLeft: '118px' }}> <div className="mb20" style={{ marginLeft: '204px' }}>
<Button type="primary" onClick={this.onPasswordSubmit}>确定</Button> <Button type="primary" onClick={this.onPasswordSubmit}>确定</Button>
<Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button> <Button type="primary grayBtn" style={{ marginLeft: '20px'}} onClick={this.hideUpdating}>取消</Button>
</div> </div>

@ -51,3 +51,33 @@ button.ant-btn.ant-btn-primary.grayBtn {
.basicForm .ant-form-item-label label { .basicForm .ant-form-item-label label {
color: #979797 color: #979797
} */ } */
.courseNormalForm .ant-select-show-search {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
.courseNormalForm .ant-select-search__field__mirror {
height: 40px;
}
.courseNormalForm .ant-input-lg {
height: 40px;
}
.courseNormalForm .ant-select-selection--single {
height: 40px;
}
.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single {
height: 40px
}
.courseNormalForm .ant-input-affix-wrapper {
height: 40px;
}
/* 职业 */
.courseNormalForm .ant-select-selection-selected-value {
line-height: 38px
}
.courseNormalForm input {
height: 40px;
}

@ -270,4 +270,7 @@
.bth100{ .bth100{
width: 100px; width: 100px;
margin: 0 auto; margin: 0 auto;
}
.ysllw100{
width: 100%;
} }

@ -43,12 +43,14 @@ class ApplyForAddChildOrgModal extends Component{
let{schoolId,departmentName}=this.props let{schoolId,departmentName}=this.props
let url=`/add_department_applies.json`; let url=`/add_department_applies.json`;
axios.post(url,{ axios.post(url,{
name:departmentName, name: values.depart,
school_id:schoolId, school_id: schoolId,
remarks:values.desc remarks: values.desc
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification("新增院系/部门成功!"); this.props.showNotification("新增院系/部门成功!");
this.props.addChildOrgSuccess(values.depart)
this.setVisible(false); this.setVisible(false);
} }
}).catch((error)=>{ }).catch((error)=>{
@ -74,7 +76,7 @@ class ApplyForAddChildOrgModal extends Component{
{...this.props } {...this.props }
onOk={this.onOk} onOk={this.onOk}
okText="保存" okText="保存"
className="applyForModal" className="applyForModal courseNormalForm"
> >
<style>{` <style>{`
.applyForModal .ant-form-item-label { .applyForModal .ant-form-item-label {
@ -88,7 +90,7 @@ class ApplyForAddChildOrgModal extends Component{
width: 390px; width: 390px;
} }
`}</style> `}</style>
<Form> <Form className="">
<Form.Item <Form.Item
label="单位名称:" label="单位名称:"
className="mt15 formItemInline hideRequireTag" className="mt15 formItemInline hideRequireTag"

@ -1,175 +1,177 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Modal, Button, Input, Form, } from "antd"; import { Modal, Button, Input, Form, } from "antd";
import axios from 'axios' import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper" import ModalWrapper from "../../courses/common/ModalWrapper"
import { City } from 'educoder' import { City } from 'educoder'
import '../account/common.css' import '../account/common.css'
const { TextArea } = Input; const { TextArea } = Input;
const Search = Input.Search const Search = Input.Search
class ApplyForAddOrgModal extends Component{ class ApplyForAddOrgModal extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
} }
} }
componentDidUpdate=(prevState)=>{ componentDidUpdate=(prevState)=>{
if(this.props.schoolName && prevState.schoolName != this.props.schoolName){ if(this.props.schoolName && prevState.schoolName != this.props.schoolName){
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
schoolName:this.props.schoolName schoolName:this.props.schoolName
}) })
} }
} }
componentDidMount=()=>{ componentDidMount=()=>{
if(this.props.schoolName){ if(this.props.schoolName){
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
schoolName:this.props.schoolName schoolName:this.props.schoolName
}) })
} }
} }
setVisible = (visible) => { setVisible = (visible) => {
this.refs.modalWrapper.setVisible(visible) this.refs.modalWrapper.setVisible(visible)
} }
onSendOk = () => { onSendOk = () => {
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values); console.log(values);
if(!err){ if(!err){
let url=`/add_school_applies.json`; let url=`/add_school_applies.json`;
axios.post(url,{ axios.post(url,{
name:values.schoolName, name:values.schoolName,
province:values.city && values.city[0], province:values.city && values.city[0],
city:values.city && values.city[1], city:values.city && values.city[1],
address:values.address, address:values.address,
remarks:values.remarks remarks:values.remarks
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification("新增学校/单位成功!"); this.props.showNotification("新增学校/单位成功!");
this.setVisible(false); this.setVisible(false);
} this.props.addOrgSuccess(values.schoolName)
}).catch((error)=>{
console.log(error); }
}) }).catch((error)=>{
} console.log(error);
}) })
} }
})
onOk = () => { }
this.onSendOk()
} onOk = () => {
this.onSendOk()
render(){ }
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
const { moduleName } = this.props render(){
const { getFieldDecorator } = this.props.form; const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
return( const { moduleName } = this.props
<ModalWrapper const { getFieldDecorator } = this.props.form;
ref="modalWrapper" return(
title={`申请添加单位名称`} <ModalWrapper
{...this.props } ref="modalWrapper"
onOk={this.onOk} title={`申请添加单位名称`}
okText="保存" {...this.props }
className="applyForModal" onOk={this.onOk}
> okText="保存"
<style>{` className="applyForModal courseNormalForm"
.applyForModal .ant-form-item-label { >
width: 100px; <style>{`
padding-right: 10px; .applyForModal .ant-form-item-label {
} width: 100px;
.applyForModal .ant-form-item-label label { padding-right: 10px;
color: #979797 }
} .applyForModal .ant-form-item-label label {
.applyForModal .formItemInline .ant-form-item-control-wrapper{ color: #979797
width: 390px; }
} .applyForModal .formItemInline .ant-form-item-control-wrapper{
.applyForModal .formItemInline .ant-form-item-control .ant-cascader-picker,.applyForModal .formItemInline .ant-cascader-picker-large .ant-input{ width: 390px;
width: 100%; }
height:32px!important; .applyForModal .formItemInline .ant-form-item-control .ant-cascader-picker,.applyForModal .formItemInline .ant-cascader-picker-large .ant-input{
} width: 100%;
.applyForModal .formItemInline .ant-input-lg{ height:40px!important;
font-size:14px!important; }
} .applyForModal .formItemInline .ant-input-lg{
.explain .ant-form-explain{ font-size:14px!important;
top:36px; }
} .explain .ant-form-explain{
top:36px;
.addOrg ul.ant-cascader-menu { }
width: 196px;
} .addOrg ul.ant-cascader-menu {
`}</style> width: 196px;
<Form onSubmit={this.onOk}> }
<Form.Item `}</style>
label="单位全称:" <Form onSubmit={this.onOk} className="">
className="mt15 formItemInline explain" <Form.Item
> label="单位全称:"
{getFieldDecorator('schoolName', { className="mt15 formItemInline explain"
rules: [{ >
// initialValue: this.state.cityDefaultValue, {getFieldDecorator('schoolName', {
required: true, rules: [{
message: '请输入学校或工作单位', // initialValue: this.state.cityDefaultValue,
}], required: true,
})( message: '请输入学校或工作单位',
<Input placeholder="学校或工作单位" className="validateInput"></Input> }],
)} })(
<div className="df mt18"> <Input placeholder="学校或工作单位" className="validateInput"></Input>
<li style={{lineHeight:"22px"}}>示例</li> )}
<ul style={{lineHeight:"22px"}}> <div className="df mt18">
<li> <li style={{lineHeight:"22px"}}>示例</li>
<i className="iconfont icon-chenggong color-green-light font-14 ml2 mr5 fl"></i> <ul style={{lineHeight:"22px"}}>
<span> 国防科学技术大学</span> <li>
</li> <i className="iconfont icon-chenggong color-green-light font-14 ml2 mr5 fl"></i>
<li> <span> 国防科学技术大学</span>
<i className="iconfont icon-htmal5icon19 font-18 fl mr4" style={{color:"#FF9348"}}></i> </li>
<span> 国防科学技术大学开福校区</span> <li>
</li> <i className="iconfont icon-htmal5icon19 font-18 fl mr4" style={{color:"#FF9348"}}></i>
</ul> <span> 国防科学技术大学开福校区</span>
</div> </li>
</Form.Item> </ul>
</div>
<Form.Item </Form.Item>
label="地区:"
className="mt15 formItemInline hideRequireTag" <Form.Item
> label="地区:"
{getFieldDecorator('city', { className="mt15 formItemInline hideRequireTag"
rules: [], >
})( {getFieldDecorator('city', {
<City matchInputWidth={true} popupClassName={"addOrg"}></City> rules: [],
)} })(
</Form.Item> <City matchInputWidth={true} popupClassName={"addOrg"}></City>
)}
<Form.Item </Form.Item>
label="详细地址:"
className="mt15 formItemInline hideRequireTag" <Form.Item
> label="详细地址:"
{getFieldDecorator('address', { className="mt15 formItemInline hideRequireTag"
rules: [], >
})( {getFieldDecorator('address', {
<Input placeholder="请填写完整的地址信息" className="validateInput"></Input> rules: [],
)} })(
</Form.Item> <Input placeholder="请填写完整的地址信息" className="validateInput"></Input>
)}
<Form.Item </Form.Item>
label="说明:"
className="mt15 formItemInline hideRequireTag" <Form.Item
> label="说明:"
{getFieldDecorator('remarks', { className="mt15 formItemInline hideRequireTag"
})( >
<TextArea placeholder="再次说明特别情况(选填)" className="validateInput"></TextArea> {getFieldDecorator('remarks', {
)} })(
</Form.Item> <TextArea placeholder="再次说明特别情况(选填)" className="validateInput"></TextArea>
)}
</Form> </Form.Item>
</Form>
</ModalWrapper>
)
} </ModalWrapper>
} )
const WrappedApplyForAddOrgModal = Form.create({ name: 'ApplyForAddOrgModal' })(ApplyForAddOrgModal); }
}
export default WrappedApplyForAddOrgModal; const WrappedApplyForAddOrgModal = Form.create({ name: 'ApplyForAddOrgModal' })(ApplyForAddOrgModal);
export default WrappedApplyForAddOrgModal;

@ -147,7 +147,7 @@ class RealNameCertificationModal extends Component{
{...this.props } {...this.props }
onOk={this.onOk} onOk={this.onOk}
okText="保存" okText="保存"
className="applyForModal certificationModal" className="applyForModal certificationModal courseNormalForm"
bottomRender={ bottomRender={
certification && certification == 1? certification && certification == 1?
<div className="bottomRender"> <div className="bottomRender">
@ -186,7 +186,7 @@ class RealNameCertificationModal extends Component{
> >
<style>{` <style>{`
.applyForModal .ant-form-item{ .applyForModal .ant-form-item{
margin-bottom:15px; margin-bottom:18px;
} }
.applyForModal .ant-form-item-label { .applyForModal .ant-form-item-label {
width: 100px; width: 100px;

Loading…
Cancel
Save