From 877c49f8cda8d033630ba06243d6de37d8aef0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 21 Aug 2019 15:51:47 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 75 +++++++++++-------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 16c71f942..d3b68ac32 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -880,8 +880,10 @@ class Coursesleftnav extends Component{ return(
-
  • this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> - this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> + +
  • this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> + + this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> { item.type==="announcement"?: item.type==="online_learning"?: @@ -912,7 +914,8 @@ class Coursesleftnav extends Component{ :""} -
  • + + {/*下拉列表*/} @@ -950,14 +953,15 @@ class Coursesleftnav extends Component{ > {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} +
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} - title={iem.category_name.length<10?"":iem.category_name} - > + > + {iem.category_name} {iem.category_count===0?"":iem.category_count} @@ -971,6 +975,7 @@ class Coursesleftnav extends Component{ {provided.placeholder} +
  • @@ -993,31 +998,35 @@ class Coursesleftnav extends Component{ return(
    {/**/} - -
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} - title={item.name.length<7?"":item.name} - > - - { - item.type==="announcement"?: - item.type==="online_learning"?: - item.type==="shixun_homework"?: - item.type==="common_homework"?: - item.type==="group_homework"?: - item.type==="graduation"?: - item.type==="exercise"?: - item.type==="poll"?: - item.type==="attachment"?: - item.type==="board"?: - item.type==="course_group"?:"" - } - - this.selectnavid(e,key,item.id,item.type,item.category_url)}>{item.name} - {item.task_count===0?"":item.task_count} - - -
  • + + +
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} + + > + + + { + item.type==="announcement"?: + item.type==="online_learning"?: + item.type==="shixun_homework"?: + item.type==="common_homework"?: + item.type==="group_homework"?: + item.type==="graduation"?: + item.type==="exercise"?: + item.type==="poll"?: + item.type==="attachment"?: + item.type==="board"?: + item.type==="course_group"?:"" + } + + this.selectnavid(e,key,item.id,item.type,item.category_url)}>{item.name} + {item.task_count===0?"":item.task_count} + + + +
  • + {/*
    */} @@ -1035,8 +1044,9 @@ class Coursesleftnav extends Component{ } } return( - -
  • + +
  • + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > {/*{iem.category_name}*/} @@ -1044,6 +1054,7 @@ class Coursesleftnav extends Component{ {iem.category_count===0?"":iem.category_count} +
  • ) From 46589f9a76112090f3e260f768109be04a89cad1 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 21 Aug 2019 15:53:49 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e7b4bdac6..ec3ea326c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -451,7 +451,7 @@ class ApplicationController < ActionController::Base cpu_limit = config.cpu_limit.presence || 1 cpu_request = config.lower_cpu_limit.presence || 0.1 memory_limit = config.memory_limit.presence || 1024 - request_limit = config.resource_limit.presence || 10 + request_limit = config.request_limit.presence || 10 resource_limit = config.resource_limit.presence || 10000 container << {:image => mirror.name, :cpuLimit => cpu_limit, From bdd02b3dbdeecd36705b5ba0115361fdd5895884 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 21 Aug 2019 15:58:09 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E6=8E=92=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 60 ++++++++++--------- app/services/homeworks_service.rb | 1 + ...0820021047_migrate_course_task_position.rb | 8 --- ...migrate_course_shixun_homework_position.rb | 11 ++++ 4 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 db/migrate/20190821072722_migrate_course_shixun_homework_position.rb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5c3f2e743..bfd7a4464 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -41,7 +41,6 @@ class CoursesController < ApplicationController before_action :find_board, only: :board_list before_action :validate_page_size, only: :mine before_action :course_tasks, only: [:tasks_list, :update_task_position] - before_action :find_container, only: [:update_task_position] if RUBY_PLATFORM =~ /linux/ require 'simple_xlsx_reader' @@ -1150,17 +1149,20 @@ class CoursesController < ApplicationController end def update_task_position - tip_exception("缺少position参数") if params[:position].blank? - unless params[:position].to_i == @task.position - if params[:position].to_i < @task.position - @tasks.where("position < #{@task.position} and position >= ?", params[:position]).update_all("position = position + 1") - else - @tasks.where("position > #{@task.position} and position <= ?", params[:position]).update_all("position = position - 1") + Rails.logger.info("#######task_ids_length#{params[:task_ids].uniq.length}#########task_count:#{@tasks.count}") + tip_exception("task_ids参数有误") if params[:task_ids].blank? || params[:task_ids].uniq.length != @tasks.count + ActiveRecord::Base.transaction do + begin + @tasks.each do |task| + position = params[:task_ids].reverse.index(task.id).to_i + 1 + task.update_attributes!(position: position) + end + normal_status(0, "移动成功") + rescue Exception => e + uid_logger(e.message) + tip_exception(e.message) + raise ActiveRecord::Rollback end - @task.update_attributes(position: params[:position]) - normal_status(0, "移动成功") - else - normal_status(-1, "位置没有变化") end end @@ -1247,24 +1249,24 @@ class CoursesController < ApplicationController end end - def find_container - case params[:container_type] - when 'shixun_homework', 'common_homework', 'group_homework' - @task = HomeworkCommon.find_by(id: params[:container_id]) - when 'exercise' - @task = Exercise.find_by(id: params[:container_id]) - when 'poll' - @task = Poll.find_by(id: params[:container_id]) - when 'graduation_topic' - @task = GraduationTopic.find_by(id: params[:container_id]) - when 'graduation_task' - @task = GraduationTask.find_by(id: params[:container_id]) - when 'attachment' - @task = Attachment.find_by(id: params[:container_id]) - else - tip_exception("container_type参数有误") - end - end + # def find_container + # case params[:container_type] + # when 'shixun_homework', 'common_homework', 'group_homework' + # @task = HomeworkCommon.find_by(id: params[:container_id]) + # when 'exercise' + # @task = Exercise.find_by(id: params[:container_id]) + # when 'poll' + # @task = Poll.find_by(id: params[:container_id]) + # when 'graduation_topic' + # @task = GraduationTopic.find_by(id: params[:container_id]) + # when 'graduation_task' + # @task = GraduationTask.find_by(id: params[:container_id]) + # when 'attachment' + # @task = Attachment.find_by(id: params[:container_id]) + # else + # tip_exception("container_type参数有误") + # end + # end def student_act_score group_id, search sql_select = %Q{SELECT cm.*,( diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index a21614efc..78be3b8f9 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -9,6 +9,7 @@ class HomeworksService homework_detail_manual = HomeworkDetailManual.new homework.homework_detail_manual = homework_detail_manual + homework.position = course.practice_homeworks.first&.position.to_i + 1 if homework.save! homework_detail_manual.save! if homework_detail_manual diff --git a/db/migrate/20190820021047_migrate_course_task_position.rb b/db/migrate/20190820021047_migrate_course_task_position.rb index cf1b633bd..f32ac88b1 100644 --- a/db/migrate/20190820021047_migrate_course_task_position.rb +++ b/db/migrate/20190820021047_migrate_course_task_position.rb @@ -1,13 +1,5 @@ class MigrateCourseTaskPosition < ActiveRecord::Migration[5.2] def change add_column :homework_commons, :position, :integer, :default => 0 - - Course.find_each do |course| - puts course.id - course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC, - homework_commons.created_at DESC").reverse.each_with_index do |homework, index| - homework.update_columns(position: index + 1) - end - end end end diff --git a/db/migrate/20190821072722_migrate_course_shixun_homework_position.rb b/db/migrate/20190821072722_migrate_course_shixun_homework_position.rb new file mode 100644 index 000000000..9a19b12e3 --- /dev/null +++ b/db/migrate/20190821072722_migrate_course_shixun_homework_position.rb @@ -0,0 +1,11 @@ +class MigrateCourseShixunHomeworkPosition < ActiveRecord::Migration[5.2] + def change + Course.find_each do |course| + puts course.id + course.practice_homeworks.order("IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC, + homework_commons.created_at DESC").reverse.each_with_index do |homework, index| + homework.update_columns(position: index + 1) + end + end + end +end From 1ca41960959582dc3f78127286c95bd0ad281a90 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 21 Aug 2019 16:08:25 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=87=91=E8=AF=BE=E7=9A=84=E9=A6=96?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5c3f2e743..58d7d6827 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -62,6 +62,9 @@ class CoursesController < ApplicationController @courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0) end + # 金课未开课的不显示在首页 + @courses = @courses.where("start_date is null or start_date <= '#{Date.today}'") + # 根据搜索关键字进一步筛选 if params[:search].present? # REDO:Extension From 524941916dbc57862c75f91bf2fb77526a76d582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 21 Aug 2019 16:08:27 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 75 ++++++++----------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index d3b68ac32..16c71f942 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -880,10 +880,8 @@ class Coursesleftnav extends Component{ return(
    - -
  • this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> - - this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> +
  • this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> + this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> { item.type==="announcement"?: item.type==="online_learning"?: @@ -914,8 +912,7 @@ class Coursesleftnav extends Component{ :""} - -
  • + {/*下拉列表*/} @@ -953,15 +950,14 @@ class Coursesleftnav extends Component{ > {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} -
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} - + title={iem.category_name.length<10?"":iem.category_name} > - + {iem.category_name} {iem.category_count===0?"":iem.category_count} @@ -975,7 +971,6 @@ class Coursesleftnav extends Component{ {provided.placeholder} -
  • @@ -998,35 +993,31 @@ class Coursesleftnav extends Component{ return(
    {/**/} - - -
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} - - > - - - { - item.type==="announcement"?: - item.type==="online_learning"?: - item.type==="shixun_homework"?: - item.type==="common_homework"?: - item.type==="group_homework"?: - item.type==="graduation"?: - item.type==="exercise"?: - item.type==="poll"?: - item.type==="attachment"?: - item.type==="board"?: - item.type==="course_group"?:"" - } - - this.selectnavid(e,key,item.id,item.type,item.category_url)}>{item.name} - {item.task_count===0?"":item.task_count} - - - -
  • - + +
  • this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)} + title={item.name.length<7?"":item.name} + > + + { + item.type==="announcement"?: + item.type==="online_learning"?: + item.type==="shixun_homework"?: + item.type==="common_homework"?: + item.type==="group_homework"?: + item.type==="graduation"?: + item.type==="exercise"?: + item.type==="poll"?: + item.type==="attachment"?: + item.type==="board"?: + item.type==="course_group"?:"" + } + + this.selectnavid(e,key,item.id,item.type,item.category_url)}>{item.name} + {item.task_count===0?"":item.task_count} + + +
  • {/*
    */} @@ -1044,9 +1035,8 @@ class Coursesleftnav extends Component{ } } return( - -
  • - + +
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > {/*{iem.category_name}*/} @@ -1054,7 +1044,6 @@ class Coursesleftnav extends Component{ {iem.category_count===0?"":iem.category_count} -
  • ) From d3c34a197729ca91604c2d41c695d1f48fb81451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 21 Aug 2019 16:19:07 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 3 +- .../courses/busyWork/CommonWorkDetailIndex.js | 6 +- .../busyWork/common/WorkDetailPageHeader.js | 5 +- .../courses/coursesDetail/CoursesBanner.js | 22 ++++- .../courses/coursesPublic/Addcourses.js | 94 ++++++------------- .../src/modules/courses/new/CoursesNew.js | 83 +++++++++++++--- .../shixunHomework/ShixunHomeworkPage.js | 3 +- .../shixunHomework/Trainingjobsetting.js | 44 ++++----- .../react/src/modules/message/js/MessagSub.js | 2 + .../modules/modals/Certifiedprofessional.js | 48 +++------- public/react/src/modules/tpm/NewHeader.js | 47 +++++++++- 11 files changed, 215 insertions(+), 142 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 9621fdc18..ab3ebb02d 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -19,7 +19,6 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import AccountProfile from "./modules/user/AccountProfile"; -import Certifiedprofessional from "./modules/modals/Certifiedprofessional" import Trialapplication from './modules/login/Trialapplication' import NotFoundPage from './NotFoundPage' @@ -306,7 +305,7 @@ class App extends Component { - + {/**/} diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 4d82f4182..a2a65ae22 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -282,11 +282,15 @@ class CommonWorkDetailIndex extends Component{ onClick={() => this.setState({moduleName: '参考答案'})} className={`${childModuleName == '参考答案' ? 'active' : '' } `} to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案} + + {this.props.isAdmin() ? this.setState({moduleName: '设置'})} className={`${childModuleName == '设置' ? 'active' : '' } `} style={{paddingLeft:'38px'}} - to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置 + to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置: + "" + } {/* { this.props.tabRightComponents } */} diff --git a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js index 56460a44a..a092c5066 100644 --- a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js +++ b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js @@ -144,10 +144,13 @@ class WorkDetailPageHeader extends Component{ {view_answer == true && 参考答案} + {this.props.isAdmin()? 设置 + to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置: + "" + } { this.props.tabRightComponents } diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index c53233d79..e9b3164ed 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -12,6 +12,7 @@ import Guide from './CoursesGuide'; import AddStudentModal from '../members/modal/AddStudentModal' import AddTeacherModal from '../members/modal/AddTeacherModal' import Jointheclass from '../../modals/Jointheclass' +import Certifiedprofessional from "../../modals/Certifiedprofessional"; // 点击按钮复制功能 // function jsCopy(){ // var e = document.getElementById("copy_invite_code"); @@ -48,6 +49,8 @@ class CoursesBanner extends Component { is_guide:false, excellent:false,//是否是精品课堂 yslJointhe:false, + mydisplay:false + } } componentDidMount() { @@ -58,9 +61,22 @@ class CoursesBanner extends Component { componentWillUnmount() { off('updatabanner', this.updatabanner) } - - onloadupdatabanner=()=>{ + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + Addcoursestypes:false, + mydisplay:true, + occupation:i, + }) + }; + ModalCancelsy=()=>{ + this.setState({ + mydisplay:false, + }) + }; + + onloadupdatabanner=()=>{ this.updatabanner() } updatabanner=()=>{ @@ -407,7 +423,9 @@ class CoursesBanner extends Component { {Addcoursestypes === true ? this.tojoinclass(2)} + HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)} /> : ""} + { + console.log("submittojoinclass"); + console.log(response); if(response === undefined){ this.setState({ // Addcoursestype:false, isSpin:false }); + // try { + // this.props.HideAddcoursestypess(3); + // }catch (e) { + // + // } return } + if(response.data.status===-2){ + this.setState({ + Addcoursestype:false, + isSpin:false + }); + try { + if(response.data.message==="该课堂要求成员完成实名认证"){ + this.props.HideAddcoursestypess(1); + } + if(response.data.message==="该课堂要求成员完成职业认证"){ + this.props.HideAddcoursestypess(2); + + } + if(response.data.message==="该课堂要求成员完成实名和职业认证"){ + this.props.HideAddcoursestypess(3); + } + }catch (e) { + this.props.showNotification(response.data.message); + } + return; + } if(response.data.status===0){ - // course_id: 1545 - // message: "成功" - // status: 0 - // this.setState({ - // // loadtype:true, - // // modalsType:true, - // // modalsTopval:response.data.message, - // // modalSave:this.submitasyn, - // course_id:response.data.course_id - // }) - // https://www.trustie.net/issues/22365 if (response.data.course_id == 2704) { this.props.history.push('/courses/2704/boards/8367/messages/42072') @@ -263,14 +281,6 @@ class Addcourses extends Component{ this.props.hideAddcoursestype(); } - - // this.setState({ - // loadtype:true, - // modalsType:true, - // modalsTopval:response.data.message, - // modalSave:this.submitasyn, - // course_id:undefined - // }) } this.setState({ @@ -285,52 +295,6 @@ class Addcourses extends Component{ }); }) - // if(value===0){ - // const form = new FormData(); - // form.append('invite_code', tojoinclasstitle); - // form.append('role', pamst); - // form.append('type', 1); - // axios.post(url,form,[true] - // ).then((response) => { - // if( response.data.state===0){ - // this.submitstatevalue(0,"加入成功",response.data.course_id) - // }else if( response.data.state===1){ - // }else if( response.data.state===2){ - // this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)") - // }else if( response.data.state===3){ - // this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id) - // }else if( response.data.state===4){ - // this.submitstatevalue( 0,"您输入的邀请码错误)") - // }else if( response.data.state===5){ - // this.submitstatevalue( 0,"您还未登录") - // }else if( response.data.state===6){ - // this.submitstatevalue( 0,"申请已提交,请等待审核") - // }else if( response.data.state===7){ - // this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待") - // }else if( response.data.state===8){ - // this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id) - // }else if( response.data.state==9){ - // this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id) - // }else if( response.data.state==10){ - // this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id) - // }else if( response.data.state==11){ - // this.submitstatevalue(0," 该课堂已归档,请联系老师") - // }else if( response.data.state==12){ - // this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师") - // }else if( response.data.state==13){ - // this.submitstatevalue(0,"您申请已提交,请等待审核") - // }else if( response.data.state==14){ - // this.submitstatevalue("此邀请码已停用,请与老师联系") - // }else if( response.data.state==15){ - // this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行") - // }else { - // this.submitstatevalue(0," 未知错误,请稍后再试") - // } - // }) - // - // } - - } render(){ diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 8629ba944..b87b4e81d 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -43,9 +43,11 @@ class CoursesNew extends Component { listvalue: undefined, fetching:false, boolxinjian:false, + checkboxgroup:undefined, + checkbofrup:["shixun_homework","common_homework","group_homework","exercise","attachment","course_group","graduation","poll","board"], + checkbofrups:[], } } - componentDidMount() { @@ -76,7 +78,32 @@ class CoursesNew extends Component { is_public: data.is_public === 1 ? true : false, Realnamecertification: data.authentication, Professionalcertification:data.professional_certification, - }) + + }); + try { + var datasysl=[]; + var dataysl2=[]; + var dataysl3=[]; + var checkbofrup =this.state.checkbofrup; + dataysl2=data.course_module_types; + datasysl=checkbofrup; + for (var k=0;k { console.log(error); @@ -442,7 +469,7 @@ class CoursesNew extends Component { this.applyForAddOrgForm.setVisible(true) } render() { - let {datatime,school,searchlistscholl} = this.state; + let {datatime,school,searchlistscholl,checkboxgroup} = this.state; const {getFieldDecorator} = this.props.form; const propsWithoutForm = Object.assign({}, this.props) delete propsWithoutForm.form @@ -669,17 +696,49 @@ class CoursesNew extends Component { "shixun_homework", "common_homework", "group_homework", "exercise", "attachment", "course_group", ], })( + this.props.match.params.coursesId != undefined? - 实训作业 - 普通作业 - 分组作业 - 试卷 - 资源 - 分班 - 毕业设计 - 问卷 - 讨论 + { + checkboxgroup===undefined?"":checkboxgroup.length===0?"":checkboxgroup.map((item,key)=>{ + return( + item ==="shixun_homework"? + 实训作业 + :item ==="common_homework"? + 普通作业 + :item ==="group_homework"? + 分组作业 + :item ==="exercise"? + 试卷 + :item ==="attachment"? + 资源 + :item ==="course_group"? + 分班 + :item ==="graduation"? + 毕业设计 + :item ==="poll"? + 问卷 + :item ==="board"? + 讨论 + :"" + ) + }) + } + : + + 实训作业 + 普通作业 + 分组作业 + 试卷 + 资源 + 分班 + 毕业设计 + 问卷 + 讨论 + + + + )}
    diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 7263594af..f46d3f6b1 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -186,9 +186,10 @@ class ShixunHomeworkPage extends Component { ` } :""} + {this.props.isAdmin() ? this.ChangeTab(3)} - >设置 + >设置:""} {/*{this.props.isAdmin() ? { - if (response != undefined) - if (response && response.data.status === -1) { - if(response.data.message==="该课堂要求成员完成实名认证"){ - this.setState({ - mydisplay:true, - occupation:1, - }) - - }else if(response.data.message==="该课堂要求成员完成职业认证"){ - this.setState({ - mydisplay:true, - occupation:2, - }) - }else if(response.data.message==="该课堂要求成员完成实名和职业认证"){ - this.setState({ - mydisplay:true, - occupation:3, - }) - } - } - return response; - }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 - - }); + // axios.interceptors.response.use((response) => { + // if (response != undefined) + // if (response && response.data.status === -1) { + // + // } + // return response; + // }, (error) => { + // //TODO 这里如果样式变了会出现css不加载的情况 + // + // }); } modalCancel=()=>{ - this.setState({ - mydisplay:false, - }) + this.props.ModalCancelsy(); }; setDownload=()=>{ @@ -63,7 +45,7 @@ class Certifiedprofessional extends Component { render() { // console.log("加入金品课堂2"); // console.log(this.props); - let{occupation} =this.state; + let{occupation} =this.props; return( diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index dff749515..66a120716 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -3,6 +3,7 @@ import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { Redirect } from 'react-router'; import AccountProfile from"../user/AccountProfile"; import PropTypes from 'prop-types'; +import Certifiedprofessional from "../../modules/modals/Certifiedprofessional" // import searchImg from '../../../../images/educoder/icon/search.svg' @@ -62,7 +63,9 @@ class NewHeader extends Component { isRender:false, showSearchOpentype:false, showTrial:false, - setevaluatinghides:false + setevaluatinghides:false, + occupation:0, + mydisplay:false } // console.log("176") // console.log(props); @@ -95,7 +98,29 @@ class NewHeader extends Component { //获取游览器地址 window.sessionStorage.setItem("yslgeturls",JSON.stringify(window.location.href)) - + // axios.interceptors.response.use((response) => { + // if (response != undefined) + // if (response && response.data.status === -1) { + // if (response.data.message === "该课堂要求成员完成实名认证") { + // + // } else if (response.data.message === "该课堂要求成员完成职业认证") { + // console.log("该课堂要求成员完成职业认证"); + // this.HideAddcoursestypess(2); + // + // + // + // return + // } else if (response.data.message === "该课堂要求成员完成实名和职业认证") { + // console.log("该课堂要求成员完成实名和职业认证"); + // this.HideAddcoursestypess(3); + // return + // + // } + // } + // return response; + // }, (error) => { + // + // }); } componentDidUpdate = (prevProps) => { @@ -326,7 +351,20 @@ class NewHeader extends Component { this.setState({ Addcoursestypes:false }) - } + }; + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + Addcoursestypes:false, + mydisplay:true, + occupation:i, + }) + }; + ModalCancelsy=()=>{ + this.setState({ + mydisplay:false, + }) + }; hidetojoinclass=()=>{ @@ -880,7 +918,10 @@ submittojoinclass=(value)=>{ {Addcoursestypes===true?this.HideAddcoursestypess(i)} />:""} + + {/* /courses/join_course_multi_role */}
  • From 491d6352d5fef9e0b8e5b85a95cf20372b274ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 21 Aug 2019 16:25:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 5e332f3be..efc30ee2e 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -518,7 +518,32 @@ class CoursesBanner extends Component {
  • - {excellent===false? + {/*{excellent===false?*/} + {/* :*/} + {/*
    */} + {/* */} + {/* /!*coursedata.course_identity === 6 是非课堂成员*!/*/} + {/* {coursedata.course_identity === 6&&coursedata.educoder_teacher===false?*/} + {/* this.myyslgradin()}>加入课堂: ""}*/} + + {/* {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?*/} + {/* this.myyslgradin()}>加入课堂: ""}*/} + + {/* /!*{this.props.isStudent()? this.exitclass()}*!/*/} + {/* /!*> 退出课堂 :""}*!/*/} + {/*
    */} + + {/*}*/}
    {coursedata.switch_to_student === true ? 退出课堂 :""}
    - : -
    - - {/*coursedata.course_identity === 6 是非课堂成员*/} - {coursedata.course_identity === 6&&coursedata.educoder_teacher===false? - this.myyslgradin()}>加入课堂: ""} - - {coursedata.course_identity === 6&&coursedata.educoder_teacher===true? - this.myyslgradin()}>加入课堂: ""} - - {/*{this.props.isStudent()? this.exitclass()}*/} - {/*> 退出课堂 :""}*/} -
    - }