增加部门统计, 网格员统计

This commit is contained in:
cuibaocheng 2021-11-09 17:23:54 +08:00
parent d7a5adbdb0
commit f40b789127
6 changed files with 1078 additions and 0 deletions

View File

@ -0,0 +1,115 @@
package cn.com.tenlion.pojo.dtos.casestatistics;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: CaseStatisticsAreaDTO
* @Description: 区域
* @Author: CodeFactory
* @Date: 2021-09-06 17:00:49
* @Version: 3.0
**/
@ApiModel
public class CaseStatisticsAreaDTO {
@ApiModelProperty(name = "areaId", value = "地区ID")
private String areaId;
@ApiModelProperty(name = "areaName", value = "地区名称")
private String areaName;
@ApiModelProperty(name = "areaCode", value = "地区编码")
private String areaCode;
@ApiModelProperty(name = "areaParentId", value = "父地区ID")
private String areaParentId;
@ApiModelProperty(name = "areaParentName", value = "父地区名称")
private String areaParentName;
@ApiModelProperty(name = "subCount", value = "地区数据总量")
private Integer dataCount;
@ApiModelProperty(name = "subList", value = "是否有子区域")
private Boolean subList = false;
@ApiModelProperty(name = "areaList", value = "是否有子区域")
private List<CaseStatisticsAreaDTO> areaList;
@ApiModelProperty(name = "dataList", value = "区域数据")
private List<CaseStatisticsAreaDataDTO> dataList;
public String getAreaCode() {
return areaCode == null ? "" : areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public List<CaseStatisticsAreaDataDTO> getDataList() {
if (dataList == null) {
return new ArrayList<>();
}
return dataList;
}
public void setDataList(List<CaseStatisticsAreaDataDTO> dataList) {
this.dataList = dataList;
}
public List<CaseStatisticsAreaDTO> getAreaList() {
if (areaList == null) {
return new ArrayList<>();
}
return areaList;
}
public void setAreaList(List<CaseStatisticsAreaDTO> areaList) {
this.areaList = areaList;
}
public Boolean getSubList() {
return subList;
}
public void setSubList(Boolean subList) {
this.subList = subList;
}
public Integer getDataCount() {
return dataCount;
}
public void setDataCount(Integer dataCount) {
this.dataCount = dataCount;
}
public String getAreaParentId() {
return areaParentId == null ? "" : areaParentId;
}
public void setAreaParentId(String areaParentId) {
this.areaParentId = areaParentId;
}
public String getAreaParentName() {
return areaParentName == null ? "" : areaParentName;
}
public void setAreaParentName(String areaParentName) {
this.areaParentName = areaParentName;
}
public String getAreaId() {
return areaId == null ? "" : areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName == null ? "" : areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}

View File

@ -0,0 +1,81 @@
package cn.com.tenlion.pojo.dtos.casestatistics;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
*
* @ClassName: CaseStatisticsDTO
* @Description: 事件统计
* @Author: CodeFactory
* @Date: 2021-09-06 17:00:49
* @Version: 3.0
**/
@ApiModel
public class CaseStatisticsDepartmentDTO {
@ApiModelProperty(name = "areaId", value = "地区ID")
private String areaId;
@ApiModelProperty(name = "areaName", value = "地区名称")
private String areaName;
@ApiModelProperty(name = "areaParentId", value = "父地区ID")
private String areaParentId;
@ApiModelProperty(name = "areaParentName", value = "父地区名称")
private String areaParentName;
@ApiModelProperty(name = "subCount", value = "地区子集数量")
private Integer subCount;
@ApiModelProperty(name = "subList", value = "是否有子区域")
private Boolean subList = false;
public Boolean getSubList() {
return subList;
}
public void setSubList(Boolean subList) {
this.subList = subList;
}
public Integer getSubCount() {
return subCount;
}
public void setSubCount(Integer subCount) {
this.subCount = subCount;
}
public String getAreaParentId() {
return areaParentId == null ? "" : areaParentId;
}
public void setAreaParentId(String areaParentId) {
this.areaParentId = areaParentId;
}
public String getAreaParentName() {
return areaParentName == null ? "" : areaParentName;
}
public void setAreaParentName(String areaParentName) {
this.areaParentName = areaParentName;
}
public String getAreaId() {
return areaId == null ? "" : areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName == null ? "" : areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}

View File

@ -0,0 +1,127 @@
package cn.com.tenlion.pojo.dtos.casestatistics;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: CaseStatisticsItemDTO
* @Description: 事件统计详情
* @Author: CodeFactory
* @Date: 2021-09-06 17:00:49
* @Version: 3.0
**/
@ApiModel
public class CaseStatisticsDepartmentItemDTO {
@ApiModelProperty(name = "areaId", value = "地区ID")
private String areaId;
@ApiModelProperty(name = "areaName", value = "地区名称")
private String areaName;
@ApiModelProperty(name = "reportNumber", value = "上报数")
private Integer reportNumber=0;
@ApiModelProperty(name = "processesNumber", value = "处理数")
private Integer processesNumber=0;
@ApiModelProperty(name = "eventNumber", value = "事件数")
private Integer eventNumber=0;
@ApiModelProperty(name = "overtimeNumber", value = "超时数")
private Integer overtimeNumber=0;
@ApiModelProperty(name = "notOvertimeNumber", value = "未超时数")
private Integer notOvertimeNumber=0;
@ApiModelProperty(name = "completeNumber", value = "完成量")
private Integer completeNumber=0;
@ApiModelProperty(name = "notCompleteNumber", value = "未完成量")
private Integer notCompleteNumber=0;
@ApiModelProperty(name = "eventNumber", value = "超时占比")
private Double overtimeProportionNumber=0.00;
@ApiModelProperty(name = "sunList", value = "是否有子集")
private Boolean subList=false;
public Boolean getSubList() {
return subList;
}
public void setSubList(Boolean subList) {
this.subList = subList;
}
public String getAreaId() {
return areaId == null ? "" : areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName == null ? "" : areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getReportNumber() {
return reportNumber;
}
public void setReportNumber(Integer reportNumber) {
this.reportNumber = reportNumber;
}
public Integer getProcessesNumber() {
return processesNumber;
}
public void setProcessesNumber(Integer processesNumber) {
this.processesNumber = processesNumber;
}
public Integer getEventNumber() {
return eventNumber;
}
public void setEventNumber(Integer eventNumber) {
this.eventNumber = eventNumber;
}
public Integer getOvertimeNumber() {
return overtimeNumber;
}
public void setOvertimeNumber(Integer overtimeNumber) {
this.overtimeNumber = overtimeNumber;
}
public Integer getNotOvertimeNumber() {
return notOvertimeNumber;
}
public void setNotOvertimeNumber(Integer notOvertimeNumber) {
this.notOvertimeNumber = notOvertimeNumber;
}
public Integer getCompleteNumber() {
return completeNumber;
}
public void setCompleteNumber(Integer completeNumber) {
this.completeNumber = completeNumber;
}
public Integer getNotCompleteNumber() {
return notCompleteNumber;
}
public void setNotCompleteNumber(Integer notCompleteNumber) {
this.notCompleteNumber = notCompleteNumber;
}
public Double getOvertimeProportionNumber() {
return overtimeProportionNumber;
}
public void setOvertimeProportionNumber(Double overtimeProportionNumber) {
this.overtimeProportionNumber = overtimeProportionNumber;
}
}

View File

@ -0,0 +1,44 @@
package cn.com.tenlion.pojo.dtos.casestatistics;
/**
* 队伍人员
*/
public class TeamMemberCountDTO {
private String areaCode;
private String areaName;
private String userId;
private String userName;
public String getAreaCode() {
return areaCode == null ? "" : areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getAreaName() {
return areaName == null ? "" : areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getUserId() {
return userId == null ? "" : userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName == null ? "" : userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}

View File

@ -0,0 +1,2 @@
spring.activiti.database-schema-update=true
spring.activiti.check-process-definitions=false

View File

@ -0,0 +1,709 @@
<!doctype html>
<html lang="en">
<head>
<base href="/case/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md3" id="tableAreaDiv">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;padding-bottom: 7px">
<button type="button" id="back" class="layui-btn layui-btn-sm layui-right callback" style="float:right;">
<i class="fa fa-lg fa-reply-all"></i> 后退
</button>
</div>
<input id="queryMode" value="" type="hidden"/>
<div id="headerToolBarBox"></div>
<table class="layui-hide" id="dataTableArea" lay-filter="dataTableArea"></table>
<script type="text/html" id="headerToolBar">
{{d.areaName}}
<input id="areaParentId" type="hidden" value="{{d.areaParentId}}"/>
<input id="areaId" type="hidden" value="{{d.areaId}}"/>
</script>
</div>
</div>
</div>
<div class="layui-col-md9">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="hidden" id="startTimeA">
<input type="text" style="cursor:pointer;" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="hidden" id="endTimeA">
<input type="text" id="endTime" style="cursor:pointer;" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<button type="button" id="search" style="margin-left: 15px;" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="selectYear" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-calendar-o"></i> 统计本年
</button>
<button type="button" id="selectMonth" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-calendar"></i> 统计本月
</button>
<button type="button" id="excel" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 导出Excel
</button>
</div>
<!-- <div id="headerToolBarBox" style="padding-bottom: 10px"></div>-->
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- <script type="text/html" id="headerToolBar">-->
<!-- <div style="text-align: center;width:100% !important;font-size: 17px">-->
<!-- -->
<!-- <h2 style="cursor:pointer;" class="{{d.areaId == '110889' ? '' : 'callback'}}">{{d.areaId == '110889' ? '' : '<i class="fa fa-lg fa-reply-all "></i>'}}<u >{{d.areaName}}</u> {{d.title}}</h2>-->
<!-- </div>-->
<!-- </script>-->
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index',
excel: 'layui_exts/excel',
}).use(['index', 'table', 'laydate', 'common', 'laytpl', 'excel'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var common = layui.common;
var excel = layui.excel;
var resizeTimeout = null;
var tableUrl = 'api/casestatistics/gridlist';
var tableAreaUrl = 'api/casestatistics/gridarealist';
var tableAreaExcelUrl = 'api/casestatistics/gridlistexcel';
// 初始化区域表格
function initTableArea() {
var width = $("#tableAreaDiv").width() - 33;
table.render({
elem: '#dataTableArea',
id: 'dataTableArea',
url: top.restAjax.path(tableAreaUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 62,
defaultToolbar: [],
cols: [
[
{field: 'areaName', width: width/5*3, title: '地区', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(row["subList"] == true) {
return '<button type="button" class="layui-btn layui-btn-sm" lay-event="areaNameEvent">' +
rowData + ' <i class="fa fa-lg fa-sign-in"></i>' +
'</button> ';
}else{
return rowData;
}
}
},
{field: 'dataCount', width: width/5*2, title: '该地区网格员数量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return '<u><a style="cursor: pointer;color:#0066ff;" href="javascript:void(0);" lay-event="areaNameDataEvent">' +
rowData + "位网格员"
'</a></u>';
}
}
]
],
parseData: function(data) {
laytpl(document.getElementById('headerToolBar').innerHTML).render(data, function(html) {
document.getElementById('headerToolBarBox').innerHTML = html;
});
console.log(data);
return {
'code': 0,
'data': data.areaList
};
}
});
}
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 62,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
defaultToolbar: [],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{field: 'name', width: 180, title: '网格员', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'reportNumber', width: 120, title: '上报数', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'processesNumber', width: 120, title: '处理数', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'eventNumber', width: 120, title: '事件量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'overtimeNumber', width: 120, title: '超时量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'notOvertimeNumber', width: 120, title: '未超时量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'completeNumber', width: 120, title: '完成量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'notCompleteNumber', width: 120, title: '未完成量', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData;
}
},
{field: 'overtimeProportionNumber', width: 120, title: '超时占比', align:'center',
templet: function(row) {
var rowData = row[this.field];
return rowData + "%";
}
},
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载区域表格
function reloadTableArea() {
table.reload('dataTableArea', {
url: top.restAjax.path(tableAreaUrl, []),
where: {
areaId:$("#areaId").val(),
time: new Date()
},
height: $win.height() - 62,
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
areaId:$("#areaId").val(),
selectYear:$("#selectYear").hasClass("layui-btn-normal"),
selectMonth:$("#selectMonth").hasClass("layui-btn-normal"),
queryMode:$("#queryMode").val(),
time: new Date()
},page: {
curr: currentPage
},
height: $win.height() - 62,
});
}
$(document).on("click","#excel", function() {
var requestData = {
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
areaId:$("#areaId").val(),
selectYear:$("#selectYear").hasClass("layui-btn-normal"),
selectMonth:$("#selectMonth").hasClass("layui-btn-normal"),
queryMode:$("#queryMode").val(),
time: new Date()
}
exportApiDemo(tableAreaExcelUrl, requestData);
});
$(document).on("click","#selectYear", function() {
if(!$(this).hasClass("layui-btn-normal")) {
$("#selectMonth").removeClass("layui-btn-normal");
$('#startTime').val("");
$('#endTime').val("");
}
$(this).toggleClass("layui-btn-normal");
reloadTable();
});
$(document).on("click","#selectMonth", function() {
if(!$(this).hasClass("layui-btn-normal")) {
$("#selectYear").removeClass("layui-btn-normal");
$('#startTime').val("");
$('#endTime').val("");
}
$(this).toggleClass("layui-btn-normal");
reloadTable();
});
$(document).on("click",".callback", function() {
$("#areaId").val($("#areaParentId").val());
$("#queryMode").val("");
reloadTableArea();
reloadTable();
});
table.on('tool(dataTableArea)', function(obj) {
var layEvent = obj.event;
var data = obj.data;
if(layEvent === 'areaNameEvent') {
$("#areaId").val(data.areaId);
$("#queryMode").val("");
reloadTableArea();
reloadTable();
}
if(layEvent === 'areaNameDataEvent') {
$("#areaId").val(data.areaId);
$("#queryMode").val("queryCurrentArea");
reloadTable()// 只加载当前数据
}
});
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
type: 'month',
format: 'yyyy年MM月',
max: 0 ,
done: function(value, date, endDate){
$("#startTimeA").val(date.year + "-" + date.month);
if($("#endTimeA").val()) {
var endTimeArr = $("#endTimeA").val().split("-");
var start = new Date(date.year, date.month);
var end = new Date(endTimeArr[0], endTimeArr[1]);
if (start > end) {
layer.msg("开始时间错误");
setTimeout(function () {
$("#startTime").val("");
$("#startTimeA").val("");
}, 20);
return false;
}else {
$("#selectYear").removeClass("layui-btn-normal");
$("#selectMonth").removeClass("layui-btn-normal");
}
}else {
$("#selectYear").removeClass("layui-btn-normal");
$("#selectMonth").removeClass("layui-btn-normal");
}
}
});
laydate.render({
elem: '#endTime',
type: 'month',
format: 'yyyy年MM月',
max: 0,
done: function(value, date, endDate){
$("#endTimeA").val(date.year + "-" + date.month);
if($("#startTimeA").val()) {
var endTimeArr = $("#startTimeA").val().split("-");
var start = new Date(endTimeArr[0], endTimeArr[1]);
var end = new Date(date.year, date.month);
if (start > end) {
layer.msg("结束时间错误");
setTimeout(function () {
$("#endTime").val("");
$("#endTimeA").val("");
}, 20);
return false;
}else {
$("#selectYear").removeClass("layui-btn-normal");
$("#selectMonth").removeClass("layui-btn-normal");
}
}else {
$("#selectYear").removeClass("layui-btn-normal");
$("#selectMonth").removeClass("layui-btn-normal");
}
}
});
}
initTableArea();
initTable();
initDate();
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
/**
* 导出接口数据
*/
function exportApiDemo(url, requestData) {
var timestart = Date.now()
var loadLayerIndex = top.dialog.msg("正在导出Excel数据中...", {icon: 16, time: 0, shade: 0.3});
$.ajax({
url: url,
dataType: 'json',
data: requestData,
success: function (res) {
var list = res.areaList;
/**
* v单元格的值
* t单元格的类型 'b'布尔值、'n'数字、'e'错误、's'字符串、'd'日期
* s单元格的样式
*/
var data = [
{
areaName: {
v: res.areaName ,
s: {
alignment: {
horizontal: 'center',
vertical: 'center'
},
font: {
bold:true,
sz: 20,
color: {
rgb: "FF0187FA"
}
},
// fill: {
// bgColor: {
// indexed: 64
// },
// fgColor: {
// rgb: "FFF"
// }
// }
}
}, name: '', reportNumber: '', processesNumber: '', eventNumber: '', overtimeNumber: '', notOvertimeNumber: '', completeNumber: '', notCompleteNumber: '', overtimeProportionNumber: ''
},// 被合并的列数据也需要填充上
{
areaName: {
v:'地区',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
},
name: {
v:'网格员',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
},
reportNumber: {
v:'上报数',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
}, processesNumber: {
v:'处理数',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
}, eventNumber: {
v:'事件量',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
},overtimeNumber: {
v:'超时量',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
}, notOvertimeNumber: {
v:'未超时量',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
}, completeNumber: {
v:'完成量',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
},notCompleteNumber: {
v:'未完成量',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
}, overtimeProportionNumber: {
v:'超时占比',
s:{
alignment: {
horizontal: 'center',
},
font: {
bold:true
}
}
},
}
];
for(var j = 0 ; j < list.length; j++) {
var dataList = list[j].dataList;
var areaName = list[j].areaName;
if(requestData.queryMode != "queryCurrentArea") {
data.push({
areaName: {
v: areaName,
s: {
alignment: {
horizontal: 'center',
vertical: 'center'
},
font: {
bold: true,
sz: 12,
color: {
rgb: "FF0187FA"
}
},
// fill: {
// bgColor: {
// indexed: 64
// },
// fgColor: {
// rgb: "FFF"
// }
// }
}
},
name: '',
reportNumber: '',
processesNumber: '',
eventNumber: '',
overtimeNumber: '',
notOvertimeNumber: '',
completeNumber: '',
notCompleteNumber: '',
overtimeProportionNumber: ''
});
}
for(var i = 0 ; i < dataList.length; i++) {
var rowData = dataList[i];
data.push(
{
areaName:{
v:rowData.areaName,
t:"s",
s:{
alignment: {
horizontal: 'center',
},
font: {
color: {
rgb: "FFD700"
}
},
}
},
name:{
v:rowData.name,
t:"s",
s:{
alignment: {
horizontal: 'center',
}
}
},
reportNumber: {
v:rowData.reportNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
processesNumber: {
v:rowData.processesNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
eventNumber: {
v:rowData.eventNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
overtimeNumber: {
v:rowData.overtimeNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
notOvertimeNumber: {
v:rowData.notOvertimeNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
completeNumber: {
v:rowData.completeNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
notCompleteNumber: {
v:rowData.notCompleteNumber,
t:"n",
s:{
alignment: {
horizontal: 'center',
}
}
},
overtimeProportionNumber: {
v:rowData.overtimeProportionNumber + "%",
t:"s",
s:{
alignment: {
horizontal: 'center',
}
}
},
}
);
}
}
// 列合并
var mergeConf = excel.makeMergeConfig([
['A1', 'J1']
])
// A列宽 200, 默认给80
var colConf = excel.makeColConfig({
'A': 150,
'B': 150,
}, 140);
// 每一行的行高, 默认给20
var rowConf = excel.makeRowConfig({
1: 30,
}, 20)
excel.exportExcel({
sheet1: data
}, res.areaName + '.xlsx', 'xlsx', {
extend: {
sheet1: {
'!merges': mergeConf
, '!cols': colConf
, '!rows': rowConf
}
}
})
var timeend = Date.now()
var spent = (timeend - timestart) / 1000
top.dialog.close(loadLayerIndex);
layer.msg('导出耗时 :' + spent + ' s');
}
, error: function () {
layer.alert('获取数据失败, 请检查网络');
}
});
}
});
</script>
</body>
</html>