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

dev_hss
杨树林 6 years ago
commit 8516bedbef

@ -13,6 +13,7 @@
//= require bootstrap-datepicker //= require bootstrap-datepicker
//= require bootstrap.viewer //= require bootstrap.viewer
//= require echarts
//= require lib/codemirror //= require lib/codemirror
//= require mode/shell/shell //= require mode/shell/shell

@ -0,0 +1,66 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-dashboards-index-page').length > 0) {
// 月新增用户
var monthChart = echarts.init(document.getElementById('month-active-user'));
monthChart.setOption({
tooltip: {
show: "true",
trigger: 'item',
formatter: '{c0}',
backgroundColor: 'rgba(0,0,0,0.7)', // 背景
padding: [8, 10], //内边距
extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
series : [
{
name: '访问来源',
type: 'pie',
radius: '55%',
data: []
}
]
});
monthChart.showLoading();
$.get('/admins/dashboards/month_active_user.json').done(function(data){
monthChart.setOption({
series: [
{ data: data.data }
]
});
monthChart.hideLoading();
});
// 近七天评测次数
// var evaluateChart = echarts.init(document.getElementById('evaluate-pie'));
// evaluateChart.setOption({
// tooltip: {
// show: "true",
// trigger: 'item',
// formatter: '{c0}',
// backgroundColor: 'rgba(0,0,0,0.7)', // 背景
// padding: [8, 10], //内边距
// extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影
// axisPointer: { // 坐标轴指示器,坐标轴触发有效
// type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
// }
// },
// xAxis: { type: 'category', boundaryGap: false, data: [] },
// yAxis: { type: 'value' },
// series: [{ data: [], type: 'line', areaStyle: {} }]
// });
// evaluateChart.showLoading();
// $.get('/admins/dashboards/evaluate.json').done(function(data){
// evaluateChart.setOption({
// xAxis: { data: data.names },
// series: [{ data: data.data }]
// });
//
// evaluateChart.hideLoading();
// });
}
});

@ -0,0 +1,7 @@
.admins-dashboards-index-page {
.pie-statistic {
.pie {
height: 300px;
}
}
}

@ -1,4 +1,51 @@
class Admins::DashboardsController < Admins::BaseController class Admins::DashboardsController < Admins::BaseController
def index def index
@active_user_count = User.where(last_login_on: today).count
@weekly_active_user_count = User.where(last_login_on: current_week).count
@month_active_user_count = User.where(last_login_on: current_month).count
@new_user_count = User.where(created_on: current_month).count
end
def month_active_user
count = UserExtension.where(created_at: current_month).group(:identity).count
data = [
{ value: count['teacher'].to_i, name: '老师' },
{ value: count['student'].to_i, name: '学生' },
{ value: count['professional'].to_i, name: '专业人士' },
{ value: count[nil].to_i, name: '未选职业' },
]
render_ok(data: data)
end
def evaluate
names = []
data = []
1.upto(7) do |i|
date = i.days.ago
names.unshift(date.strftime('%Y-%m-%d'))
count = Output.where(created_at: date.beginning_of_day..date.end_of_day).count
data.unshift(count)
end
render_ok(names: names, data: data)
end
private
def today
Time.now.beginning_of_day..Time.now.end_of_day
end
def current_week
7.days.ago.beginning_of_day..Time.now.end_of_day
end
def current_month
30.days.ago.beginning_of_day..Time.now.end_of_day
end end
end end

@ -50,8 +50,8 @@ module GitCommon
Rails.logger.info(" good repo_name is #{@repo_path}") Rails.logger.info(" good repo_name is #{@repo_path}")
@content = GitService.update_file(repo_path: @repo_path, @content = GitService.update_file(repo_path: @repo_path,
file_path: @path, file_path: @path,
message: message, message: message.force_encoding('UTF-8'),
content: content, content: content.force_encoding('UTF-8'),
author_name: author_name, author_name: author_name,
author_email: author_email) author_email: author_email)
end end

@ -3,21 +3,21 @@ class ShixunsController < ApplicationController
include ApplicationHelper include ApplicationHelper
before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right, :ranking_list, before_action :require_login, :check_auth, except: [:download_file, :index, :menus, :show, :show_right, :ranking_list,
:discusses, :collaborators, :fork_list, :propaedeutics, :add_file] :discusses, :collaborators, :fork_list, :propaedeutics]
before_action :check_account, only: [:new, :create, :shixun_exec] before_action :check_account, only: [:new, :create, :shixun_exec]
before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns, before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file] :get_mirror_script, :download_file]
before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :add_file, before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file] :get_mirror_script, :download_file]
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file] before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file]
before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish,
:shixun_members_added, :change_manager, :collaborators_delete, :shixun_members_added, :change_manager, :collaborators_delete,
:cancel_publish, :add_collaborators] :cancel_publish, :add_collaborators, :add_file]
before_action :portion_allowed, only: [:copy] before_action :portion_allowed, only: [:copy]
before_action :special_allowed, only: [:send_to_course, :search_user_courses] before_action :special_allowed, only: [:send_to_course, :search_user_courses]

@ -12,19 +12,19 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Traffic</h5> <h5 class="card-title text-uppercase text-muted mb-0">当日活跃用户</h5>
<span class="h2 font-weight-bold mb-0">350,897</span> <span class="h2 font-weight-bold mb-0"><%= @active_user_count %></span>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="icon icon-shape bg-danger text-white rounded-circle shadow"> <div class="icon icon-shape rounded-circle shadow">
<i class="fas fa-pie-chart"></i> <i class="fa fa-users"></i>
</div> </div>
</div> </div>
</div> </div>
<p class="mt-3 mb-0 text-muted text-sm"> <!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 3.48%</span> <!-- <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 3.48%</span>-->
<span class="text-nowrap">Since last month</span> <!-- <span class="text-nowrap">Since last month</span>-->
</p> <!-- </p>-->
</div> </div>
</div> </div>
</div> </div>
@ -33,19 +33,19 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">New users</h5> <h5 class="card-title text-uppercase text-muted mb-0">7天内活跃用户数</h5>
<span class="h2 font-weight-bold mb-0">2,356</span> <span class="h2 font-weight-bold mb-0"><%= @weekly_active_user_count %></span>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="icon icon-shape bg-warning text-white rounded-circle shadow"> <div class="icon icon-shape rounded-circle shadow">
<i class="fas fa-pie-chart"></i> <i class="fa fa-users"></i>
</div> </div>
</div> </div>
</div> </div>
<p class="mt-3 mb-0 text-muted text-sm"> <!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<span class="text-danger mr-2"><i class="fas fa-arrow-down"></i> 3.48%</span> <!-- <span class="text-danger mr-2"><i class="fas fa-arrow-down"></i> 3.48%</span>-->
<span class="text-nowrap">Since last week</span> <!-- <span class="text-nowrap">Since last week</span>-->
</p> <!-- </p>-->
</div> </div>
</div> </div>
</div> </div>
@ -54,19 +54,19 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Sales</h5> <h5 class="card-title text-uppercase text-muted mb-0">30天内活跃用户数</h5>
<span class="h2 font-weight-bold mb-0">924</span> <span class="h2 font-weight-bold mb-0"><%= @month_active_user_count %></span>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="icon icon-shape bg-yellow text-white rounded-circle shadow"> <div class="icon icon-shape rounded-circle shadow">
<i class="fas fa-user"></i> <i class="fa fa-users"></i>
</div> </div>
</div> </div>
</div> </div>
<p class="mt-3 mb-0 text-muted text-sm"> <!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<span class="text-warning mr-2"><i class="fas fa-arrow-down"></i> 1.10%</span> <!-- <span class="text-warning mr-2"><i class="fas fa-arrow-down"></i> 1.10%</span>-->
<span class="text-nowrap">Since yesterday</span> <!-- <span class="text-nowrap">Since yesterday</span>-->
</p> <!-- </p>-->
</div> </div>
</div> </div>
</div> </div>
@ -75,19 +75,19 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Performance</h5> <h5 class="card-title text-uppercase text-muted mb-0">30天内新增用户数</h5>
<span class="h2 font-weight-bold mb-0">49,65%</span> <span class="h2 font-weight-bold mb-0"><%= @new_user_count %></span>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="icon icon-shape bg-info text-white rounded-circle shadow"> <div class="icon icon-shape rounded-circle shadow">
<i class="fas fa-pie-chart"></i> <i class="fa fa-user-plus"></i>
</div> </div>
</div> </div>
</div> </div>
<p class="mt-3 mb-0 text-muted text-sm"> <!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<span class="text-success mr-2"><i class="fas fa-arrow-up"></i> 12%</span> <!-- <span class="text-success mr-2"><i class="fas fa-arrow-up"></i> 12%</span>-->
<span class="text-nowrap">Since last month</span> <!-- <span class="text-nowrap">Since last month</span>-->
</p> <!-- </p>-->
</div> </div>
</div> </div>
</div> </div>
@ -95,94 +95,124 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-fluid mt--7">
<div class="container-fluid mt--7 pie-statistic">
<div class="row mt-5"> <div class="row mt-5">
<div class="col-xl-8 mb-5 mb-xl-0"> <div class="col-xl-8 mb-5 mb-xl-0">
<div class="card shadow"> <div class="card shadow">
<div class="card-header border-0"> <!-- <div class="card-header border-0">-->
<div class="row align-items-center"> <!-- <div class="row align-items-center">-->
<div class="col"> <!-- <h5 class="mb-0">近7天评测次数</h5>-->
<h3 class="mb-0">Page visits</h3> <!-- </div>-->
</div> <!-- </div>-->
<div class="col text-right"> <!-- <div class="table-responsive">-->
<a href="#!" class="btn btn-sm btn-primary">Test</a> <!-- <div id="evaluate-pie" class="pie"></div>-->
</div> <!-- </div>-->
</div>
</div>
<div class="table-responsive">
<!-- Projects table -->
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr>
<th scope="col">Test</th>
<th scope="col">Test</th>
<th scope="col">Test</th>
<th scope="col">Test</th>
</tr>
</thead>
<tbody>
<% 5.times do %>
<tr>
<th scope="row">/test/</th>
<td>4,569</td>
<td>340</td>
<td>
<i class="fas fa-arrow-up text-success mr-3"></i> 46,53%
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<div class="card shadow"> <div class="card shadow">
<div class="card-header border-0"> <div class="card-header border-0">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col"> <h5 class="mb-0">30天内新增用户</h5>
<h3 class="mb-0">Test</h3>
</div>
<div class="col text-right">
<a href="#!" class="btn btn-sm btn-primary">Test</a>
</div>
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<!-- Projects table --> <div id="month-active-user" class="pie"></div>
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr>
<th scope="col">Test</th>
<th scope="col">Test</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<% 5.times do %>
<tr>
<th scope="row">
Test
</th>
<td>
1,480
</td>
<td>
<div class="d-flex align-items-center">
<span class="mr-2">60%</span>
<div>
<div class="progress">
<div class="progress-bar bg-gradient-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"></div>
</div>
</div>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!--<div class="container-fluid mt--7">-->
<!-- <div class="row mt-5">-->
<!-- <div class="col-xl-8 mb-5 mb-xl-0">-->
<!-- <div class="card shadow">-->
<!-- <div class="card-header border-0">-->
<!-- <div class="row align-items-center">-->
<!-- <div class="col">-->
<!-- <h3 class="mb-0">Page visits</h3>-->
<!-- </div>-->
<!-- <div class="col text-right">-->
<!-- <a href="#!" class="btn btn-sm btn-primary">Test</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="table-responsive">-->
<!-- <table class="table align-items-center table-flush">-->
<!-- <thead class="thead-light">-->
<!-- <tr>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<%# 5.times do %>
<!-- <tr>-->
<!-- <th scope="row">/test/</th>-->
<!-- <td>4,569</td>-->
<!-- <td>340</td>-->
<!-- <td>-->
<!-- <i class="fas fa-arrow-up text-success mr-3"></i> 46,53%-->
<!-- </td>-->
<!-- </tr>-->
<%# end %>
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-xl-4">-->
<!-- <div class="card shadow">-->
<!-- <div class="card-header border-0">-->
<!-- <div class="row align-items-center">-->
<!-- <div class="col">-->
<!-- <h3 class="mb-0">Test</h3>-->
<!-- </div>-->
<!-- <div class="col text-right">-->
<!-- <a href="#!" class="btn btn-sm btn-primary">Test</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="table-responsive">-->
<!-- <table class="table align-items-center table-flush">-->
<!-- <thead class="thead-light">-->
<!-- <tr>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col">Test</th>-->
<!-- <th scope="col"></th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<%# 5.times do %>
<!-- <tr>-->
<!-- <th scope="row">-->
<!-- Test-->
<!-- </th>-->
<!-- <td>-->
<!-- 1,480-->
<!-- </td>-->
<!-- <td>-->
<!-- <div class="d-flex align-items-center">-->
<!-- <span class="mr-2">60%</span>-->
<!-- <div>-->
<!-- <div class="progress">-->
<!-- <div class="progress-bar bg-gradient-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<%# end %>
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->

@ -779,6 +779,12 @@ Rails.application.routes.draw do
namespace :admins do namespace :admins do
get '/', to: 'dashboards#index' get '/', to: 'dashboards#index'
resources :dashboards, only: [:index] do
collection do
get :month_active_user
get :evaluate
end
end
resources :files, only: [:create] resources :files, only: [:create]
resources :daily_school_statistics, only: [:index] do resources :daily_school_statistics, only: [:index] do

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

@ -2,89 +2,90 @@ import React, { Component } from 'react';
const $ = window.jQuery const $ = window.jQuery
const jQuery = $; const jQuery = $;
if (!$.drag) { // if () {
(function($){ // !$.drag
$.fn.dragValidator = function(options){ // (function($){
var x, drag = this, isMove = false, defaults = { // $.fn.dragValidator = function(options){
}; // var x, drag = this, isMove = false, defaults = {
var options = $.extend(defaults, options); // };
//添加背景,文字,滑块 // var options = $.extend(defaults, options);
var html = '<div class="drag_bg"></div>'+ // //添加背景,文字,滑块
'<div class="drag_text" onselectstart="return false;" unselectable="on">拖动滑块验证</div>'+ // var html = '<div class="drag_bg"></div>'+
'<div class="handler handler_bg"></div>'; // '<div class="drag_text" onselectstart="return false;" unselectable="on">拖动滑块验证</div>'+
this.append(html); // '<div class="handler handler_bg"></div>';
// this.append(html);
var handler = drag.find('.handler'); //
var drag_bg = drag.find('.drag_bg'); // var handler = drag.find('.handler');
var text = drag.find('.drag_text'); // var drag_bg = drag.find('.drag_bg');
var maxWidth = text.width() - handler.width(); //能滑动的最大间距 // var text = drag.find('.drag_text');
//鼠标按下时候的x轴的位置 // var maxWidth = text.width() - handler.width(); //能滑动的最大间距
handler.mousedown(function(e){ // //鼠标按下时候的x轴的位置
isMove = true; // handler.mousedown(function(e){
x = e.pageX - parseInt(handler.css('left'), 10); // isMove = true;
}); // x = e.pageX - parseInt(handler.css('left'), 10);
// });
//鼠标指针在上下文移动时移动距离大于0小于最大间距滑块x轴位置等于鼠标移动距离 //
$(document).mousemove(function(e){ // //鼠标指针在上下文移动时移动距离大于0小于最大间距滑块x轴位置等于鼠标移动距离
var _x = e.pageX - x; // $(document).mousemove(function(e){
var handler_offset = handler.offset(); // var _x = e.pageX - x;
var lastX = e.clientX -x; // var handler_offset = handler.offset();
lastX = Math.max(0,Math.min(maxWidth,lastX)); // var lastX = e.clientX -x;
if(isMove){ // lastX = Math.max(0,Math.min(maxWidth,lastX));
if(_x > 0 && _x <= maxWidth){ // if(isMove){
handler.css({'left': lastX}); // if(_x > 0 && _x <= maxWidth){
drag_bg.css({'width': lastX}); // handler.css({'left': lastX});
} // drag_bg.css({'width': lastX});
else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件 // }
dragOk(); // else if(lastX > maxWidth - 5 && lastX < maxWidth + 5 ){ //鼠标指针移动距离达到最大时清空事件
// dragOk();
} //
} // }
}); // }
handler.mouseup(function(e){ // });
isMove = false; // handler.mouseup(function(e){
var _x = e.pageX - x; // isMove = false;
if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 // var _x = e.pageX - x;
handler.animate({'left': 0}); // if(text.text() != '验证通过' && _x < maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置
drag_bg.animate({'width': 0}); // handler.animate({'left': 0});
} // drag_bg.animate({'width': 0});
}); // }
// });
//清空事件 //
function dragOk(){ // //清空事件
options.dragOkCallback && options.dragOkCallback() // function dragOk(){
var kuaiwidth=drag.width() - handler.width() - 2; // options.dragOkCallback && options.dragOkCallback()
handler.removeClass('handler_bg').addClass('handler_ok_bg'); // var kuaiwidth=drag.width() - handler.width() - 2;
handler.css({'left':kuaiwidth+'px'}) // handler.removeClass('handler_bg').addClass('handler_ok_bg');
text.css({'width':kuaiwidth+'px'}); // handler.css({'left':kuaiwidth+'px'})
text.text('验证通过'); // text.css({'width':kuaiwidth+'px'});
drag.css({'color': '#fff'}); // text.text('验证通过');
drag_bg.css({'width':kuaiwidth+'px'}) // drag.css({'color': '#fff'});
handler.unbind('mousedown'); // drag_bg.css({'width':kuaiwidth+'px'})
$(document).unbind('mousemove'); // handler.unbind('mousedown');
$(document).unbind('mouseup'); // $(document).unbind('mousemove');
$("#user_verification_notice").html(""); // $(document).unbind('mouseup');
$('#user_verification_notice').parent().hide(); // $("#user_verification_notice").html("");
} // $('#user_verification_notice').parent().hide();
}; // }
})(jQuery); // };
} // })(jQuery);
// }
class DragValidator extends Component { class DragValidator extends Component {
componentDidMount () { componentDidMount () {
// if($("#reg-drag").length>0 && IsPC()){ // if($("#reg-drag").length>0 && IsPC()){
$("#reg-drag").dragValidator({ // $("#reg-drag").dragValidator({
height: this.props.height, // height: this.props.height,
dragOkCallback: () => { // dragOkCallback: () => {
this.props.dragOkCallback && this.props.dragOkCallback() // this.props.dragOkCallback && this.props.dragOkCallback()
} // }
}); // });
// }else{ // }else{
// $("#reg-drag").empty(); // $("#reg-drag").empty();
// } // }
} }
empty() { empty() {
$("#reg-drag").empty(); // $("#reg-drag").empty();
} }
render() { render() {
const height = this.props.height || 45; const height = this.props.height || 45;

@ -42,7 +42,7 @@ export { SetAppModel } from './components/SetAppModel'
export { default as LinkAfterLogin } from './components/LinkAfterLogin' export { default as LinkAfterLogin } from './components/LinkAfterLogin'
export { default as Cropper } from './components/Cropper' export { default as Cropper } from './components/Cropper'
export { default as ConditionToolTip } from './components/ConditionToolTip' export { default as ConditionToolTip } from './components/ConditionToolTip'
export { default as DragValidator } from './components/DragValidator' // export { default as DragValidator } from './components/DragValidator'
export { default as PopInstruction } from './components/instruction/PopInstruction' export { default as PopInstruction } from './components/instruction/PopInstruction'

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip} from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip , Divider } from "antd";
import ClipboardJS from 'clipboard' import ClipboardJS from 'clipboard'
import '../css/Courses.css' import '../css/Courses.css'
import '../css/members.css' import '../css/members.css'
@ -612,7 +612,12 @@ class studentsList extends Component{
padding-top: 10px; padding-top: 10px;
padding-bottom: 8px; padding-bottom: 8px;
} }
.drop_down_menu .drop_down_btn{
border-top:none;
}
.dividerStyle.ant-divider-horizontal{
margin: 0px;
}
`}</style> `}</style>
{ isAdmin && { isAdmin &&
<li className="li_line drop_down fr color-blue font-16"> <li className="li_line drop_down fr color-blue font-16">
@ -656,8 +661,10 @@ class studentsList extends Component{
</p>): </p>):
'' ''
} }
{course_group_id != 0 && <li key={0} onClick={() => this.moveToGroup({id: 0})}>未分班</li>} {
course_group_id != 0 && course_groups && course_groups.length > 0 &&
<li key={0} onClick={() => this.moveToGroup({id: 0})}>未分班</li>
}
{ course_groups.filter((item)=> { { course_groups.filter((item)=> {
return item.id != course_group_id && (!this.state.groupSearchValue || item.name.indexOf(this.state.groupSearchValue) != -1) return item.id != course_group_id && (!this.state.groupSearchValue || item.name.indexOf(this.state.groupSearchValue) != -1)
}).map( item => { }).map( item => {
@ -665,6 +672,7 @@ class studentsList extends Component{
<li key={item.id} onClick={() => this.moveToGroup(item)} title={item.name}>{item.name}</li> <li key={item.id} onClick={() => this.moveToGroup(item)} title={item.name}>{item.name}</li>
) )
}) } }) }
{ course_groups && course_groups.length > 0 && <Divider className="dividerStyle"></Divider> }
{ isAdmin && { isAdmin &&
<p className="drop_down_btn"> <p className="drop_down_btn">

@ -677,6 +677,12 @@ class studentsList extends Component{
float: none; float: none;
text-align: center; text-align: center;
} }
.drop_down_menu .drop_down_btn{
border-top:none;
}
.dividerStyle.ant-divider-horizontal{
margin: 0px;
}
`}</style> `}</style>
<div className="mt20 edu-back-white padding20 teacherList"> <div className="mt20 edu-back-white padding20 teacherList">
@ -705,12 +711,13 @@ class studentsList extends Component{
{ {
groupList && groupList.graduation_group_list && groupList.graduation_group_list.filter((item)=> { groupList && groupList.graduation_group_list && groupList.graduation_group_list.filter((item)=> {
return (!this.state.graduationGroupSearchValue || item.name.indexOf(this.state.graduationGroupSearchValue) != -1) return (!this.state.graduationGroupSearchValue || item.name.indexOf(this.state.graduationGroupSearchValue) != -1)
}).map((item,key)=>{ }).map((item,key)=>{
return( return(
<li key={key} value={item.id} onClick={() => this.joinGraduationGroup(item.id)}>{item.name}</li> <li key={key} value={item.id} onClick={() => this.joinGraduationGroup(item.id)}>{item.name}</li>
) )
}) })
} }
{ groupList && groupList.graduation_groups_count > 0 && <Divider className="dividerStyle"></Divider> }
<p className="drop_down_btn"> <p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6" <a href="javascript:void(0)" className="color-grey-6"
onClick={() => this.refs['addGraduationGroupModal'].setVisible(true)} onClick={() => this.refs['addGraduationGroupModal'].setVisible(true)}

@ -782,14 +782,14 @@ submittojoinclass=(value)=>{
<style> <style>
{ {
` `
.posi-searchs{ .posi-searchs{
opacity: 1; opacity: 1;
position: absolute; position: absolute;
top: -2px; top: -2px;
background: #fff; background: #fff;
z-index:10000; z-index:10000;
right: 185px; right: 185px;
} }
` `
} }
</style> </style>
@ -869,6 +869,11 @@ submittojoinclass=(value)=>{
<li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}>
<a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a>
</li> </li>
{
this.props.Headertop && this.props.Headertop.college_identifier &&
<li><a href={`${this.props.Headertop.old_url}/colleges/${this.props.Headertop.college_identifier}/statistics`}>学院统计</a></li>
}
<li><a href={`/account/profile`}>账号管理</a></li> <li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/} {/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/} {/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}

@ -41,7 +41,7 @@ class Repository extends Component {
} }
render() { render() {
let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray } = this.props; let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray , TPMRightSectionData } = this.props;
if (!author) { if (!author) {
author = {} author = {}
} }
@ -49,7 +49,6 @@ class Repository extends Component {
if(this.props.author!=undefined){ if(this.props.author!=undefined){
userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null; userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null;
} }
return ( return (
<React.Fragment> <React.Fragment>
{/* jfinalshop/WebRoot */} {/* jfinalshop/WebRoot */}
@ -85,7 +84,7 @@ class Repository extends Component {
<a href="/forums/2784" target="_blank" <a href="/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a> className=" guideBtn" >Git使用指南</a>
{ {
this.props.current_user && this.props.current_user.admin ==true ? this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData&& TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
<ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn>:"" <ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn>:""
} }

@ -89,8 +89,10 @@ class RepositoryAddFile extends Component {
} }
checkPath= (rule, value, callback) =>{ checkPath= (rule, value, callback) =>{
if (value.indexOf("/") > -1 && value.length==1 ) { if (value == "/" ) {
callback('请输入正确的文件路径'); callback('请输入正确的文件路径');
}else if(!value){
callback('文件名不能为空');
}else{ }else{
callback(); callback();
} }
@ -156,7 +158,6 @@ class RepositoryAddFile extends Component {
<Form.Item label="文件名"> <Form.Item label="文件名">
{getFieldDecorator('path', { {getFieldDecorator('path', {
rules: [ rules: [
{required: true, message: "文件名不能为空"},
{ {
validator:this.checkPath validator:this.checkPath
}] }]

Loading…
Cancel
Save