dev_SaaS
jingquan huang 6 years ago
commit 91c95a7988

@ -2,6 +2,7 @@
class EcCourseAchievementMethodsController < ApplicationController class EcCourseAchievementMethodsController < ApplicationController
before_filter :find_target, :only => [:edit_course_target, :create_evaluation_methods] before_filter :find_target, :only => [:edit_course_target, :create_evaluation_methods]
skip_before_filter :verify_authenticity_token, :only => [:create_evaluation_methods, :sync_course_data] skip_before_filter :verify_authenticity_token, :only => [:create_evaluation_methods, :sync_course_data]
before_filter :find_ec_course, :only => [:index]
include ApplicationHelper include ApplicationHelper
@ -59,11 +60,9 @@ class EcCourseAchievementMethodsController < ApplicationController
############################################################### ###############################################################
def index def index
achievement_list = [] achievement_list = []
# 具体工程课程
ec_course = EcCourse.find params[:ec_course_id]
# 课程的所有目标 # 课程的所有目标
targets = ec_course.ec_course_targets targets = @ec_course.ec_course_targets
targets.each do |target| targets.each do |target|
evaluate_data = [] evaluate_data = []
# 评价环节 # 评价环节
@ -95,7 +94,7 @@ class EcCourseAchievementMethodsController < ApplicationController
end end
achievement_list << {target_id: target.id, target_evaluate_data: evaluate_data} achievement_list << {target_id: target.id, target_evaluate_data: evaluate_data}
end end
render :json => {achievement_list: achievement_list} render :json => {achievement_list: achievement_list, is_manager: @is_manager}
end end
@ -306,4 +305,13 @@ class EcCourseAchievementMethodsController < ApplicationController
@target = EcCourseTarget.find params[:ec_course_target_id] @target = EcCourseTarget.find params[:ec_course_target_id]
end end
def find_ec_course
@ec_course = EcCourse.find(params[:ec_course_id])
@year = @ec_course.ec_year
@ec_major_school = @year.ec_major_school
@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)
@is_manager = @template_major || @ec_course.ec_course_users.pluck(:user_id).include?(User.current.id)
end
end end

@ -47,6 +47,8 @@ class EcCourseSupportsController < ApplicationController
course_support_data = [] course_support_data = []
max_support_count = 0 max_support_count = 0
subitems_count = 0 subitems_count = 0
major_school = @year.ec_major_school
is_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)
ec_graduation_requirements.each_with_index do |gr, i| ec_graduation_requirements.each_with_index do |gr, i|
logger.info("#############index:#{i}#####_ec_gradiation_reqiorements: #{gr.id}") logger.info("#############index:#{i}#####_ec_gradiation_reqiorements: #{gr.id}")
subitems_count += gr.ec_graduation_subitems.count subitems_count += gr.ec_graduation_subitems.count
@ -74,7 +76,8 @@ class EcCourseSupportsController < ApplicationController
subitems_url: "#{graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", subitems_url: "#{graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
course_count: @year.ec_courses.count, course_count: @year.ec_courses.count,
course_url: "#{ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}", course_url: "#{ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
max_support_count: max_support_count} max_support_count: max_support_count,
is_manager: is_manager}
end end
# 毕业要求vs课程体系 详情页面 # 毕业要求vs课程体系 详情页面

@ -77,7 +77,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
# 课程目标配置 # 课程目标配置
@ -429,7 +430,7 @@ class EcCoursesController < ApplicationController
{score: 70, level: ""}, {score: 70, level: ""},
{score: 60, level: ""}] {score: 60, level: ""}]
end end
render :json => {levels: ls} render :json => {levels: ls, is_manager: @is_manager}
} }
end end
end end

@ -125,7 +125,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?,
} }
end end

@ -387,6 +387,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
@ -397,12 +405,30 @@ class EcYearsController < ApplicationController
new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id") new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id")
new_eto.ec_year_id = ec_year.id new_eto.ec_year_id = ec_year.id
new_eto.save! new_eto.save!
# 复制 "培养目标分项" # 复制 "培养目标分项"
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

@ -115,6 +115,9 @@ class EcloudController < ApplicationController
def ecloud_login_callback def ecloud_login_callback
#获取code #获取code
logger.info "oauth2 login_callback: #{params}" logger.info "oauth2 login_callback: #{params}"
raise "没有code" unless params[:code]
url = "#{SERVER_URL}/oauth2/authorization?grant_type=authorization_code" + url = "#{SERVER_URL}/oauth2/authorization?grant_type=authorization_code" +
"&client_id=#{CLIENT_ID}&scope=&redirect_uri=&code=#{params[:code]}" "&client_id=#{CLIENT_ID}&scope=&redirect_uri=&code=#{params[:code]}"

@ -245,6 +245,8 @@ class User < Principal
has_many :ec_major_schools, :through => :ec_major_school_users has_many :ec_major_schools, :through => :ec_major_school_users
has_many :ec_major_school_users, :dependent => :destroy has_many :ec_major_school_users, :dependent => :destroy
has_many :ec_course_users
##### #####
scope :logged, lambda { where("#{User.table_name}.status <> #{STATUS_ANONYMOUS}") } scope :logged, lambda { where("#{User.table_name}.status <> #{STATUS_ANONYMOUS}") }
@ -344,6 +346,14 @@ class User < Principal
end end
end end
} }
# 工程认证的学校
def ec_school
school_id = self.ec_school_users.pluck(:school_id).first ||
self.ec_major_schools.pluck(:school_id).first ||
(self.ec_course_users.first && self.ec_course_users.first.try(:ec_course).try(:ec_year).try(:ec_major_school).try(:school_id))
end
def challenge_tags def challenge_tags
games = self.games.where(:id => self.experiences.map(&:container_id), :status => 2) games = self.games.where(:id => self.experiences.map(&:container_id), :status => 2)
challenge_tags = ChallengeTag.where(:challenge_id => games.map(&:challenge_id)).where("name != ''") challenge_tags = ChallengeTag.where(:challenge_id => games.map(&:challenge_id)).where("name != ''")

@ -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.80b6ec5e.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.60c226df.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.80b6ec5e.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.7d62a5b7.js"></script></body></html>

@ -26,7 +26,7 @@
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
<% else %> <% elsif @template_major %>
<form id="form_data_for_requirements"> <form id="form_data_for_requirements">
<div class="clearfix ml30 mr30 pt20 pb20 bor-top-greyE" id="requirementNew"> <div class="clearfix ml30 mr30 pt20 pb20 bor-top-greyE" id="requirementNew">
<p class="df mb20"><input type="hidden" name="year_id" value="<%= @year.id %>"> <p class="df mb20"><input type="hidden" name="year_id" value="<%= @year.id %>">

@ -13,7 +13,7 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% elsif @ec_training_objective.present? %> <% elsif @ec_training_objective.present? && @template_major && @ec_training_objective && @sub_training_objectives.count > 0 %>
<form id="edit_training_subitems"> <form id="edit_training_subitems">
<ul class="edu-back-white padding10-30" id="SubentryNewPanel"> <ul class="edu-back-white padding10-30" id="SubentryNewPanel">
<li class="df mb10"> <li class="df mb10">

@ -12,7 +12,7 @@
<a href="javascript:void(0)" class="defalutCancelbtn mr20 fr" onclick="CancelEditBtn();">取消</a> <a href="javascript:void(0)" class="defalutCancelbtn mr20 fr" onclick="CancelEditBtn();">取消</a>
</p> </p>
</div> </div>
<% else %> <% elsif @template_major && @ec_training_objective && @sub_training_objectives.count > 0 %>
<div class="clearfix" id="targetEdit"> <div class="clearfix" id="targetEdit">
<textarea class="winput-100-130 mb10" id="training_obejctive"></textarea> <textarea class="winput-100-130 mb10" id="training_obejctive"></textarea>
<p class="clearfix"> <p class="clearfix">

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

@ -18,9 +18,10 @@
<li class="<%= params[:action] == "index" && params[:controller] == "courses" ? " active" : "" %>"><%= link_to "课堂", courses_path %></li> <li class="<%= params[:action] == "index" && params[:controller] == "courses" ? " active" : "" %>"><%= link_to "课堂", courses_path %></li>
<li class="<%= params[:action] == "index" && params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li> <li class="<%= params[:action] == "index" && params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li>
<li class="<%= params[:action] == "index" && params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li> <li class="<%= params[:action] == "index" && params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li>
<% ec_user = EcSchoolUser.where(:user_id => User.current.id).first %> <% if User.current.ec_school.present? %>
<% if ec_user %> <li class="<%= params[:controller] == "ecs" ? " active" : "" %>" id="ec_banner">
<li class="<%= params[:controller] == "ecs" ? " active" : "" %>" id="ec_banner"><%= link_to "认证", department_ecs_path(:school_id => ec_user.school_id) %></li> <%= link_to "认证", department_ecs_path(:school_id => User.current.ec_school) %>
</li>
<% end %> <% end %>
</ul> </ul>
<div class="posi-search" id="posi-search" style="display: none"> <div class="posi-search" id="posi-search" style="display: none">

@ -67,8 +67,8 @@
"./static/js/9.2971266e.chunk.js.map": "./static/js/9.2971266e.chunk.js.map", "./static/js/9.2971266e.chunk.js.map": "./static/js/9.2971266e.chunk.js.map",
"main.css": "./static/css/main.80b6ec5e.css", "main.css": "./static/css/main.80b6ec5e.css",
"main.css.map": "./static/css/main.80b6ec5e.css.map", "main.css.map": "./static/css/main.80b6ec5e.css.map",
"main.js": "./static/js/main.60c226df.js", "main.js": "./static/js/main.7d62a5b7.js",
"main.js.map": "./static/js/main.60c226df.js.map", "main.js.map": "./static/js/main.7d62a5b7.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.80b6ec5e.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.60c226df.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.80b6ec5e.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.7d62a5b7.js"></script></body></html>

File diff suppressed because one or more lines are too long

@ -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">

@ -234,7 +234,7 @@ class EcCourseSupportSetting extends Component {
} }
render() { render() {
let { editableMode, schooldata } = this.state; let { editableMode, schooldata, is_manager } = this.state;
if (!schooldata) schooldata = {} if (!schooldata) schooldata = {}
const course_targets = this.state.course_targets; const course_targets = this.state.course_targets;
@ -290,6 +290,8 @@ class EcCourseSupportSetting extends Component {
</div> </div>
</div> </div>
{/* && is_manager */}
{ course_targets&&course_targets.length>=0 ? (editableMode ? { course_targets&&course_targets.length>=0 ? (editableMode ?
<EditableCourseSupportSetting <EditableCourseSupportSetting
setEditableMode={this.setEditableMode} setEditableMode={this.setEditableMode}

@ -236,10 +236,15 @@ function getTableData(data_args) {
targetValueRowData[`c${courseIndex + 1}`] = course.target_value && course.target_value.toFixed targetValueRowData[`c${courseIndex + 1}`] = course.target_value && course.target_value.toFixed
? course.target_value.toFixed(3) : course.target_value ; ? course.target_value.toFixed(3) : course.target_value ;
target_value_total = target_value_total + targetValueRowData[`c${courseIndex + 1}`] if (course.target_value) {
target_value_total = target_value_total + course.target_value
}
realValueRowData[`c${courseIndex + 1}`] = course.real_value && course.real_value.toFixed realValueRowData[`c${courseIndex + 1}`] = course.real_value && course.real_value.toFixed
? course.real_value.toFixed(3) : course.real_value ; ? course.real_value.toFixed(3) : course.real_value ;
real_value_total = real_value_total + realValueRowData[`c${courseIndex + 1}`] if (course.real_value) {
real_value_total = real_value_total + course.real_value
}
}) })
if (real_value_total >= target_value_total && real_value_total != 0) { if (real_value_total >= target_value_total && real_value_total != 0) {
nameRowData.status = true nameRowData.status = true
@ -533,6 +538,7 @@ class GraduatesRequirement extends Component {
daChengYuZhi: response.data.calculation_value, daChengYuZhi: response.data.calculation_value,
daChengYuZhiSaved: response.data.calculation_value, daChengYuZhiSaved: response.data.calculation_value,
course_ids: response.data.course_ids, course_ids: response.data.course_ids,
is_manager: response.data.is_manager,
calculating: false, calculating: false,
}) })
} }
@ -578,13 +584,14 @@ class GraduatesRequirement extends Component {
} }
render() { render() {
const { match, history, current_user } = this.props const { match, history, current_user } = this.props
const { daChengYuZhiEditableMode, daChengYuZhi, daChengYuZhiSaved } = this.state const { daChengYuZhiEditableMode, daChengYuZhi, daChengYuZhiSaved, is_manager } = this.state
let { schooldata } =this.state; let { schooldata } =this.state;
let { example_major, template_major } = schooldata; let { example_major, template_major } = schooldata;
let showCalculateButton = false; let showCalculateButton = is_manager;
if (example_major && current_user.admin || !example_major && template_major) { // let showCalculateButton = false;
showCalculateButton = true; // if (example_major && current_user.admin || !example_major && template_major) {
} // showCalculateButton = true;
// }
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="educontent mb290"> <div className="educontent mb290">

Loading…
Cancel
Save