|
|
//通知查询
|
|
|
layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect', 'echarts','laydate'], function (exports) {
|
|
|
var $ = layui.$;
|
|
|
var form = layui.form;
|
|
|
var layer = layui.layer;
|
|
|
var admin = layui.admin;
|
|
|
var table = layui.table;
|
|
|
var common = layui.common;
|
|
|
var domainName = common.domainName;
|
|
|
var xmSelect = layui.xmSelect;
|
|
|
var echarts = layui.echarts;
|
|
|
var laydate = layui.laydate;
|
|
|
|
|
|
//对外暴露的接口
|
|
|
exports('myNoticeIndex', function (data) {
|
|
|
var resTypeSelect = {}; //资源类型下拉框
|
|
|
var busIdSelect = {}; //业务类型下拉框
|
|
|
var userSelect = {}; //通知用户下拉框
|
|
|
var busId = '';
|
|
|
var resType = '';
|
|
|
var userNames = '';
|
|
|
var sessions = layui.sessions;
|
|
|
var accessToken = sessions.getToken()['access_token'];
|
|
|
var noticeUserChart = echarts.init(document.getElementById('my_notice_chart_user'));
|
|
|
var noticeTypeChart = echarts.init(document.getElementById('my_notice_chart_type'));
|
|
|
// var noticeUserChartNew = echarts.init(document.getElementById('my_notice_chart_user_new'));
|
|
|
// lsq 告警指标 2022-07-05
|
|
|
var alarmKpi= '';
|
|
|
//回车搜索
|
|
|
$('#notice_search_keyword').keydown(function (e) {
|
|
|
if (e.keyCode === 13) {
|
|
|
reloadData();
|
|
|
}
|
|
|
});
|
|
|
//查询按钮点击事件
|
|
|
$('#noticeSearchQueryBtn').on('click',function () {
|
|
|
reloadData();
|
|
|
})
|
|
|
|
|
|
//发送状态
|
|
|
form.on('select(notice_search_isSend)', function(){
|
|
|
reloadData();
|
|
|
});
|
|
|
|
|
|
$('#queryMore').on('click',function(){
|
|
|
queryData();
|
|
|
});
|
|
|
|
|
|
$('button[data-period]').on('click',function(){
|
|
|
var that = $(this);
|
|
|
that.addClass('active');
|
|
|
that.removeClass('layui-btn-primary');
|
|
|
var currentVal = that.attr('data-period');
|
|
|
$.each($('button[data-period]'), function(index , el){
|
|
|
var itemEl = $(el);
|
|
|
var val = itemEl.attr('data-period');
|
|
|
if(currentVal != val){
|
|
|
itemEl.addClass('layui-btn-primary');
|
|
|
itemEl.removeClass('active');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// yyyy-MM-dd HH:mm:ss - yyyy-MM-dd HH:mm:ss
|
|
|
if(currentVal == 'custom'){
|
|
|
laydate.render({
|
|
|
elem: '#dataPeriodCustom', //指定元素
|
|
|
range: true,
|
|
|
type: 'datetime',
|
|
|
isInitValue: false,
|
|
|
isPreview: false,
|
|
|
value : new Date(),
|
|
|
format:'yyyy-MM-dd HH:mm:ss',
|
|
|
show: true, //直接显示
|
|
|
done: function(value, date, endDate){
|
|
|
that.attr('data-val',value);
|
|
|
reloadData();
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
reloadData();
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
getChartData();
|
|
|
//渲染表格
|
|
|
var noticeTable = table.render({
|
|
|
elem: '#myNoticeSearchTable'
|
|
|
, url: domainName + '/api-web/notice/myPage'
|
|
|
, where:{
|
|
|
access_token:accessToken,
|
|
|
keyword: $('#notice_search_keyword').val(),
|
|
|
busId: busId,
|
|
|
resType: resType,
|
|
|
usernames:userNames,
|
|
|
isSend: $('#notice_search_isSend').val(),
|
|
|
alarmKpi: $("#myNoticeAlarmKpiSearchBox").val(),
|
|
|
way:$('#myNoticeWaySearchBox').val(),
|
|
|
dataPeriod: $('button[data-period].active').attr('data-period'),
|
|
|
timeRange: $('button[data-period].active').attr('data-val')
|
|
|
}
|
|
|
, height: 'full-380'
|
|
|
, page: {
|
|
|
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
|
|
|
,theme: '#1E9FFF'//自定义分页主题颜色
|
|
|
}
|
|
|
, end: function(e){
|
|
|
form.render();
|
|
|
}
|
|
|
, even: true
|
|
|
, cols: [[
|
|
|
{title: '序号', align: "center", type: 'numbers',width: '3%'}
|
|
|
, {field: 'typeName', title: '通知类型', align: 'center', sort: true, width:130}
|
|
|
, {field: 'way', title: '通知方式', align: 'center', sort: true, width:120,
|
|
|
templet: function (d){
|
|
|
switch (d.way){
|
|
|
case 'wechat':
|
|
|
return '<div class="small-icon small-icon-wechat"></div>'
|
|
|
break;
|
|
|
case 'email':
|
|
|
return '<div class="small-icon small-icon-email"></div>'
|
|
|
break;
|
|
|
case 'message':
|
|
|
return '<div class="small-icon small-icon-msg"></div>'
|
|
|
break;
|
|
|
default:
|
|
|
return '<div class="small-icon small-icon-msg"></div>'
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
}}
|
|
|
// , {field: 'targetId', title: '通知对象', align: 'center', sort: true, width:180}
|
|
|
, {field: 'content', title: '通知内容', align: 'left', sort: true, minWidth: 300,}
|
|
|
, {field: 'nickname', title: '通知用户', align: 'center', sort: true, width:200}
|
|
|
, {field: 'noticeTime', title: '通知时间', align: 'center', sort: true, width:180}
|
|
|
// , {field: 'createTime',title: '入库时间',align: 'center', sort: true,width:180}
|
|
|
, {title: '操作', align: 'center',width: 80,fixed: 'right',
|
|
|
templet: function (d) {
|
|
|
var str = '';
|
|
|
if (d.ipAddr && d.ipAddr !== '') {
|
|
|
str += `ip地址 : ${d.ipAddr}</br>`
|
|
|
}
|
|
|
if (d.resName && d.resName !== '') {
|
|
|
str += `资源名称 : ${d.resName}</br>`
|
|
|
}
|
|
|
if (d.busName && d.busName !== '') {
|
|
|
str += `业务名称 : ${d.busName}</br>`
|
|
|
}
|
|
|
if (d.kpiName && d.kpiName !== '') {
|
|
|
str += `指标名称 : ${d.kpiName}</br>`
|
|
|
}
|
|
|
if (d.reportType && d.reportType !== '') {
|
|
|
str += `报表类型 : ${d.reportType}</br>`
|
|
|
}
|
|
|
if (d.alarmTimes && d.alarmTimes !== '') {
|
|
|
str += `告警次数 : ${d.alarmTimes}次</br>`
|
|
|
}
|
|
|
if (str.trim() !== '') {
|
|
|
return `<div><button lay-tips="${str}" type="button" class="layui-btn layui-btn-xs layui-btn-normal"><i class="layui-icon layui-icon-star-fill"></i></button></div>`
|
|
|
} else {
|
|
|
return `<div><button type="button" class="layui-btn layui-btn-xs layui-btn-normal"><i class="layui-icon layui-icon-star-fill"></i></button></div>`
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]],
|
|
|
done:function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
//用户下拉框 joke add 20211209
|
|
|
/*$.ajax({
|
|
|
url: `${common.domainName}/api-web/notice/getNoticeUsers?access_token=${accessToken}`,
|
|
|
method: 'GET',
|
|
|
success: function (response) {
|
|
|
if (response && response.success){
|
|
|
userSelect = xmSelect.render({
|
|
|
el: '#notice_user_list',
|
|
|
name: 'users',
|
|
|
tips: '=接收人=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
radio: true,
|
|
|
clickClose: true,
|
|
|
height: '170px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: false,
|
|
|
indent: 20
|
|
|
},
|
|
|
model: {
|
|
|
label: {
|
|
|
type: 'text'
|
|
|
}
|
|
|
},
|
|
|
prop: {
|
|
|
name: 'nickname',
|
|
|
value: 'username'
|
|
|
},
|
|
|
data: response.data,
|
|
|
on: function (data) {
|
|
|
if (data.arr && data.arr.length > 0){
|
|
|
userNames = data.arr[0].username;
|
|
|
} else {
|
|
|
userNames = '';
|
|
|
}
|
|
|
reloadData();
|
|
|
}
|
|
|
});
|
|
|
}else{
|
|
|
layer.msg('获取资源类型失败', {icon: 2});
|
|
|
}
|
|
|
if(userSelect){
|
|
|
//追加样式
|
|
|
$('#notice_user_list').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
}
|
|
|
});*/
|
|
|
|
|
|
//绑定业务下拉选择数据 joke add 20211209
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/notice/getNoticeBusTypes',
|
|
|
success: function (response) {
|
|
|
if (response && response.success) {
|
|
|
var busTypeList = response.data;
|
|
|
// 影响业务下拉框
|
|
|
busIdSelect = xmSelect.render({
|
|
|
el: '#my_notice_search_busId',
|
|
|
name: 'bizId',
|
|
|
tips: '=业务类型=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
radio: true,
|
|
|
clickClose: true,
|
|
|
height: '170px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: false,
|
|
|
indent: 20
|
|
|
},
|
|
|
model: {
|
|
|
label: {
|
|
|
type: 'text'
|
|
|
}
|
|
|
},
|
|
|
prop: {
|
|
|
name: 'busTypeName',
|
|
|
value: 'busId'
|
|
|
},
|
|
|
data: busTypeList,
|
|
|
on: function (data) {
|
|
|
if (data.isAdd){
|
|
|
busId = data.arr[0].busId;
|
|
|
} else {
|
|
|
busId = '';
|
|
|
}
|
|
|
reloadData();
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#my_notice_search_busId').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
} else {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
//资源类型下拉框 joke add 20211209
|
|
|
$.ajax({
|
|
|
url: `${common.domainName}/api-web/notice/getNoticeResTypes?access_token=${accessToken}`,
|
|
|
method: 'GET',
|
|
|
success: function (res) {
|
|
|
// 资源类型下拉框
|
|
|
if (res && res.success){
|
|
|
var resTypeList = res.data;
|
|
|
resTypeSelect = xmSelect.render({
|
|
|
el: '#my_notice_search_resType',
|
|
|
name: "resType",
|
|
|
tips: '=资源类型=',
|
|
|
filterable: true,
|
|
|
radio: true,
|
|
|
clickClose: true,
|
|
|
prop: {
|
|
|
name: 'resTypeName',
|
|
|
value: 'resTypeCode'
|
|
|
},
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: false,
|
|
|
indent: 20
|
|
|
},
|
|
|
model: {
|
|
|
label: {
|
|
|
type: 'text'
|
|
|
}
|
|
|
},
|
|
|
height: '170px',
|
|
|
data: resTypeList,
|
|
|
on: function (data) {
|
|
|
if (data.isAdd){
|
|
|
resType = data.arr[0].resTypeCode;
|
|
|
} else {
|
|
|
resType = '';
|
|
|
}
|
|
|
reloadData();
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#my_notice_search_resType').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
}else{
|
|
|
layer.msg('获取资源类型失败', {icon: 2});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
// lsq 告警指标下拉列表 2022-07-05
|
|
|
$.ajax({
|
|
|
url: common.domainName + '/api-web/manage/kpi/findKpiInAlarm?access_token='+accessToken+'&tableName=b_alarm',
|
|
|
type: "get",
|
|
|
success:function (res) {
|
|
|
var kpis = res.data;
|
|
|
var html = '<option value="">=指标名称=</option>'
|
|
|
$.each(kpis,function (i,e) {
|
|
|
html+='<option value="'+e.kpiId+'">'+e.kpiName+'</option>'
|
|
|
})
|
|
|
$("#myNoticeAlarmKpiSearchBox").html('');
|
|
|
$("#myNoticeAlarmKpiSearchBox").append(html);
|
|
|
form.render();
|
|
|
}
|
|
|
})
|
|
|
//lsq 通知方式下拉列表 2022-07-07
|
|
|
$.ajax({
|
|
|
url: domainName + '/api-web/manage/ddic/findSucDdics/notice_type?access_token='+accessToken,
|
|
|
type: "POST",
|
|
|
success:function (res) {
|
|
|
var ways = res.data;
|
|
|
var html = '<option value="">=通知方式=</option>'
|
|
|
$.each(ways,function (i,e) {
|
|
|
html+='<option value="'+e.ddicCode+'">'+e.ddicName+'</option>'
|
|
|
})
|
|
|
$("#myNoticeWaySearchBox").html('');
|
|
|
$("#myNoticeWaySearchBox").append(html);
|
|
|
form.render();
|
|
|
}
|
|
|
})
|
|
|
|
|
|
//刷新表格
|
|
|
function reloadTable() {
|
|
|
noticeTable.reload({
|
|
|
page: {
|
|
|
curr: 1
|
|
|
},
|
|
|
where:{
|
|
|
access_token:accessToken,
|
|
|
keyword: $('#notice_search_keyword').val(),
|
|
|
busId: busId,
|
|
|
resType: resType,
|
|
|
isSend: $('#notice_search_isSend').val(),
|
|
|
usernames:userNames,
|
|
|
page: 1,
|
|
|
alarmKpi: $("#myNoticeAlarmKpiSearchBox").val(),
|
|
|
way:$('#myNoticeWaySearchBox').val(),
|
|
|
dataPeriod: $('button[data-period].active').attr('data-period'),
|
|
|
timeRange: $('button[data-period].active').attr('data-val')
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//未读人员
|
|
|
function loadNoticeChart(echartObject,xData,yData) {
|
|
|
var series = [{
|
|
|
name: '通知次数',
|
|
|
data: yData,
|
|
|
barWidth: 20,
|
|
|
type: 'bar',
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
textStyle: {
|
|
|
color: '#555'
|
|
|
},
|
|
|
},
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
color: (params) => {
|
|
|
var colors = ['#b6c2ff', '#96edc1', '#fcb75b'];
|
|
|
return colors[params.dataIndex % 3]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
emphasis: {
|
|
|
itemStyle: {
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
{ offset: 0, color: '#2378f7' },
|
|
|
{ offset: 0.7, color: '#2378f7' },
|
|
|
{ offset: 1, color: '#83bff6' }
|
|
|
])
|
|
|
}
|
|
|
},
|
|
|
}]
|
|
|
|
|
|
var option = {
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
|
}
|
|
|
},
|
|
|
grid: [{
|
|
|
top: 20,
|
|
|
bottom: 45,
|
|
|
left: 40,
|
|
|
right: 5
|
|
|
}],
|
|
|
xAxis: [{
|
|
|
type: 'category',
|
|
|
data: xData,
|
|
|
axisLabel: {
|
|
|
color: '#333',
|
|
|
show: true,
|
|
|
interval:0,
|
|
|
rotate:15
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: '#e7e7e7'
|
|
|
}
|
|
|
},
|
|
|
axisTick: {
|
|
|
lineStyle: {
|
|
|
color: '#e7e7e7'
|
|
|
}
|
|
|
},
|
|
|
zlevel: 1
|
|
|
}],
|
|
|
yAxis: [{
|
|
|
type: 'value',
|
|
|
gridIndex: 0,
|
|
|
axisLabel: {
|
|
|
color: '#333'
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
type: 'dashed'
|
|
|
}
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: '#ccc'
|
|
|
}
|
|
|
},
|
|
|
axisTick: {
|
|
|
lineStyle: {
|
|
|
color: '#ccc'
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
series: series,
|
|
|
dataZoom: [
|
|
|
{
|
|
|
type: 'inside'
|
|
|
}
|
|
|
],
|
|
|
}
|
|
|
echartObject.setOption(option)
|
|
|
const zoomSize = 6;
|
|
|
echartObject.on('click', function (params) {
|
|
|
echartObject.dispatchAction({
|
|
|
type: 'dataZoom',
|
|
|
startValue: xData[Math.max(params.dataIndex - zoomSize / 2, 0)],
|
|
|
endValue:
|
|
|
xData[Math.min(params.dataIndex + zoomSize / 2, yData.length - 1)]
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
/********************单独加载更多****************************/
|
|
|
function loadNoticeMoreChart(echartObject,xData,yData) {
|
|
|
var series = [{
|
|
|
name: '通知次数',
|
|
|
data: yData,
|
|
|
barWidth: 20,
|
|
|
type: 'bar',
|
|
|
label: {
|
|
|
show: true,
|
|
|
position: 'top',
|
|
|
textStyle: {
|
|
|
color: '#555'
|
|
|
},
|
|
|
},
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
color: (params) => {
|
|
|
var colors = ['#b6c2ff', '#96edc1', '#fcb75b'];
|
|
|
return colors[params.dataIndex % 3]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
emphasis: {
|
|
|
itemStyle: {
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
{ offset: 0, color: '#2378f7' },
|
|
|
{ offset: 0.7, color: '#2378f7' },
|
|
|
{ offset: 1, color: '#83bff6' }
|
|
|
])
|
|
|
}
|
|
|
},
|
|
|
}]
|
|
|
|
|
|
var option = {
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
|
}
|
|
|
},
|
|
|
grid: [{
|
|
|
top: 20,
|
|
|
bottom: 70,
|
|
|
left: 30,
|
|
|
right: 5
|
|
|
}],
|
|
|
xAxis: [{
|
|
|
type: 'category',
|
|
|
data: xData,
|
|
|
axisLabel: {
|
|
|
color: '#333',
|
|
|
show: true,
|
|
|
interval:0,
|
|
|
rotate:15
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: '#e7e7e7'
|
|
|
}
|
|
|
},
|
|
|
axisTick: {
|
|
|
lineStyle: {
|
|
|
color: '#e7e7e7'
|
|
|
}
|
|
|
},
|
|
|
zlevel: 1
|
|
|
}],
|
|
|
yAxis: [{
|
|
|
type: 'value',
|
|
|
gridIndex: 0,
|
|
|
axisLabel: {
|
|
|
color: '#333'
|
|
|
},
|
|
|
splitLine: {
|
|
|
lineStyle: {
|
|
|
type: 'dashed'
|
|
|
}
|
|
|
},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: '#ccc'
|
|
|
}
|
|
|
},
|
|
|
axisTick: {
|
|
|
lineStyle: {
|
|
|
color: '#ccc'
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
series: series,
|
|
|
dataZoom: [
|
|
|
{ type: 'slider',
|
|
|
show: true,
|
|
|
xAxisIndex: [0],
|
|
|
left: '1%',
|
|
|
bottom: -5,
|
|
|
start: 0,
|
|
|
end: 20 //初始化滚动条
|
|
|
}
|
|
|
],
|
|
|
}
|
|
|
echartObject.setOption(option)
|
|
|
window.onresize=function(){
|
|
|
echartObject.resize();
|
|
|
}
|
|
|
// const zoomSize = 6;
|
|
|
// echartObject.on('click', function (params) {
|
|
|
// echartObject.dispatchAction({
|
|
|
// type: 'dataZoom',
|
|
|
// startValue: xData[Math.max(params.dataIndex - zoomSize / 2, 0)],
|
|
|
// endValue:
|
|
|
// xData[Math.min(params.dataIndex + zoomSize / 2, yData.length - 1)]
|
|
|
// });
|
|
|
// });
|
|
|
}
|
|
|
//获取图表数据
|
|
|
function getChartData() {
|
|
|
var where = {
|
|
|
access_token:accessToken,
|
|
|
keyword: $('#notice_search_keyword').val(),
|
|
|
busId: busId,
|
|
|
resType: resType,
|
|
|
isSend: $('#notice_search_isSend').val(),
|
|
|
alarmKpi: $("#myNoticeAlarmKpiSearchBox").val(),
|
|
|
way:$('#myNoticeWaySearchBox').val(),
|
|
|
dataPeriod: $('button[data-period].active').attr('data-period'),
|
|
|
timeRange: $('button[data-period].active').attr('data-val')
|
|
|
};
|
|
|
|
|
|
$.ajax({
|
|
|
url: `${common.domainName}/api-web/notice/myGroupByType`,
|
|
|
method: 'GET',
|
|
|
data: where,
|
|
|
success: function (res) {
|
|
|
var xData = [];
|
|
|
var yData = [];
|
|
|
if (res && res.map) {
|
|
|
$.each(res.map.typeList,function (i,v) {
|
|
|
xData.push(v)
|
|
|
})
|
|
|
yData = res.map.countList;
|
|
|
}
|
|
|
loadNoticeChart(noticeTypeChart,xData,yData)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
$.ajax({
|
|
|
url: `${common.domainName}/api-web/notice/myGroupByUser`,
|
|
|
method: 'GET',
|
|
|
data: where,
|
|
|
success: function (res) {
|
|
|
if (res && res.data) {
|
|
|
var yData = res.data.map(item=>item.count);
|
|
|
var xData = res.data.map(item=>item.noticeTime);
|
|
|
//展示前20条数据 @Editor LH
|
|
|
loadNoticeChart(noticeUserChart,xData.slice(0, 15), yData.slice(0, 15));
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function reloadData(){
|
|
|
getChartData();
|
|
|
reloadTable();
|
|
|
}
|
|
|
function queryData(){
|
|
|
var $content = $('#more_info');
|
|
|
layer.open({
|
|
|
type: 1
|
|
|
, title: '人员分组统计' //不显示标题栏
|
|
|
, area: ["91%", "500px"]
|
|
|
, id: 'aaa' //设定一个id,防止重复弹出
|
|
|
, btn:['取消']
|
|
|
, content: $content.html()
|
|
|
, success: function (layero, index) {
|
|
|
var where = {
|
|
|
access_token:accessToken,
|
|
|
keyword: $('#notice_search_keyword').val(),
|
|
|
busId: busId,
|
|
|
resType: resType,
|
|
|
isSend: $('#notice_search_isSend').val(),
|
|
|
alarmKpi: $("#myNoticeAlarmKpiSearchBox").val(),
|
|
|
way:$('#myNoticeWaySearchBox').val(),
|
|
|
dataPeriod: $('button[data-period].active').attr('data-period'),
|
|
|
timeRange: $('button[data-period].active').attr('data-val')
|
|
|
};
|
|
|
var noticeTypeChartNew = echarts.init(document.getElementById('my_notice_chart_type_new'));
|
|
|
$.ajax({
|
|
|
url: `${common.domainName}/api-web/notice/myGroupByUser`,
|
|
|
method: 'GET',
|
|
|
data: where,
|
|
|
success: function (res) {
|
|
|
if (res && res.data) {
|
|
|
var yData = res.data.map(item=>item.count);
|
|
|
var xData = res.data.map(item=>item.noticeTime);
|
|
|
//展示前20条数据 @Editor LH
|
|
|
loadNoticeMoreChart(noticeTypeChartNew,xData, yData);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
, yes: function (index, layero) {
|
|
|
layer.close(index); //执行关闭
|
|
|
// if (fn && fn()) {
|
|
|
// fn()
|
|
|
// layer.close(index); //如果设定了yes回调,需进行手工关闭
|
|
|
// }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}); |
...
|
...
|
|