Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
杨树明 6 years ago
commit 8c655fcc05

@ -34,7 +34,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){
$statisticBody.find('.shixun-chart-loading').hide(); $statisticBody.find('.shixun-chart-loading').hide();
if (data.data.length > 0) { if (data.data.length > 0) {
$shixunChart.css('height', '400px').css('width', '400px'); $shixunChart.css('height', '400px').css('width', '100%');
initShixunChart(data.names, data.data); initShixunChart(data.names, data.data);
} else { } else {
$statisticBody.find('.shixun-chart-empty').show(); $statisticBody.find('.shixun-chart-empty').show();
@ -146,7 +146,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){
$statisticBody.find('.hot-chart-loading').hide(); $statisticBody.find('.hot-chart-loading').hide();
if (data.names.length > 0) { if (data.names.length > 0) {
$statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%');
initHotEvaluating(data.names.reverse(), data.values.reverse()); initHotEvaluating(data.names.reverse(), data.values.reverse());
} else { } else {
$statisticBody.find('.hot-chart-empty').show(); $statisticBody.find('.hot-chart-empty').show();

@ -14,7 +14,13 @@
<td class="member-container"> <td class="member-container">
<%= render partial: 'admins/departments/shared/member_users', locals: { department: department } %> <%= render partial: 'admins/departments/shared/member_users', locals: { department: department } %>
</td> </td>
<td><%= link_to department.identifier.to_s, '#', target: '_blank' %></td> <td>
<% if department.identifier.present? %>
<%= link_to department.identifier.to_s, statistics_college_path(department.identifier), target: '_blank' %>
<% else %>
--
<% end %>
</td>
<td><%= department.host_count %></td> <td><%= department.host_count %></td>
<td><%= department.created_at&.strftime('%Y-%m-%d %H:%M') %></td> <td><%= department.created_at&.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container"> <td class="action-container">

@ -17,10 +17,10 @@
<% if @courses.present? %> <% if @courses.present? %>
<% @courses.each do |course| %> <% @courses.each do |course| %>
<tr> <tr>
<td class="text-left"><a href="/courses/<%= course.id %>/students" target="_blank" class="task-hide pl20 edu-txt-left" style="max-width: 220px"><%= course.name %></a></td> <td class="text-left"><a href="/courses/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td>
<% teacher_names = course.teacher_users.map(&:real_name).join('、') %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %>
<td class="text-left"> <td class="text-left">
<span class="d-inline-block text-truncate" style="max-width: 220px" data-toggle="tooltip" title="<%= teacher_names %>"> <span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>">
<%= teacher_names || '--' %> <%= teacher_names || '--' %>
</span> </span>
</td> </td>

@ -104,8 +104,8 @@
<th>排名</th> <th>排名</th>
<th>姓名</th> <th>姓名</th>
<th>管理课堂</th> <th>管理课堂</th>
<th>已发布实训作业</th> <th width="15%">已发布实训作业</th>
<th>未发布实训作业</th> <th width="15%">未发布实训作业</th>
<th>学生数</th> <th>学生数</th>
<th>完成率</th> <th>完成率</th>
<th>发布实训</th> <th>发布实训</th>

File diff suppressed because one or more lines are too long

@ -129134,7 +129134,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){
$statisticBody.find('.shixun-chart-loading').hide(); $statisticBody.find('.shixun-chart-loading').hide();
if (data.data.length > 0) { if (data.data.length > 0) {
$shixunChart.css('height', '400px').css('width', '400px'); $shixunChart.css('height', '400px').css('width', '100%');
initShixunChart(data.names, data.data); initShixunChart(data.names, data.data);
} else { } else {
$statisticBody.find('.shixun-chart-empty').show(); $statisticBody.find('.shixun-chart-empty').show();
@ -129246,7 +129246,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){
$statisticBody.find('.hot-chart-loading').hide(); $statisticBody.find('.hot-chart-loading').hide();
if (data.names.length > 0) { if (data.names.length > 0) {
$statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%');
initHotEvaluating(data.names.reverse(), data.values.reverse()); initHotEvaluating(data.names.reverse(), data.values.reverse());
} else { } else {
$statisticBody.find('.hot-chart-empty').show(); $statisticBody.find('.hot-chart-empty').show();

@ -109199,7 +109199,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){ $.get('/colleges/' + schoolId + '/shixun_chart_data', function(data){
$statisticBody.find('.shixun-chart-loading').hide(); $statisticBody.find('.shixun-chart-loading').hide();
if (data.data.length > 0) { if (data.data.length > 0) {
$shixunChart.css('height', '400px').css('width', '400px'); $shixunChart.css('height', '400px').css('width', '100%');
initShixunChart(data.names, data.data); initShixunChart(data.names, data.data);
} else { } else {
$statisticBody.find('.shixun-chart-empty').show(); $statisticBody.find('.shixun-chart-empty').show();
@ -109311,7 +109311,7 @@ $(document).on('turbolinks:load', function() {
$.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){ $.get('/colleges/' + schoolId + '/student_hot_evaluations', function(data){
$statisticBody.find('.hot-chart-loading').hide(); $statisticBody.find('.hot-chart-loading').hide();
if (data.names.length > 0) { if (data.names.length > 0) {
$statisticBody.find('.hot-chart').css('height', '400px').css('width', '400px'); $statisticBody.find('.hot-chart').css('height', '400px').css('width', '100%');
initHotEvaluating(data.names.reverse(), data.values.reverse()); initHotEvaluating(data.names.reverse(), data.values.reverse());
} else { } else {
$statisticBody.find('.hot-chart-empty').show(); $statisticBody.find('.hot-chart-empty').show();

@ -81,7 +81,7 @@ export function TPMIndexHOC(WrappedComponent) {
isRender: false, isRender: false,
AccountProfiletype: false, AccountProfiletype: false,
slowDownloading: false globalLoading: false
} }
} }
@ -137,7 +137,7 @@ export function TPMIndexHOC(WrappedComponent) {
keyupListener = (e) => { keyupListener = (e) => {
if (e.key === "Escape") { if (e.key === "Escape") {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
} }
} }
componentWillUnmount() { componentWillUnmount() {
@ -378,20 +378,27 @@ export function TPMIndexHOC(WrappedComponent) {
type===true?window.open(url):window.location.href=url; type===true?window.open(url):window.location.href=url;
} }
slowDownload = (url, tip) => { slowDownload = (url, tip) => {
this._slowDownloadTip = tip || '正在生成文件,请稍后...'; this._gLoadingTip = tip || '正在生成文件,请稍后...';
this.setState({ slowDownloading: true }) this.setState({ globalLoading: true })
const fileUrl = url; const fileUrl = url;
downloadFile({ downloadFile({
url: fileUrl, url: fileUrl,
successCallback: (url) => { successCallback: (url) => {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
console.log('successCallback') console.log('successCallback')
}, },
failCallback: (responseHtml, url) => { failCallback: (responseHtml, url) => {
this.setState({ slowDownloading: false }) this.setState({ globalLoading: false })
console.log('failCallback') console.log('failCallback')
} }
}) })
}
showGlobalLoading = (tip) => {
this._gLoadingTip = tip || '加载中,请稍后...';
this.setState({ globalLoading: true })
}
hideGlobalLoading = () => {
this.setState({ globalLoading: false })
} }
render() { render() {
let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state; let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state;
@ -418,7 +425,10 @@ export function TPMIndexHOC(WrappedComponent) {
DownloadFileA:(title,url)=>this.DownloadFileA(title,url), DownloadFileA:(title,url)=>this.DownloadFileA(title,url),
DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url), DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url),
slowDownload: this.slowDownload slowDownload: this.slowDownload,
showGlobalLoading: this.showGlobalLoading,
hideGlobalLoading: this.hideGlobalLoading,
} }
return ( return (
<div className="indexHOC"> <div className="indexHOC">
@ -456,7 +466,7 @@ export function TPMIndexHOC(WrappedComponent) {
} }
.globalSpin { .globalSpin {
max-height: 700px !important;
} }
.indexHOC > .ant-spin-nested-loading { .indexHOC > .ant-spin-nested-loading {
background: #000; background: #000;
@ -471,9 +481,9 @@ export function TPMIndexHOC(WrappedComponent) {
} }
` `
}</style> }</style>
<Spin spinning={this.state.slowDownloading} delay={0} className="globalSpin" <Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" size="large"
tip= {this._slowDownloadTip || "加载中..."} tip= {this._gLoadingTip || "加载中..."}
> >
<NewHeader {...this.state} {...this.props}></NewHeader> <NewHeader {...this.state} {...this.props}></NewHeader>

Loading…
Cancel
Save