Authored by xwx

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-v32-xwx

@@ -67,10 +67,10 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin', @@ -67,10 +67,10 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin',
67 , height: 'full-80' 67 , height: 'full-80'
68 , data: dataArr 68 , data: dataArr
69 , cols: [[ 69 , cols: [[
70 - {field: 'dirctiveName', title: '指令名称', align: 'center', width: 230 70 + {field: 'dirctiveName', title: '指令名称', align: 'center', minWidth: 230
71 ,templet:'<div><span data-id="{{d.dirctiveId}}" >{{d.dirctiveName}}</span></div>'} 71 ,templet:'<div><span data-id="{{d.dirctiveId}}" >{{d.dirctiveName}}</span></div>'}
72 , {field: 'outputNum', title: '输出指标数量', align: 'center', width: 150} 72 , {field: 'outputNum', title: '输出指标数量', align: 'center', width: 150}
73 - , {field: 'frequencyType', title: '周期时间类型', align: 'center', minWidth: 80,templet: function (d) { 73 + , {field: 'frequencyType', title: '周期时间类型', align: 'center', width:180,minWidth: 180,templet: function (d) {
74 var html = '<select name="frequencyType" lay-filter="frequency-type">' + 74 var html = '<select name="frequencyType" lay-filter="frequency-type">' +
75 '<option value="often" >常用周期</option>'+ 75 '<option value="often" >常用周期</option>'+
76 '<option value="cron">CronTab表达式</option>'+ 76 '<option value="cron">CronTab表达式</option>'+
@@ -83,7 +83,7 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin', @@ -83,7 +83,7 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin',
83 }) 83 })
84 return $dom.prop("outerHTML"); 84 return $dom.prop("outerHTML");
85 }} 85 }}
86 - , {field: 'collFrequency', title: '周期', align: 'center', width: 220,templet:function (d) { 86 + , {field: 'collFrequency', title: '周期', align: 'center', width: 180,templet:function (d) {
87 var selectStr = getTableSelectDom().select; 87 var selectStr = getTableSelectDom().select;
88 var inputStr = getTableSelectDom().input; 88 var inputStr = getTableSelectDom().input;
89 if(d.frequencyType == 'often'){ 89 if(d.frequencyType == 'often'){
@@ -100,7 +100,7 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin', @@ -100,7 +100,7 @@ layui.define(['table', 'form', 'laydate', 'common','sessions','laydate','admin',
100 return $dom.prop("outerHTML"); 100 return $dom.prop("outerHTML");
101 } 101 }
102 }} 102 }}
103 - , {title: '操作', align: 'center', minWidth: 100,templet: '<div><span checkTemplate-data-delete="{{d.dirctiveId}}" class="layui-table-link">删除</span>'} 103 + , {title: '操作', align: 'center', width:100,minWidth: 100,templet: '<div><span checkTemplate-data-delete="{{d.dirctiveId}}" class="layui-table-link">删除</span>'}
104 ]], 104 ]],
105 done: function (res, curr, count) { 105 done: function (res, curr, count) {
106 form.render(); 106 form.render();
@@ -253,33 +253,36 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -253,33 +253,36 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
253 // 发送状态 1已发送,2未发送 253 // 发送状态 1已发送,2未发送
254 noticeTimely.sendState = 2;//statusChange(document.querySelector("#switch_noticeTimely_sendState").checked ? 0 : 1); 254 noticeTimely.sendState = 2;//statusChange(document.querySelector("#switch_noticeTimely_sendState").checked ? 0 : 1);
255 noticeTimely.noticeNames = userNames; 255 noticeTimely.noticeNames = userNames;
256 - var noticeStateList = [];  
257 - //获取消息状态列表  
258 - $.each($('#editNoticeTimely_add_table').find('tbody tr'), function (i, v) {  
259 - var noticeState = {};  
260 - noticeState.noticeName = $(this).find('input[name="noticeName"]').val();  
261 - noticeState.sendTime = $(this).find('input[name="sendTime"]').val();  
262 - noticeState.sendContent = $(this).find('input[name="sendContent"]').val();  
263 - noticeState.noticeState = $(this).find('select[name="noticeState"]').val();  
264 - noticeStateList.push(noticeState);  
265 - });  
266 - noticeTimely.noticeStateList = noticeStateList; 256 + // var noticeStateList = [];
  257 + // //获取消息状态列表
  258 + // $.each($('#editNoticeTimely_add_table').find('tbody tr'), function (i, v) {
  259 + // var noticeState = {};
  260 + // noticeState.noticeName = $(this).find('input[name="noticeName"]').val();
  261 + // noticeState.sendTime = $(this).find('input[name="sendTime"]').val();
  262 + // noticeState.sendContent = $(this).find('input[name="sendContent"]').val();
  263 + // noticeState.noticeState = $(this).find('select[name="noticeState"]').val();
  264 + // noticeStateList.push(noticeState);
  265 + // });
  266 + // noticeTimely.noticeStateList = noticeStateList;
267 if (!noticeTimely.noticeNames) { 267 if (!noticeTimely.noticeNames) {
268 layer.msg('请选择用户', {icon: 7, time: 3000}); 268 layer.msg('请选择用户', {icon: 7, time: 3000});
269 return false; 269 return false;
270 } 270 }
271 - if (!noticeTimely.templates) {  
272 - layer.msg('请配置自定义展示中的展示内容', {icon: 7, time: 3000});  
273 - return false;  
274 - } 271 +
275 noticeTimely.site = $('#notice_timely_select').val() + $('#notice_timely_site').val(); 272 noticeTimely.site = $('#notice_timely_select').val() + $('#notice_timely_site').val();
276 //获取配置参数 273 //获取配置参数
277 var map = getParam(); 274 var map = getParam();
278 if(!map){ 275 if(!map){
279 - return ; 276 + return false;
  277 + }
  278 + if(map.msgSetting && map.msgSetting != '' && map.msgSetting != null){
  279 + noticeTimely.msgSetting = JSON.stringify(map.msgSetting);
280 } 280 }
281 - noticeTimely.msgSetting = JSON.stringify(map.msgSetting);  
282 noticeTimely.templates = map.templates; 281 noticeTimely.templates = map.templates;
  282 + if (!noticeTimely.templates || map.msgSetting == '' || map.msgSetting == null) {
  283 + layer.msg('请配置自定义展示中的展示内容', {icon: 7, time: 3000});
  284 + return false;
  285 + }
283 layer.load(2); 286 layer.load(2);
284 admin.req({ 287 admin.req({
285 url: domainName + '/api-web/noticeTimely/save?access_token=' + accessToken, 288 url: domainName + '/api-web/noticeTimely/save?access_token=' + accessToken,
@@ -449,8 +452,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -449,8 +452,6 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
449 $('#details_tags').append(details_tags); 452 $('#details_tags').append(details_tags);
450 $('#details_tags span').on('click',function (){ 453 $('#details_tags span').on('click',function (){
451 $('[name="templates"]').val($('[name="templates"]').val() + '#{'+$(this).text() + '}'); 454 $('[name="templates"]').val($('[name="templates"]').val() + '#{'+$(this).text() + '}');
452 - noticeTimely.templates += '#{'+$(this).text() + '}';  
453 -  
454 }); 455 });
455 } 456 }
456 457
@@ -459,8 +460,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -459,8 +460,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
459 460
460 //获取模板和等级 461 //获取模板和等级
461 var obj = { 462 var obj = {
462 - msgSetting: null,  
463 - templates: null 463 + msgSetting: '',
  464 + templates: ''
464 }; 465 };
465 466
466 var errMsg = ''; 467 var errMsg = '';
@@ -186,46 +186,41 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -186,46 +186,41 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
186 cols: [[{ 186 cols: [[{
187 type: 'checkbox' 187 type: 'checkbox'
188 }, { 188 }, {
189 - field: 'name', title: '名称', align: 'center', width: '250', 189 + field: 'name', title: '名称', align: 'center', width: '15%',
190 templet: 190 templet:
191 '<div>' + 191 '<div>' +
192 ' <span data-id="{{d.id}}" class="link link-noticeTimely-edit">{{d.name}}</span>' + 192 ' <span data-id="{{d.id}}" class="link link-noticeTimely-edit">{{d.name}}</span>' +
193 '</div>' 193 '</div>'
194 }, { 194 }, {
195 - field: 'details', title: '内容', align: 'left', minWidth: '650', 195 + field: 'details', title: '内容', align: 'left', width: '25%',
196 templet: function (d) { 196 templet: function (d) {
197 // return '<input type="text" class="layui-input" style= "background-color:transparent;border:0;padding-bottom: 10px" readonly="readonly" name="details" value="' + d.details + '">' 197 // return '<input type="text" class="layui-input" style= "background-color:transparent;border:0;padding-bottom: 10px" readonly="readonly" name="details" value="' + d.details + '">'
198 return '<code>' + d.details + '</code>' 198 return '<code>' + d.details + '</code>'
199 } 199 }
200 }, { 200 }, {
201 - field: 'frequency', title: '频率', align: 'center', width: '130' 201 + field: 'frequency', title: '频率', align: 'center', minWidth: '130'
202 }, { 202 }, {
203 field: 'noticeNicknames', title: '用户', align: 'center', minWidth: '180' 203 field: 'noticeNicknames', title: '用户', align: 'center', minWidth: '180'
204 }, { 204 }, {
205 - field: 'state', title: '是否启用', align: 'center', width: '100', 205 + field: 'lastSendTime', title: '最后发送时间', align: 'center', minWidth: '170',templet: function (d) {
  206 + if(d.noticeStateNew && d.noticeStateNew.sendTime){
  207 + return d.noticeStateNew.sendTime;
  208 + }
  209 + return '';
  210 + }
  211 + },{
  212 + field: 'state', title: '是否启用', align: 'center', minWidth: '100',
206 templet: function (d) { 213 templet: function (d) {
207 var checked = d.state == 2 ? 'checked' : ''; 214 var checked = d.state == 2 ? 'checked' : '';
208 return '<div><input type="checkbox" data-id="' + d.id + '" lay-filter="switch_noticeTimely_checkbox_state" name="state" lay-skin="switch" lay-text="启用|禁用" ' + checked + ' ></div>' 215 return '<div><input type="checkbox" data-id="' + d.id + '" lay-filter="switch_noticeTimely_checkbox_state" name="state" lay-skin="switch" lay-text="启用|禁用" ' + checked + ' ></div>'
209 } 216 }
210 - }, /*{  
211 - field: 'broadcast', title: '是否广播', align: 'center', width: '100',  
212 - templet: function (d) {  
213 - var checked = d.broadcast == 1 ? 'checked' : '';  
214 - return '<div><input type="checkbox" data-id="' + d.id + '" lay-filter="switch_noticeTimely_checkbox_broadcast" name="broadcast" lay-skin="switch" lay-text="是|否" ' + checked + ' ></div>'  
215 - }  
216 }, { 217 }, {
217 - field: 'retry', title: '是否轮循', align: 'center', width: '100',  
218 - templet: function (d) {  
219 - var checked = d.retry == 1 ? 'checked' : '';  
220 - return '<div><input type="checkbox" data-id="' + d.id + '" lay-filter="switch_noticeTimely_checkbox_retry" name="retry" lay-skin="switch" lay-text="重发|不重发" ' + checked + ' ></div>'  
221 - }  
222 - }, */{  
223 - title: '操作', align: 'center', minWidth: '150', fixed: 'right',  
224 - templet:  
225 - '<div>' +  
226 - ' <button data-id="{{d.id}}" class="layui-btn layui-btn-xs layui-btn-normal link-noticeTimely-delete" lay-tips="删除"><i class="layui-icon">&#xe640;</i></button>' +  
227 - ' <button data-id="{{d.id}}" class="layui-btn layui-btn-xs layui-btn-normal link-noticeTimely-history" lay-tips="历史记录"><i class="layui-icon">&#xe705;</i></button>' +  
228 - '</div>' 218 + title: '操作', align: 'center', minWidth: '120', fixed: 'right',
  219 + templet:
  220 + '<div>' +
  221 + ' <button data-id="{{d.id}}" class="layui-btn layui-btn-xs layui-btn-normal link-noticeTimely-delete" lay-tips="删除"><i class="layui-icon">&#xe640;</i></button>' +
  222 + ' <button data-id="{{d.id}}" class="layui-btn layui-btn-xs layui-btn-normal link-noticeTimely-history" lay-tips="历史记录"><i class="layui-icon">&#xe705;</i></button>' +
  223 + '</div>'
229 }]], 224 }]],
230 done: function (res) { 225 done: function (res) {
231 // 点击名称编辑事件 226 // 点击名称编辑事件
@@ -20,7 +20,8 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart @@ -20,7 +20,8 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart
20 var list = []; 20 var list = [];
21 var dataList = []; 21 var dataList = [];
22 var date = '2021'; 22 var date = '2021';
23 - 23 + //lsq 调用获取今年和去年年份 2022-07-04
  24 + getYearDate();
24 getChartData(); 25 getChartData();
25 // loadAlarmOverChart1(alarmTrendChart,null,'24小时趋势表'); 26 // loadAlarmOverChart1(alarmTrendChart,null,'24小时趋势表');
26 loadResourceTable('resType','overviewResTypeTable'); 27 loadResourceTable('resType','overviewResTypeTable');
@@ -435,5 +436,22 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart @@ -435,5 +436,22 @@ layui.define(['admin', 'form', 'table', 'element', 'sessions', 'common', 'echart
435 alink.click(); 436 alink.click();
436 document.body.removeChild(alink); 437 document.body.removeChild(alink);
437 } 438 }
  439 +
  440 + //lsq 获取今年和去年的年份赋值给按钮 2022-07-04
  441 + function getYearDate(){
  442 + let myDate=new Date();
  443 + let thisYear=getDateTime(myDate);
  444 + myDate.setFullYear(myDate.getFullYear()-1);
  445 + let lastYear=getDateTime(myDate);
  446 + $('#thisYear').attr('data-years',thisYear);
  447 + $('#lastYear').attr('data-years',lastYear);
  448 + date=thisYear;
  449 + }
  450 + //获取时间点 转年月日的方法
  451 + function getDateTime(newDate){
  452 + let year=newDate.getFullYear();//获取年
  453 + return year;
  454 + }
  455 +
438 }); 456 });
439 }); 457 });
@@ -27,10 +27,10 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function @@ -27,10 +27,10 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function
27 } 27 }
28 }); 28 });
29 29
30 - // //按钮搜索  
31 - // $('#heartbeatQueryBtn').unbind().on('click',function (e) {  
32 - // reloadTable();  
33 - // }) 30 + //按钮搜索
  31 + $('#heartbeatQueryBtn').unbind().on('click',function (e) {
  32 + reloadTable();
  33 + })
34 34
35 35
36 // 渲染表格 36 // 渲染表格
@@ -63,10 +63,12 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function @@ -63,10 +63,12 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function
63 }, { 63 }, {
64 field: 'currTime', title: '最近心跳时间', align: 'center',sort: true, 64 field: 'currTime', title: '最近心跳时间', align: 'center',sort: true,
65 templet: function (d) { 65 templet: function (d) {
  66 + var durationVal = $('[name="durationVal"]').val();
  67 + if(!durationVal || durationVal == '' || durationVal == null){
  68 + durationVal = 10;
  69 + }
66 var beatTime = new Date(d.currTime); 70 var beatTime = new Date(d.currTime);
67 - var time = new Date();  
68 - time.setMinutes(time.getMinutes() - 10);  
69 - if (time > beatTime) { 71 + if (d.between > parseInt(durationVal)) {
70 return `<div class="red">${beatTime.format("yyyy-MM-dd HH:mm:ss")}</div>` 72 return `<div class="red">${beatTime.format("yyyy-MM-dd HH:mm:ss")}</div>`
71 } else { 73 } else {
72 return `<div>${beatTime.format("yyyy-MM-dd HH:mm:ss")}</div>` 74 return `<div>${beatTime.format("yyyy-MM-dd HH:mm:ss")}</div>`
@@ -85,7 +87,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function @@ -85,7 +87,7 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function
85 heartbeatTable.reload({ 87 heartbeatTable.reload({
86 where: { 88 where: {
87 access_token: accessToken, 89 access_token: accessToken,
88 - keyword: $('#condition-heartbeat-name').val(), 90 + keyword: $('#condition-heartbeat-name').val()
89 }, 91 },
90 page: { 92 page: {
91 curr: 1 93 curr: 1
@@ -93,4 +95,4 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function @@ -93,4 +95,4 @@ layui.define(['table', 'form', 'sessions', 'common', 'view', 'admin'], function
93 }); 95 });
94 } 96 }
95 }); 97 });
96 -});  
  98 +});
@@ -8032,4 +8032,11 @@ form[lay-filter="activewarning-form"] .layui-inline { @@ -8032,4 +8032,11 @@ form[lay-filter="activewarning-form"] .layui-inline {
8032 cursor: pointer; 8032 cursor: pointer;
8033 text-decoration: underline; 8033 text-decoration: underline;
8034 } 8034 }
8035 -/*end lsq 2022-06-28*/  
  8035 +/*end lsq 2022-06-28*/
  8036 +/*lsq 指令模板编辑指令时的指令名称样式 2022-07-04*/
  8037 +.table-edit.table-edit-textoverflow td[data-field="dirctiveName"] .layui-table-cell{
  8038 + overflow: hidden;
  8039 + text-overflow: ellipsis;
  8040 + white-space: nowrap;
  8041 +
  8042 +}
@@ -69,8 +69,8 @@ @@ -69,8 +69,8 @@
69 <li>业务系统</li> 69 <li>业务系统</li>
70 <li>业务域</li> 70 <li>业务域</li>
71 <div class="layui-btn-group time-group" id="overview_time" style="margin-left: 60%"> 71 <div class="layui-btn-group time-group" id="overview_time" style="margin-left: 60%">
72 - <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" data-years="2020">去年</button>  
73 - <button type="button" class="layui-btn layui-btn-primary layui-btn-sm active" data-years="2021">今年</button> 72 + <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" id="lastYear" data-years="2020">去年</button>
  73 + <button type="button" class="layui-btn layui-btn-primary layui-btn-sm active" id="thisYear" data-years="2021">今年</button>
74 </div> 74 </div>
75 <button class="layui-btn layui-btn-sm layui-btn-normal tab-button" id="btn_overview_export_excel"> 75 <button class="layui-btn layui-btn-sm layui-btn-normal tab-button" id="btn_overview_export_excel">
76 <i class="layui-icon">&#xe60a;</i>导出到Excel 76 <i class="layui-icon">&#xe60a;</i>导出到Excel
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <a class="layui-btn layui-btn-xs layui-btn-normal" id="checkTemplateChooseKpi"><i class="layui-icon">&#xe624;</i></a> 36 <a class="layui-btn layui-btn-xs layui-btn-normal" id="checkTemplateChooseKpi"><i class="layui-icon">&#xe624;</i></a>
37 </legend> 37 </legend>
38 </fieldset> 38 </fieldset>
39 - <div class="layui-form-item table-edit"> 39 + <div class="layui-form-item table-edit table-edit-textoverflow">
40 <table id="checkTemplate_add_table"></table> 40 <table id="checkTemplate_add_table"></table>
41 </div> 41 </div>
42 </form> 42 </form>
@@ -13,8 +13,7 @@ @@ -13,8 +13,7 @@
13 </div> 13 </div>
14 </div> 14 </div>
15 <div class="layui-inline"> 15 <div class="layui-inline">
16 - <button id="noticeTimelyQueryBtn" type="button" class="layui-btn layui-btn-normal" ><i  
17 - class="layui-icon layui-icon-search"></i>查询 16 + <button id="noticeTimelyQueryBtn" type="button" class="layui-btn layui-btn-normal" >查询
18 </button> 17 </button>
19 </div> 18 </div>
20 </div> 19 </div>
@@ -14,11 +14,16 @@ @@ -14,11 +14,16 @@
14 placeholder="输入关键字,回车搜索" autocomplete="off" class="layui-input"> 14 placeholder="输入关键字,回车搜索" autocomplete="off" class="layui-input">
15 </div> 15 </div>
16 </div> 16 </div>
17 -<!-- <div class="layui-inline">-->  
18 -<!-- <button id="heartbeatQueryBtn" type="button" class="layui-btn layui-btn-normal" ><i-->  
19 -<!-- class="layui-icon layui-icon-search"></i>查询-->  
20 -<!-- </button>-->  
21 -<!-- </div>--> 17 + <div class="layui-inline">
  18 + <div class="layui-input-inline">
  19 + <input type="number" name="durationVal"
  20 + lay-tips="最近心跳时间(单位:分钟)" placeholder="最近心跳时间" value="10" class="layui-input">
  21 + <!-- <span>分钟</span>-->
  22 + </div>
  23 + </div>
  24 + <div class="layui-inline">
  25 + <button id="heartbeatQueryBtn" type="button" class="layui-btn layui-btn-normal">查询</button>
  26 + </div>
22 </div> 27 </div>
23 </form> 28 </form>
24 </div> 29 </div>
@@ -45,4 +50,4 @@ @@ -45,4 +50,4 @@
45 layui.use('selfmonitor', function (fn) { 50 layui.use('selfmonitor', function (fn) {
46 fn(); 51 fn();
47 }); 52 });
48 -</script>  
  53 +</script>