221 lines
8.9 KiB
HTML
221 lines
8.9 KiB
HTML
|
|
|
|
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<base href="/bigdata/">
|
|
<meta charset="UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.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-fluid layui-anim layui-anim-fadein">
|
|
<div class="layui-row">
|
|
<div class="layui-col-md12">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
|
<div class="layui-inline" id="areaBox" style="width: 150px;"></div>
|
|
<script id="areaTemplate" type="text/html">
|
|
<select id="areaId" name="areaId" lay-filter="areaChange">
|
|
<option value="">请选择地区</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
<div class="layui-inline" id="communityBox" style="width: 150px;"></div>
|
|
<script id="communityTemplate" type="text/html">
|
|
<select id="communityId" name="communityId">
|
|
<option value="">请选择社区</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.communityId}}">{{item.communityName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
<div class="layui-inline">
|
|
<input type="text" id="startTime" class="layui-input search-item"
|
|
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
|
</div>
|
|
<div class="layui-inline">
|
|
<input type="text" id="endTime" class="layui-input search-item"
|
|
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
|
</div>
|
|
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
|
<i class="fa fa-lg fa-search"></i> 搜索
|
|
</button>
|
|
</div>
|
|
|
|
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="assets/layuiadmin/layui/layui.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
layui.config({
|
|
base: 'assets/layuiadmin/'
|
|
}).extend({
|
|
index: 'lib/index'
|
|
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
|
var $ = layui.$;
|
|
var $win = $(window);
|
|
var laytpl = layui.laytpl;
|
|
var table = layui.table;
|
|
var admin = layui.admin;
|
|
var form = layui.form;
|
|
var laydate = layui.laydate;
|
|
var tableUrl = 'api/kpi/list-community-case-count';
|
|
var dataLoading = false;
|
|
|
|
function init(){
|
|
laydate.render({
|
|
elem: '#startTime'
|
|
,value: ''
|
|
});
|
|
laydate.render({
|
|
elem: '#endTime'
|
|
,value: ''
|
|
});
|
|
initArea();
|
|
initCommunity('');
|
|
initTable();
|
|
}
|
|
init();
|
|
|
|
//初始化地区
|
|
function initArea(){
|
|
top.restAjax.get('api/kpi/list-area', {}, null, function(code, data) {
|
|
laytpl(document.getElementById('areaTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('areaBox').innerHTML = html;
|
|
});
|
|
form.render('select');
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
form.on('select(areaChange)',function(data){
|
|
var areaId = data.value;
|
|
initCommunity(areaId);
|
|
});
|
|
|
|
//初始化社区
|
|
function initCommunity(areaId){
|
|
if(!areaId){
|
|
laytpl(document.getElementById('communityTemplate').innerHTML).render([], function(html) {
|
|
document.getElementById('communityBox').innerHTML = html;
|
|
});
|
|
form.render('select');
|
|
return;
|
|
}
|
|
top.restAjax.get('api/kpi/list-community/area-id/'+ areaId, {}, null, function(code, data) {
|
|
laytpl(document.getElementById('communityTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('communityBox').innerHTML = html;
|
|
});
|
|
form.render('select');
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化表格
|
|
function initTable() {
|
|
dataLoading = true;
|
|
table.render({
|
|
elem: '#dataTable',
|
|
id: 'dataTable',
|
|
url: top.restAjax.path(tableUrl, []),
|
|
where :{
|
|
areaId : $('#areaId').val(),
|
|
communityId : $('#communityId').val()
|
|
},
|
|
width: admin.screen() > 1 ? '100%' : '',
|
|
height: $win.height() - 100,
|
|
toolbar: false,
|
|
defaultToolbar: ['print', 'exports'],
|
|
cols: [[
|
|
{field:'areaName', width:180, title: '地区', fixed: 'left', align:'center'},
|
|
{field:'communityName', width:180, title: '社区', fixed: 'left', align:'center'},
|
|
{field:'caseTotal', width:100, title: '案件总数', align:'center',
|
|
templet: function(row) {
|
|
var rowData = row[this.field];
|
|
return rowData + '件';
|
|
}
|
|
},
|
|
{field:'caseAcceptTotal', width:160, title: '已受理案件', align:'center',
|
|
templet: function(row) {
|
|
var rowData = row[this.field];
|
|
return rowData + '件'
|
|
}
|
|
},
|
|
{field:'caseHandleTotal', width:160, title: '已处理案件', align:'center',
|
|
templet: function(row) {
|
|
var rowData = row[this.field];
|
|
return rowData + '件';
|
|
}
|
|
},
|
|
{field:'caseInspectTotal', width:160, title: '已检查案件', align:'center',
|
|
templet: function(row) {
|
|
var rowData = row[this.field];
|
|
return rowData + '件';
|
|
}
|
|
},
|
|
{field:'caseOnfileTotal', width:160, title: '已归档案件', align:'center',
|
|
templet: function(row) {
|
|
var rowData = row[this.field];
|
|
return rowData + '件';
|
|
}
|
|
},
|
|
]],
|
|
page: false,
|
|
parseData: function(data) {
|
|
return {
|
|
'code': 0,
|
|
'msg': '',
|
|
'count': data.length,
|
|
'data': data
|
|
};
|
|
},
|
|
done: function(){
|
|
dataLoading = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
// 重载表格
|
|
function reloadTable() {
|
|
dataLoading = true;
|
|
table.reload('dataTable', {
|
|
url: top.restAjax.path(tableUrl, []),
|
|
where: {
|
|
areaId : $('#areaId').val(),
|
|
communityId : $('#communityId').val(),
|
|
startTime : $('#startTime').val(),
|
|
endTime : $('#endTime').val(),
|
|
},
|
|
height: $win.height() - 100,
|
|
done:function(){
|
|
dataLoading = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
$(document).on('click', '#search', function() {
|
|
if(dataLoading){
|
|
layer.msg('数据加载中,请稍等...');
|
|
return;
|
|
}
|
|
reloadTable(1);
|
|
});
|
|
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |