Commit bb297ef0 authored by 王国存's avatar 王国存

Merge branch 'test' into 'master'

Test

See merge request !37
parents 1d72ecd2 ae511555
...@@ -390,15 +390,15 @@ public class QuestionnaireCtrl { ...@@ -390,15 +390,15 @@ public class QuestionnaireCtrl {
//列表排序 //列表排序
String sorting = ""; String sorting = "";
if(StringUtils.isEmpty(performanceSummary.getSorting())){ if(StringUtils.isEmpty(performanceSummary.getSorting())){
sorting = "tr.id asc"; sorting = "t_record.id asc";
} else if(performanceSummary.getSorting().equals("desc")){ } else if(performanceSummary.getSorting().equals("desc")){
sorting = "basicIndicators desc,guideIndicators desc,rewardIndicators desc"; sorting = "basicIndicators desc,guideIndicators desc,rewardIndicators desc";
}else{ }else{
sorting = "tr.id asc"; sorting = "t_record.id asc";
} }
performanceSummary.setSorting(sorting); performanceSummary.setSorting(sorting);
int totalScore = 0; float totalScore = 0;
//查询空间的不同指标的分数 //查询空间的不同指标的分数
List<PerformanceSummary> performanceSummaryList = questionnaireService.selectPerformanceSummaryList(performanceSummary); List<PerformanceSummary> performanceSummaryList = questionnaireService.selectPerformanceSummaryList(performanceSummary);
if(performanceSummaryList.size() > 0){ if(performanceSummaryList.size() > 0){
......
...@@ -3,10 +3,10 @@ package com.tiptimes.model; ...@@ -3,10 +3,10 @@ package com.tiptimes.model;
public class PerformanceSummary { public class PerformanceSummary {
private String optinName;//众创空间名称 private String optinName;//众创空间名称
private int basicIndicators;//基础指标得分 private float basicIndicators;//基础指标得分
private int guideIndicators;//引导指标得分 private float guideIndicators;//引导指标得分
private int rewardIndicators;//奖励指标得分 private float rewardIndicators;//奖励指标得分
private int totalScore;//合计得分 private float totalScore;//合计得分
private String sorting; //排序使用 - desc 默认 --asc 升 private String sorting; //排序使用 - desc 默认 --asc 升
...@@ -18,35 +18,35 @@ public class PerformanceSummary { ...@@ -18,35 +18,35 @@ public class PerformanceSummary {
this.optinName = optinName; this.optinName = optinName;
} }
public int getBasicIndicators() { public float getBasicIndicators() {
return basicIndicators; return basicIndicators;
} }
public void setBasicIndicators(int basicIndicators) { public void setBasicIndicators(float basicIndicators) {
this.basicIndicators = basicIndicators; this.basicIndicators = basicIndicators;
} }
public int getGuideIndicators() { public float getGuideIndicators() {
return guideIndicators; return guideIndicators;
} }
public void setGuideIndicators(int guideIndicators) { public void setGuideIndicators(float guideIndicators) {
this.guideIndicators = guideIndicators; this.guideIndicators = guideIndicators;
} }
public int getRewardIndicators() { public float getRewardIndicators() {
return rewardIndicators; return rewardIndicators;
} }
public void setRewardIndicators(int rewardIndicators) { public void setRewardIndicators(float rewardIndicators) {
this.rewardIndicators = rewardIndicators; this.rewardIndicators = rewardIndicators;
} }
public int getTotalScore() { public float getTotalScore() {
return totalScore; return totalScore;
} }
public void setTotalScore(int totalScore) { public void setTotalScore(float totalScore) {
this.totalScore = totalScore; this.totalScore = totalScore;
} }
......
This diff is collapsed.
...@@ -94,6 +94,13 @@ ...@@ -94,6 +94,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
  <div style="width: 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
    <div class="progress progress-striped active" style="margin-bottom: 0;background-color:rgba(0,0,0,0)">
    <img src="<%=request.getContextPath()%>/res/image/loading.gif"><span style="color: white">数据加载中,请稍候...</span>
</div>
  </div>
</div>
<!-- 全局js --> <!-- 全局js -->
<script src="<%=request.getContextPath()%>/res/js/jquery.min.js?v=2.1.4"></script> <script src="<%=request.getContextPath()%>/res/js/jquery.min.js?v=2.1.4"></script>
<script src="<%=request.getContextPath()%>/res/js/bootstrap.min.js?v=3.3.6"></script> <script src="<%=request.getContextPath()%>/res/js/bootstrap.min.js?v=3.3.6"></script>
......
...@@ -90,17 +90,36 @@ function sortAsc() { ...@@ -90,17 +90,36 @@ function sortAsc() {
//导出汇总文件 //导出汇总文件
function reform_DIV_Export() { function reform_DIV_Export() {
$.ajax({ showLoading()
url: webroot + "questionnaire/exportPerformanceSummary", var url = webroot+"questionnaire/exportPerformanceSummary";
method: "GET", var xhr = new XMLHttpRequest();
responseType: "blob", xhr.open('GET', url, true); // 也可以使用POST方式,根据接口
success: (res) => { xhr.responseType = "blob"; // 返回类型blob
window.location.href = webroot+"questionnaire/exportPerformanceSummary" // 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
}, xhr.onload = function () {
error: () => { // 请求完成
swal("失败!",'网络有问题,稍后再试', "error") if (this.status === 200) {
// 返回200
var blob = this.response;
var reader = new FileReader();
reader.readAsDataURL(blob); // 转换为base64,可以直接放入a表情href
reader.onload = function (e) {
// 转换完成,创建一个a标签用于下载
var a = document.createElement('a');
a.download = '绩效汇总表.xls';
a.href = e.target.result;
$("body").append(a); // 修复firefox中无法触发click
a.click();
$(a).remove();
hideLoading()
}
}else {
hideLoading()
swal("失败!", '网络错误,稍后再试', "error");
} }
}) };
// 发送ajax请求
xhr.send()
} }
//搜索标题内容 //搜索标题内容
...@@ -142,4 +161,11 @@ function getTableData() { ...@@ -142,4 +161,11 @@ function getTableData() {
} }
}) })
}
showLoading = function(){
$('#loadingModal').modal({backdrop: 'static', keyboard: false});
}
hideLoading = function(){
$('#loadingModal').modal('hide');
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment