<!DOCTYPE html>
< html lang = "zh" xmlns:th = "http://www.thymeleaf.org" xmlns:shiro = "http://www.pollix.at/thymeleaf/shiro" >
< head >
< th:block th:include = "include :: header('用户统计列表')" / >
< th:block th:include = "include :: layout-latest-css" / >
< th:block th:include = "include :: ztree-css" / >
< / head >
< style >
.echart{
width: 100%;
height: 43%;
background-color: white;
margin-top: 10px;
border-radius: 10px;
box-shadow: 1px 1px 3px rgba(0, 0, 0, .2);
display: flex;
justify-content: space-between;
overflow: hidden;
}
.children_echarts{
width: 49%;
height: 100%;
}
< / style >
< body class = "gray-bg" >
< div class = "ui-layout-center" id = "app" >
< div class = "container-div" >
< div class = "row" >
< div class = "echart" >
< div class = "children_echarts left_echarts" >
< div id = "leftMain" style = "width: 600px;height:330px" > < / div >
< / div >
< div class = "children_echarts right_echarts" >
< div id = "rightMain" style = "width: 600px;height:330px" > < / div >
< / div >
< / div >
< div class = "col-sm-12 search-collapse" >
< form id = "user-form" >
< input type = "hidden" id = "deptId" name = "deptId" >
< input type = "hidden" id = "parentId" name = "parentId" >
< div class = "select-list" >
< ul >
< li >
< label > 单位名称:< / label >
< input type = "text" name = "deptName" / >
< / li >
< li >
< label > 所属市州:< / label >
< select id = "City" name = "framework" @ change = "getAreaList()" v-model = "City" >
< option value = "" > 请选择< / option >
< option v-for = "option in CityList" :value = "option.id" :key = "option.id" >
{{ option.name }}
< / option >
< / select >
< / li >
< li >
< label > 所属区县:< / label >
< select id = "Area" name = "area" v-model = "Area" >
< option value = "" > 请选择< / option >
< option v-for = "option in AreaList" :value = "option.id" :key = "option.id" >
{{ option.name }}
< / option >
< / select >
< / li >
< li >
< a class = "btn btn-primary btn-rounded btn-sm" onclick = "$.table.search()" > < i class = "fa fa-search" > < / i > 搜索< / a >
< a class = "btn btn-warning btn-rounded btn-sm" onclick = "resetPre()" > < i class = "fa fa-refresh" > < / i > 重置< / a >
< / li >
< / ul >
< / div >
< / form >
< / div >
< div class = "col-sm-12 select-table table-striped" style = "min-height: 44%;" >
< table id = "bootstrap-table" > < / table >
< / div >
< / div >
< / div >
< / div >
< th:block th:include = "include :: footer" / >
< th:block th:include = "include :: layout-latest-js" / >
< th:block th:include = "include :: ztree-js" / >
< th:block th:include = "include :: echarts-js" / >
< script th:inline = "javascript" >
var detailFlag = [[${@permission.hasPermi('system:usernum:detail')}]];
var politics = [[${@dict.getType('sys_user_politics')}]];
var shemichengdu = [[${@dict.getType('sys_user_shemi')}]];
var examineState = [[${@dict.getType('sys_examine_state')}]];
var prefix = ctx + "system/usernum";
let datas = []
$.ajax({
url: ctx + "system/area/getAllList",
type: 'GET',
data:{parentId:''} ,
success:((res)=>{
datas = res.data
}) ,
});
$(function() {
var panehHidden = false;
if ($(this).width() < 769 ) {
panehHidden = true;
}
$('body').layout({ initClosed: panehHidden, west__size: 185 });
// 回到顶部绑定
if ($.fn.toTop !== undefined) {
var opt = {
win:$('.ui-layout-center'),
doc:$('.ui-layout-center')
};
$('#scroll-up').toTop(opt);
}
queryUserList();
});
function queryUserList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
detail: prefix + "/detail/{id}",
print: prefix + "/print/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "用户",
pageSize:'5',
columns: [
{
field : 'dept.deptid',
title : '编号',
visible: false
},
{
field: 'dept.framework',
title: '所属市州',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'dept.area',
title: '所属区县',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'dept.deptName',
title: '所在单位'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('< a class = "btn btn-info btn-xs ' + detailFlag + '" href = "javascript:void(0)" onclick = "print(\'' + row.deptId + '\')" > < i class = "fa fa-download" > < / i > 打印< / a > ');
return actions.join(''); }
}]
};
$.table.init(options);
}
/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
function resetPre() {
resetDate();
$("#user-form")[0].reset();
$("#deptId").val("");
$("#parentId").val("");
$(".curSelectedNode").removeClass("curSelectedNode");
$.table.search();
}
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:'',
Area:'',
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
if (this.City){
this.getAreaList()
}
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
getAreaList(){
this.params.parentId = this.City
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params,
success:((res)=>{
this.AreaList = res.data
}) ,
});
}
}
})
/* 用户管理-部门 */
function dept() {
var url = ctx + "system/dept";
$.modal.openTab("部门管理", url);
}
function print(deptId) {
var url = prefix + '/print/' + deptId;
$.modal.openTab("打印界面", url);
}
var myChart = echarts.init(document.getElementById('leftMain'));
axios.post(prefix + '/countSm').then(response => {
if (response.data.code == web_status.SUCCESS){
myChart.setOption({
title: {
text: '人员涉密程度统计'
},
tooltip: {},
legend: {
data:['人数']
},
xAxis: {
data: response.data.data.xAxisData
},
yAxis: {
},
series: [
{
name: '人数',
type: 'bar',
data: response.data.data.yAxisData,
itemStyle: {
color: '#5470C6'
}
}
]
});
console.log(response.data.data)
}
})
var rightMain = echarts.init(document.getElementById('rightMain'));
axios.post(prefix + '/countUser').then(response => {
if (response.data.code == web_status.SUCCESS){
rightMain.setOption({
title: {
text: '人员状态统计'
},
tooltip: {},
legend: {
orient: 'vertical',
x: 'right',
data: ['已登记', '已申报', '已审核', '已离职']
},
series: [
{
type: 'pie',
data: response.data.data
}
]
});
}
})
< / script >
< / body >
< / html >