Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

ecloud_sso
daiao 5 years ago
commit 35f36fb9be

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
$(document).on('turbolinks:load', function() {
if ($('.weapp-banner-setting-container').length > 0) {
var $form = $('#course_form');
$('.course.banner-item-bottom').on("change", 'input[type="file"]', function() {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;
if (file && file.type.match(imageType)) {
$form.ajaxSubmit()
}
});
var $shixunform = $('#shixun_form');
$('.shixun.banner-item-bottom').on("change", 'input[type="file"]', function() {
var $fileInput = $(this);
var file = this.files[0];
var imageType = /image.*/;
if (file && file.type.match(imageType)) {
$shixunform.ajaxSubmit()
}
});
}
})

@ -1,171 +1,154 @@
.admins-laboratories-index-page {
.laboratory-list-table {
.member-container {
.laboratory-user {
display: flex;
justify-content: center;
flex-wrap: wrap;
.laboratory-user-item {
display: flex;
align-items: center;
height: 22px;
line-height: 22px;
padding: 2px 5px;
margin: 2px 2px;
border: 1px solid #91D5FF;
background-color: #E6F7FF;
color: #91D5FF;
border-radius: 4px;
.laboratory-list-table {
.member-container {
.laboratory-user {
display: flex;
justify-content: center;
flex-wrap: wrap;
.laboratory-user-item {
display: flex;
align-items: center;
height: 22px;
line-height: 22px;
padding: 2px 5px;
margin: 2px 2px;
border: 1px solid #91D5FF;
background-color: #E6F7FF;
color: #91D5FF;
border-radius: 4px;
}
}
}
}
}
}
}
.admins-laboratory-settings-show-page, .admins-laboratory-settings-update-page {
.edit-laboratory-setting-container {
.logo-item {
display: flex;
&-img {
display: block;
width: 80px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 80px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 39px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 27px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-left {
position: relative;
width: 80px;
height: 80px;
&.has-img {
.logo-item-upload {
display: none;
}
&:hover {
.logo-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
.admins-laboratory-settings-show-page,
.admins-laboratory-settings-update-page,
.weapp-banner-setting-container {
.edit-laboratory-setting-container {
.logo-item {
display: flex;
&-img {
display: block;
width: 80px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 80px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 39px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 27px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-left {
position: relative;
width: 80px;
height: 80px;
&.has-img {
.logo-item-upload {
display: none;
}
&:hover {
.logo-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
}
}
}
&-right {
display: flex;
flex-direction: column;
justify-content: space-between;
color: #777777;
font-size: 12px;
}
&-title {
color: #23272B;
font-size: 14px;
}
}
}
}
&-right {
display: flex;
flex-direction: column;
justify-content: space-between;
color: #777777;
font-size: 12px;
}
&-title {
color: #23272B;
font-size: 14px;
}
}
.banner-item {
margin-bottom: 15px;
display: flex;
flex-direction: column;
&-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-top {
margin-bottom: 10px;
}
&-bottom {
position: relative;
width: 300px;
height: 80px;
&.has-img {
.banner-item-upload {
display: none;
}
&:hover {
.banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
.banner-item {
margin-bottom: 15px;
display: flex;
flex-direction: column;
&-img {
display: block;
width: 300px;
height: 80px;
background: #f0f0f0;
}
&-upload {
cursor: pointer;
position: absolute;
top: 0;
width: 300px;
height: 80px;
background: #F5F5F5;
border: 1px solid #E5E5E5;
&::before {
content: '';
position: absolute;
top: 27px;
left: 149px;
width: 2px;
height: 26px;
background: #E5E5E5;
}
&::after {
content: '';
position: absolute;
top: 39px;
left: 137px;
width: 26px;
height: 2px;
background: #E5E5E5;
}
}
&-top {
margin-bottom: 10px;
}
&-bottom {
position: relative;
width: 300px;
height: 80px;
&.has-img {
.banner-item-upload {
display: none;
}
&:hover {
.banner-item-upload {
display: block;
background: rgba(145, 145, 145, 0.8);
}
}
}
}
&-title {
color: #23272B;
font-size: 14px;
}
}
}
}
&-title {
color: #23272B;
font-size: 14px;
}
}
}
}

@ -0,0 +1,52 @@
class Admins::WeappBannersController < Admins::BaseController
def index
@shixun = WeappSettings::ShixunBanner.first
@course = WeappSettings::CourseBanner.first
end
def create
ActiveRecord::Base.transaction do
old_carouse = WeappSettings::CourseBanner.first
if old_carouse.present?
old_carouse.destroy!
file_path = Util::FileManage.source_disk_filename(old_carouse)
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
end
@course = WeappSettings::CourseBanner.create!
save_image_file(params[:course_banner], @course)
end
end
def shixun_banner
ActiveRecord::Base.transaction do
old_shixun = WeappSettings::ShixunBanner.first
if old_shixun.present?
old_shixun.destroy!
file_path = Util::FileManage.source_disk_filename(old_shixun)
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
end
@shixun = WeappSettings::ShixunBanner.create!
save_image_file(params[:shixun_banner], @shixun)
end
end
private
def save_image_file(file, model)
return unless file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
file_path = Util::FileManage.source_disk_filename(model)
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
Util.write_file(file, file_path)
end
end

@ -106,7 +106,7 @@ class CoursesController < ApplicationController
videos = @course.videos
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
@count = videos.count
@videos = paginate videos
@videos = paginate videos.includes(user: :user_extension)
end
def delete_course_video

@ -963,7 +963,7 @@ class GamesController < ApplicationController
begin
shixun = game.myshixun.shixun
shixun_tomcat = edu_setting('cloud_bridge')
#service_host = edu_setting('vnc_url')
service_host = edu_setting('vnc_url')
tpiGitURL = "#{edu_setting('git_address_domain')}/#{game.myshixun.repo_path}"
uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
@ -973,14 +973,15 @@ class GamesController < ApplicationController
if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级99")
end
@vnc_url = res['showServer']
# if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb"
# # 无域名版本
# "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
# else
# # 有域名版本
# "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
# end
# @vnc_url = res['showServer']
@vnc_url =
if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb"
# 无域名版本
"http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
else
# 有域名版本
"https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
end
@vnc_evaluate = shixun.vnc_evaluate
rescue Exception => e
Rails.logger.error(e.message)

@ -1210,7 +1210,7 @@ class HomeworkCommonsController < ApplicationController
rescue Exception => e
uid_logger(e.message)
tip_exception("删除失败")
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end

@ -360,6 +360,7 @@ class StudentWorksController < ApplicationController
# 给作品评分
def add_score
tip_exception("该学生的分数已经过调整,不能再评阅") if @work.ultimate_score
tip_exception("学生匿评时分数为必填") if params[:score].blank? && @user_course_identity == Course::STUDENT
tip_exception("分数和评语不能都为空") if params[:score].blank? && params[:comment].blank?
tip_exception("分数不能超过0-100") if params[:score] && (params[:score].to_f < 0 || params[:score].to_f > 100)

@ -0,0 +1,12 @@
class Weapps::BannersController < Weapps::BaseController
def index
shixun = WeappSettings::ShixunBanner.first
course = WeappSettings::CourseBanner.first
render json: {
shixun_img: shixun ? Util::FileManage.source_disk_file_url(shixun) : '',
course_img: course ? Util::FileManage.source_disk_file_url(course) : ''
}
end
end

@ -14,7 +14,9 @@ class CreateStudentWorkJob < ApplicationJob
student_ids = course.students.pluck(:user_id)
student_ids.each do |user_id|
worker.add same_attrs.merge(user_id: user_id)
unless StudentWork.where(user_id: user_id, homework_common_id: homework.id).exists?
worker.add same_attrs.merge(user_id: user_id)
end
end
end
end

@ -12,5 +12,5 @@ class HomeworkBank < ApplicationRecord
validates :name, length: { maximum: 60, too_long: "不能超过60个字符" }
validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" }
validates :reference_answer, length: { maximum: 15000, too_long: "不能超过15000个字符" }
validates :reference_answer, length: { maximum: 25000, too_long: "不能超过25000个字符" }
end

@ -38,7 +38,7 @@ class HomeworkCommon < ApplicationRecord
validates :name, presence: true, length: { maximum: 60, too_long: "不能超过60个字符" }
validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" }
validates :explanation, length: { maximum: 5000, too_long: "不能超过5000个字符" }
validates :reference_answer, length: { maximum: 15000, too_long: "不能超过15000个字符" }
validates :reference_answer, length: { maximum: 25000, too_long: "不能超过25000个字符" }
# after_update :update_activity
before_destroy :update_homework_bank_quotes

@ -2,7 +2,7 @@ class ShixunInfo < ApplicationRecord
belongs_to :shixun
validates_uniqueness_of :shixun_id
validates_length_of :fork_reason, maximum: 60, message: "不能超过60个字符"
validates_presence_of :evaluate_script, message: "实训脚本不能为空"
# validates_presence_of :evaluate_script, message: "实训脚本不能为空"
after_commit :create_diff_record
validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" }

@ -0,0 +1,3 @@
class WeappSettings::CourseBanner < WeappSetting
default_scope { order(position: :asc) }
end

@ -0,0 +1,3 @@
class WeappSettings::ShixunBanner < WeappSetting
default_scope { order(position: :asc) }
end

@ -125,6 +125,7 @@
<%= sidebar_item_group('#weapp-setting-submenu', '小程序设置', icon: 'id-badge') do %>
<li><%= sidebar_item(admins_weapp_carousels_path, '轮播图', icon: 'image', controller: 'admins-weapp_carousels') %></li>
<li><%= sidebar_item(admins_weapp_adverts_path, '广告栏', icon: 'paper-plane', controller: 'admins-weapp_adverts') %></li>
<li><%= sidebar_item(admins_weapp_banners_path, 'banner', icon: 'image', controller: 'admins-weapp_banners') %></li>
<% end %>
</li>

@ -0,0 +1,2 @@
$("#course_img")[0].innerHTML = "<%= escape_javascript(image_tag Util::FileManage.source_disk_file_url(@course), class: 'banner-item-img course-banner-img') %>";
$("#course_img_banner").addClass('has-img');

@ -0,0 +1,40 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('banner设置') %>
<% end %>
<div class="box weapp-banner-setting-container">
<div class="form-group px-2 setting-item edit-laboratory-setting-container">
<div class="pl-0 py-3 row setting-item-body">
<%= form_with(url: '/admins/weapp_banners', html: { id: 'course_form', enctype: 'multipart/form-data' }) do |f| %>
<div class="col-12 col-md-4 banner-item">
<div class="banner-item-top">实践课程</div>
<div class="course banner-item-bottom <%= @course ? 'has-img' : '' %>" id="course_img_banner">
<div id="course_img">
<% if @course %>
<img class="banner-item-img course-banner-img" src="<%= Util::FileManage.exists?(@course) ? Util::FileManage.source_disk_file_url(@course) : '' %>"/>
<% end %>
</div>
<%= file_field_tag(:course_banner, accept: 'image/*', style: 'display: none', value: '') %>
<label for="course_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<% end %>
<%= form_with(url: '/admins/weapp_banners/shixun_banner', html: { id: 'shixun_form', enctype: 'multipart/form-data' }) do |f| %>
<div class="col-12 col-md-4 banner-item">
<div class="banner-item-top">实训项目</div>
<div class="shixun banner-item-bottom <%= @shixun ? 'has-img' : '' %>" id="shixun_img_banner">
<div id="shixun_img">
<% if @shixun %>
<img class="banner-item-img shixun-banner-img" src="<%= Util::FileManage.exists?(@shixun) ? Util::FileManage.source_disk_file_url(@shixun) : '' %>"/>
<% end %>
</div>
<%= file_field_tag(:shixun_banner, accept: 'image/*', style: 'display: none', value: '') %>
<label for="shixun_banner" class="banner-item-upload" data-toggle="tooltip" data-title="选择图片"></label>
</div>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,2 @@
$("#shixun_img")[0].innerHTML = "<%= escape_javascript(image_tag Util::FileManage.source_disk_file_url(@shixun), class: 'banner-item-img course-banner-img') %>";
$("#shixun_img_banner").addClass('has-img');

@ -3,4 +3,8 @@ json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_i
json.play_duration video.video_play_duration
json.published_at video.display_published_at
json.created_at video.display_created_at
json.updated_at video.display_updated_at
json.updated_at video.display_updated_at
user = video.user
json.user_name user&.real_name
json.user_img url_to_avatar(user)
json.user_login user&.login

@ -1028,6 +1028,8 @@ Rails.application.routes.draw do
resource :check_account, only: [:create]
resource :unbind_accounts, only: [:show, :destroy]
resources :banners, only: [:index]
resources :searchs, only: [:index]
resources :course_stickies, only: [:create] do
post :cancel_sticky, on: :collection
@ -1331,6 +1333,12 @@ Rails.application.routes.draw do
resources :weapp_adverts, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :weapp_banners, only: [:index, :create] do
collection do
post :shixun_banner
end
end
resources :subject_settings, only: [:index, :update] do
post :update_mobile_show, on: :collection

@ -17,7 +17,7 @@ namespace :homework_evaluation do
homework_detail_manuals.each do |homework_detail_manual|
homework_common = homework_detail_manual.homework_common
if homework_common.anonymous_comment
if homework_common.homework_group_settings.where("end_time is null or end_time > '#{Time.now}'").count == 0
if homework_common.homework_group_settings.where("end_time > '#{Time.now}'").count == 0
if homework_common.homework_type == "group"
student_works = homework_common.student_works.where("work_status != 0").group(:group_id)
else
@ -25,9 +25,8 @@ namespace :homework_evaluation do
end
if student_works.present? && student_works.length >= 2
HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id)
homework_detail_manual.update_column('comment_status', 3)
HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id)
else
#作业数小于2启动失败, 只给老师和助教发
extra = "作品数量低于两个,无法开启匿评"
@ -35,12 +34,12 @@ namespace :homework_evaluation do
else
extra = "存在尚未截止的分班,无法开启匿评"
end
HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra)
if extra.present?
homework_detail_manual.update_attributes(:evaluation_start => nil, :evaluation_end => nil, :absence_penalty => 0,
:evaluation_num => 0, :appeal_time => nil, :appeal_penalty => 0)
homework_common.update_attributes(:anonymous_comment => 0, :anonymous_appeal => 0)
end
HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra)
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -42,7 +42,7 @@ if (isDev) {
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
// 超管
debugType="admin";
//debugType="admin";
// 老师
// debugType="teacher";
// 学生

@ -495,7 +495,8 @@ class CoursesBanner extends Component {
setHistoryFun=(url)=>{
this.props.history.replace(url)
this.updatabanner();
this.props.history.replace(url);
}

@ -32,12 +32,13 @@ class GraduationTasksappraiseMainEditor extends Component{
return item.response ? item.response.id : item.id
})
const comment = this.mdRef.current.getValue()
if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true) {
if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true&&comment!=0&&comment!=0.0) {
this.setState( {errorMessage : '分数和评语不能同时为空' })
// this.props.showNotification('请先输入评阅说明')
return;
}
if (!score && this.props.isAdmin()===false) {
if (!score && this.props.isAdmin()===false &&this.props.isAdmin()===true&&comment!=0&&comment!=0.0) {
this.setState( {
errorMessage : '分数不能为空',
errorMessagetype:true

@ -38,7 +38,7 @@ function CourseGroupChooser({ course_groups, isAdminOrCreator = true, item, inde
that.state.checkAllArray[index] - checkAllValue
*/
console.log('arg_course_groups', arg_course_groups)
// console.log('arg_course_groups', arg_course_groups)
const urlStyle = {"left":"unset", minWidth: '262px'};

@ -41,7 +41,6 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
setCheckAllValue(!checkAllValue)
}
const onOk = async () => {
console.log(checkAllValue, arg_course_groups)
let approval = 1
const courseId = props.match.params.coursesId
let url = `/courses/${courseId}/teacher_application_review.json`
@ -51,13 +50,13 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
approval: approval,
group_id: arg_course_groups
}).then((result) => {
if (result.data.status === 0) {
props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
fetchAll(1)
modalEl.current.setVisible(false)
window.location.reload();
}})
if (result.data.status === 0) {
props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
fetchAll(1)
modalEl.current.setVisible(false)
// window.location.reload();
}})
// fetchAll(1);
}
return (
<ModalWrapper

@ -206,8 +206,8 @@ function buildColumns(that) {
title: '',
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return content ? <Checkbox value={content}></Checkbox> : ''
render: (content, item, key) => {
return content ? <Checkbox value={content} key={content}></Checkbox> : ''
}
})
}
@ -401,7 +401,6 @@ class studentsList extends Component{
}
fetchAll = async (argPage,filterKey) => {
let { searchValue }=this.state
this.setState({
isSpin:true
})
@ -434,32 +433,28 @@ class studentsList extends Component{
if(searchValue!=""){
url+='&search='+searchValue;
}
const { updatabanners } = this.props;
updatabanners && updatabanners();
const result = await axios.get(encodeURI(url))
// axios.get((url)).then((result)=>{
if (result.data.teacher_list) {
this.setState({
teachers: result.data.teacher_list,
total_count: result.data.teacher_list_size,
application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false
})
} else if (result.data.application_list) {
this.setState({
total_count: result.data.teacher_list_size,
application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false
})
}
// }).catch((error)=>{
// console.log(error);
// this.setState({
// isSpin:false
// })
// })
if (result.data.teacher_list) {
this.setState({
teachers: result.data.teacher_list,
total_count: result.data.teacher_list_size,
application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false
})
} else if (result.data.application_list) {
this.setState({
total_count: result.data.teacher_list_size,
application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false
})
}
}
getGroupList(){
let id = this.props.match.params.coursesId
@ -536,7 +531,7 @@ class studentsList extends Component{
})
} else {
this.setState({
checkBoxValues: _.difference(this.state.checkBoxValues, values)
checkBoxValues: _.difference(this.state.checkBoxValues, values),
})
}
}
@ -632,7 +627,7 @@ class studentsList extends Component{
});
};
clearSelection = () => {
this.setState({ checkBoxValues: [] })
this.setState({ checkBoxValues: []})
}
selectedStatus=(e)=>{
this.clearSelection()
@ -652,10 +647,9 @@ class studentsList extends Component{
const isAdmin = this.props.isAdmin()
const columns = buildColumns(this)
let {
searchValue, checkBoxValues, checkAllValue, course_groups,
searchValue, checkBoxValues,checkAllValue, course_groups,
groupList, total_count, teachers, order, page, apply_size, filterKey
}=this.state
let currentOrderName = '加入时间排序'
if (order == ORDER_BY_NAME) {
currentOrderName = '姓名排序'

@ -65,4 +65,11 @@
.padding0-12{
padding: 12px 0px;
}
.pointer{
cursor: pointer;
}
.pl23{
padding-left: 23px !important;
}

@ -81,6 +81,7 @@ class Repository extends Component {
}else{
confirm({
title: '确认需要删除该文件?',
centered:true,
okText: '确定',
cancelText: '取消',
onOk() {
@ -292,7 +293,7 @@ class Repository extends Component {
</div>
{
this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
this.props.current_user && ( this.props.identity<5||this.props.current_user.business==true || this.props.current_user.admin==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
// !this.props.secret_repository_tab &&
(
<div>
@ -394,7 +395,7 @@ class Repository extends Component {
{/* })}*/}
{/*</div>*/}
{ this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
{ this.props.current_user && (this.props.identity<5||this.props.current_user.business==true || this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
<Button size={"small"} className={"fr"} type="link" onClick={this.showDeleteConfirm}>删除</Button>:""}
<div className={"both"}></div>
@ -413,13 +414,14 @@ class Repository extends Component {
className={"reposanttreeswitcher"}
multiple
defaultExpandAll
checkable={ this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?true:false}
checkable={ this.props.current_user && (this.props.identity<5||this.props.current_user.business==true ||this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?true:false}
onSelect={this.onSelectDirectoryTree}
onCheck={this.onCheck}
>
{treesdelecttype===false || trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {
return (
<TreeNode disableCheckbox={this.state.ischeckevalue===item.name?false:this.state.ischecke?true:item.type==='tree'?true:false} item={item} title={`${item.name}`} key={item.type==='tree'?"0-0":`0-0-${index}`} icon={item.type==='tree'?<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />:<i className="iconfont icon-xingzhuangjiehe color-blue font-12"/>} id={`file${index}`} key={index}>
<TreeNode className={item.type==='tree'?"pl23":""} checkable={item.type==='tree'?false:true} disableCheckbox={this.state.ischeckevalue===item.name?false:this.state.ischecke?true:item.type==='tree'?true:false} item={item} title={`${item.name}`} key={item.type==='tree'?"0-0":`0-0-${index}`} icon={item.type==='tree'?<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />:<i className="iconfont icon-xingzhuangjiehe color-blue font-12"/>} id={`file${index}`} key={index}>
</TreeNode>
)})}
</DirectoryTree>

@ -270,7 +270,7 @@ class RepositoryAddFileupload_files extends Component {
<p className="ant-form-item-label">
<div className={"color888 font-16"}>当前目录{this.state.filspath===""?"/":"/"+this.state.filspath} <span className={"color-blue"} onClick={this.Selectfiledirectory}>选择文件目录</span></div>
<div className={"color888 font-16"}>当前目录{this.state.filspath===""?"/":"/"+this.state.filspath} <span className={"color-blue pointer"} onClick={this.Selectfiledirectory}>选择文件目录</span></div>
</p>
{/*<div className="mt10 mb25 repoCMWrapper filecode">*/}

@ -98,23 +98,24 @@ class RepositoryDirectories extends Component {
</a>
<span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span>
{ pathArray.map((item, index) => {
if(index<pathArray.length-1){
return (
<React.Fragment>
{ this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1
{ index===pathArray.length-1 && item.indexOf('.') === -1?<span className={"color888"}>
/ {item} </span>:this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1
? <a
onClick={() => fetchRepo(index + 1)}
className={this.props.tpmComment===true?"color888":"color-blue"}
>
/ {item}</a>
:
<a className={this.props.tpmComment===true?"color888":""}>
/ {item}</a>
<span className={this.props.tpmComment===true?"color888":""}>
/ {item}</span>
}
{index !== pathArray.length - 1 && <span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span>}
</React.Fragment>
)
}
})
}
{/*{ this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?*/}

Loading…
Cancel
Save