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
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
end

@ -2,8 +2,9 @@
#
# 文件上传
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 :attachment_candown, only: [:show]
include ApplicationHelper
@ -157,4 +158,33 @@ class AttachmentsController < ApplicationController
end
edu_setting('public_cdn_host') + "/" + path
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

@ -29,10 +29,10 @@ class CoursesController < ApplicationController
:transfer_to_course_group, :delete_from_course,
: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,
: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,
: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 :find_board, only: :board_list
before_action :validate_page_size, only: :mine

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

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

@ -4,6 +4,8 @@ Rails.application.routes.draw do
require 'admin_constraint'
mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new
get 'attachments/download/:id', to: 'attachments#show'
resources :edu_settings
scope '/api' do
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
// })
// }
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(){
let {tab,visible,Commonheadofthetestpaper}=this.state;
const isAdmin =this.props.isAdmin();
@ -251,9 +265,9 @@ class Testpapersettinghomepage extends Component{
<div className="educontent mb20" style={{width:"1200px"}}>
<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>
<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>
<WordsBtn className="fl">试卷详情</WordsBtn>
</p>
@ -274,9 +288,7 @@ class Testpapersettinghomepage extends Component{
<CoursesListType
typelist={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}
/>
<a className="color-grey-6 fr font-16 summaryname mr30"
href={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`}>返回</a>
<a className="color-grey-6 fr font-16 summaryname mr30" onClick={this.goback}>返回</a>
<p className="color-grey-6 fr font-16"> </p>
</div>

@ -35,12 +35,13 @@ class single extends Component{
}=this.props
let isStudent =this.props.isStudent();
let isJudge = questionType.question_type == 2
return(
<div className="pl30 pr30 singleDisplay">
<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)=>{
let prefix = `${tagArray[key]}.`
let prefix = isJudge ? undefined : `${tagArray[key]}.`
return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio>

@ -78,12 +78,12 @@ class GraduationTasksSubmitedit extends Component{
}
setedit=()=>{
let coursesId=this.props.match.params.coursesId;
let workId=this.props.match.params.work_Id;
let {workslist}=this.state
let task_id=workslist&&workslist.task_id;
// let coursesId=this.props.match.params.coursesId;
// let workId=this.props.match.params.work_Id;
// let {workslist}=this.state
// 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/"+workId+"/appraise";
this.goback()
}
@ -96,11 +96,13 @@ class GraduationTasksSubmitedit extends Component{
}
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;
window.location.href="/courses/"+courseId+"/graduation_tasks/"+work_Id+"/appraise";
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);
}
}
@ -568,7 +570,7 @@ class GraduationTasksSubmitedit extends Component{
<p className="clearfix mt10">
{/*<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>*/}
<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>
<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>
@ -825,7 +827,7 @@ class GraduationTasksSubmitedit extends Component{
<Form.Item>
<div className="clearfix mt30 mb30">
<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>
</Form.Item>
{/*</Form>*/}

@ -100,9 +100,12 @@ class GraduationTasksSubmitnew extends Component{
goback=()=>{
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
})
if(response!==undefined){
this.setedit(response.data.work_id)
this.goback()
}
// if(response.status===200) {
// GraduationTasksnewtype=false;
@ -567,7 +570,7 @@ render(){
<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>*/}
{/*<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>
<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>
@ -802,7 +805,7 @@ render(){
<Form.Item>
<div className="clearfix mt30 mb30">
<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>
</Form.Item>
{/*</Form>*/}

@ -70,7 +70,13 @@ class GraduationTasksappraise extends Component{
// let category_id=this.props.match.params.category_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=()=>{
@ -164,7 +170,7 @@ class GraduationTasksappraise extends Component{
<div className={"educontent mb20"}>
<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>
<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>

@ -81,10 +81,13 @@ class GraduationTasksedit extends Component{
goback=()=>{
// let courseId=this.props.match.params.coursesId;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+this.state.data.graduation_id;
// goback = () => {
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);
}
}
@ -233,8 +236,8 @@ class GraduationTasksedit extends Component{
// console.log(response)
// GraduationTasksedittype=false;
// window.location.href="/courses/"+course_id+"/graduation/"+graduationId+"/graduation_tasks/"+category_id+"/questions";
// this.goback()
this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
this.goback()
//this.props.history.push("/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+graduation_id+"/"+this.props.match.params.category_id +"/setting");
}
}).catch((error) => {
console.log(error)
@ -333,7 +336,7 @@ class GraduationTasksedit extends Component{
<div className={"educontent mb20"}>
<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>
<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>

@ -91,7 +91,7 @@ class GraduationTasksnew extends Component {
// GraduationTasksnewtype = false;
// this.goback();
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) => {
@ -108,9 +108,11 @@ class GraduationTasksnew extends Component {
goback = () => {
let courseId = this.props.match.params.coursesId;
let category_id = this.props.match.params.category_id;
window.location.href = "/courses/" + courseId + "/graduation_tasks/" + category_id;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
@ -307,8 +309,7 @@ class GraduationTasksnew extends Component {
<div className={"educontent mb20"}>
<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>
<WordsBtn style="grey" className="fl"> <Link
to={"/courses/" + courseId + "/graduation_tasks/" + category_id} className="color-grey-6">毕设任务</Link></WordsBtn>

@ -761,9 +761,11 @@ class GraduationTaskssettingapp extends Component{
goback=()=>{
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
if(courseId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
isgoback=()=>{
@ -1046,7 +1048,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"educontent mb20"}>
<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>
<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>

@ -57,11 +57,15 @@ class GraduationTaskssettinglist extends Component{
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);
}
goback=()=>{
// window.history.back(-1)
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
if(courseId===undefined){
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"}>
<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>
<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>

@ -55,7 +55,12 @@ class GraduationTasksquestions extends Component{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
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=()=>{
@ -300,7 +305,7 @@ class GraduationTasksquestions extends Component{
<div className={"educontent mb20"}>
<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>
<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>

@ -28,6 +28,7 @@ function disabledDateTime() {
};
}
class CoursesNew extends Component {
constructor(props) {
@ -46,7 +47,8 @@ class CoursesNew extends Component {
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
this.getschool("")
this.Searchvalue("")
if (coursesId != undefined) {
let url = "/courses/" + coursesId + "/settings.json"
axios.get(url).then((result) => {
@ -85,8 +87,7 @@ class CoursesNew extends Component {
})
}
this.getschool("")
this.Searchvalue("")
}
componentDidUpdate(prevProps){
@ -152,7 +153,7 @@ class CoursesNew extends Component {
}
if(values.school===""||values.school===undefined){
this.scrollToAnchor("isschool")
// this.scrollToAnchor("isschool")
return
}
@ -191,17 +192,7 @@ class CoursesNew extends Component {
).then((response) => {
// debugger
if (response.data.status === 0) {
// this.setState({
// 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";
this.goback()
}
}).catch((error) => {
console.log(error)
@ -220,7 +211,7 @@ class CoursesNew extends Component {
return
}
if(values.school===""||values.school===undefined){
this.scrollToAnchor("isschool")
// this.scrollToAnchor("isschool")
return
}
@ -244,9 +235,7 @@ class CoursesNew extends Component {
}
).then((response) => {
if (response.status === 200) {
if (response.data.course_id != undefined) {
window.location.href = "/courses/" + response.data.course_id+"/students";
}
this.goback()
}
}).catch((error) => {
console.log(error)
@ -262,7 +251,7 @@ class CoursesNew extends Component {
if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses");
}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)
}
@ -292,7 +281,8 @@ class CoursesNew extends Component {
search:value
}).then((result)=>{
// console.log(result.data)
if (result.data.status===0) {
if (result.data.message===undefined) {
this.setState({
searchlist: result.data.course_lists,
// course:value,
@ -357,7 +347,9 @@ class CoursesNew extends Component {
};
getschool=(value)=>{
this.props.form.setFieldsValue({
school: value
})
let url="/schools/school_list.json";
axios.get(url,{
params: {
@ -369,9 +361,7 @@ class CoursesNew extends Component {
searchlistscholl: result.data.school_names,
school: value
})
this.props.form.setFieldsValue({
school: value
})
}
}).catch((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>);
// console.log(this.props.current_user.user_school)
// form合并了
// console.log(optionschool)
return (
<React.Fragment>

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

@ -70,7 +70,14 @@ class CommitSummary extends Component{
const mdContnet = this.refs[`md${1}`].getValue().trim();
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=()=>{
this.setState({
contents:""
@ -123,20 +130,19 @@ class CommitSummary extends Component{
}} >
<div className="educontent mb30">
<p className="clearfix mb20 mt10 ml29">
<WordsBtn className="btn colorgrey fl hovercolorblue "
style="grey">{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</WordsBtn>
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey"
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</WordsBtn>
<a style="grey"
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>
<WordsBtn className="fl">作业详情</WordsBtn>
<a className="fl">作业详情</a>
</p>
</div>
</div>
<div>
<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>
{/*educontentbox*/}
<div className="stud-class-set pt40 pb40">

@ -111,7 +111,14 @@ class ShixunHomeworkPage extends Component {
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() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
@ -125,12 +132,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<ActionBtn className=" btn colorgrey fl hovercolorblue "
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</ActionBtn>
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<ActionBtn
<a
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>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
@ -142,8 +148,7 @@ class ShixunHomeworkPage extends Component {
<CoursesListType
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
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 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
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() {
let{data} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
@ -119,16 +127,15 @@ class ShixunWorkReport extends Component {
modalsType={this.state.DownloadType}
/>
<p className="clearfix mt20">
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/students"} className="fl color-grey-9" style="btn colorgrey fl hovercolorblue">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>
<span className={"color-grey-9"}> {data&&data.course_name}</span>
</WordsBtn>
</a>
<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>
</WordsBtn>
</a>
<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>
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>

@ -875,6 +875,14 @@ class ShixunHomework extends Component{
let data={id:parseInt(datas.category_id),name:name}
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(){
let {
modalname,

@ -93,7 +93,7 @@ class ShixunsHome extends Component {
const CustomNextArrow = props => {
return (
<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>
);
};
@ -101,7 +101,7 @@ class ShixunsHome extends Component {
const CustomPrevArrow = props => {
return (
<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>
);
};
@ -374,7 +374,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<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>
</a>
</li>
@ -388,7 +388,7 @@ class ShixunsHome extends Component {
<li className="pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<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>
</a>
</li>
@ -402,7 +402,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<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>
</a>
</li>
@ -418,7 +418,7 @@ class ShixunsHome extends Component {
return (
<li key={key}>
<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>
</a>
</li>
@ -450,7 +450,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<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>
</a>
</li>
@ -464,7 +464,7 @@ class ShixunsHome extends Component {
<li className="pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<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>
</a>
</li>
@ -478,7 +478,7 @@ class ShixunsHome extends Component {
<li className="mt35 pr" key={key}>
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<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>
</a>
</li>
@ -494,7 +494,7 @@ class ShixunsHome extends Component {
return (
<li key={key}>
<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>
</a>
</li>

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

@ -114,7 +114,7 @@ class MainContent extends Component {
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<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> :
<React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>

@ -235,7 +235,10 @@ class MainContentContainer extends Component {
}
// 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;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
@ -293,6 +296,11 @@ class MainContentContainer extends Component {
// that._cancel = c;
// })
}).then((fetchRepositoryCodeResponse) => {
// monaca 需要刷新,不然无法编辑
if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
window.location.reload()
return;
}
// 空字符串还是正常切换
if (fetchRepositoryCodeResponse.data.status == 0) {
readingRepoTimes = readingRepoTimes + 1;

@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
<div className="df mb30">
<span className="mr30 color-orange pt10">*</span>
<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>
<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>
<Link to={"/paths/"+item.id} className="square-img" >
{/*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>
<div className="square-main">
<p className="task-hide">

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

@ -493,7 +493,7 @@ export default class TPMchallengesnew extends Component {
<p className="color-grey-6 font-16 mb30">过关任务</p>
<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_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 './common.css'
import './commontwo.css'
const TabPane = Tabs.TabPane
const loginInputsyl = {
@ -27,7 +28,7 @@ class LoginRegisterComponent extends Component {
login: "",
password: "",
passwords: "",
seconds: 35,
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotcobool: false,
@ -126,7 +127,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 35,
seconds: 60,
})
}
});
@ -144,7 +145,7 @@ class LoginRegisterComponent extends Component {
clearInterval(timer);
this.setState({
getverificationcodes: false,
seconds: 35,
seconds: 60,
})
}
@ -600,6 +601,7 @@ class LoginRegisterComponent extends Component {
height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}}
dragOkCallback={()=>this.dragOkCallback()}
className="ysllw100"
></DragValidator>
:
""
@ -611,6 +613,7 @@ class LoginRegisterComponent extends Component {
height={38} successGreenColor="#29bd8b"
style={{height: "38px", width: "100%"}}
dragOkCallback={()=>this.dragOkCallback()}
className="ysllw100"
></DragValidatortwo>
:
""

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

@ -182,10 +182,6 @@ class InterestpageMax extends Component {
//兴趣页面点击
Interestcompletionpage(){
this.setState({
setpagecomplet:true
})
if(this.state.gouxuans.length === 0){
this.openNotification("请选择职业");
return
@ -197,6 +193,8 @@ class InterestpageMax extends Component {
ints.push(this.state.gouxuans4[i].id);
}
}
console.log("200200");
console.log(ints);
if(ints.length<1){
this.openNotification("请至少选择一个您感兴趣的内容");
return
@ -302,7 +300,7 @@ class InterestpageMax extends Component {
)
})}
</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>

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

@ -1,7 +1,7 @@
import React, { Component } from 'react';
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 ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal'
import axios from 'axios'
@ -70,28 +70,44 @@ class AccountBasic extends Component {
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}, 100)
//if(basicInfo.nickname){
this.setState({
forDisable: true,
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
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`;
axios.get(url).then((result)=>{
if(result){
this.setState({
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({
school:basicInfo.school_name,
filterSchoolList:this.state.schoolList.filter(function(item){
@ -119,6 +135,15 @@ class AccountBasic extends Component {
console.log(values);
let {basicInfo}=this.props;
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`
axios.put((url),{
nickname:values.nickname,
@ -187,6 +212,10 @@ class AccountBasic extends Component {
school:e,
filterSchoolList:arr
})
} else {
this.setState({
school: '',
})
}
// else{
// let {school}=this.state;
@ -208,6 +237,10 @@ class AccountBasic extends Component {
filterDepartments:arr,
departmentsName:e
})
} else {
this.setState({
filterDepartments: this.state.departments
})
}
}
@ -216,6 +249,15 @@ class AccountBasic extends Component {
let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
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({
departmentsName:e,
department_id: arr[0].id
@ -231,20 +273,58 @@ class AccountBasic extends Component {
let arr=this.state.schoolList.filter(function(item){
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
this.this_school_id = arr[0].id
this.setState({
school_id: arr[0].id,
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)=>{
if(result){
this.setState({
departments:result.data.departments,
filterDepartments:result.data.departments
})
if (selectedName) {
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){
// 切换学校后,部门默认选择第一个
if(result.data.departments && result.data.departments.length>0 && flag==true){
this.props.form.setFieldsValue({
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 = () => {
this.applyForAddOrgForm.setVisible(true)
@ -309,19 +406,22 @@ class AccountBasic extends Component {
return (
<div>
<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}
{...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>{`
.formItemInline {
display: flex;
margin-bottom: 20px;
margin-bottom: 10px;
position:relative;
}
.formItemInline .ant-form-explain{
position:absolute;
/* position:absolute;*/
bottom:-20px;
left:0px;
width:100%;
@ -349,9 +449,7 @@ class AccountBasic extends Component {
.basicForm .cancelBtn {
margin-left: 0px;
}
.basicForm .ant-input-lg {
height: 32px;
}
.basicForm .ant-form-item-label {
width: 100px;
padding-right: 10px;
@ -365,6 +463,10 @@ class AccountBasic extends Component {
.resetCityStyle .ant-form-item-control{
width:220px;
}
.basicForm .ant-input-suffix {
line-height: 2.2;
background: transparent !important;
}
`}</style>
<div className="title">基本信息</div>
@ -473,6 +575,7 @@ class AccountBasic extends Component {
<Form.Item
label=""
className="formItemInline fl"
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}}
>
{getFieldDecorator('student_No', {
@ -544,28 +647,40 @@ class AccountBasic extends Component {
// type: 'array',
required: true,
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)=>{
return(<Option value={item.name} key={item.id}>{item.name}</Option>)
})
}
</Select>
</AutoComplete>
)}
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&&
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
</span>
}
</div>
}
<Form.Item
label="院系/部门"
className="formItemInline mb0"
style={{ 'margin-top': '10px'}}
>
{getFieldDecorator('org2', {
rules: [{
@ -573,9 +688,16 @@ class AccountBasic extends Component {
// type: 'array',
required: true,
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)=>{
return(
@ -583,18 +705,20 @@ class AccountBasic extends Component {
)
})
}
</Select>
</AutoComplete>
)}
</Form.Item>
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
{
!filterDepartments || (filterDepartments && filterDepartments.length==0 )&&
!filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{departmentsName}的院系/部门</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span>
</span>
}
</div>
}
{/* htmlType="submit" */}
{/* <Form.Item>
@ -607,7 +731,7 @@ class AccountBasic extends Component {
</Form.Item> */}
</Form>
</div>
<div style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</div>
<div style={{color: '#989898', marginLeft: '20px', marginBottom: '10px'}}>* 我们确保你所提供的信息均处于严格保密状态不会泄露</div>
</div>
);
}

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

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

@ -51,3 +51,33 @@ button.ant-btn.ant-btn-primary.grayBtn {
.basicForm .ant-form-item-label label {
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;
}

@ -271,3 +271,6 @@
width: 100px;
margin: 0 auto;
}
.ysllw100{
width: 100%;
}

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

@ -49,6 +49,8 @@ class ApplyForAddOrgModal extends Component{
if(result){
this.props.showNotification("新增学校/单位成功!");
this.setVisible(false);
this.props.addOrgSuccess(values.schoolName)
}
}).catch((error)=>{
console.log(error);
@ -72,7 +74,7 @@ class ApplyForAddOrgModal extends Component{
{...this.props }
onOk={this.onOk}
okText="保存"
className="applyForModal"
className="applyForModal courseNormalForm"
>
<style>{`
.applyForModal .ant-form-item-label {
@ -87,7 +89,7 @@ class ApplyForAddOrgModal extends Component{
}
.applyForModal .formItemInline .ant-form-item-control .ant-cascader-picker,.applyForModal .formItemInline .ant-cascader-picker-large .ant-input{
width: 100%;
height:32px!important;
height:40px!important;
}
.applyForModal .formItemInline .ant-input-lg{
font-size:14px!important;
@ -100,7 +102,7 @@ class ApplyForAddOrgModal extends Component{
width: 196px;
}
`}</style>
<Form onSubmit={this.onOk}>
<Form onSubmit={this.onOk} className="">
<Form.Item
label="单位全称:"
className="mt15 formItemInline explain"

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

Loading…
Cancel
Save