Merge branch 'develop' into educoder

dev_shixuns
cxt 6 years ago
commit 008a1412f1

4
.gitignore vendored

@ -46,3 +46,7 @@ config/oneapm.yml
/public/npm-debug.log /public/npm-debug.log
/vendor /vendor
/workspace/* /workspace/*
.ruby-gemset
.rvmrc

@ -10,7 +10,7 @@ module Mobile
desc "ecloud接口测试" desc "ecloud接口测试"
post 'list' do post 'list' do
EcloudService.new.list EcloudService.new.list(params)
end end
end end

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

@ -0,0 +1,3 @@
// Place all the styles related to the ecloud controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -274,6 +274,7 @@ class ApplicationController < ActionController::Base
true true
end end
def require_admin def require_admin
return unless require_login return unless require_login
if !User.current.admin? if !User.current.admin?

@ -2,6 +2,8 @@
class EcCourseSupportsController < ApplicationController class EcCourseSupportsController < ApplicationController
before_filter :find_year, :except => [:edit_require_vs_course, :destroy_require_vs_course] before_filter :find_year, :except => [:edit_require_vs_course, :destroy_require_vs_course]
skip_before_filter :verify_authenticity_token, :only => [:create, :edit_require_vs_course, :destroy_require_vs_course] skip_before_filter :verify_authenticity_token, :only => [:create, :edit_require_vs_course, :destroy_require_vs_course]
before_filter :require_login
before_filter :ec_auth, :except => [:edit_require_vs_course, :destroy_require_vs_course]
############################################################################### ###############################################################################
# 毕业要求vs课程体系 # 毕业要求vs课程体系
@ -216,4 +218,11 @@ class EcCourseSupportsController < ApplicationController
def find_year def find_year
@year = EcYear.find(params[:ec_year_id]) @year = EcYear.find(params[:ec_year_id])
end end
# 职业认证的权限判断
def ec_auth
unless User.current.admin? || (User.current.ec_school.present? && @year.ec_major_school.school_id == User.current.ec_school)
render_403
end
end
end end

@ -3,6 +3,8 @@ class EcCoursesController < ApplicationController
layout 'base_ec' layout 'base_ec'
before_filter :find_ec_course, :except => [:create, :get_calculation_data, :sync_all_course_data] before_filter :find_ec_course, :except => [:create, :get_calculation_data, :sync_all_course_data]
before_filter :find_year, :only => [:create, :get_calculation_data] before_filter :find_year, :only => [:create, :get_calculation_data]
before_filter :require_login
before_filter :ec_auth, :except => [:sync_all_course_data]
skip_before_filter :verify_authenticity_token, :only => [:crud_targets, :crud_score_level, :sync_all_course_data, :search_courses, skip_before_filter :verify_authenticity_token, :only => [:crud_targets, :crud_score_level, :sync_all_course_data, :search_courses,
:correlation_course, :delete_course] :correlation_course, :delete_course]
@ -77,7 +79,8 @@ class EcCoursesController < ApplicationController
end end
calculation_data << {first_level: first_level, first_leval_data: first_leval_data} calculation_data << {first_level: first_level, first_leval_data: first_leval_data}
end end
render :json => {calculation_data: calculation_data, calculation_value: @year.calculation_value, course_ids: course_ids.uniq} render :json => {calculation_data: calculation_data, calculation_value: @year.calculation_value, course_ids: course_ids.uniq,
is_manager: @template_major}
end end
# 课程目标配置 # 课程目标配置
@ -100,6 +103,12 @@ class EcCoursesController < ApplicationController
end end
end end
def ec_course_support_setting_data
course_targets = @ec_course.ec_course_targets.includes(:ec_graduation_subitems)
json_data = target_list_data(course_targets)
render :json => json_data
end
# 课程目标配置的更新操作() # 课程目标配置的更新操作()
# /ec_courses/1/crud_targets # /ec_courses/1/crud_targets
def crud_targets def crud_targets
@ -414,6 +423,8 @@ class EcCoursesController < ApplicationController
def score_level def score_level
respond_to do |format| respond_to do |format|
format.html{ format.html{
Rails.logger.info("1111111111111111111template_major: #{@template_major}")
Rails.logger.info("1111111111111111111is_manager: #{@is_manager}")
render "/common/index", :layout => false render "/common/index", :layout => false
} }
format.json{ format.json{
@ -434,6 +445,22 @@ class EcCoursesController < ApplicationController
end end
end end
def score_level_data
levels = @ec_course.ec_score_levels
ls = []
if levels.present?
levels.each do |l|
ls << {score: l.score, level: l.level}
end
else
ls = [{score: 90, level: ""},
{score: 80, level: ""},
{score: 70, level: ""},
{score: 60, level: ""}]
end
render :json => {levels: ls, is_manager: @is_manager}
end
def crud_score_level def crud_score_level
levels = params[:levels] levels = params[:levels]
render :json => {status: -1, message: "参数不能为空"} if levels.blank? render :json => {status: -1, message: "参数不能为空"} if levels.blank?
@ -574,6 +601,13 @@ class EcCoursesController < ApplicationController
#@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id) #@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id)
end end
# 职业认证的权限判断
def ec_auth
unless User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == @ec_major_school.school_id)
render_403
end
end
def target_list_data course_targets def target_list_data course_targets
targets = [] targets = []
course_targets.each do |ct| course_targets.each do |ct|
@ -595,6 +629,10 @@ class EcCoursesController < ApplicationController
end end
end end
Rails.logger.info("111111111111111user_id: #{User.current.try(:id)}")
Rails.logger.info("template_major: #{@template_major}")
Rails.logger.info("is_manager: #{@is_manager}")
return {ec_year_id: @ec_course.ec_year_id, ec_course_id: @ec_course.id, course_targets: targets, return {ec_year_id: @ec_course.ec_year_id, ec_course_id: @ec_course.id, course_targets: targets,
requirements: requirements, is_manager: @is_manager} requirements: requirements, is_manager: @is_manager}
end end

@ -2,7 +2,10 @@
class EcMajorSchoolsController < ApplicationController class EcMajorSchoolsController < ApplicationController
layout "base_ec" layout "base_ec"
before_filter :require_login
before_filter :find_major_school, :except => [:get_navigation_data] before_filter :find_major_school, :except => [:get_navigation_data]
before_filter :ec_auth, :except => [:get_navigation_data]
def show def show
@years = @major_school.ec_years @years = @major_school.ec_years
@ -125,7 +128,8 @@ class EcMajorSchoolsController < ApplicationController
evaluation_methods_url: evaluation_methods_url, evaluation_methods_url: evaluation_methods_url,
competition_calculation_info_url: competition_calculation_info_url, competition_calculation_info_url: competition_calculation_info_url,
score_level_setting_url: score_level_setting_url, score_level_setting_url: score_level_setting_url,
example_major: example_major example_major: example_major,
allow_visit: User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == major.school.id)
} }
end end
@ -181,4 +185,11 @@ class EcMajorSchoolsController < ApplicationController
# 管理员权限 # 管理员权限
@major_manager = User.current.admin? || @major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) || @major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id) @major_manager = User.current.admin? || @major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) || @major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
end end
# 职业认证的权限判断
def ec_auth
unless User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == @major_school.school_id)
render_403
end
end
end end

@ -3,6 +3,9 @@ class EcYearsController < ApplicationController
layout "base_ec" layout "base_ec"
before_filter :find_major_and_year, except: [:create] before_filter :find_major_and_year, except: [:create]
before_filter :require_login
before_filter :ec_auth, except: [:create]
#before_filter :find_year, only: [:set_calculation_value] #before_filter :find_year, only: [:set_calculation_value]
skip_before_filter :verify_authenticity_token, :only => [:import_students, :set_calculation_value, :destroy_students] skip_before_filter :verify_authenticity_token, :only => [:import_students, :set_calculation_value, :destroy_students]
require 'simple_xlsx_reader' require 'simple_xlsx_reader'
@ -54,37 +57,38 @@ class EcYearsController < ApplicationController
format.html { format.html {
render "/common/index", :layout => false render "/common/index", :layout => false
} }
format.json { end
template_file = EcTemplate.find_by_name "学生列表导入模板" end
if template_file.present?
file = template_file.attachments.first
template_url = "/attachments/download/#{file.id}/#{file.filename}"
else
template_url = "javascript:void(0);"
end
students = @year.ec_year_students
show_name = @year.ec_year_students.where(:name => nil).count == 0
page = params[:page] || 1 def student_lists_data
total_student = students.count template_file = EcTemplate.find_by_name "学生列表导入模板"
total_page = (total_student / 50.0).ceil if template_file.present?
students = paginateHelper students, 50 file = template_file.attachments.first
template_url = "/attachments/download/#{file.id}/#{file.filename}"
else
template_url = "javascript:void(0);"
end
ec_students = [] students = @year.ec_year_students
students.each_with_index do |student, index| show_name = @year.ec_year_students.where(:name => nil).count == 0
student = {index: (50*(page.to_i - 1) + index + 1),
student_name: student.name,
student_id: student.student_id}
ec_students << student
end
import_url = "/ec_major_schools/#{@ec_major_school.id}/academic_years/#{@year.id}/import_students" page = params[:page] || 1
total_student = students.count
total_page = (total_student / 50.0).ceil
students = paginateHelper students, 50
render :json => {template_url: template_url, ec_students: ec_students, total_page: total_page, import_url: import_url, ec_students = []
show_name: show_name, :total_student => total_student} students.each_with_index do |student, index|
} student = {index: (50*(page.to_i - 1) + index + 1),
student_name: student.name,
student_id: student.student_id}
ec_students << student
end end
import_url = "/ec_major_schools/#{@ec_major_school.id}/academic_years/#{@year.id}/import_students"
render :json => {template_url: template_url, ec_students: ec_students, total_page: total_page, import_url: import_url,
show_name: show_name, :total_student => total_student, :is_manager => @template_major}
end end
# DELETE: /ec_major_schools/:major_id/academic_years/:year_id/destroy_students # DELETE: /ec_major_schools/:major_id/academic_years/:year_id/destroy_students
@ -346,6 +350,13 @@ class EcYearsController < ApplicationController
@template_major = User.current.admin? || @ec_major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) || @ec_major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id) @template_major = User.current.admin? || @ec_major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) || @ec_major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
end end
# 职业认证的权限判断
def ec_auth
unless User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == @ec_major_school.school_id)
render_403
end
end
def find_year def find_year
@year = EcYear.find(params[:id]) @year = EcYear.find(params[:id])
end end
@ -387,6 +398,14 @@ class EcYearsController < ApplicationController
new_egs.save! new_egs.save!
# 记录新旧对应关系,为之后的中间表做记录 # 记录新旧对应关系,为之后的中间表做记录
egs_record << [pre_egs.id, new_egs.id] egs_record << [pre_egs.id, new_egs.id]
prev_ersvss = EcRequireSubVsStandard.where(:ec_graduation_subitem_id => pre_egs.id)
prev_ersvss.each do |prev_ersvs|
new_ersvss = EcRequireSubVsStandard.new
new_ersvss.attributes = prev_ersvs.attributes.dup.except("id", "ec_graduation_subitem_id")
new_ersvss.ec_graduation_subitem_id = new_egs.id
new_ersvss.save!
end
end end
end end
@ -398,28 +417,29 @@ class EcYearsController < ApplicationController
new_eto.ec_year_id = ec_year.id new_eto.ec_year_id = ec_year.id
new_eto.save! new_eto.save!
# 复制 "毕业要去 vs 培养目标"
pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_eto.id)
pre_ervsos.each do |ervso|
new_ervso = EcRequirementVsObjective.new
new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id")
new_ervso.ec_training_objective_id = new_eto.id
new_egr_id = -1
egr_record.each do |egr_id|
if egr_id[0] == ervso.id
new_egr_id = egr_id[1]
end
end
raise("找不对应的毕业要求") if new_egr_id == -1
new_ervso.ec_graduation_requirement_id = new_egr_id
end
# 复制 "培养目标分项" # 复制 "培养目标分项"
pre_eto.ec_training_subitems.try(:each) do |pre_ets| pre_eto.ec_training_subitems.try(:each) do |pre_ets|
new_ets = EcTrainingSubitem.new new_ets = EcTrainingSubitem.new
new_ets.attributes = pre_ets.attributes.dup.except("id", "ec_training_objective_id") new_ets.attributes = pre_ets.attributes.dup.except("id", "ec_training_objective_id")
new_ets.ec_training_objective_id = new_eto.id new_ets.ec_training_objective_id = new_eto.id
new_ets.save! new_ets.save!
# 复制 "毕业要去 vs 培养目标"
pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_ets.id)
pre_ervsos.each do |ervso|
new_ervso = EcRequirementVsObjective.new
new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id")
new_ervso.ec_training_objective_id = new_ets.id
new_egr_id = -1
egr_record.each do |egr_id|
if egr_id[0] == ervso.ec_graduation_requirement_id
new_egr_id = egr_id[1]
end
end
raise("找不对应的毕业要求") if new_egr_id == -1
new_ervso.ec_graduation_requirement_id = new_egr_id
new_ervso.save!
end
end end
end end

@ -0,0 +1,198 @@
#encoding=utf-8
require 'net/http'
require 'digest'
class EcloudController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :check_sign
before_filter :user_setup
# before_filter :require_login, only: [:authorize]
skip_before_filter :verify_authenticity_token, only: [:ps_new, :ps_update, :bs_new, :bs_update, :ecloud_login_callback]
def index
render file: 'public/react-oschina/build/index.html', :layout => false
end
def trustie_login
end
CLIENT_ID = '1022'
CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668'
ROOT_URl = 'http://localhost:3000'
SERVER_URL = "https://221.176.54.92:9081/restful/services/"
## 签名
def sign(timestamp)
Digest::MD5.hexdigest("client_id=#{CLIENT_ID}client_key=#{CLIENT_SECRET}timestamp=#{timestamp}").upcase
end
# 企业开通
# ecordercode 唯一标志一个企业的订购关系
def bs_new
ActiveRecord::Base.transaction do
begin
ecloud = Ecloud.create!(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'],
trial: params['trial'], bossorderid: params['bossorderid'], custid: params['custid'], custtype: params['custtype'],
custcode: params['custcode'], registersource: params['registersource'], custname: params['custname'],
userid: params['userid'], username: params['username'], useralias: params['useralias'], mobile: params['mobile'],
email: params['email'], productcode: params['productcode'], begintime: params['begintime'],
endtime: params['endtime'])
services = params['services'].first
EcloudService.create(opttype: services['opttype'], code: services['code'], begintime: services['begintime'],
endtime: services['endtime'], ecloud_id: ecloud.try(:id))
render :json => {result: true, errmsg: ""}
rescue Exception => e
logger.error(e.message)
render :json => {code: 500, msg: "#{e.message}"}
raise ActiveRecord::Rollback
end
end
end
# 企业更新
def bs_update
ActiveRecord::Base.transaction do
begin
ecloud = Ecloud.where(custid: params['custid']).first
ecloud.update_attributes!(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'],
custid: params['custid'], custcode: params['custcode'], productcode: params['productcode'],
operatime: params['operatime'], effecttime: params['effecttime'])
services = params['services'].first
ecloud.ecloud_service.update_attributes!(packagecode: services['packagecode'], bossorderid: services['bossorderid'])
render :json => {result: true, errmsg: ""}
rescue Exception => e
logger.error(e.message)
render :json => {code: 500, msg: "#{e.message}"}
raise ActiveRecord::Rollback
end
end
end
# 用户业务开通接口
def ps_new
begin
user_param = params['users'].first
ecloud_user = EcloudUser.where(:custid => params['custid'], :userid => user_param['userid']).first
if ecloud_user.present?
render :json => {code: 500, msg: "你已开通过该业务"}
else
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
username: user_param['username'], useralias: user_param['useralias'],
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
endtime: user_param['endtime'].to_s)
render :json => {success: true, errmsg: ""}
end
rescue Exception => e
logger.error(e.message)
render :json => {code: 500, msg: "#{e.message}"}
end
end
# 用户业务变更、销毁接口
def ps_update
begin
user_param = params['users'].first
ecloud_user = EcloudUser.where(:custid => params['custid'], :userid => user_param['userid']).first
if ecloud_user.present?
ecloud_user.update_attributes(opttype: user_param['opttype'])
render :json => {success: true, errmsg: ""}
else
render :json => {code: 404, msg: "企业ID不存在"}
end
rescue Exception => e
logger.error(e.message)
render :json => {code: 500, msg: "#{e.message}"}
end
end
def ecloud_login_callback
#获取code
logger.info "oauth2 login_callback: #{params}"
raise "没有code" unless params[:code]
url = "#{SERVER_URL}/oauth2/authorization?grant_type=authorization_code" +
"&client_id=#{CLIENT_ID}&scope=&redirect_uri=&code=#{params[:code]}"
res = post(url)
logger.info "oauth2 authorization resp: #{res}"
body = decode(res)
#{"access_token":"21a80f20ff736b54aecd002b60210943","token_type":"bearer","expires_in":86400,"refresh_token":"be92e2c137a8c6dd22f0d8c4a622b3aeceb054087a95d293130f04ec60fd3e3f","scope":"user_info","created_at":1542684088}
raise '登录失败' unless body["access_token"]
#获取此用户信息
# res = get("https://gitee.com/api/v5/user?access_token=#{body["access_token"]}")
res = get("#{SERVER_URL}/user/info?access_token=#{body['access_token']}&userid=#{body['uid']}")
logger.info "oauth2 get user info: #{res}"
# 同步用户
# info = decode(res)
#
# user = User.find_by_oschina_user_id(info["id"])
# unless user
# user = User.create_with_oschina!(info)
# end
#
# @current_user = user
render :index
end
private
def get(url)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Get.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
#req.body = {a: 1}.to_json
http.request(req)
end
res.body
end
def post(url)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Post.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
#req.body = {a: 1}.to_json
http.request(req)
end
res.body
end
def decode(s)
begin
obj = ActiveSupport::JSON.decode(s)
rescue ActiveSupport::JSON.parse_error
logger.error("Attempted to decode invalid JSON: #{s}")
end
end
private
def check_sign
sign = sign(params['timestamp'])
if sign != params['sign']
render :json => {code: 501, msg: "sign的值错误"}
return
end
end
end

@ -1,5 +1,7 @@
class EcsController < ApplicationController class EcsController < ApplicationController
before_filter :find_school, :except => [:get_navigation_url] before_filter :find_school, :except => [:get_navigation_url]
before_filter :require_login
before_filter :ec_auth, :except => [:get_navigation_url]
layout 'base_ec' layout 'base_ec'
def department def department
@ -62,4 +64,11 @@ class EcsController < ApplicationController
def find_school def find_school
@school = School.find(params[:school_id]) @school = School.find(params[:school_id])
end end
# 职业认证的权限判断
def ec_auth
unless User.current.admin? || (User.current.ec_school.present? && User.current.ec_school == @school.id)
render_403
end
end
end end

@ -1,6 +1,6 @@
#encoding: utf-8 #encoding: utf-8
class OauthController < ApplicationController class OauthController < ApplicationController
require
include ApplicationHelper include ApplicationHelper
before_filter :user_setup before_filter :user_setup

@ -0,0 +1,2 @@
module EcloudHelper
end

@ -0,0 +1,7 @@
class Ecloud < ActiveRecord::Base
attr_accessible :applyno, :begintime, :bossorderid, :custcode, :custid, :custname, :custtype, :ecordercode, :endtime,
:mobile, :opttype, :productcode, :registersource, :string, :trial, :useralias, :userid, :username, :email,
:effecttime, :operatime
has_one :ecloud_user
has_one :ecloud_service
end

@ -0,0 +1,3 @@
class EcloudService < ActiveRecord::Base
attr_accessible :begintime, :code, :endtime, :opttype, :ecloud_id, :packagecode, :bossorderid
end

@ -0,0 +1,3 @@
class EcloudUser < ActiveRecord::Base
attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid
end

@ -0,0 +1,3 @@
class EcloudUser < ActiveRecord::Base
attr_accessible :begintime, :email, :endtime, :mobile, :opttype, :paras, :useralias, :userid, :username, :custid
end

@ -1,6 +1,7 @@
class EcloudService class EcloudService
def list def list params
return {status: 0, message: "test"}
return {status: 0, message: "test", code: params[:code], params: params}
end end
end end

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.3274c43b.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.9f01900e.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.32605315.js"></script></body></html>

@ -53,9 +53,9 @@
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>','您确定要删除吗?')" class="mr15 color-grey-c">删除</a> <a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>','您确定要删除吗?')" class="mr15 color-grey-c">删除</a>
<% end %> <% end %>
<%#= link_to '删除', ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school), method: :delete, :class => "mr15 color-grey-c", data: { confirm: '您确定要删除吗' } %> <%#= link_to '删除', ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school), method: :delete, :class => "mr15 color-grey-c", data: { confirm: '您确定要删除吗' } %>
<% if @major_manager || @major_school.template_major %> <%# if @major_manager || @major_school.template_major %>
<a href="javascript:void(0)" data-tip-down="导出本学年所有数据" class="mr15 color-blue">导出</a> <!--<a href="javascript:void(0)" data-tip-down="导出本学年所有数据" class="mr15 color-blue">导出</a>-->
<% end %> <%# end %>
<%= link_to @btn_text, training_objectives_ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %> <%= link_to @btn_text, training_objectives_ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>
</span> </span>

@ -46,13 +46,16 @@
</label> </label>
</span> </span>
<span class="column-11 edu-txt-center"> <span class="column-11 edu-txt-center">
<label class="color-red-dd">
<% if course.ec_course_targets.count == 0 %> <% if course.ec_course_targets.count == 0 %>
-- --
<% else %> <% else %>
<%= course.complete_target_count == course.ec_course_targets.count ? "达成" : "未达成" %> <% if course.complete_target_count == course.ec_course_targets.count %>
<label class="color-green">达成</label>
<% else %>
<label class="color-red-dd">未达成</label>
<% end %>
<%#= course.complete_target_count == course.ec_course_targets.count ? "达成" : "未达成" %>
<% end %> <% end %>
</label>
</span> </span>
<span class="column-10 fl edu-txt-left"> <span class="column-10 fl edu-txt-left">
<% if course_manager || @template_major %> <% if course_manager || @template_major %>

@ -9,7 +9,7 @@
<li class="clearfix"> <li class="clearfix">
<span class="column-No">0</span> <span class="column-No">0</span>
<span class="column-2">000000</span> <span class="column-2">000000</span>
<span class="column-3 task-hide"><a href="javascript:void(0)"><%= @template_major.name %>(示例)</a></span> <span class="column-3 task-hide"><a href="<%= ec_major_school_path(@template_major) %>"><%= @template_major.name %>(示例)</a></span>
<span class="column-5"> <span class="column-5">
<a href="<%= ec_major_school_path(@template_major) %>" class="color-blue" target="_blank"><%= User.current.admin? ? "配置" : "查看" %></a> <a href="<%= ec_major_school_path(@template_major) %>" class="color-blue" target="_blank"><%= User.current.admin? ? "配置" : "查看" %></a>
</span> </span>
@ -19,7 +19,7 @@
<li class="clearfix" id="major_list_<%= major_school.id %>"> <li class="clearfix" id="major_list_<%= major_school.id %>">
<span class="column-No major_index"><%= index + 1 %></span> <span class="column-No major_index"><%= index + 1 %></span>
<span class="column-2"><%= major_school.code %></span> <span class="column-2"><%= major_school.code %></span>
<span class="column-3 task-hide"><a href="javascript:void(0)"><%= major_school.name %></a></span> <span class="column-3 task-hide"><a href="<%= ec_major_school_path(major_school) %>"><%= major_school.name %></a></span>
<span class="column-4"> <span class="column-4">
<% if major_manager %> <% if major_manager %>
<a href="javascript:void(0)" data-major-id="<%= major_school.id %>" class="color-blue mr5 mt-3 fl addMajorManager"><i class="iconfont icon-tianjiafangda"></i></a> <a href="javascript:void(0)" data-major-id="<%= major_school.id %>" class="color-blue mr5 mt-3 fl addMajorManager"><i class="iconfont icon-tianjiafangda"></i></a>
@ -29,7 +29,7 @@
</p> </p>
</span> </span>
<span class="column-5"> <span class="column-5">
<% if major_manager %> <% if @is_school_manager %>
<a href="javascript:void(0)" class="mr15 color-grey-c" onclick="delete_confirm_box_2('<%= ec_major_school_path(major_school) %>','是否确认删除')">删除</a> <a href="javascript:void(0)" class="mr15 color-grey-c" onclick="delete_confirm_box_2('<%= ec_major_school_path(major_school) %>','是否确认删除')">删除</a>
<% end %> <% end %>
<a href="<%= ec_major_school_path(major_school) %>" class="color-blue"><%= major_manager ? "配置" : "查看" %></a> <a href="<%= ec_major_school_path(major_school) %>" class="color-blue"><%= major_manager ? "配置" : "查看" %></a>

@ -1,6 +1,6 @@
<% major_school.users.each do |user| %> <% major_school.users.each do |user| %>
<span class="MajorName"><%= user.show_real_name %> <span class="MajorName"><%= user.show_real_name %>
<% if @is_school_manager || major_school.users.where(:id => User.current.id).count > 0 %> <% if @is_school_manager %>
<i class="iconfont icon-htmal5icon19 font-16" onclick="delete_confirm_box_2('<%= delete_manager_ec_major_school_path(major_school, :user_id => user.id) %>','是否确认删除')"></i> <i class="iconfont icon-htmal5icon19 font-16" onclick="delete_confirm_box_2('<%= delete_manager_ec_major_school_path(major_school, :user_id => user.id) %>','是否确认删除')"></i>
<% end %> <% end %>
</span> </span>

@ -0,0 +1,9 @@
Gitlab.configure do |config|
# config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
# config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
config.endpoint = 'http://testbdgit.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
config.private_token = 's89kqsMPtF8YLZSLyVmF' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
# Optional
# config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'
# config.sudo = 'user' # username for sudo mode, default: nil
end

@ -26,12 +26,19 @@
# Example: :via => :get ====> :via => :get # Example: :via => :get ====> :via => :get
RedmineApp::Application.routes.draw do ## oauth相关 RedmineApp::Application.routes.draw do ## oauth相关
match 'oauth', to: 'oauth#index' match 'oauth', to: 'oauth#index'
match 'oauth/authorize', to: 'oauth#authorize', :via => [:get, :post] match 'oauth/authorize', to: 'oauth#authorize', :via => [:get, :post]
match 'oauth/token', to: 'oauth#token', :via => :post match 'oauth/token', to: 'oauth#token', :via => :post
match 'oauth/cb', to: 'oauth#test_callback', :via => :get match 'oauth/cb', to: 'oauth#test_callback', :via => :get
match 'oauth/userinfo', to: 'oauth#get_userinfo', :via => :get match 'oauth/userinfo', to: 'oauth#get_userinfo', :via => :get
get 'ecloud/ecloud_login', to: 'ecloud#ecloud_login_callback'
post 'ecloud/bs_new', to: 'ecloud#bs_new'
post 'ecloud/bs_update', to: 'ecloud#bs_update'
post 'ecloud/ps_new', to: 'ecloud#ps_new'
post 'ecloud/ps_update', to: 'ecloud#ps_update'
resources :ec_course_evaluations do resources :ec_course_evaluations do
member do member do
@ -61,6 +68,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'add_manager' post 'add_manager'
delete 'delete_manager' delete 'delete_manager'
get "ec_course_support_setting" get "ec_course_support_setting"
get "ec_course_support_setting_data"
get "ec_course_reach_setting" get "ec_course_reach_setting"
get "evaluation_methods" get "evaluation_methods"
match "search_courses", :via => [:get, :post] match "search_courses", :via => [:get, :post]
@ -74,6 +82,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'crud_targets' post 'crud_targets'
post 'crud_score_level' post 'crud_score_level'
get 'score_level' get 'score_level'
get 'score_level_data'
end end
collection do collection do
get 'get_calculation_data' get 'get_calculation_data'
@ -136,6 +145,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
resources :ec_years, :path => "academic_years" do resources :ec_years, :path => "academic_years" do
member do member do
get 'student_lists' get 'student_lists'
get 'student_lists_data'
match 'import_students', :via => [:post] match 'import_students', :via => [:post]
get 'training_objectives' get 'training_objectives'
get 'graduation_requirement' get 'graduation_requirement'

@ -0,0 +1,30 @@
class CreateEcloudusers < ActiveRecord::Migration
def change
create_table :ecloudusers do |t|
t.string :applyno
t.string :ecordercoder
t.string :string
t.integer :opttype
t.boolean :trial
t.string :bossorderid
t.integer :custid
t.string :custcod
t.string :string
t.integer :custtype
t.integer :registersource
t.string :custname
t.integer :userid
t.string :username
t.string :useralias
t.string :moblile
t.string :email
t.string :productcode
t.datetime :begintime
t.datetime :endtime
t.string :productparas
t.string :services
t.timestamps
end
end
end

@ -0,0 +1,18 @@
class CreateEcloudUser < ActiveRecord::Migration
def change
create_table :ecloud_users do |t|
t.integer :opttype
t.integer :userid
t.string :username
t.string :useralias
t.string :mobile
t.string :email
t.string :begintime
t.string :endtime
t.string :paras
t.integer :custid
t.timestamps
end
end
end

@ -0,0 +1,25 @@
class CreateEclouds < ActiveRecord::Migration
def change
create_table :eclouds do |t|
t.string :applyno
t.string :ecordercode
t.integer :opttype
t.boolean :trial
t.string :bossorderid
t.integer :custid
t.string :custcode
t.integer :registersource
t.integer :custtype
t.string :custname
t.integer :userid
t.string :username
t.string :useralias
t.string :mobile
t.string :productcode
t.string :begintime
t.string :endtime
t.timestamps
end
end
end

@ -0,0 +1,13 @@
class CreateEcloudServices < ActiveRecord::Migration
def change
create_table :ecloud_services do |t|
t.integer :opttype
t.string :code
t.string :begintime
t.string :endtime
t.integer :ecloud_id
t.timestamps
end
end
end

@ -0,0 +1,5 @@
class AddIndexToEcloud < ActiveRecord::Migration
def change
add_index :eclouds, [:ecordercode, :custcode], :unique => true, :name => 'ecorder_cust_code'
end
end

@ -0,0 +1,5 @@
class AddEmailToEcloud < ActiveRecord::Migration
def change
add_column :eclouds, :email, :string
end
end

@ -0,0 +1,6 @@
class AddPackagecodeToEcloudServices < ActiveRecord::Migration
def change
add_column :ecloud_services, :packagecode, :string
add_column :ecloud_services, :bossorderid, :string
end
end

@ -0,0 +1,6 @@
class AddOperatimeToEcloud < ActiveRecord::Migration
def change
add_column :eclouds, :operatime, :string
add_column :eclouds, :effecttime, :string
end
end

@ -0,0 +1,46 @@
#coding=utf-8
require 'net/http'
require 'uri'
module Trustie
module Http
def get(url)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Get.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
#req.body = {a: 1}.to_json
http.request(req)
end
res.body
end
def post(url, data=nil)
uri = URI(url)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
req = Net::HTTP::Post.new(uri)
#req['Content-Type'] = 'application/json'
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
req.body = data if data
http.request(req)
end
res.body
end
def decode(s)
begin
obj = ActiveSupport::JSON.decode(s)
rescue ActiveSupport::JSON.parse_error
logger.error("Attempted to decode invalid JSON: #{s}")
end
end
end
end

@ -1,30 +1,30 @@
{ {
"./static/js/0.d15cdb8c.chunk.js": "./static/js/0.d15cdb8c.chunk.js", "./static/js/0.6b9d3c60.chunk.js": "./static/js/0.6b9d3c60.chunk.js",
"./static/js/0.d15cdb8c.chunk.js.map": "./static/js/0.d15cdb8c.chunk.js.map", "./static/js/0.6b9d3c60.chunk.js.map": "./static/js/0.6b9d3c60.chunk.js.map",
"./static/js/1.b37de40f.chunk.js": "./static/js/1.b37de40f.chunk.js", "./static/js/1.5f152c98.chunk.js": "./static/js/1.5f152c98.chunk.js",
"./static/js/1.b37de40f.chunk.js.map": "./static/js/1.b37de40f.chunk.js.map", "./static/js/1.5f152c98.chunk.js.map": "./static/js/1.5f152c98.chunk.js.map",
"./static/js/10.0b59b6d9.chunk.js": "./static/js/10.0b59b6d9.chunk.js", "./static/js/10.2464b0fd.chunk.js": "./static/js/10.2464b0fd.chunk.js",
"./static/js/10.0b59b6d9.chunk.js.map": "./static/js/10.0b59b6d9.chunk.js.map", "./static/js/10.2464b0fd.chunk.js.map": "./static/js/10.2464b0fd.chunk.js.map",
"./static/js/11.03d0c22e.chunk.js": "./static/js/11.03d0c22e.chunk.js", "./static/js/11.03d0c22e.chunk.js": "./static/js/11.03d0c22e.chunk.js",
"./static/js/11.03d0c22e.chunk.js.map": "./static/js/11.03d0c22e.chunk.js.map", "./static/js/11.03d0c22e.chunk.js.map": "./static/js/11.03d0c22e.chunk.js.map",
"./static/js/12.33ef9274.chunk.js": "./static/js/12.33ef9274.chunk.js", "./static/js/12.ef7290f1.chunk.js": "./static/js/12.ef7290f1.chunk.js",
"./static/js/12.33ef9274.chunk.js.map": "./static/js/12.33ef9274.chunk.js.map", "./static/js/12.ef7290f1.chunk.js.map": "./static/js/12.ef7290f1.chunk.js.map",
"./static/js/13.84649bc7.chunk.js": "./static/js/13.84649bc7.chunk.js", "./static/js/13.1ca007d2.chunk.js": "./static/js/13.1ca007d2.chunk.js",
"./static/js/13.84649bc7.chunk.js.map": "./static/js/13.84649bc7.chunk.js.map", "./static/js/13.1ca007d2.chunk.js.map": "./static/js/13.1ca007d2.chunk.js.map",
"./static/js/14.57622e23.chunk.js": "./static/js/14.57622e23.chunk.js", "./static/js/14.29e80958.chunk.js": "./static/js/14.29e80958.chunk.js",
"./static/js/14.57622e23.chunk.js.map": "./static/js/14.57622e23.chunk.js.map", "./static/js/14.29e80958.chunk.js.map": "./static/js/14.29e80958.chunk.js.map",
"./static/js/15.cd2747c4.chunk.js": "./static/js/15.cd2747c4.chunk.js", "./static/js/15.0dcec662.chunk.js": "./static/js/15.0dcec662.chunk.js",
"./static/js/15.cd2747c4.chunk.js.map": "./static/js/15.cd2747c4.chunk.js.map", "./static/js/15.0dcec662.chunk.js.map": "./static/js/15.0dcec662.chunk.js.map",
"./static/js/16.e8e3aa00.chunk.js": "./static/js/16.e8e3aa00.chunk.js", "./static/js/16.e8e3aa00.chunk.js": "./static/js/16.e8e3aa00.chunk.js",
"./static/js/16.e8e3aa00.chunk.js.map": "./static/js/16.e8e3aa00.chunk.js.map", "./static/js/16.e8e3aa00.chunk.js.map": "./static/js/16.e8e3aa00.chunk.js.map",
"./static/js/17.db50ac9a.chunk.js": "./static/js/17.db50ac9a.chunk.js", "./static/js/17.b9f5064d.chunk.js": "./static/js/17.b9f5064d.chunk.js",
"./static/js/17.db50ac9a.chunk.js.map": "./static/js/17.db50ac9a.chunk.js.map", "./static/js/17.b9f5064d.chunk.js.map": "./static/js/17.b9f5064d.chunk.js.map",
"./static/js/18.e8b5b490.chunk.js": "./static/js/18.e8b5b490.chunk.js", "./static/js/18.5fe45ac4.chunk.js": "./static/js/18.5fe45ac4.chunk.js",
"./static/js/18.e8b5b490.chunk.js.map": "./static/js/18.e8b5b490.chunk.js.map", "./static/js/18.5fe45ac4.chunk.js.map": "./static/js/18.5fe45ac4.chunk.js.map",
"./static/js/19.5f9a9263.chunk.js": "./static/js/19.5f9a9263.chunk.js", "./static/js/19.5f9a9263.chunk.js": "./static/js/19.5f9a9263.chunk.js",
"./static/js/19.5f9a9263.chunk.js.map": "./static/js/19.5f9a9263.chunk.js.map", "./static/js/19.5f9a9263.chunk.js.map": "./static/js/19.5f9a9263.chunk.js.map",
"./static/js/2.48f59130.chunk.js": "./static/js/2.48f59130.chunk.js", "./static/js/2.eb0d1091.chunk.js": "./static/js/2.eb0d1091.chunk.js",
"./static/js/2.48f59130.chunk.js.map": "./static/js/2.48f59130.chunk.js.map", "./static/js/2.eb0d1091.chunk.js.map": "./static/js/2.eb0d1091.chunk.js.map",
"./static/js/20.6efcbe58.chunk.js": "./static/js/20.6efcbe58.chunk.js", "./static/js/20.6efcbe58.chunk.js": "./static/js/20.6efcbe58.chunk.js",
"./static/js/20.6efcbe58.chunk.js.map": "./static/js/20.6efcbe58.chunk.js.map", "./static/js/20.6efcbe58.chunk.js.map": "./static/js/20.6efcbe58.chunk.js.map",
"./static/js/21.6e5a22af.chunk.js": "./static/js/21.6e5a22af.chunk.js", "./static/js/21.6e5a22af.chunk.js": "./static/js/21.6e5a22af.chunk.js",
@ -37,38 +37,38 @@
"./static/js/24.e1553222.chunk.js.map": "./static/js/24.e1553222.chunk.js.map", "./static/js/24.e1553222.chunk.js.map": "./static/js/24.e1553222.chunk.js.map",
"./static/js/25.7f05ced8.chunk.js": "./static/js/25.7f05ced8.chunk.js", "./static/js/25.7f05ced8.chunk.js": "./static/js/25.7f05ced8.chunk.js",
"./static/js/25.7f05ced8.chunk.js.map": "./static/js/25.7f05ced8.chunk.js.map", "./static/js/25.7f05ced8.chunk.js.map": "./static/js/25.7f05ced8.chunk.js.map",
"./static/js/26.00916fb9.chunk.js": "./static/js/26.00916fb9.chunk.js", "./static/js/26.e3927d38.chunk.js": "./static/js/26.e3927d38.chunk.js",
"./static/js/26.00916fb9.chunk.js.map": "./static/js/26.00916fb9.chunk.js.map", "./static/js/26.e3927d38.chunk.js.map": "./static/js/26.e3927d38.chunk.js.map",
"./static/js/27.85a886e8.chunk.js": "./static/js/27.85a886e8.chunk.js", "./static/js/27.d2f21a4d.chunk.js": "./static/js/27.d2f21a4d.chunk.js",
"./static/js/27.85a886e8.chunk.js.map": "./static/js/27.85a886e8.chunk.js.map", "./static/js/27.d2f21a4d.chunk.js.map": "./static/js/27.d2f21a4d.chunk.js.map",
"./static/js/28.db5cbded.chunk.js": "./static/js/28.db5cbded.chunk.js", "./static/js/28.db5cbded.chunk.js": "./static/js/28.db5cbded.chunk.js",
"./static/js/28.db5cbded.chunk.js.map": "./static/js/28.db5cbded.chunk.js.map", "./static/js/28.db5cbded.chunk.js.map": "./static/js/28.db5cbded.chunk.js.map",
"./static/js/29.95e5a009.chunk.js": "./static/js/29.95e5a009.chunk.js", "./static/js/29.95e5a009.chunk.js": "./static/js/29.95e5a009.chunk.js",
"./static/js/29.95e5a009.chunk.js.map": "./static/js/29.95e5a009.chunk.js.map", "./static/js/29.95e5a009.chunk.js.map": "./static/js/29.95e5a009.chunk.js.map",
"./static/js/3.a357162e.chunk.js": "./static/js/3.a357162e.chunk.js", "./static/js/3.123eae7e.chunk.js": "./static/js/3.123eae7e.chunk.js",
"./static/js/3.a357162e.chunk.js.map": "./static/js/3.a357162e.chunk.js.map", "./static/js/3.123eae7e.chunk.js.map": "./static/js/3.123eae7e.chunk.js.map",
"./static/js/30.3482c43d.chunk.js": "./static/js/30.3482c43d.chunk.js", "./static/js/30.92e2f4a6.chunk.js": "./static/js/30.92e2f4a6.chunk.js",
"./static/js/30.3482c43d.chunk.js.map": "./static/js/30.3482c43d.chunk.js.map", "./static/js/30.92e2f4a6.chunk.js.map": "./static/js/30.92e2f4a6.chunk.js.map",
"./static/js/31.3edb9173.chunk.js": "./static/js/31.3edb9173.chunk.js", "./static/js/31.3edb9173.chunk.js": "./static/js/31.3edb9173.chunk.js",
"./static/js/31.3edb9173.chunk.js.map": "./static/js/31.3edb9173.chunk.js.map", "./static/js/31.3edb9173.chunk.js.map": "./static/js/31.3edb9173.chunk.js.map",
"./static/js/32.23fc5ec4.chunk.js": "./static/js/32.23fc5ec4.chunk.js", "./static/js/32.23fc5ec4.chunk.js": "./static/js/32.23fc5ec4.chunk.js",
"./static/js/32.23fc5ec4.chunk.js.map": "./static/js/32.23fc5ec4.chunk.js.map", "./static/js/32.23fc5ec4.chunk.js.map": "./static/js/32.23fc5ec4.chunk.js.map",
"./static/js/4.a72da972.chunk.js": "./static/js/4.a72da972.chunk.js", "./static/js/4.a563b706.chunk.js": "./static/js/4.a563b706.chunk.js",
"./static/js/4.a72da972.chunk.js.map": "./static/js/4.a72da972.chunk.js.map", "./static/js/4.a563b706.chunk.js.map": "./static/js/4.a563b706.chunk.js.map",
"./static/js/5.1853fe23.chunk.js": "./static/js/5.1853fe23.chunk.js", "./static/js/5.459a49ba.chunk.js": "./static/js/5.459a49ba.chunk.js",
"./static/js/5.1853fe23.chunk.js.map": "./static/js/5.1853fe23.chunk.js.map", "./static/js/5.459a49ba.chunk.js.map": "./static/js/5.459a49ba.chunk.js.map",
"./static/js/6.070d1eab.chunk.js": "./static/js/6.070d1eab.chunk.js", "./static/js/6.83516b55.chunk.js": "./static/js/6.83516b55.chunk.js",
"./static/js/6.070d1eab.chunk.js.map": "./static/js/6.070d1eab.chunk.js.map", "./static/js/6.83516b55.chunk.js.map": "./static/js/6.83516b55.chunk.js.map",
"./static/js/7.1ad7321f.chunk.js": "./static/js/7.1ad7321f.chunk.js", "./static/js/7.accad232.chunk.js": "./static/js/7.accad232.chunk.js",
"./static/js/7.1ad7321f.chunk.js.map": "./static/js/7.1ad7321f.chunk.js.map", "./static/js/7.accad232.chunk.js.map": "./static/js/7.accad232.chunk.js.map",
"./static/js/8.d5642b7b.chunk.js": "./static/js/8.d5642b7b.chunk.js", "./static/js/8.69fefc71.chunk.js": "./static/js/8.69fefc71.chunk.js",
"./static/js/8.d5642b7b.chunk.js.map": "./static/js/8.d5642b7b.chunk.js.map", "./static/js/8.69fefc71.chunk.js.map": "./static/js/8.69fefc71.chunk.js.map",
"./static/js/9.c6b81c3d.chunk.js": "./static/js/9.c6b81c3d.chunk.js", "./static/js/9.e77edf45.chunk.js": "./static/js/9.e77edf45.chunk.js",
"./static/js/9.c6b81c3d.chunk.js.map": "./static/js/9.c6b81c3d.chunk.js.map", "./static/js/9.e77edf45.chunk.js.map": "./static/js/9.e77edf45.chunk.js.map",
"main.css": "./static/css/main.3274c43b.css", "main.css": "./static/css/main.c95e49c6.css",
"main.css.map": "./static/css/main.3274c43b.css.map", "main.css.map": "./static/css/main.c95e49c6.css.map",
"main.js": "./static/js/main.9f01900e.js", "main.js": "./static/js/main.32605315.js",
"main.js.map": "./static/js/main.9f01900e.js.map", "main.js.map": "./static/js/main.32605315.js.map",
"static/media/ERASBD.ttf": "static/media/ERASBD.d5213044.ttf", "static/media/ERASBD.ttf": "static/media/ERASBD.d5213044.ttf",
"static/media/background1.png": "static/media/background1.a34df396.png", "static/media/background1.png": "static/media/background1.a34df396.png",
"static/media/background2.png": "static/media/background2.22ee659e.png", "static/media/background2.png": "static/media/background2.22ee659e.png",

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/css/css_min_all.css"><link rel="stylesheet" href="http://testbdweb.educoder.net/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.3274c43b.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/js/js_min_all.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/js/create_kindeditor.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.9f01900e.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/css/css_min_all.css"><link rel="stylesheet" href="http://testbdweb.educoder.net/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/js/js_min_all.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/js/create_kindeditor.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.32605315.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
webpackJsonp([30],{1788:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n.n(i),u=n(595),l=n(322),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=function(e){function t(){var e,n,c,i;o(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=c=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),c.fetchPosts=function(){(0,c.props.dispatch)(Object(u.c)())},i=n,r(c,i)}return c(t,e),s(t,[{key:"componentDidMount",value:function(){console.log("TestRealWorldRedux "),this.fetchPosts()}},{key:"render",value:function(){var e=this.props,t=e.memo_list,n=e.isFetching;return a.a.createElement("div",null,"TestRealWorldRedux",t.length,a.a.createElement("p",null,n?"isFetching":"fetched"),a.a.createElement("button",{onClick:this.fetchPosts},"fetch again"))}}]),t}(a.a.Component),p=function(e){var t=(e.counter,e.testRealWorld);return{memo_list:t.memo_list,isFetching:t.isFetching}};t.default=Object(l.connect)(p)(f)}}); webpackJsonp([30],{1788:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n.n(i),u=n(595),l=n(321),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=function(e){function t(){var e,n,c,i;o(this,t);for(var a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return n=c=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),c.fetchPosts=function(){(0,c.props.dispatch)(Object(u.c)())},i=n,r(c,i)}return c(t,e),s(t,[{key:"componentDidMount",value:function(){console.log("TestRealWorldRedux "),this.fetchPosts()}},{key:"render",value:function(){var e=this.props,t=e.memo_list,n=e.isFetching;return a.a.createElement("div",null,"TestRealWorldRedux",t.length,a.a.createElement("p",null,n?"isFetching":"fetched"),a.a.createElement("button",{onClick:this.fetchPosts},"fetch again"))}}]),t}(a.a.Component),p=function(e){var t=(e.counter,e.testRealWorld);return{memo_list:t.memo_list,isFetching:t.isFetching}};t.default=Object(l.connect)(p)(f)}});
//# sourceMappingURL=30.3482c43d.chunk.js.map //# sourceMappingURL=30.92e2f4a6.chunk.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -41,7 +41,8 @@ class EcCompletionCalculation extends Component {
completionlist:"", completionlist:"",
course_total_scoreaverage:0, course_total_scoreaverage:0,
calculatesetype:false, calculatesetype:false,
Spintype:false Spintype:false,
ismanager:false
} }
} }
@ -58,6 +59,9 @@ class EcCompletionCalculation extends Component {
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({ this.setState({
schooldata:response.data, schooldata:response.data,
ec_course_id:ec_course_id ec_course_id:ec_course_id
@ -76,6 +80,9 @@ class EcCompletionCalculation extends Component {
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({ this.setState({
schooldata:response.data, schooldata:response.data,
ec_course_id:ec_course_id ec_course_id:ec_course_id
@ -139,7 +146,8 @@ class EcCompletionCalculation extends Component {
target_score:response.data.target_score, target_score:response.data.target_score,
ec_course_targets_count:response.data.ec_course_targets_count, ec_course_targets_count:response.data.ec_course_targets_count,
morelisttype:newmorelisttype, morelisttype:newmorelisttype,
course_total_scoreaverage:course_total_scoreaverage course_total_scoreaverage:course_total_scoreaverage,
ismanager:response.data.is_manager
}) })
@ -287,7 +295,7 @@ class EcCompletionCalculation extends Component {
}) })
} }
render() { render() {
let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist} = this.state; let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
let TargetresList = (length) => { let TargetresList = (length) => {
let target_listres = []; let target_listres = [];
@ -461,14 +469,14 @@ class EcCompletionCalculation extends Component {
evaluate_result===false?<span className="Systemnum">未达成</span>:<span className="Systemnum color-green"></span> evaluate_result===false?<span className="Systemnum">未达成</span>:<span className="Systemnum color-green"></span>
} }
</span> */} </span> */}
<span className="right newrightcalculatebutton" <span className={ismanager===false?"none":"right newrightcalculatebutton"}
style={{ style={{
marginLeft: '26px', marginLeft: '26px',
position: 'absolute', position: 'absolute',
right: '157px' right: '157px'
}} }}
onClick={this.newrightcalculatebutton}>计算</span> onClick={this.newrightcalculatebutton}>计算</span>
<span className="Importclassroomdata" style={{top: "26px"}}> <span className={ismanager===false?"none":"Importclassroomdata"} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a> <a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span> </span>
</div> </div>

@ -72,6 +72,9 @@ class ecCourseEvaluations extends Component {
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({ this.setState({
schooldata:response.data schooldata:response.data
}) })
@ -867,9 +870,9 @@ class ecCourseEvaluations extends Component {
{/*课程考核方式与数据来源*/} {/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */} {/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.associatedclass} style={{display:course_url===""?"block":"none"}}>关联课堂</a> <a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.associatedclass} style={{display:course_url===""&&ecmanager===true?"block":"none"}}>关联课堂</a>
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.deleteassociatedclass} style={{display:course_url===""?"none":"block"}}>取消关联</a> <a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.deleteassociatedclass} style={{display:course_url===""||ecmanager===false?"none":"block"}}>取消关联</a>
<span className="Importclassroomdata" style={{top: '22px'}}> <span className="Importclassroomdata" style={{top: '22px',display:ecmanager===false?"none":""}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a> <a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span> </span>
</p> </p>
@ -893,17 +896,17 @@ class ecCourseEvaluations extends Component {
style={{display:schooldata.competition_calculation_info_url===null?"none":"block"}} style={{display:schooldata.competition_calculation_info_url===null?"none":"block"}}
href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a> href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a>
<span className="fr ml20 SystemParameters" style={{display:course_url===""?"none":"block",height:'37px'}}><span className="ecblock">在线课堂:</span> <span className="fr ml20 SystemParameters" style={{display:course_url===""||ecmanager===false?"none":"block",height:'37px'}}><span className="ecblock">在线课堂:</span>
<Tooltip placement="bottom" title={course_name}> {ecmanager===false?"":<Tooltip placement="bottom" title={course_name}>
<a href={course_url} target="_blank" className="ecnowrap" <a href={course_url} target="_blank" className="ecnowrap"
style={{marginRight: '123px'}} style={{marginRight: '123px'}}
>{course_name}</a> >{course_name}</a>
</Tooltip> </Tooltip>}
</span> </span>
<span className="fl" style={{display:course_name===null||course_name===undefined?"block":"none",padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color: '#989898',marginTop: '-13px'}}>请在完成配置后使用各项成绩导入模板将本学年所有参与的学生成绩数据导入系统</span> <span className="fl" style={{display:course_name===null||course_name===undefined?"block":"none",padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color: '#989898',marginTop: '-13px'}}>请在完成配置后使用各项成绩导入模板将本学年所有参与的学生成绩数据导入系统</span>
<span className="Importclassroomdata" style={{display:course_url===""?"none":"block"}}><a onClick={this.sync_course_data} className="white-btn edu-orangeback-btn fr mt2 mr10">导入课堂数据</a></span> <span className="Importclassroomdata" style={{display:course_url===""||ecmanager===false?"none":"block"}}><a onClick={this.sync_course_data} className="white-btn edu-orangeback-btn fr mt2 mr10">导入课堂数据</a></span>
{/* style={{lineHeight:'23px'}}*/} {/* style={{lineHeight:'23px'}}*/}
</div> </div>
@ -921,11 +924,12 @@ class ecCourseEvaluations extends Component {
style={{width: '34px'}} style={{width: '34px'}}
> >
{/* 操作 */} {/* 操作 */}
{ecmanager===false?"":
<a className="mr20 newAddSubentry" data-tip-down="添加"> <a className="mr20 newAddSubentry" data-tip-down="添加">
<i className="iconfont icon-tianjiafangda color-green" <i className="iconfont icon-tianjiafangda color-green"
style={{display:savetype==='add'||savetype==='edit'?'none':'inline-block'}} style={{display:savetype==='add'||savetype==='edit'?'none':'inline-block'}}
onClick={this.AddCourseEvaluations}></i> onClick={this.AddCourseEvaluations}></i>
</a> </a>}
</span> </span>
<span className="column-2 operationright color-666" style={{width: "126px"}}> <span className="column-2 operationright color-666" style={{width: "126px"}}>
@ -1017,38 +1021,44 @@ class ecCourseEvaluations extends Component {
</span> </span>
<span className="column-1 detaillist mr20" style={{width:'156px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}> <span className="column-1 detaillist mr20" style={{width:'156px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}>
<a href={list.export_url+'?type=1'} style={{display:list.is_course_type===false?"block":"none"}}> <a href={ecmanager===false?"":list.export_url+'?type=1'} style={{display:list.is_course_type===false?"block":"none"}}>
<div className="color-green" <div className={ecmanager===false?"color-white":"color-green"}>
><i className="iconfont icon-fujian mr5 color-green font-16"></i></div> <i className={ecmanager===false?"color-white":"iconfont icon-fujian mr5 color-green font-16"}></i>
</div>
</a> </a>
</span> </span>
<span className="column-1" style={{paddingLeft: '13px',width:"127px",display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}> <span className="column-1" style={{paddingLeft: '13px',width:"127px",display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}>
<a href={list.export_url+'?type=2'} style={{display:list.is_course_type===false?"block":"none"}}> <a href={ecmanager===false?"":list.export_url+'?type=2'} style={{display:list.is_course_type===false?"block":"none"}}>
<div className="color-green" <div className={ecmanager===false?"color-white":"color-green"}
><i className="iconfont icon-fujian mr5 color-green font-16"></i></div> ><i className={ecmanager===false?"color-white":"iconfont icon-fujian mr5 color-green font-16"}></i></div>
</a> </a>
</span> </span>
<span className="column-1" style={{width: "121px",marginRight:'-5px',paddingLeft: '24px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}> <span className="column-1" style={{width: "121px",marginRight:'-5px',paddingLeft: '24px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}>
<div className="operationColumn"> <div className="operationColumn">
<div className="left operationalter" style={{display:list.is_course_type===false?'block':'none'}}> <div className="left operationalter" style={{display:list.is_course_type===false?'block':'none'}}>
<Upload <Upload
{...uploadProps} {...uploadProps}
data={list.id} data={list.id}
showUploadList={false} showUploadList={false}
> >
<span className="delSubentry" idkey={m}>成绩导入</span> {ecmanager===false?<span className="color-white" idkey={m}>成绩导入</span>:<span className="delSubentry" idkey={m}></span>}
</Upload> </Upload>
</div> </div>
</div> </div>
</span> </span>
<span className="column-2" style={{marginLeft: '-8px',width:'96px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}> {ecmanager===false?""
: <span className="column-2" style={{marginLeft: '-8px',width:'96px',display:savetype==='edit'&&parseInt(idkey)===m?'none':'inline-block'}}>
<div style={{display:list.is_course_type===false?"block":"none"}} <div style={{display:list.is_course_type===false?"block":"none"}}
>{list.import_status===true||list.is_course_type?"已导入":"未导入"}</div> >{list.import_status===true||list.is_course_type?"已导入":"未导入"}</div>
</span> </span>}
<div className="ListTableLine newSystem" style={{display:parseInt(idkey)===m?'block':'none'}}> <div className="ListTableLine newSystem" style={{display:parseInt(idkey)===m?'block':'none'}}>
@ -1124,7 +1134,7 @@ class ecCourseEvaluations extends Component {
}) })
} }
<div className="ListTableLine newSystem" id="EvaluationsList" style={{display:'none'}}> {ecmanager===false?"": <div className="ListTableLine newSystem" id="EvaluationsList" style={{display:'none'}}>
{ {
@ -1189,9 +1199,8 @@ class ecCourseEvaluations extends Component {
) )
}) })
} }
</div> </div>
}
</div> </div>
</div> </div>

@ -46,7 +46,8 @@ class EcCourseEvaluationsbottom extends Component {
methodologytype:false, methodologytype:false,
meweacoursetype:false, meweacoursetype:false,
newshowredvalue:false, newshowredvalue:false,
percentagetype:false percentagetype:false,
ismanager:false
} }
} }
getec_course_achievement_methods=()=>{ getec_course_achievement_methods=()=>{
@ -59,7 +60,8 @@ class EcCourseEvaluationsbottom extends Component {
.then((response)=>{ .then((response)=>{
this.setState({ this.setState({
achievement_list:response.data.achievement_list, achievement_list:response.data.achievement_list,
spinningstate:false spinningstate:false,
ismanager:response.data.is_manager
}) })
}).catch(function (error) { }).catch(function (error) {
console.log(error); console.log(error);
@ -96,6 +98,9 @@ class EcCourseEvaluationsbottom extends Component {
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({ this.setState({
schooldata:response.data schooldata:response.data
}) })
@ -115,7 +120,8 @@ class EcCourseEvaluationsbottom extends Component {
.then((response)=>{ .then((response)=>{
this.setState({ this.setState({
achievement_list:response.data.achievement_list, achievement_list:response.data.achievement_list,
spinningstate:false spinningstate:false,
ismanager:response.data.is_manager
}) })
}).catch(function (error) { }).catch(function (error) {
console.log(error); console.log(error);
@ -218,7 +224,8 @@ class EcCourseEvaluationsbottom extends Component {
evaluation_subitems_list:newevaluation_subitems_list, evaluation_subitems_list:newevaluation_subitems_list,
newec_course_target_id:id, newec_course_target_id:id,
methodologytype:true, methodologytype:true,
ec_course_target_name:response.data.ec_course_target_name ec_course_target_name:response.data.ec_course_target_name,
ismanager:response.data.is_manager
}) })
// this.setState({ // this.setState({
@ -426,7 +433,8 @@ class EcCourseEvaluationsbottom extends Component {
.then((response)=>{ .then((response)=>{
this.setState({ this.setState({
achievement_list:response.data.achievement_list, achievement_list:response.data.achievement_list,
spinningstate:false spinningstate:false,
ismanager:response.data.is_manager
}) })
}).catch(function (error) { }).catch(function (error) {
@ -565,7 +573,8 @@ class EcCourseEvaluationsbottom extends Component {
meweacoursetype:false, meweacoursetype:false,
achievement_methods:undefined, achievement_methods:undefined,
eacoursesavetypes:false, eacoursesavetypes:false,
newshowredvalue:false newshowredvalue:false,
ismanager:response.data.is_manager
}) })
// $("#ecCourseEvaluationsbottomsubmit").hide(); // $("#ecCourseEvaluationsbottomsubmit").hide();
// $("#SystemParametersbottom").hide(); // $("#SystemParametersbottom").hide();
@ -649,7 +658,8 @@ class EcCourseEvaluationsbottom extends Component {
methodologytype, methodologytype,
newec_course_idbottom, newec_course_idbottom,
meweacoursetype, meweacoursetype,
percentagetype percentagetype,
ismanager
} = this.state; } = this.state;
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
@ -763,7 +773,7 @@ class EcCourseEvaluationsbottom extends Component {
</span> </span>
<span className="column-1 operationright mt4"> <span className="column-1 operationright mt4">
<div className="operationColumn"> <div className="operationColumn">
<div className="right operationalter nulleditSubentry" style={{display:schooldata.template_major===false?'none':'block'}}> <div className="right operationalter nulleditSubentry" style={{display:ismanager===false?'none':'block'}}>
<a className="mr16 editSubentry" data-tip-down="编辑" ><i target_id={item.target_id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a> <a className="mr16 editSubentry" data-tip-down="编辑" ><i target_id={item.target_id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a>
</div> </div>
</div> </div>
@ -840,7 +850,7 @@ class EcCourseEvaluationsbottom extends Component {
onInput={this.handevaluation_CoursePercentag.bind(this)} id={itemkey} style={{ width: '11%' }} placeholder="请输入占比"/> onInput={this.handevaluation_CoursePercentag.bind(this)} id={itemkey} style={{ width: '11%' }} placeholder="请输入占比"/>
<span className="column-1 ml5 mr10">%</span> <span className="column-1 ml5 mr10">%</span>
<span className="buttoninline SetTheAssociated" style={{marginLeft:'10px'}}> <span className="buttoninline SetTheAssociated" style={{marginLeft:'10px'}}>
<div className="left operatebutton" style={{display:schooldata.template_major===false?'none':'block'}}> <div className="left operatebutton" style={{display:ismanager===false?'none':'block'}}>
<a className="mr15 delSubentry" style={{display:itemkey===0?'none':'inline-block'}}> <a className="mr15 delSubentry" style={{display:itemkey===0?'none':'inline-block'}}>
<Tooltip placement="bottom" title="删除"> <Tooltip placement="bottom" title="删除">
<i className="iconfont icon-shanchu color-grey-c font-17" index={itemkey} onClick={this.Delethandevaluation.bind(this)}></i> <i className="iconfont icon-shanchu color-grey-c font-17" index={itemkey} onClick={this.Delethandevaluation.bind(this)}></i>
@ -890,7 +900,7 @@ class EcCourseEvaluationsbottom extends Component {
{ {
key-k===key?<span className="column-1 operationright mt4"> key-k===key?<span className="column-1 operationright mt4">
<div className="operationColumn"> <div className="operationColumn">
<div className="right operationalter neweditSubentry" style={{display:schooldata.template_major===false?'none':'block'}}> <div className="right operationalter neweditSubentry" style={{display:ismanager===false?'none':'block'}}>
<a className="mr20 editSubentry" data-tip-down="编辑" ><i target_id={item.target_id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a> <a className="mr20 editSubentry" data-tip-down="编辑" ><i target_id={item.target_id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a>
</div> </div>
</div> </div>
@ -978,7 +988,7 @@ class EcCourseEvaluationsbottom extends Component {
placeholder="请输入占比"/> placeholder="请输入占比"/>
<span className="column-1 ml5 mr10">%</span> <span className="column-1 ml5 mr10">%</span>
<span className="buttoninline SetTheAssociated" style={{marginLeft:'10px'}}> <span className="buttoninline SetTheAssociated" style={{marginLeft:'10px'}}>
<div className="left operatebutton" style={{display:schooldata.template_major===false?'none':'block'}}> <div className="left operatebutton" style={{display:ismanager===false?'none':'block'}}>
<a className="mr15 delSubentry" style={{display:achievement_methods.length===1?'none':'inline-block'}}> <a className="mr15 delSubentry" style={{display:achievement_methods.length===1?'none':'inline-block'}}>
<Tooltip placement="bottom" title="删除"> <Tooltip placement="bottom" title="删除">
<i className="iconfont icon-shanchu color-grey-c font-17" index={itemkey} onClick={this.Delethandevaluation.bind(this)}></i> <i className="iconfont icon-shanchu color-grey-c font-17" index={itemkey} onClick={this.Delethandevaluation.bind(this)}></i>

@ -196,6 +196,10 @@ class EditableCourseSupportSetting extends Component {
} }
handleSubmit = (e) => { handleSubmit = (e) => {
if (!this.props.is_manager) {
this.props.showModal('提示', '您没权限编辑,请联系管理员。')
return;
}
this.setState({ errorMsg: '' }) this.setState({ errorMsg: '' })
e.preventDefault && e.preventDefault(); e.preventDefault && e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {

@ -33,6 +33,7 @@ class ShowTableCourseSupportSetting extends Component {
render() { render() {
const course_targets = this.props.course_targets; const course_targets = this.props.course_targets;
const is_manager = this.props.is_manager;
return ( return (
<div className="ListTableLine" id="show-Target-table"> <div className="ListTableLine" id="show-Target-table">
<p className="clearfix"> <p className="clearfix">
@ -46,11 +47,11 @@ class ShowTableCourseSupportSetting extends Component {
<i className="iconfont icon-tianjiafangda"></i> <i className="iconfont icon-tianjiafangda"></i>
</a> */} </a> */}
<a href="javascript:void(0)" { is_manager && <a href="javascript:void(0)"
onClick={() => { this.props.setEditableMode(true)} } onClick={() => { this.props.setEditableMode(true)} }
class="color-green EditCourse" data-id="5" data-tip-down="编辑"> class="color-green EditCourse" data-id="5" data-tip-down="编辑">
<i class="iconfont icon-bianjidaibeijing"></i> <i class="iconfont icon-bianjidaibeijing"></i>
</a> </a> }
</span> </span>
</p> </p>
<div id="course_targets_list"> <div id="course_targets_list">

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save