From 6779b75d7b1ef2e266f43d30388850d71a889e6d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Sep 2019 15:41:17 +0800 Subject: [PATCH 01/28] =?UTF-8?q?sql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 4 ++-- app/tasks/statistic_school_daily_report_task.rb | 4 ++-- app/tasks/statistic_school_report_task.rb | 4 ++-- db/migrate/20190920073337_migrate_user_extension_index.rb | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20190920073337_migrate_user_extension_index.rb diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 66d327649..f869e9ec6 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -40,8 +40,8 @@ class CollegesController < ApplicationController def teachers @teachers = User.find_by_sql("SELECT users.id, users.login, users.lastname, users.firstname, users.nickname, IFNULL((SELECT count(shixuns.id) FROM shixuns where shixuns.user_id =users.id group by shixuns.user_id), 0) AS publish_shixun_count, - (SELECT count(c.id) FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.role in (1,2,3) and c.school_id = #{current_school.id} AND m.user_id=users.id AND c.is_delete = 0) as course_count - FROM `users`, user_extensions ue where users.id=ue.user_id and ue.identity=0 and ue.school_id=#{current_school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") + (SELECT count(c.id) FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.user_id=users.id AND m.role in (1,2,3) and c.school_id = #{current_school.id} AND c.is_delete = 0) as course_count + FROM `users`, user_extensions ue where ue.school_id=#{current_school.id} and users.id=ue.user_id and ue.identity=0 ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") # ).order("publish_shixun_count desc, experience desc").limit(10) @teachers = @teachers.map do |teacher| diff --git a/app/tasks/statistic_school_daily_report_task.rb b/app/tasks/statistic_school_daily_report_task.rb index 5cd3fda7c..794a4b573 100644 --- a/app/tasks/statistic_school_daily_report_task.rb +++ b/app/tasks/statistic_school_daily_report_task.rb @@ -27,8 +27,8 @@ class StatisticSchoolDailyReportTask # 新增实训评测数量 shixun_evaluate_count = EvaluateRecord.joins('LEFT JOIN homework_commons_shixuns hcs ON hcs.shixun_id = evaluate_records.shixun_id') .joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4') - .joins('LEFT JOIN members ON members.user_id = evaluate_records.user_id') - .joins('LEFT JOIN courses ON members.course_id = courses.id AND hc.course_id = courses.id') + .joins('LEFT JOIN course_members ON course_members.user_id = evaluate_records.user_id') + .joins('LEFT JOIN courses ON course_members.course_id = courses.id AND hc.course_id = courses.id') .where(courses: { school_id: school.id }) .where(created_at: yesterday).reorder(nil).count diff --git a/app/tasks/statistic_school_report_task.rb b/app/tasks/statistic_school_report_task.rb index a55eb7a42..a72c57830 100644 --- a/app/tasks/statistic_school_report_task.rb +++ b/app/tasks/statistic_school_report_task.rb @@ -2,10 +2,10 @@ class StatisticSchoolReportTask def call School.find_each do |school| evaluate_count = Game.joins(:challenge) - .joins('LEFT JOIN members ON members.user_id = games.user_id') + .joins('LEFT JOIN course_members ON course_members.user_id = games.user_id') .joins('LEFT JOIN homework_commons_shixuns hcs ON hcs.shixun_id = challenges.shixun_id') .joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4') - .joins('LEFT JOIN courses ON hc.course_id = courses.id AND members.course_id = courses.id') + .joins('LEFT JOIN courses ON hc.course_id = courses.id AND course_members.course_id = courses.id') .where(courses: { school_id: school.id }) .sum(:evaluate_count) diff --git a/db/migrate/20190920073337_migrate_user_extension_index.rb b/db/migrate/20190920073337_migrate_user_extension_index.rb new file mode 100644 index 000000000..1d333bd99 --- /dev/null +++ b/db/migrate/20190920073337_migrate_user_extension_index.rb @@ -0,0 +1,6 @@ +class MigrateUserExtensionIndex < ActiveRecord::Migration[5.2] + def change + remove_index :user_extensions, :school_id + add_index :user_extensions, [:school_id, :user_id] + end +end From 1eaf637141038666e81c965e91f5bf89c388be30 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 20 Sep 2019 16:05:31 +0800 Subject: [PATCH 02/28] ecs: fix ec course support position --- .../ecs/save_graduation_course_supports_service.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/services/ecs/save_graduation_course_supports_service.rb b/app/services/ecs/save_graduation_course_supports_service.rb index bfbdb997f..de4ecc71a 100644 --- a/app/services/ecs/save_graduation_course_supports_service.rb +++ b/app/services/ecs/save_graduation_course_supports_service.rb @@ -9,6 +9,8 @@ class Ecs::SaveGraduationCourseSupportsService < ApplicationService end def call + set_course_supports_position! + Ecs::SaveGraduationCourseSupportForm.new(params).validate! accepts_attributes = build_accepts_nested_attributes( @@ -20,4 +22,10 @@ class Ecs::SaveGraduationCourseSupportsService < ApplicationService graduation_subitem.save! graduation_subitem end + + def set_course_supports_position! + params[:course_supports].each_with_index do |item, index| + item[:position] = index + 1 + end + end end \ No newline at end of file From f7a9f3f5e9e1bd34e483f570002c93f07cddaf96 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Sep 2019 16:48:44 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/graduation_work.rb | 2 +- app/models/student_work.rb | 2 +- app/views/student_works/show.json.jbuilder | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/graduation_work.rb b/app/models/graduation_work.rb index 235bfcac6..c0db92483 100644 --- a/app/models/graduation_work.rb +++ b/app/models/graduation_work.rb @@ -48,7 +48,7 @@ class GraduationWork < ApplicationRecord def delete_atta atta last_score = graduation_work_scores.where.not(score: nil).last - atta.author_id == user_id && (!last_score.present? || last_score.try(:created_at) < atta.created_on) + (atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) end # 分班名 diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 9c9efa17c..670990c34 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -106,7 +106,7 @@ class StudentWork < ApplicationRecord def delete_atta atta last_score = student_works_scores.where.not(score: nil).last - atta.author_id == user_id && (!last_score.present? || last_score.try(:created_at) < atta.created_on) + (atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) end # 作品总体评价 diff --git a/app/views/student_works/show.json.jbuilder b/app/views/student_works/show.json.jbuilder index 192e4d8ec..9bafbe93e 100644 --- a/app/views/student_works/show.json.jbuilder +++ b/app/views/student_works/show.json.jbuilder @@ -11,7 +11,7 @@ json.update_user_name @is_evaluation ? "匿名" : @work.update_user.try(:real_na json.update_atta @homework.late_duration && @is_author json.attachments @attachments do |atta| - json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: @work.delete_atta(atta)} + json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false} end unless @is_evaluation From ae58131a82acd22b9bdb6cf915b8f5848421a04c Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 20 Sep 2019 16:50:44 +0800 Subject: [PATCH 04/28] ecs: modify student import api --- app/controllers/ecs/students_controller.rb | 2 +- app/services/ecs/import_student_service.rb | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/controllers/ecs/students_controller.rb b/app/controllers/ecs/students_controller.rb index c21d625e0..abc5ddb65 100644 --- a/app/controllers/ecs/students_controller.rb +++ b/app/controllers/ecs/students_controller.rb @@ -14,7 +14,7 @@ class Ecs::StudentsController < Ecs::BaseController end def import - success_count = Ecs::ImportStudentService.call(current_year, params[:attachment_id]) + success_count = Ecs::ImportStudentService.call(current_year, params) render_ok(success_count: success_count) rescue Ecs::ImportStudentService::Error => ex render_error(ex.message) diff --git a/app/services/ecs/import_student_service.rb b/app/services/ecs/import_student_service.rb index 9014e221c..3a4930033 100644 --- a/app/services/ecs/import_student_service.rb +++ b/app/services/ecs/import_student_service.rb @@ -1,18 +1,17 @@ class Ecs::ImportStudentService < ApplicationService Error = Class.new(StandardError) - attr_reader :ec_year, :attachment + attr_reader :ec_year, :params - def initialize(ec_year, attachment_id) - @ec_year = ec_year - @attachment = Attachment.find_by(id: attachment_id) + def initialize(ec_year, params) + @ec_year = ec_year + @params = params end def call - raise Error, '文件不存在' if attachment.blank? + raise Error, '文件不存在' if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile) - path = attachment.diskfile - excel = Ecs::ImportStudentExcel.new(path) + excel = Ecs::ImportStudentExcel.new(params[:file].to_path) success_count = 0 EcYearStudent.bulk_insert(:student_id, :name, :created_at, :updated_at) do |worker| From 73aae4f4bce3fd78766d548faf5ae5cfb991d5e0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 20 Sep 2019 16:56:10 +0800 Subject: [PATCH 05/28] esc: fix import student --- app/services/ecs/import_student_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/ecs/import_student_service.rb b/app/services/ecs/import_student_service.rb index 3a4930033..8c16bd6e5 100644 --- a/app/services/ecs/import_student_service.rb +++ b/app/services/ecs/import_student_service.rb @@ -11,7 +11,7 @@ class Ecs::ImportStudentService < ApplicationService def call raise Error, '文件不存在' if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile) - excel = Ecs::ImportStudentExcel.new(params[:file].to_path) + excel = Ecs::ImportStudentExcel.new(params[:file].path) success_count = 0 EcYearStudent.bulk_insert(:student_id, :name, :created_at, :updated_at) do |worker| From 6eebfad0c9de8a8029ec7a2e6422b256480a7a87 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Sep 2019 16:57:57 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E8=B7=B3=E5=95=8A=E8=B5=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_work.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 670990c34..bbe0c0bed 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -106,7 +106,7 @@ class StudentWork < ApplicationRecord def delete_atta atta last_score = student_works_scores.where.not(score: nil).last - (atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) + ((atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on)) end # 作品总体评价 From 17c0d7eb2101969059dc59264b2d99ca4ae149e6 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 20 Sep 2019 17:03:58 +0800 Subject: [PATCH 07/28] add data-disable-with to professional --- .../admins/professional_authentications/shared/_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb index fd7685f98..bdcb87e21 100644 --- a/app/views/admins/professional_authentications/shared/_list.html.erb +++ b/app/views/admins/professional_authentications/shared/_list.html.erb @@ -53,11 +53,11 @@ <%= apply.status_text %> <% else %> - <%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %> + <%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?', 'data-disable-with': "提交中..." %> <%= javascript_void_link('拒绝', class: 'action refuse-action', data: { toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, - url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}") + url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}", 'data-disable-with': "拒绝中...") }) %> <% end %> From a5f2ef52520719dfb7e633df3be30d17dbc65103 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Sep 2019 17:05:07 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=9A=84=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/graduation_work.rb | 2 +- app/models/student_work.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/graduation_work.rb b/app/models/graduation_work.rb index c0db92483..c7420ffef 100644 --- a/app/models/graduation_work.rb +++ b/app/models/graduation_work.rb @@ -48,7 +48,7 @@ class GraduationWork < ApplicationRecord def delete_atta atta last_score = graduation_work_scores.where.not(score: nil).last - (atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) + (atta.author_id == User.current.id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) end # 分班名 diff --git a/app/models/student_work.rb b/app/models/student_work.rb index bbe0c0bed..b4ad834de 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -106,7 +106,7 @@ class StudentWork < ApplicationRecord def delete_atta atta last_score = student_works_scores.where.not(score: nil).last - ((atta.author_id == self.user_id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on)) + (atta.author_id == User.current.id) && (last_score.blank? || last_score.try(:created_at) < atta.created_on) end # 作品总体评价 From 23fbd22d6d2bbca0aefcb01cfef99b97ed2c2a71 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 20 Sep 2019 17:05:33 +0800 Subject: [PATCH 09/28] fix --- app/services/ecs/import_student_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/ecs/import_student_service.rb b/app/services/ecs/import_student_service.rb index 8c16bd6e5..f5cd7c6ac 100644 --- a/app/services/ecs/import_student_service.rb +++ b/app/services/ecs/import_student_service.rb @@ -14,7 +14,7 @@ class Ecs::ImportStudentService < ApplicationService excel = Ecs::ImportStudentExcel.new(params[:file].path) success_count = 0 - EcYearStudent.bulk_insert(:student_id, :name, :created_at, :updated_at) do |worker| + EcYearStudent.bulk_insert(:ec_year_id, :student_id, :name, :created_at, :updated_at) do |worker| excel.read_each do |student_id, name| success_count += 1 @@ -24,7 +24,7 @@ class Ecs::ImportStudentService < ApplicationService next end - worker.add(student_id: student_id, name: name) + worker.add(ec_year_id: ec_year.id, student_id: student_id, name: name) end end From f79153688f7647020047ea5542cddd68127cb288 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 20 Sep 2019 17:07:45 +0800 Subject: [PATCH 10/28] change data-disable-with --- .../admins/professional_authentications/shared/_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb index bdcb87e21..10934a702 100644 --- a/app/views/admins/professional_authentications/shared/_list.html.erb +++ b/app/views/admins/professional_authentications/shared/_list.html.erb @@ -57,8 +57,8 @@ <%= javascript_void_link('拒绝', class: 'action refuse-action', data: { toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, - url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}", 'data-disable-with': "拒绝中...") - }) %> + url: refuse_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}") + }, 'data-disable-with': "拒绝中...") %> <% end %> From 758663079b8e0befe1545d8c3aa89b89a149718b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 20 Sep 2019 17:18:16 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 841b516bb..de48f9fdb 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -168,7 +168,7 @@ class GraduationTasksController < ApplicationController end end else - @work_list = @work + @work_list = !@task.published? ? [] : @work @view_work = false @work_count = @work_list.count @all_work_count = @work_list.count From ed9b322893fec98c444f62736cb119a68f1fe696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Sep 2019 17:57:16 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E8=AF=84=E5=88=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseSupports/ecCourseSupports.css | 6 + .../ecs/EcSetting/CourseSupports/index.js | 403 +++++++++++------- public/react/src/modules/home/shixunsHome.js | 8 +- .../src/modules/tpm/TPMFork/TPMForklist.js | 2 +- .../src/modules/tpm/shixuns/ShixunCard.js | 8 +- 5 files changed, 266 insertions(+), 161 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/ecCourseSupports.css b/public/react/src/modules/ecs/EcSetting/CourseSupports/ecCourseSupports.css index 7f497b28e..87f87fc8e 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/ecCourseSupports.css +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/ecCourseSupports.css @@ -355,4 +355,10 @@ input{ .editlybuttonbox{ margin-bottom: 30px; margin-right: 3%; +} + +.Importclassroomdata{ + top: 30px; + position: absolute; + right: 0px; } \ No newline at end of file diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index bc848b209..a38bc814a 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -34,7 +34,13 @@ class CourseSupports extends Component { Supportslist:'', Supportssum:false, Supportsclass:false, - Supportsclasskey:undefined + Supportsclasskey:undefined, + neweditcourse:[{"weights": 0, + "ec_course_name":'', + "top_relation": false, + "ec_course_id":'' + }], + max_support_count:0 } } @@ -58,15 +64,25 @@ class CourseSupports extends Component { axios.get(url) .then((response) => { if(response.status===200){ - this.setState({ - data:response.data - }) - console.log(response.data.graduation_subitems.length) if(response.data.graduation_subitems.length===0){ this.setState({ Supportstype:true, + data:response.data, Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据' }) + }else{ + let datas=response.data.graduation_subitems; + let listlength=[] + datas.map((item,key)=>{ + listlength.push(item.course_supports.length) + }) + + let max_support_count=Math.max(...listlength); + + this.setState({ + max_support_count:max_support_count, + data:response.data + }) } } @@ -108,7 +124,7 @@ class CourseSupports extends Component { id=parseInt(id); let subindex =e.target.getAttribute("subindex"); - debugger + // const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id // axios.get(url) // .then((response) => { @@ -155,14 +171,18 @@ class CourseSupports extends Component { if(item.course_supports.length>0){ this.setState({ editcourse:item.course_supports, + neweditcourse:item.course_supports, Editkey:key, index:subindex, + ec_graduation_subitem_id:id, }) }else if(item.course_supports.length===0){ this.setState({ editcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}], + neweditcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}], Editkey:key, index:subindex, + ec_graduation_subitem_id:id, }) } @@ -197,7 +217,12 @@ class CourseSupports extends Component { Addcourse=(e)=>{ let {editcourse} =this.state; - let neweditcourse=editcourse; + let arr=new Array(); + editcourse.map((item,key)=>{ + arr.push(item) + }) + + let neweditcourse=arr; let newadd = {weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}; neweditcourse.push(newadd); this.setState({ @@ -215,29 +240,49 @@ class CourseSupports extends Component { // 删除 // let id =e.target.getAttribute("index"); let {editcourse} = this.state; - let neweditcourse=editcourse; - neweditcourse.splice(e,1); - let newnum=0; - for(var j=0;j{ + arr.push(item) + }) + + let neweditcourse=arr; + if(neweditcourse.length>1){ + neweditcourse.splice(e,1); + let newnum=0; + for(var j=0;j{ let {editcourse} = this.state; - let neweditcourse=editcourse; + let arr=new Array(); + editcourse.map((item,key)=>{ + arr.push(item) + }) + + let neweditcourse=arr; var id=e.target.id; var value=parseFloat(e.target.value); if(isNaN(value)){ @@ -301,9 +346,15 @@ class CourseSupports extends Component { handleChange=(e)=> { let {editcourse} = this.state; - let value=`${e[0]}`; - value=parseInt(value) - let neweditcourse=editcourse; + + let arr=new Array(); + editcourse.map((item,key)=>{ + arr.push(item) + }) + let neweditcourse=arr; + + let value=`${e[0]}`; + value=parseInt(value) let num=`${e[1]}`; num=parseInt(num) @@ -327,7 +378,13 @@ class CourseSupports extends Component { relevancetop=(e)=>{ let {editcourse} = this.state; - let neweditcourse=editcourse; + + let arr=new Array(); + editcourse.map((item,key)=>{ + arr.push(item) + }) + + let neweditcourse=arr; let id =e.target.getAttribute("itindex"); for(var i=0;i<1;i++){ neweditcourse[id].top_relation=false; @@ -339,7 +396,11 @@ class CourseSupports extends Component { relevancebottom=(e)=>{ let {editcourse} = this.state; - let neweditcourse=editcourse; + let arr=new Array(); + editcourse.map((item,key)=>{ + arr.push(item) + }) + let neweditcourse=arr; let id =e.target.getAttribute("itindex"); for(var i=0;i<1;i++){ neweditcourse[id].top_relation=true; @@ -355,14 +416,20 @@ class CourseSupports extends Component { this.inputNumberRef.blur(); } CancelSupports=()=>{ + let{editcourse,neweditcourse}=this.state; + // + // console.log(editcourse) + // console.log(neweditcourse) + this.setState({ Editkey:null, Supportssum:false, Supportsclass:false, + editcourse:neweditcourse }) } SubmitClassData=()=>{ - let {editcourse,editnum,ec_graduation_subitem_id,ec_year_id} = this.state; + let {editcourse,editnum,ec_graduation_subitem_id} = this.state; if(editcourse.length===0){ this.setState({ // Supportstype:true, @@ -409,35 +476,39 @@ class CourseSupports extends Component { } }) - var Url = '/ec_course_supports'; + + + + var Url = `/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.json`; axios.post(Url, { - ec_year_id: ec_year_id, - ec_graduation_subitem_id:ec_graduation_subitem_id, - course: editcourse - }, - { - withCredentials: true + graduation_subitem_id :ec_graduation_subitem_id, + course_supports: editcourse } ).then((response) => { - - if(response.data.status===0){ - this.setState({ - Editkey:null, - Supportslist:response.data.messsage, - Supportstype:true, - Supportssum:false, - Supportsclass:false, - Supportsclasskey:undefined, - }) - this.UpdateClassData(); + if(response.data.id===ec_graduation_subitem_id){ + + // this.setState({ + // Editkey:null, + // Supportslist:"保存成功", + // Supportstype:true, + // Supportssum:false, + // Supportsclass:false, + // Supportsclasskey:undefined, + // }) + this.UpdateClassData(); + this.setState({ + Editkey:null, + Supportssum:false, + Supportsclass:false, + }) }else if(response.data.status===-1){ - this.setState({ - Supportslist:"参数错误", - Supportstype:true, - Supportssum:false, - Supportsclass:false, - Supportsclasskey:undefined, - }) + // this.setState({ + // Supportslist:"参数错误", + // Supportstype:true, + // Supportssum:false, + // Supportsclass:false, + // Supportsclasskey:undefined, + // }) } }).catch((error) => { console.log(error) @@ -457,9 +528,37 @@ class CourseSupports extends Component { Supportslist:"", }) } + + confirmysl(url){ + axios.get(url + '?export=true').then((response) => { + if(response.data.status&&response.data.status===-1){ + + }else if(response.data.status&&response.data.status===-2){ + if(response.data.message === "100"){ + // 已超出文件导出的上限数量(100 ),建议: + + this.setState({ + DownloadType:true, + DownloadMessageval:100 + }) + }else { + //因附件资料超过500M + this.setState({ + DownloadType:true, + DownloadMessageval:500 + }) + } + }else { + this.props.showNotification(`正在下载中`); + window.open("/api"+url, '_blank'); + } + }).catch((error) => { + console.log(error) + }); + } render() { const Option = Select.Option; - let {data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state; + let {max_support_count,data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state; var list = (length) => { var res = []; for(var i = 0; i < length; i++) { @@ -472,6 +571,11 @@ class CourseSupports extends Component { return res } + let toptiebox={width: 126.6*max_support_count+"px"}; + + let ismidbox={width:123.82*max_support_count+"px",margin:'0px 0px'}; + + console.log(this.props) return (
-
+
@@ -506,8 +610,10 @@ class CourseSupports extends Component {
课程体系对毕业要求的支撑 {/* 导出培养目标 */} + + - 导出课程体系支撑矩阵 + this.confirmysl(`/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.xlsx`)}>导出课程体系支撑矩阵
用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 window.elasticLayer(3534)} >查看详情
@@ -521,9 +627,9 @@ class CourseSupports extends Component {
-

1200? 140*data.max_support_count : 1200+"px"}}> +

毕业要求指标点 - {list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)} + {list(max_support_count<5||max_support_count===undefined?5:max_support_count)} }/>:data.graduation_subitems.map((item,key)=>{ return ( -

  • 1134 ? 136*data.max_support_count : 1134+"px",margin: '0px 0px'}}> +
  • {item.graduation_requirement_position+"-"+item.position} @@ -550,7 +656,7 @@ class CourseSupports extends Component { display:Editkey!=key?"block":'none', marginRight: '-1px' }}> -
    {t.ec_course_name.length>12?t.ec_course_name.substring(0, 10)+"...":t.ec_course_name}
    {Math.round(item.weights_total*100)/100===0?0:(Math.round(item.weights_total*100)/100)}
  • - {data.is_manager===false?"": - + {data.is_manager===false?"": + }
    - -

    - -

    - 指标点 {index} - 支撑课程 - + + {Editkey===key? +

    +

    +

    + 指标点 {index} + 支撑课程 + 权重(∑=1) (精确到两位小数) - 关联度最高 -

    + 关联度最高 +

    -
    +
    {Supportsclass===true?:""} - { - editcourse.map((it,key)=>{ - - return( -
    - - - - -
    - -
    - - - - -
    - - - -
    - -
    - ) - }) - } - -
    - {Supportslist} -
    + { + editcourse.map((it,key)=>{ + + return( +
    + + + + +
    + +
    + + + + +
    + +
    + {editcourse.length===1?"": + this.Deletcourses(key)}> + } + +
    + +
    + +
    + ) + }) + } + +
    + {Supportslist} +
    合计: {editcourse.length} - 合计: {editnum} -
    - -
    -
    保存
    -
    取消
    -
    - -

    - - + style={{ + width: '580px', + paddingLeft: '37px', + display: 'inline-block' + }} + >合计: {editcourse.length} + 合计: {editnum} +
    + +
    +
    保存
    +
    取消
    +
    +
    +

    :""} ) }) diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 5677193d5..11f17fa3b 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -14,13 +14,7 @@ import UpgradeModals from '../modals/UpgradeModals'; import { SnackbarHOC , getImageUrl, configShareForIndex} from 'educoder'; -import Slider from '@icedesign/base/lib/slider'; - -import '@icedesign/base/lib/slider/style.js'; - -import Rating from '@icedesign/base/lib/rating'; - -import '@icedesign/base/lib/rating/style.js'; +import { Slider ,Rating} from "@icedesign/base"; import './home.css'; diff --git a/public/react/src/modules/tpm/TPMFork/TPMForklist.js b/public/react/src/modules/tpm/TPMFork/TPMForklist.js index bbe3509a6..c8af10e4d 100644 --- a/public/react/src/modules/tpm/TPMFork/TPMForklist.js +++ b/public/react/src/modules/tpm/TPMFork/TPMForklist.js @@ -6,7 +6,7 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; // import "antd/dist/antd.css"; -import Rating from '@icedesign/base/lib/rating'; +import { Rating } from "@icedesign/base"; import axios from 'axios'; diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index 3a0935e66..002471f60 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -10,19 +10,13 @@ import classNames from 'classnames'; import {getImageUrl,setImagesUrl, toPath} from 'educoder'; import { Spin,Icon } from 'antd'; - +import { Rating ,Pagination} from "@icedesign/base"; import 'antd/lib/pagination/style/index.css'; import './shixunCss/shixunCard.css'; -import Rating from '@icedesign/base/lib/rating'; - -import Pagination from '@icedesign/base/lib/pagination'; - // 引入业务组件样式 -import '@icedesign/base/lib/pagination/style.js'; -import '@icedesign/base/lib/rating/style.js'; import { Tooltip } from 'antd'; From fb0fd87f08c55c6db9d647d8ecd5d2b85982150f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 18:09:15 +0800 Subject: [PATCH 13/28] =?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/modules/courses/Index.js | 49 ++++++++++++++++++- .../courses/coursesDetail/CoursesBanner.js | 46 ++++++++++++++++- 2 files changed, 91 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 95927893d..f9f80a9da 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -315,9 +315,33 @@ class CoursesIndex extends Component{ if(isNaN(id)){ return } + + const querys = this.props.location.search; + var dataqueryss={} + try { + var foqus=this.foo(querys); + if(JSON.stringify(foqus) ==="{}"){ + this.setState({ + dataquerys:{}, + }); + }else{ + this.setState({ + dataquerys:foqus, + }); + dataqueryss=foqus; + } + }catch (e) { + this.setState({ + dataquerys:{}, + }) + } // let id=this.props.match.params.coursesId; let url ="/courses/"+id+"/left_banner.json" - axios.get(url).then((response) => { + axios.get(url, + {params: + dataqueryss + } + ).then((response) => { if(response!=undefined){ if(response.data&&response.data){ this.setState({ @@ -330,7 +354,28 @@ class CoursesIndex extends Component{ } } }) - } + }; + foo=(url)=> { + var json = {}; + var regExp = /[\?\&](\w+)(=?)(\w*)/g; + var arr; + do { + arr = regExp.exec(url); + // console.log(arr); // arr = [完整的字符串, key, 等号或'', value或''] + + if (arr) { + var key = arr[1]; + var value = arr[3]; + // arr[2] === ''时, value = undefined + if (!arr[2]) + value = undefined; + + json[key] = value; + } + } while (arr); + + return json; + }; locationNav=(list)=>{ if(list){ diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 21ac26727..437471436 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -94,9 +94,30 @@ class CoursesBanner extends Component { this.updatabanner() } updatabanner=()=>{ + const query = this.props.location.search; + var dataqueryss={} + try { + var foqus=this.foo(query); + if(JSON.stringify(foqus) ==="{}"){ + this.setState({ + dataquerys:{}, + }); + }else{ + this.setState({ + dataquerys:foqus, + }); + dataqueryss=foqus; + } + }catch (e) { + this.setState({ + dataquerys:{}, + }) + } let courseId = this.props.match.params.coursesId; let url = "/courses/" + courseId + "/top_banner.json" - axios.get(url).then((result) => { + axios.get(url,{params: + dataqueryss + }).then((result) => { if( result!=undefined){ let data = result.data; this.setState({ @@ -107,7 +128,28 @@ class CoursesBanner extends Component { this.onloadupdatabanner() } }) - } + }; + foo=(url)=> { + var json = {}; + var regExp = /[\?\&](\w+)(=?)(\w*)/g; + var arr; + do { + arr = regExp.exec(url); + // console.log(arr); // arr = [完整的字符串, key, 等号或'', value或''] + + if (arr) { + var key = arr[1]; + var value = arr[3]; + // arr[2] === ''时, value = undefined + if (!arr[2]) + value = undefined; + + json[key] = value; + } + } while (arr); + + return json; + }; showeditmenu = () => { this.setState({ show: true, From 828bc2512c88cd86dab54927c36b83961230578e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Sep 2019 18:11:32 +0800 Subject: [PATCH 14/28] =?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/modules/tpm/shixuns/ShixunCard.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index 002471f60..c2e35cc45 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -7,19 +7,16 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { Rating ,Pagination} from "@icedesign/base"; + import {getImageUrl,setImagesUrl, toPath} from 'educoder'; -import { Spin,Icon } from 'antd'; -import { Rating ,Pagination} from "@icedesign/base"; -import 'antd/lib/pagination/style/index.css'; +import { Spin,Icon,Tooltip } from 'antd'; import './shixunCss/shixunCard.css'; // 引入业务组件样式 - -import { Tooltip } from 'antd'; - import axios from 'axios'; const $ = window.$; From 7bb80d506899cbe77d02d10fcca9a2199f6d142c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Sep 2019 18:34:37 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/ecs/EcSetting/CourseSupports/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index a38bc814a..53ad2d936 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -556,6 +556,10 @@ class CourseSupports extends Component { console.log(error) }); } + + toforums=(url)=>{ + window.open( url, '_blank'); + } render() { const Option = Select.Option; let {max_support_count,data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state; @@ -575,7 +579,7 @@ class CourseSupports extends Component { let ismidbox={width:123.82*max_support_count+"px",margin:'0px 0px'}; - console.log(this.props) + console.log(this.props.year&&this.props.year.can_manager) return (
    导出培养目标 */} - + this.confirmysl(`/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.xlsx`)}>导出课程体系支撑矩阵 -
    用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 window.elasticLayer(3534)} >查看详情
    +
    用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 this.toforums(`/forums/${3534}`)} >查看详情
    @@ -675,7 +679,7 @@ class CourseSupports extends Component {
    {Math.round(item.weights_total*100)/100===0?0:(Math.round(item.weights_total*100)/100)}
    From 9e50ef1041876397426ed18d66031f76a579314e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 20 Sep 2019 19:02:50 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E7=A7=81=E5=AF=86=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E6=8D=A2=E6=88=90ip=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index b9da12ab0..4a087ae7a 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -559,7 +559,7 @@ class GamesController < ApplicationController secret_rep = @shixun.shixun_secret_repository logger.info("############secret_rep: #{secret_rep}") if secret_rep&.repo_name - secretGitUrl = repo_url secret_rep.repo_path + secretGitUrl = repo_ip_url secret_rep.repo_path br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path}) logger.info("#######br_params:#{br_params}") end From 943925678166cb9d99c3d563ed4efd05f9eca012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 09:05:56 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86=20?= =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 2 +- .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 2 +- public/react/src/modules/tpm/shixuns/ShixunCard.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/package.json b/public/react/package.json index 4d899935f..e91e61f03 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@icedesign/base": "^0.2.8", + "@icedesign/base": "^0.2.5", "@novnc/novnc": "^1.1.0", "antd": "^3.23.2", "array-flatten": "^2.1.2", diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index bb8ccae4a..2667f1dd9 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -349,7 +349,7 @@ class ShixunWorkReport extends Component { {data&&data.course_name} > - + {data===undefined?"":data.category===null?"":data.category.category_name} > diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index c2e35cc45..28b0117d0 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -116,7 +116,7 @@ class ShixunCard extends Component {

    - + {item.score_info===null?"5分":item.score_info+"分"}

    From 490a30444a46a07d4cd730030061a72e8d095968 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 21 Sep 2019 10:59:57 +0800 Subject: [PATCH 18/28] fix --- app/views/ecs/graduation_course_supports/show.xlsx.axlsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx index e2c2599ec..6222539af 100644 --- a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx +++ b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx @@ -11,7 +11,7 @@ wb.styles do |style| ec_year_style = style.add_style(sz: 10, height: 14) label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center }, border: { style: :thin, color: '000000' }) content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) - tip_style = style.add_style(sz: 11, height: 16, color: 'FFA07A') + tip_style = style.add_style(sz: 11, height: 16, color: '#FFA07A') wb.add_worksheet(:name => '课程体系对毕业要求的支撑') do |sheet| sheet.add_row ['课程体系VS毕业要求'], style: title_style From f00da2711bf8fe080f6cb42ccae469a60fedfe33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 11:08:04 +0800 Subject: [PATCH 19/28] =?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/public/css/edu-all.css | 2 +- .../react/src/modules/ecs/EcSetting/CourseSupports/index.js | 4 ++-- public/stylesheets/educoder/edu-all.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 425255048..cb78f8e00 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -3048,7 +3048,7 @@ a.singlepublishtwo{ /*工程认证*/ /*首页*/ .authMainImg{width: 100%;height: 240px;background:url("/images/educoder/auth/banner1.jpg") no-repeat top center;background-size: 100% 100%;justify-content: center;align-items: center;display: -webkit-flex;} -.ListTableLine>p,.ListTableLine>.ListTableTitle{padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;} +.ListTableLine>p,.ListTableLine>.ListTableTitle{margin-bottom: 0px;padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;} .ListTableLine>p span,.ListTableTitle span{float: left;color: #666;box-sizing: border-box} .ListTableLine li{min-height: 48px;padding: 10px 0px;box-sizing: border-box;margin:0px 30px;border-bottom: 1px solid #eaeaea;} .ListTableLine li>span{float: left;box-sizing: border-box;} diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index 53ad2d936..1fe126d21 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -579,7 +579,7 @@ class CourseSupports extends Component { let ismidbox={width:123.82*max_support_count+"px",margin:'0px 0px'}; - console.log(this.props.year&&this.props.year.can_manager) + // console.log(this.props.year&&this.props.year.can_manager) return (
    毕业要求指标点({data.count} - 课程体系({data.course_count} + 课程体系({data.course_count}
    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 91ea604d4..c20b648db 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3051,7 +3051,7 @@ a.singlepublishtwo{ /*工程认证*/ /*首页*/ .authMainImg{width: 100%;height: 240px;background:url("/images/educoder/auth/banner1.jpg") no-repeat top center;background-size: 100% 100%;justify-content: center;align-items: center;display: -webkit-flex;} -.ListTableLine>p,.ListTableLine>.ListTableTitle{padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;} +.ListTableLine>p,.ListTableLine>.ListTableTitle{margin-bottom: 0px;padding: 0px 30px;background-color: #F5F5F5;line-height: 40px;height: 56px;padding-top: 8px;box-sizing: border-box;} .ListTableLine>p span,.ListTableTitle span{float: left;color: #666;box-sizing: border-box} .ListTableLine li{min-height: 48px;padding: 10px 0px;box-sizing: border-box;margin:0px 30px;border-bottom: 1px solid #eaeaea;} .ListTableLine li>span{float: left;box-sizing: border-box;} From b8ae779bd9edd38de3ac56e26c65bb014d17c74b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 21 Sep 2019 11:18:19 +0800 Subject: [PATCH 20/28] ecs: fix export xlsx --- .../graduation_course_supports/show.xlsx.axlsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx index 6222539af..ae81d931b 100644 --- a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx +++ b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx @@ -9,13 +9,13 @@ wb = xlsx_package.workbook wb.styles do |style| title_style = style.add_style(sz: 16, height: 20, b: true) ec_year_style = style.add_style(sz: 10, height: 14) - label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center }, border: { style: :thin, color: '000000' }) + label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center, vertical: :center }, border: { style: :thin, color: '000000' }) content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) - tip_style = style.add_style(sz: 11, height: 16, color: '#FFA07A') + tip_style = style.add_style(sz: 11, height: 16, color: Axlsx::Color.new(rgb: 'FFFFA07A')) wb.add_worksheet(:name => '课程体系对毕业要求的支撑') do |sheet| sheet.add_row ['课程体系VS毕业要求'], style: title_style - sheet.merge_cells wb.rows.first.cells[(1..(3 + max_support_length - 1))] + sheet.merge_cells sheet.rows.first.cells[(1..(3 + max_support_length - 1))] sheet.add_row [] @@ -25,8 +25,8 @@ wb.styles do |style| sheet.add_row ['注:有对应关系的课程名称下方为其权重系数,一个指标点的权重系数之和必须等于1'], style: tip_style sheet.add_row ['注:“★” 表示关联度高'] - sheet.merge_cells wb.rows[5].cells[(1..(3 + max_support_length - 1))] - sheet.merge_cells wb.rows[6].cells[(1..(3 + max_support_length - 1))] + sheet.merge_cells sheet.rows[5].cells[(1..(3 + max_support_length - 1))] + sheet.merge_cells sheet.rows[6].cells[(1..(3 + max_support_length - 1))] sheet.add_row [] @@ -34,9 +34,9 @@ wb.styles do |style| data[last_column_index] = '课程数量' sheet.add_row data, style: label_style course_columns = max_support_length.times.map { |i| "课程#{i + 1}" } - sheet.add_row %w('一级 二级') + course_columns + ['∑目标值'], style: label_style + sheet.add_row %w(一级 二级) + course_columns + ['∑目标值'], style: label_style sheet.merge_cells("A9:B9") - sheet.merge_cells wb.rows[8].cells[(3..(3 + max_support_length - 1))] + # sheet.merge_cells sheet.rows[8].cells[(3..(3 + max_support_length - 1))] current_row = 11 graduation_subitems.group_by(&:ec_graduation_requirement).each do |requirement, items| @@ -61,11 +61,11 @@ wb.styles do |style| sheet.add_row course_data, style: styles sheet.add_row weight_data, style: styles - sheet.merge_cells("B#{current_row - 1}:B#{current_row}") + sheet.merge_cells("B#{current_row}:B#{current_row + 1}") current_row += 2 end - sheet.merge_cells("A#{start_row - 1}:B#{current_row - 1}") + sheet.merge_cells("A#{start_row}:A#{current_row - 1}") end end end \ No newline at end of file From df50ee59ecac43bf5f9e880a4edf9870050f2fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 11:18:33 +0800 Subject: [PATCH 21/28] =?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/modules/ecs/EcSetting/CourseSupports/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index 1fe126d21..aeaf58f53 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -623,7 +623,7 @@ class CourseSupports extends Component {
    - 毕业要求指标点({data.count} + 毕业要求指标点({data.count} 课程体系({data.course_count}
    From 5b347ca199f43b4b44429977476a33223c9de790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 11:25:03 +0800 Subject: [PATCH 22/28] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=93=E7=B3=BB=20vs?= =?UTF-8?q?=20=E6=AF=95=E4=B8=9A=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/ecs/EcSetting/CourseSupports/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js index aeaf58f53..511a0da64 100644 --- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js +++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js @@ -633,7 +633,7 @@ class CourseSupports extends Component {

    毕业要求指标点 - {list(max_support_count<5||max_support_count===undefined?5:max_support_count)} + {data.graduation_subitems===undefined?"":list(max_support_count<5||max_support_count===undefined?5:max_support_count)} Date: Sat, 21 Sep 2019 12:27:40 +0800 Subject: [PATCH 23/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 36 +++++--- .../src/modules/tpm/TPMShixunDiscuss.css | 92 +++++++++---------- .../src/modules/tpm/shixuns/css/TPMBanner.css | 2 +- 3 files changed, 71 insertions(+), 59 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 1ac81fe86..70e837bec 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import { Rating ,Progress} from "@icedesign/base"; -import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; +import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip,Rate} from 'antd'; import AccountProfile from"../user/AccountProfile"; @@ -607,7 +607,19 @@ class TPMBanner extends Component {

    -
      + +
      • 学习人数 {shixunsDetails.stu_num} @@ -624,11 +636,11 @@ class TPMBanner extends Component {
      this.showonMouseOver()} onMouseOut={()=>this.hideonMouseOut()}> -
      学员评分
      +
      学员评分
      - +
      -
      this.hideonMouseOut()}> +
      this.hideonMouseOut()}>
      @@ -639,16 +651,16 @@ class TPMBanner extends Component { 总评分
      {showradios === true ? - + : ""}
      -
      +
      {showradios === true ? - + : ""}
      @@ -657,7 +669,7 @@ class TPMBanner extends Component {
      {showradios === true ? - + : ""}
      @@ -666,7 +678,7 @@ class TPMBanner extends Component {
      {showradios === true ? - + : ""}
      @@ -675,7 +687,7 @@ class TPMBanner extends Component {
      {showradios === true ? - + : ""}
      @@ -684,7 +696,7 @@ class TPMBanner extends Component {
      {showradios === true ? - + : ""}
      diff --git a/public/react/src/modules/tpm/TPMShixunDiscuss.css b/public/react/src/modules/tpm/TPMShixunDiscuss.css index 6006b3f30..3af4ec269 100644 --- a/public/react/src/modules/tpm/TPMShixunDiscuss.css +++ b/public/react/src/modules/tpm/TPMShixunDiscuss.css @@ -1,47 +1,47 @@ -.tpmComment .-fit { - position: inherit; -} -.tpmComment .rc-pagination { - margin-left: auto; - margin-right: auto; - margin-top: 12px; - margin-bottom: 20px; -} -.tpmComment .paginationSection { - background: #FAFAFA; -} -.tpmComment .comment_item_cont.df.clearfix:nth-last-child(1) { - border-bottom: none; -} - -/*.tpmComment .fl.edu-back-white {*/ -/*min-height: 600px;*/ -/*}*/ - - -.user_watch_btn { - cursor: pointer; -} - - -/*md编辑器*/ -.tpmComment .commentItemMDEditor a.task-btn { - background: #4cacff!important; - margin-right: 16px; - margin-top: 16px; -} -/* md编辑器 resizeBar*/ - .tpmComment .commentItemMDEditor .editor__resize { - transform: translateX(-176%) -} - -#ratePanel > div > div > div.fr div.rateYo.fl.mt3 { - height: 20px; - line-height: 20px; - cursor: default; - width: 90px; -} - -.tpmComment .icon-jiangli { - /* margin-top: 2px; */ +.tpmComment .-fit { + position: inherit; +} +.tpmComment .rc-pagination { + margin-left: auto; + margin-right: auto; + margin-top: 12px; + margin-bottom: 20px; +} +.tpmComment .paginationSection { + background: #FAFAFA; +} +.tpmComment .comment_item_cont.df.clearfix:nth-last-child(1) { + border-bottom: none; +} + +/*.tpmComment .fl.edu-back-white {*/ +/*min-height: 600px;*/ +/*}*/ + + +.user_watch_btn { + cursor: pointer; +} + + +/*md编辑器*/ +.tpmComment .commentItemMDEditor a.task-btn { + background: #4cacff!important; + margin-right: 16px; + margin-top: 16px; +} +/* md编辑器 resizeBar*/ + .tpmComment .commentItemMDEditor .editor__resize { + transform: translateX(-176%) +} + +#ratePanel > div > div > div.fr div.rateYo.fl.mt3 { + height: 20px; + line-height: 20px; + cursor: default; + width: 110px; +} + +.tpmComment .icon-jiangli { + /* margin-top: 2px; */ } \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css index a6a7acc9a..fe059fccd 100644 --- a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css +++ b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css @@ -8,7 +8,7 @@ .rateYo{ text-align: center; cursor: default; - width: 90px; + width: 111px; } a:link, a:visited { From 16129e60fcffe603c9fa67a197b977022c84491a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 13:01:52 +0800 Subject: [PATCH 24/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/home/shixunsHome.js | 12 ++++- public/react/src/modules/tpm/TPMBanner.js | 50 ++++++++++++------- .../src/modules/tpm/TPMFork/TPMForklist.js | 16 ++++-- .../src/modules/tpm/shixuns/ShixunCard.js | 32 ++++++++++-- 4 files changed, 81 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 11f17fa3b..97e8e52a0 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -109,7 +109,15 @@ class ShixunsHome extends Component { homedatalistreps.push(homedatalist.reps[homedatalist.reps.length-i-1]) } } - + const MyRate = ({ defaultValue, ...rest }) => { + let myValue = defaultValue; + console.log(myValue-Math.floor(myValue)) + // if (myValue < Math.ceil(myValue)) { + // myValue = Math.floor(myValue) + 0.5; + // } + + return ; + }; return (
      {this.state.updata===undefined?"": - + {item.score_info===null?"5分":item.score_info+"分"}

      diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 70e837bec..979b4b6f7 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -569,6 +569,15 @@ class TPMBanner extends Component { }; const antIcon = ; + const MyRate = ({ defaultValue, ...rest }) => { + let myValue = defaultValue; + console.log(myValue-Math.floor(myValue)) + // if (myValue < Math.ceil(myValue)) { + // myValue = Math.floor(myValue) + 0.5; + // } + + return ; + }; return ( shixunsDetails===undefined?"": @@ -607,18 +616,21 @@ class TPMBanner extends Component {

      - + {/**/}
      • 学习人数 @@ -638,7 +650,7 @@ class TPMBanner extends Component {
        this.showonMouseOver()} onMouseOut={()=>this.hideonMouseOut()}>
        学员评分
        - +
        this.hideonMouseOut()}>
        @@ -651,7 +663,7 @@ class TPMBanner extends Component { 总评分
        {showradios === true ? - + : ""}
        @@ -660,7 +672,7 @@ class TPMBanner extends Component {
        {showradios === true ? - + : ""}
        @@ -669,7 +681,7 @@ class TPMBanner extends Component {
        {showradios === true ? - + : ""}
        @@ -678,7 +690,7 @@ class TPMBanner extends Component {
        {showradios === true ? - + : ""}
        @@ -687,7 +699,7 @@ class TPMBanner extends Component {
        {showradios === true ? - + : ""}
        @@ -696,7 +708,7 @@ class TPMBanner extends Component {
        {showradios === true ? - + : ""}
        diff --git a/public/react/src/modules/tpm/TPMFork/TPMForklist.js b/public/react/src/modules/tpm/TPMFork/TPMForklist.js index c8af10e4d..a98e5f995 100644 --- a/public/react/src/modules/tpm/TPMFork/TPMForklist.js +++ b/public/react/src/modules/tpm/TPMFork/TPMForklist.js @@ -88,7 +88,15 @@ export default class TPMFork_listComponent extends Component { let {shixuns, total_count, shixunsID, Forkvisible, Forkcurrent} = this.state; - + const MyRate = ({ defaultValue, ...rest }) => { + let myValue = defaultValue; + console.log(myValue-Math.floor(myValue)) + // if (myValue < Math.ceil(myValue)) { + // myValue = Math.floor(myValue) + 0.5; + // } + + return ; + }; return (
        @@ -141,9 +149,9 @@ export default class TPMFork_listComponent extends Component {

        - - - + + + {item.score_info===null?"5分":item.score_info+"分"}

        diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index 28b0117d0..9c3dc0058 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -11,7 +11,7 @@ import { Rating ,Pagination} from "@icedesign/base"; import {getImageUrl,setImagesUrl, toPath} from 'educoder'; -import { Spin,Icon,Tooltip } from 'antd'; +import { Spin,Icon,Tooltip ,Rate} from 'antd'; import './shixunCss/shixunCard.css'; @@ -46,6 +46,15 @@ class ShixunCard extends Component { render() { let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props; + const MyRate = ({ defaultValue, ...rest }) => { + let myValue = defaultValue; + console.log(myValue-Math.floor(myValue)) + // if (myValue < Math.ceil(myValue)) { + // myValue = Math.floor(myValue) + 0.5; + // } + + return ; + }; return (
        @@ -113,12 +122,27 @@ class ShixunCard extends Component {

        {/*target="_blank"*/} - + {/**/}

        - + {/**/} + - {item.score_info===null?"5分":item.score_info+"分"} + {item.score_info===null?"5分":item.score_info+"分"}

        From d4737b3aa2f4483b04cd0c7a387e29bb52b793c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 21 Sep 2019 13:11:18 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/home/shixunsHome.js | 2 +- public/react/src/modules/tpm/TPMFork/TPMForklist.js | 2 +- public/react/src/modules/tpm/shixuns/ShixunCard.js | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index 97e8e52a0..06127f671 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -351,7 +351,7 @@ class ShixunsHome extends Component {

        - + {item.score_info===null?"5分":item.score_info+"分"}

        diff --git a/public/react/src/modules/tpm/TPMFork/TPMForklist.js b/public/react/src/modules/tpm/TPMFork/TPMForklist.js index a98e5f995..6f700ad04 100644 --- a/public/react/src/modules/tpm/TPMFork/TPMForklist.js +++ b/public/react/src/modules/tpm/TPMFork/TPMForklist.js @@ -150,7 +150,7 @@ export default class TPMFork_listComponent extends Component {

        - + {item.score_info===null?"5分":item.score_info+"分"}

        diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index 9c3dc0058..3fcf95269 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -78,10 +78,11 @@ class ShixunCard extends Component {
        + // style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "none" : "block"}} + >
        - { middleshixundata===undefined?" ":middleshixundata.map((item,key)=>{ + {middleshixundata === undefined || middleshixundata.length === 0?" ":middleshixundata.map((item,key)=>{ return(