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

sso
cxt 5 years ago
commit 858e854887

@ -13,7 +13,7 @@ class CoursesController < ApplicationController
end
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :informs, :online_learning, :course_groups]
:left_banner, :top_banner, :informs, :online_learning, :course_groups, :search_slim]
before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course]
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :apply_to_join_course, :exit_course, :course_groups]

@ -20,11 +20,8 @@ class MainController < ApplicationController
uid_logger("main start is #{cookies[:_educoder_session]}")
end
if params[:path] && params[:path]&.include?("educoderh5") && params[:path].split("/").first == "educoderh5"
render file: 'public/h5build/index.html', :layout => false
# TODO: 这块之后需要整合到上面去或者架构重新变化统一跳转到index后再路由分发
elsif params[:path] && params[:path]&.include?("h5educoderbuild") && params[:path].split("/").first == "h5educoderbuild"
# TODO: 这块之后需要整合者架构重新变化统一跳转到index后再路由分发
if params[:path] && params[:path]&.include?("h5educoderbuild") && params[:path].split("/").first == "h5educoderbuild"
render file: 'public/h5educoderbuild/index.html', :layout => false
else
render file: 'public/react/build/index.html', :layout => false

@ -1,5 +1,4 @@
class Weapps::ShixunListsController < ApplicationController
before_action :require_login
def index
results = Weapps::ShixunSearchService.call(search_params, current_laboratory)

@ -1,5 +1,5 @@
class Weapps::SubjectsController < Weapps::BaseController
before_action :require_login
before_action :require_login, except: [:index, :show]
before_action :find_subject, except: [:index]
# 首页

@ -1,3 +1,4 @@
class HackCode < ApplicationRecord
# 编程题代码相关
belongs_to :hack
end

@ -6,20 +6,23 @@ class SalesmanChannel < ApplicationRecord
school.name
end
def teacher_count
UserExtension.where(school_id: school_id).where.not(identity: 1).count
def teacher_count(start_time, end_time, keyword)
UserExtension.joins(:school).where("schools.name like '%#{keyword}%' and user_extensions.identity=0
and user_extensions.created_at between '#{start_time}' and '#{end_time}'").count
# UserExtension.where(school_id: school_id).where(query).count
end
def student_count
UserExtension.where(school_id: school_id, identity: 1).count
def student_count(start_time, end_time, keyword)
UserExtension.joins(:school).where("schools.name like '%#{keyword}%' and user_extensions.identity=1
and user_extensions.created_at between '#{start_time}' and '#{end_time}'").count
end
def course_count
Course.where(school_id: school_id).count
def course_count(start_time, end_time, keyword)
Course.joins(:school).where("schools.name like '%#{keyword}%' and courses.created_at between '#{start_time}' and '#{end_time}'").count
end
def shixuns_count
ShixunMember.joins("join user_extensions on user_extensions.user_id = shixun_members.user_id")
def shixuns_count(start_time, end_time, keyword)
ShixunMember.joins("join user_extensions on user_extensions.user_id = shixun_members.user_id and shixun_members.created_at between '#{start_time}' and '#{end_time}'")
.where(user_extensions: {school_id: school_id}).pluck(:shixun_id).uniq.count
end

@ -2,12 +2,32 @@
<% add_admin_breadcrumb("#{@salesman.name}的渠道", admins_salesmans_path) %>
<% end %>
<div class="box search-form-container salesman-channel-list-form rig">
<div class="flex-1">
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('数据变化报表', admins_school_statistics_path) %>
<% end %>
<div class="box search-form-container saleman-channel-list-form">
<form class="form-inline search-form d-flex" data-search-form-url="<%= admins_salesman_channels_path %>">
<div class="time-select">
<div class="form-group grow-date-container">
<div class="input-group input-daterange grow-date-input-daterange">
<%= text_field_tag :start_date, params[:start_date], class: 'form-control start-date mx-0', placeholder: '开始时间' %>
<div class="input-group-prepend"><span class="input-group-text">到</span></div>
<%= text_field_tag :end_date, params[:start_date], class: 'form-control end-date mx-0', placeholder: '结束时间' %>
</div>
</div>
</div>
<%= text_field_tag :keyword, params[:keyword], placeholder: 'ID/单位名称检索', class: 'form-control mx-3 search-input' %>
<%= javascript_void_link '搜索', class: 'btn btn-primary search-btn', target: '' %>
</form>
<div class="flex-12">
<%= javascript_void_link '新增渠道', class: 'btn btn-primary', data: {salesman_id: @salesman.id, toggle: 'modal', target: '.admin-add-salesman-channel-user-modal' } %>
</div>
</div>
<div class="box admin-list-container salesman-channel-list-container">
<%= render(partial: 'admins/salesman_channels/shared/list') %>
</div>

@ -19,16 +19,16 @@
<span><%= channel.school_name %></span>
</td>
<td class="text-left">
<span><%= channel.teacher_count %></span>
<span><%= channel.teacher_count(@start_time, @end_time, @keyword) %></span>
</td>
<td class="text-left">
<span><%= channel.student_count %></span>
<span><%= channel.student_count(@start_time, @end_time, @keyword) %></span>
</td>
<td>
<%= channel.course_count %>
<%= channel.course_count(@start_time, @end_time, @keyword) %>
</td>
<td>
<%= channel.shixuns_count %>
<%= channel.shixuns_count(@start_time, @end_time, @keyword) %>
</td>
<td>
<%= delete_link '删除', admins_salesman_channel_path(channel, salesman_id: channel.salesman_id, element: ".salesman-channel-item-#{channel.id}"), class: 'delete-salesman-action' %>

@ -1,7 +1,7 @@
class SyncSubjectdsMobile < ActiveRecord::Migration[5.2]
def change
SubDisciplineContainer.where(container_type: "Subject").find_each do |sc|
Subject.find(sc.container_id).update_column('show_mobile', true)
Subject.find(sc.container_id).update_column("show_mobile", true)
end
end
end

@ -45,13 +45,6 @@ class CommonWorkAppraise extends Component{
}
exportMdtoHtml=(md)=> {
let newmd=md;
newmd=newmd.replace(/TOC/g, '');
newmd=newmd.replace(/\[|]/g,'');
newmd=newmd.replace(/`/g, '');
newmd=newmd.replace(/`/g, '');
newmd=newmd.replace(/"/g, '');
newmd=newmd.replace(/"/g, '');
newmd=newmd.replace(/"/g, '');
const converter = new showdown.Converter({
extensions: [
showdownKatex({
@ -182,7 +175,7 @@ class CommonWorkAppraise extends Component{
<div className={"color-grey-6 mb15 font-16"}>
内容
</div>
<div className="markdown-body ml20" dangerouslySetInnerHTML={{__html: this.exportMdtoHtml(description)}}>
<div className="markdown-body ml20" dangerouslySetInnerHTML={{__html: markdownToHTML(description)}}>
</div>
{attachments.map((item,key)=>{

@ -160,13 +160,6 @@ class CCommentItem extends Component{
exportMdtoHtml=(md)=> {
let newmd=md;
newmd=newmd.replace(/TOC/g, '');
newmd=newmd.replace(/\[|]/g,'');
newmd=newmd.replace(/`/g, '');
newmd=newmd.replace(/`/g, '');
newmd=newmd.replace(/"/g, '');
newmd=newmd.replace(/"/g, '');
newmd=newmd.replace(/"/g, '');
const converter = new showdown.Converter({
extensions: [
showdownKatex({
@ -269,7 +262,7 @@ class CCommentItem extends Component{
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3" id={`reply_content_${item.id}`}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html:this.exportMdtoHtml(item.content)}}></div>
dangerouslySetInnerHTML={{__html:markdownToHTML(item.content)}}></div>
<div className="cl"></div>
</div>
</div>
@ -285,7 +278,7 @@ class CCommentItem extends Component{
render(){
let { item, commentIndex, homework_status, is_author }=this.props;
let { show_reply, show_appeal }=this.state;
const _content = item.content ? this.exportMdtoHtml(item.content) : ''
const _content = item.content ? markdownToHTML(item.content): ''
const isAnonymous = homework_status && homework_status.indexOf('匿评中') != -1
const isAppealing = homework_status && homework_status.indexOf('申诉中') != -1
const attachments = item.attachments;

@ -463,7 +463,7 @@ class PollDetailTabForthRules extends Component{
disabledTime={disabledDateTime}
disabledDate={disabledDate}
disabled={
this.props.isAdmin()===true?
this.props.isAdmin()===true?this.props.type==="Shixun"?false:
this.props.type==="Exercise"||this.props.type==="polls"?
rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ?this.props.isAdmin()?!flagPageEdit: true : !flagPageEdit : rule.e_timeflag == true ? this.props.isAdmin()?!flagPageEdit :true : !flagPageEdit:
rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ? true : !flagPageEdit : rule.e_timeflag == true ? true : !flagPageEdit:true

@ -2065,7 +2065,7 @@ class Trainingjobsetting extends Component {
}
//截止时间
if (moment(datas.data.end_time, "YYYY-MM-DD HH:mm") <= moment()) {
deadline = false;
// deadline = false;
}
//结束时间
if (moment(datas.data.late_time, "YYYY-MM-DD HH:mm") <= moment()) {
@ -2554,6 +2554,7 @@ class Trainingjobsetting extends Component {
}}
teacherdatapage={this.props.teacherdatapage}
rules={rules}
type={"Shixun"}
moduleName={"作业"}
course_group={rulest}
flagPageEdit={flagPageEdit}

@ -1,7 +1,7 @@
/*
* @Description:
* @Description:
* @Author: tangjiang
* @Github:
* @Github:
* @Date: 2020-01-14 13:39:12
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-14 16:30:05
@ -70,7 +70,7 @@ const DisplayTableData = (props) => {
dataSource={datas}
pagination={false}
loading={loading}
scroll={{y: 500}}
// scroll={{y: 500}}
ref={(ref)=>tableEl=ref}
footer={total ? () => renderFooter(total) : ''}
/>

@ -173,39 +173,39 @@ const App = (props) => {
title: '通关实训数',
dataIndex: 'passed_myshixun_count',
align: 'center',
with: 170,
render: (val) => val + '',
with: 130,
render: (val) => val + '',
sorter: (a, b) => a.passed_myshixun_count - b.passed_myshixun_count
},
{
title: '完成关卡',
dataIndex: 'passed_games_count',
align: 'center',
with: 170,
render: (val) => val + '',
with: 130,
render: (val) => val + '',
sorter: (a, b) => a.passed_games_count - b.passed_games_count
},
{
title: '代码行',
dataIndex: 'code_line_count',
align: 'center',
with: 170,
render: (val) => val + '',
with: 130,
render: (val) => val + '',
sorter: (a, b) => a.code_line_count - b.code_line_count
},
{
title: '评测次数',
dataIndex: 'evaluate_count',
align: 'center',
with: 170,
render: (val) => val + '',
with: 130,
render: (val) => val + '',
sorter: (a, b) => a.evaluate_count - b.evaluate_count
},
{
title: '所用时间',
dataIndex: 'cost_time',
align: 'center',
// with: 180,
with: 200,
render: (text) => (text && moment(text).format('HH:mm:ss')) || '-',
sorter: (a, b) => a.cost_time - b.cost_time
}

Loading…
Cancel
Save