Authored by 张凯

feat:迁移页面优化(告警策略、告警模板、告警订阅及ip视图)

@@ -11,10 +11,9 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f @@ -11,10 +11,9 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f
11 exports('alarmpolicyAdd', function (data) { 11 exports('alarmpolicyAdd', function (data) {
12 var sessions = layui.sessions; 12 var sessions = layui.sessions;
13 var accessToken = sessions.getToken()['access_token']; 13 var accessToken = sessions.getToken()['access_token'];
14 - console.log(data)  
15 admin.req({ 14 admin.req({
16 url: common.domainName + '/api-web/manage/ddic/findSucDdics/alarm_strategy_type' 15 url: common.domainName + '/api-web/manage/ddic/findSucDdics/alarm_strategy_type'
17 - , method: 'POST' 16 + , method: 'get'
18 , async: false 17 , async: false
19 }).done(function (res) { 18 }).done(function (res) {
20 let radioData = res.data; 19 let radioData = res.data;
@@ -24,7 +23,6 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f @@ -24,7 +23,6 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f
24 htmlRadio += `<option value="` + item.ddicSort + `">` + item.ddicName + '</option>' 23 htmlRadio += `<option value="` + item.ddicSort + `">` + item.ddicName + '</option>'
25 }) 24 })
26 } 25 }
27 - ;  
28 $('#alarmpolicy_policyType_add').html(htmlRadio); 26 $('#alarmpolicy_policyType_add').html(htmlRadio);
29 }); 27 });
30 //编辑 28 //编辑
@@ -75,7 +73,7 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f @@ -75,7 +73,7 @@ layui.define(['form', 'admin', 'laydate', 'common', 'sessions', 'reskpilist'], f
75 function getNoticeMergeFlag() { 73 function getNoticeMergeFlag() {
76 admin.req({ 74 admin.req({
77 url: common.domainName + '/api-web/manage/ddic/findSucDdics/noticeMergeFlag' 75 url: common.domainName + '/api-web/manage/ddic/findSucDdics/noticeMergeFlag'
78 - , method: 'POST' 76 + , method: 'get'
79 , async: false 77 , async: false
80 , success: function (res) { 78 , success: function (res) {
81 $.each(res.data, function (i, v) { 79 $.each(res.data, function (i, v) {
@@ -20,7 +20,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect', @@ -20,7 +20,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect',
20 resListSelectIds = []; 20 resListSelectIds = [];
21 admin.req({ 21 admin.req({
22 url: common.domainName + '/api-web/manage/ddic/findSucDdics/alarm_strategy_type' 22 url: common.domainName + '/api-web/manage/ddic/findSucDdics/alarm_strategy_type'
23 - , method: 'POST' 23 + , method: 'get'
24 , async: false 24 , async: false
25 }).done(function (res) { 25 }).done(function (res) {
26 let radioData = res.data; 26 let radioData = res.data;
@@ -69,17 +69,15 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect', @@ -69,17 +69,15 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect',
69 form.render(null, 'alarmpolicy-form'); 69 form.render(null, 'alarmpolicy-form');
70 //新增 70 //新增
71 $("#alarmpolicy_create").unbind("click").on("click",function () { 71 $("#alarmpolicy_create").unbind("click").on("click",function () {
72 - if ($.inArray('back:alarmpolicy:save', checkList) == -1) {  
73 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 72 + if(!common.hasPermission('back:alarmpolicy:save')){
74 return; 73 return;
75 } 74 }
76 openPolicyForm(); 75 openPolicyForm();
77 }); 76 });
78 77
79 //同步 78 //同步
80 - $("#alarmpolicy_sync").on("click",function (){  
81 - if ($.inArray('back:alarmpolicy:synchronization', checkList) == -1) {  
82 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 79 + $("#alarmpolicy_sync").unbind("click").on("click",function (){
  80 + if(!common.hasPermission('back:alarmpolicy:synchronization')){
83 return; 81 return;
84 } 82 }
85 syncAlarmPolicy(); 83 syncAlarmPolicy();
@@ -199,8 +197,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect', @@ -199,8 +197,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect',
199 197
200 //点击名称编辑 198 //点击名称编辑
201 $(".view-alarmPolicy-name").off("click").on("click",function () { 199 $(".view-alarmPolicy-name").off("click").on("click",function () {
202 - if ($.inArray('back:alarmpolicy:update', checkList) == -1) {  
203 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 200 + if (!common.hasPermission('back:alarmpolicy:update')){
204 return; 201 return;
205 } 202 }
206 openPolicyForm($(this).data("id")); 203 openPolicyForm($(this).data("id"));
@@ -350,8 +347,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect', @@ -350,8 +347,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect',
350 347
351 //删除数据 348 //删除数据
352 function deleteAlarmPolicy(id) { 349 function deleteAlarmPolicy(id) {
353 - if ($.inArray('back:alarmpolicy:delete', checkList) == -1) {  
354 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 350 + if(!common.hasPermission('back:alarmpolicy:delete')){
355 return; 351 return;
356 } 352 }
357 if (typeof (id) != "string") { 353 if (typeof (id) != "string") {
@@ -395,61 +391,117 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect', @@ -395,61 +391,117 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions','xmSelect',
395 }); 391 });
396 } 392 }
397 393
398 - $.ajax({  
399 - url: `${common.domainName}/api-web/manage/restype/list?access_token=${accessToken}`,  
400 - method: 'GET',  
401 - success: function (res) {  
402 - // 资源类型下拉框  
403 - var resTypeList = res.data.map(item => {  
404 - return {  
405 - name: item.resTypeName,  
406 - value: item.resTypeCode,  
407 - parentId: item.parentId 394 + admin.req({
  395 + url: `${common.domainName}/api-web/manage/restype/list?access_token=${accessToken}`
  396 + ,type:"GET"
  397 + }).done(function (res) {
  398 + // 资源类型下拉框
  399 + var resTypeList = res.data.map(item => {
  400 + return {
  401 + name: item.resTypeName,
  402 + value: item.resTypeCode,
  403 + parentId: item.parentId
  404 + }
  405 + });
  406 + var resTypeTree = treeTable.pidToChildren(resTypeList, "value", "parentId");
  407 + xmSelect.render({
  408 + el: '#alarmpolicy_kpi_resName',
  409 + name: "resName",
  410 + tips: '=资源类型=',
  411 + filterable: true,
  412 + radio: true,
  413 + clickClose: true,
  414 + toolbar: {
  415 + show: true,
  416 + list: ['CLEAR']
  417 + },
  418 + tree: {
  419 + show: true,
  420 + showFolderIcon: true,
  421 + showLine: true,
  422 + strict: false,
  423 + indent: 20
  424 + },
  425 + model: {
  426 + label: {
  427 + type: 'text'
408 } 428 }
409 - });  
410 - var resTypeTree = treeTable.pidToChildren(resTypeList, "value", "parentId");  
411 - xmSelect.render({  
412 - el: '#alarmpolicy_kpi_resName',  
413 - name: "resName",  
414 - tips: '=资源类型=',  
415 - filterable: true,  
416 - radio: true,  
417 - clickClose: true,  
418 - toolbar: {  
419 - show: true,  
420 - list: ['CLEAR']  
421 - },  
422 - tree: {  
423 - show: true,  
424 - showFolderIcon: true,  
425 - showLine: true,  
426 - strict: false,  
427 - indent: 20  
428 - },  
429 - model: {  
430 - label: {  
431 - type: 'text'  
432 - }  
433 - },  
434 - prop: {  
435 - name: 'name',  
436 - value: 'name'  
437 - },  
438 - height: 'auto',  
439 - data: resTypeTree,  
440 - on: function (data) {  
441 - if(data.isAdd){  
442 - if (data.arr.length != 0) {  
443 - resName = data.arr[0].name;  
444 - } else {  
445 - resName = '';  
446 - }  
447 - reloadAlarmPolicyTable(); 429 + },
  430 + prop: {
  431 + name: 'name',
  432 + value: 'name'
  433 + },
  434 + height: 'auto',
  435 + data: resTypeTree,
  436 + on: function (data) {
  437 + if(data.isAdd){
  438 + if (data.arr.length != 0) {
  439 + resName = data.arr[0].name;
  440 + } else {
  441 + resName = '';
448 } 442 }
  443 + reloadAlarmPolicyTable();
449 } 444 }
450 - });  
451 - } 445 + }
  446 + });
  447 + }).error(function (error) {
  448 + console.log(error);
452 }); 449 });
  450 + // $.ajax({
  451 + // url: `${common.domainName}/api-web/manage/restype/list?access_token=${accessToken}`,
  452 + // method: 'GET',
  453 + // success: function (res) {
  454 + // // 资源类型下拉框
  455 + // var resTypeList = res.data.map(item => {
  456 + // return {
  457 + // name: item.resTypeName,
  458 + // value: item.resTypeCode,
  459 + // parentId: item.parentId
  460 + // }
  461 + // });
  462 + // var resTypeTree = treeTable.pidToChildren(resTypeList, "value", "parentId");
  463 + // xmSelect.render({
  464 + // el: '#alarmpolicy_kpi_resName',
  465 + // name: "resName",
  466 + // tips: '=资源类型=',
  467 + // filterable: true,
  468 + // radio: true,
  469 + // clickClose: true,
  470 + // toolbar: {
  471 + // show: true,
  472 + // list: ['CLEAR']
  473 + // },
  474 + // tree: {
  475 + // show: true,
  476 + // showFolderIcon: true,
  477 + // showLine: true,
  478 + // strict: false,
  479 + // indent: 20
  480 + // },
  481 + // model: {
  482 + // label: {
  483 + // type: 'text'
  484 + // }
  485 + // },
  486 + // prop: {
  487 + // name: 'name',
  488 + // value: 'name'
  489 + // },
  490 + // height: 'auto',
  491 + // data: resTypeTree,
  492 + // on: function (data) {
  493 + // if(data.isAdd){
  494 + // if (data.arr.length != 0) {
  495 + // resName = data.arr[0].name;
  496 + // } else {
  497 + // resName = '';
  498 + // }
  499 + // reloadAlarmPolicyTable();
  500 + // }
  501 + // }
  502 + // });
  503 + // }
  504 + // });
453 505
454 //新增、编辑策略表单 506 //新增、编辑策略表单
455 function openPolicyForm(id){ 507 function openPolicyForm(id){
@@ -47,8 +47,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -47,8 +47,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
47 form.render(null, 'alarmsubscribe-form'); 47 form.render(null, 'alarmsubscribe-form');
48 //新增 48 //新增
49 $("#alarmsubscribe_create").off("click").on("click", function () { 49 $("#alarmsubscribe_create").off("click").on("click", function () {
50 - if ($.inArray('back:alarmsubscribe:save', checkList) == -1) {  
51 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 50 + if(!common.hasPermission('back:alarmsubscribe:save')){
52 return; 51 return;
53 } 52 }
54 openAlarmsubscribeForm(); 53 openAlarmsubscribeForm();
@@ -58,9 +57,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -58,9 +57,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
58 deletealarmsubscribe(); 57 deletealarmsubscribe();
59 }); 58 });
60 //同步 59 //同步
61 - $("#alarmsubscribe_sync").on("click", function () {  
62 - if ($.inArray('back:alarmsubscribe:synchronization', checkList) == -1) {  
63 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 60 + $("#alarmsubscribe_sync").unbind("click").on("click", function () {
  61 + if(!common.hasPermission('back:alarmsubscribe:synchronization')){
64 return; 62 return;
65 } 63 }
66 var ids = []; 64 var ids = [];
@@ -333,8 +331,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -333,8 +331,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
333 done: function () { 331 done: function () {
334 //点击名称编辑 332 //点击名称编辑
335 $(".view-alarmsubscribe-name").on("click", function () { 333 $(".view-alarmsubscribe-name").on("click", function () {
336 - if ($.inArray('back:alarmsubscribe:update', checkList) == -1) {  
337 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 334 + if(!common.hasPermission('back:alarmsubscribe:update')){
338 return; 335 return;
339 } 336 }
340 openAlarmsubscribeForm($(this).data("id")); 337 openAlarmsubscribeForm($(this).data("id"));
@@ -454,7 +451,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -454,7 +451,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
454 }); 451 });
455 452
456 //查看资源订阅列表 453 //查看资源订阅列表
457 - $(".view-alarmsubscribe-resource").on("click", function () { 454 + $(".view-alarmsubscribe-resource").unbind("click").on("click", function () {
458 if ($(this).text() == '0') { 455 if ($(this).text() == '0') {
459 layer.msg('暂无订阅资源,请先订阅!', {icon: 7, time: 3000}); 456 layer.msg('暂无订阅资源,请先订阅!', {icon: 7, time: 3000});
460 return false; 457 return false;
@@ -800,7 +797,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -800,7 +797,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
800 }); 797 });
801 798
802 //查看资源类型订阅列表 799 //查看资源类型订阅列表
803 - $(".view-alarmsubscribe-resType").on("click", function () { 800 + $(".view-alarmsubscribe-resType").unbind("click").on("click", function () {
804 if ($(this).text() == '0') { 801 if ($(this).text() == '0') {
805 layer.msg('暂无订阅资源类型,请先订阅!', {icon: 7, time: 3000}); 802 layer.msg('暂无订阅资源类型,请先订阅!', {icon: 7, time: 3000});
806 return false; 803 return false;
@@ -833,8 +830,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -833,8 +830,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
833 830
834 //资源订阅 831 //资源订阅
835 $(".alarmsubscribe-resource-btn").on("click", function () { 832 $(".alarmsubscribe-resource-btn").on("click", function () {
836 - if ($.inArray('back:alarmsubscribe:resource', checkList) == -1) {  
837 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 833 + if(!common.hasPermission('back:alarmsubscribe:resource')){
838 return; 834 return;
839 } 835 }
840 var subId = $(this).data("id"); 836 var subId = $(this).data("id");
@@ -880,8 +876,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -880,8 +876,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
880 876
881 //指标订阅 877 //指标订阅
882 $(".alarmsubscribe-kpi-btn").on("click", function () { 878 $(".alarmsubscribe-kpi-btn").on("click", function () {
883 - if ($.inArray('back:alarmsubscribe:target', checkList) == -1) {  
884 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 879 + if(!common.hasPermission('back:alarmsubscribe:target')){
885 return; 880 return;
886 } 881 }
887 var subId = $(this).data("id"); 882 var subId = $(this).data("id");
@@ -1088,8 +1083,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function @@ -1088,8 +1083,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions'], function
1088 1083
1089 //删除拓扑数据 1084 //删除拓扑数据
1090 function deletealarmsubscribe(id) { 1085 function deletealarmsubscribe(id) {
1091 - if ($.inArray('back:alarmsubscribe:delete', checkList) == -1) {  
1092 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 1086 + if(!common.hasPermission('back:alarmsubscribe:delete')){
1093 return; 1087 return;
1094 } 1088 }
1095 if (typeof (id) != "string") { 1089 if (typeof (id) != "string") {
@@ -35,8 +35,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -35,8 +35,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
35 form.render(null, 'alarmtemplate-form'); 35 form.render(null, 'alarmtemplate-form');
36 //新增 36 //新增
37 $("#alarmtemplate_create").on("click", function () { 37 $("#alarmtemplate_create").on("click", function () {
38 - if ($.inArray('back:alarmtemp:save', checkList) == -1) {  
39 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 38 + if(!common.hasPermission('back:alarmtemp:save')){
40 return; 39 return;
41 } 40 }
42 openAlarmTemplateForm(); 41 openAlarmTemplateForm();
@@ -47,16 +46,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -47,16 +46,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
47 }); 46 });
48 //同步 47 //同步
49 $("#alarmtemplate_sync").on("click", function () { 48 $("#alarmtemplate_sync").on("click", function () {
50 - if ($.inArray('back:alarmtemp:synchronization', checkList) == -1) {  
51 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 49 + if(!common.hasPermission('back:alarmtemp:synchronization')){
52 return; 50 return;
53 } 51 }
54 syncAlarmTemplate(); 52 syncAlarmTemplate();
55 }); 53 });
56 //配置策略 54 //配置策略
57 $("#alarmtemplate_configpolicy").on("click", function () { 55 $("#alarmtemplate_configpolicy").on("click", function () {
58 - if ($.inArray('back:alarmtemp:tactics', checkList) == -1) {  
59 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 56 + if(!common.hasPermission('back:alarmtemp:tactics')){
60 return; 57 return;
61 } 58 }
62 var tempData = table.checkStatus('alarmtemplateTable').data; 59 var tempData = table.checkStatus('alarmtemplateTable').data;
@@ -174,9 +171,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -174,9 +171,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
174 } 171 }
175 172
176 //配置资源 173 //配置资源
177 - $("#alarmtemplate_configres").on("click", function () {  
178 - if ($.inArray('back:alarmtemp:resource', checkList) == -1) {  
179 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 174 + $("#alarmtemplate_configres").unbind("click").on("click", function () {
  175 + if(!common.hasPermission('back:alarmtemp:resource')){
180 return; 176 return;
181 } 177 }
182 var tempIds = []; 178 var tempIds = [];
@@ -309,8 +305,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -309,8 +305,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
309 done: function () { 305 done: function () {
310 //点击名称编辑 306 //点击名称编辑
311 $(".view-alarmtemplate-name").on("click", function () { 307 $(".view-alarmtemplate-name").on("click", function () {
312 - if ($.inArray('back:alarmtemp:update', checkList) == -1) {  
313 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 308 + if(!common.hasPermission('back:alarmtemp:update')){
314 return; 309 return;
315 } 310 }
316 openAlarmTemplateForm($(this).data("id")); 311 openAlarmTemplateForm($(this).data("id"));
@@ -570,13 +565,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -570,13 +565,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
570 layer.confirm('您确定要删除绑定的该资源吗?', { 565 layer.confirm('您确定要删除绑定的该资源吗?', {
571 btn: ['确定', '取消'] //按钮 566 btn: ['确定', '取消'] //按钮
572 }, function () { 567 }, function () {
573 - $.ajax({  
574 - url: common.domainName + '/api-web/alarmtemplate/deleteByResIdsAndTempIds?access_token=' + accessToken  
575 - , data: { 568 + admin.req({
  569 + url: common.domainName + '/api-web/alarmtemplate/deleteByResIdsAndTempIds?access_token=' + accessToken,
  570 + async: false,
  571 + data: {
576 resIds: id, 572 resIds: id,
577 tempIds: alarmTempId.toString() 573 tempIds: alarmTempId.toString()
578 - }  
579 - }).done(function (res) { 574 + },
  575 + }).done(function (response) {
580 layer.msg('删除成功', { 576 layer.msg('删除成功', {
581 offset: '15px' 577 offset: '15px'
582 , icon: 1 578 , icon: 1
@@ -585,9 +581,25 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -585,9 +581,25 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
585 layer.closeAll(); 581 layer.closeAll();
586 reloadalarmtemplateTable() 582 reloadalarmtemplateTable()
587 }); 583 });
588 - }).error(function (error) {  
589 - console.log(error);  
590 }); 584 });
  585 + // $.ajax({
  586 + // url: common.domainName + '/api-web/alarmtemplate/deleteByResIdsAndTempIds?access_token=' + accessToken
  587 + // , data: {
  588 + // resIds: id,
  589 + // tempIds: alarmTempId.toString()
  590 + // }
  591 + // }).done(function (res) {
  592 + // layer.msg('删除成功', {
  593 + // offset: '15px'
  594 + // , icon: 1
  595 + // , time: 2000
  596 + // }, function () {
  597 + // layer.closeAll();
  598 + // reloadalarmtemplateTable()
  599 + // });
  600 + // }).error(function (error) {
  601 + // console.log(error);
  602 + // });
591 }); 603 });
592 } 604 }
593 605
@@ -652,8 +664,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -652,8 +664,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
652 664
653 //删除拓扑数据 665 //删除拓扑数据
654 function deletealarmtemplate(id) { 666 function deletealarmtemplate(id) {
655 - if ($.inArray('back:alarmtemp:delete', checkList) == -1) {  
656 - layer.msg('暂无权限!', {icon: 7, time: 3000}); 667 + if(!common.hasPermission('back:alarmtemp:delete')){
657 return; 668 return;
658 } 669 }
659 if (typeof (id) != "string") { 670 if (typeof (id) != "string") {
@@ -2758,15 +2758,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -2758,15 +2758,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
2758 } 2758 }
2759 }); 2759 });
2760 if ($('.layui-show').find(".detail-left-panel").length == 0) { 2760 if ($('.layui-show').find(".detail-left-panel").length == 0) {
2761 - var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId'  
2762 - $.ajax({ 2761 + var leftUrl = common.domainName + '/api-web/detail/findRelationGroupByResId';
  2762 + admin.req({
2763 url: leftUrl, 2763 url: leftUrl,
2764 - type: 'get',  
2765 - headers: {  
2766 - "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""  
2767 - },  
2768 data: {resId: resId}, 2764 data: {resId: resId},
2769 - success: function (res) { 2765 + success(res) {
2770 if (!res || !res.success) { 2766 if (!res || !res.success) {
2771 layer.msg('获取关联信息失败!', {icon: 0}); 2767 layer.msg('获取关联信息失败!', {icon: 0});
2772 res.map = {}; 2768 res.map = {};
@@ -2857,8 +2853,111 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -2857,8 +2853,111 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
2857 obj.openDetail(resId, resType, title, false, null, null, 'newTabPage'); 2853 obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
2858 }); 2854 });
2859 }, 0) 2855 }, 0)
  2856 + },
  2857 + error() {
  2858 +
2860 } 2859 }
2861 - }) 2860 + });
  2861 + // $.ajax({
  2862 + // url: leftUrl,
  2863 + // type: 'get',
  2864 + // headers: {
  2865 + // "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
  2866 + // },
  2867 + // data: {resId: resId},
  2868 + // success: function (res) {
  2869 + // if (!res || !res.success) {
  2870 + // layer.msg('获取关联信息失败!', {icon: 0});
  2871 + // res.map = {};
  2872 + // }
  2873 + // setTimeout(function () {
  2874 + // // var height = $("#" + tableId).parent().parent().parent().parent().parent().height() - 10;
  2875 + // var height = $('.layui-layer-page').find('.layui-layer-content').height();
  2876 + // if (!height || height === 0) {
  2877 + // height = window.innerHeight
  2878 + // }
  2879 + // if ($('.layui-layer-page').find('.layui-tab-title').length > 0) {
  2880 + // height = height - 70;
  2881 + // } else {
  2882 + // height = height - 15;
  2883 + // }
  2884 + // $("#" + tableId).parent().parent().parent().parent().before(laytpl($("#detailPageLeftPanel").html()).render(res))
  2885 + // $(".detail-left-panel").css({height: height + "px"})
  2886 + // $(".detail-left-panel").find(".detail-left-panel-btn").unbind("click").on("click", function () {
  2887 + // var $that = $(this);
  2888 + // if ($(".detail-left-panel").width() == 0) {
  2889 + // $that.find("i.layui-icon").removeClass("layui-icon-next").addClass("layui-icon-prev")
  2890 + // $(".detail-left-panel").animate({width: 270, marginLeft: 0}, 300);
  2891 + // $(".detail-left-panel").find(".detail-left-panel-node").show();
  2892 + // } else {
  2893 + // $that.find("i.layui-icon").removeClass("layui-icon-prev").addClass("layui-icon-next")
  2894 + // $(".detail-left-panel").animate({width: 0, marginLeft: 10}, 300);
  2895 + // $(".detail-left-panel").find(".detail-left-panel-node").hide();
  2896 + // }
  2897 + // });
  2898 + // $('div.info-box').unbind('click').bind('click', function () {
  2899 + // var name = $(this).text();
  2900 + // var resId = $(this).data("resid");
  2901 + // var resType = '';
  2902 + // var ip = $(this).data("ip");
  2903 + // var resTypeName = $(this).data("restypename");
  2904 + // var admin = $(this).data("admin");
  2905 + // var adminName = '';
  2906 + // var manageIp = '';
  2907 + // var collProtocol = '';
  2908 + // $.ajax({
  2909 + // url: common.domainName + "/api-web/home/resource/findById?resId=" + resId,
  2910 + // async: false,
  2911 + // type: 'get',
  2912 + // headers: {
  2913 + // "Authorization": "Bearer " + obj.sessions.getToken().access_token + ""
  2914 + // },
  2915 + // error: function () {
  2916 + // layer.closeAll('loading');
  2917 + // },
  2918 + // success: function (res) {
  2919 + // var data = res.object;
  2920 + // resType = data.resType;
  2921 + // adminName = data.adminName;
  2922 + // manageIp = data.manageIp;
  2923 + // collProtocol = data.collProtocol;
  2924 + // }
  2925 + // })
  2926 + // var title = name;
  2927 + // if (title && title !== '') {
  2928 + // title += '|';
  2929 + // }
  2930 + // if (resTypeName && resType !== 'HOST_X86SERVER') {
  2931 + // title += resTypeName + '|';
  2932 + // }
  2933 + // if (ip) {
  2934 + // if (resType === 'HOST_X86SERVER') {
  2935 + // if (collProtocol && (collProtocol.split(",").length > 1 || collProtocol === 'SSH')) {
  2936 + // title += '应用IP-' + ip + '|';
  2937 + // }
  2938 + // } else {
  2939 + // title += ip + '|';
  2940 + // }
  2941 + // }
  2942 + // if (resType === 'HOST_X86SERVER' && collProtocol && collProtocol.indexOf('SNMP') !== -1) {
  2943 + // if (manageIp) {
  2944 + // title += '管理IP-' + manageIp + '|';
  2945 + // }
  2946 + // }
  2947 + // if (adminName) {
  2948 + // title += adminName + '|';
  2949 + // }
  2950 + // if (title.length > 0) {
  2951 + // title = title.substr(0, title.length - 1);
  2952 + // }
  2953 + // layer.closeAll('page');
  2954 + // //资源关联关系时弹窗在新的标签页
  2955 + // // obj.openDetail(resId, resType, name, false,null,null,'newTabPage');
  2956 + // obj.openDetail(resId, resType, title, false, null, null, 'newTabPage');
  2957 + // });
  2958 + // }, 0)
  2959 + // }
  2960 + // })
2862 2961
2863 } 2962 }
2864 }, 2963 },
@@ -2996,7 +3095,6 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -2996,7 +3095,6 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
2996 }); 3095 });
2997 cols.push({field: 'resRemark', title: '备注', align: 'center', sort: false}); 3096 cols.push({field: 'resRemark', title: '备注', align: 'center', sort: false});
2998 3097
2999 - console.log(JSON.stringify(cols))  
3000 var vhostTable = table.render(Object.assign({ 3098 var vhostTable = table.render(Object.assign({
3001 elem: '#' + tableId 3099 elem: '#' + tableId
3002 , url: common.domainName + '/api-web/home/res-list/' + resType + '?parentId=' + resId 3100 , url: common.domainName + '/api-web/home/res-list/' + resType + '?parentId=' + resId
@@ -3376,176 +3474,341 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -3376,176 +3474,341 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
3376 "provider": res.provider, 3474 "provider": res.provider,
3377 "model": res.model 3475 "model": res.model
3378 }; 3476 };
3379 - $.ajax({ 3477 + admin.req({
3380 url: common.domainName + "/api-web/favorites/checkResIsExist", 3478 url: common.domainName + "/api-web/favorites/checkResIsExist",
3381 async: false, 3479 async: false,
3382 data: { 3480 data: {
3383 resId: resId, 3481 resId: resId,
3384 access_token: layui.sessions.getToken()['access_token'] 3482 access_token: layui.sessions.getToken()['access_token']
3385 }, 3483 },
3386 - success: function (response) {  
3387 - layer.closeAll('loading');  
3388 - //拼接提示信息  
3389 - var li = '';  
3390 - var html = '';  
3391 - admin.req({  
3392 - url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId  
3393 - , async: false  
3394 - , done: function (res) {  
3395 - if (res.success) {  
3396 - if (res.map) {  
3397 - if (res.map.ip) {  
3398 - li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +  
3399 - '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3400 - + res.map.ip + '</span></li>'  
3401 - }  
3402 - if (res.map.resTypeName) {  
3403 - li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +  
3404 - '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3405 - + res.map.resTypeName + '</span></li>'  
3406 - }  
3407 - if (res.map.businessName) {  
3408 - li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +  
3409 - '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3410 - + res.map.businessName + '</span></li>'  
3411 - }  
3412 - if (res.map.taskName) {  
3413 - li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +  
3414 - '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3415 - + res.map.taskName + '</span></li>'  
3416 - }  
3417 - if (res.map.collectorName) {  
3418 - li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +  
3419 - '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3420 - + res.map.collectorName + '</span></li>'  
3421 - }  
3422 - if (res.map.domainName) {  
3423 - li += ' <li><span style="text-align:left;width:40%">所属域</span>' +  
3424 - '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3425 - + res.map.domainName + '</span></li>'  
3426 - }  
3427 - if (res.map.extendCol3) {  
3428 - li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +  
3429 - '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3430 - + res.map.extendCol3 + '</span></li>'  
3431 - }  
3432 - if (res.map.colonyName) {  
3433 - li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +  
3434 - '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3435 - + res.map.colonyName + '</span></li>'  
3436 - }  
3437 - if (res.map.resNameHost) {  
3438 - li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +  
3439 - '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3440 - + res.map.resNameHost + '</span></li>'  
3441 - }  
3442 - if (res.map.os) {  
3443 - li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +  
3444 - '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3445 - + res.map.os + '</span></li>'  
3446 - }  
3447 - if (res.map.provider) {  
3448 - li += ' <li><span style="text-align:left;width:40%">厂商</span>' +  
3449 - '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3450 - + res.map.provider + '</span></li>'  
3451 - }  
3452 - if (res.map.model) {  
3453 - li += ' <li><span style="text-align:left;width:40%">型号</span>' +  
3454 - '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3455 - + res.map.model + '</span></li>'  
3456 - }  
3457 - if (res.map.resPositon) {  
3458 - li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +  
3459 - '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3460 - + res.map.resPositon + '</span></li>'  
3461 - }  
3462 - if (resId) {  
3463 - li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +  
3464 - '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'  
3465 - + resId + '</span></li>'  
3466 - } 3484 + }).done(function (response) {
  3485 + layer.closeAll('loading');
  3486 + //拼接提示信息
  3487 + var li = '';
  3488 + var html = '';
  3489 + admin.req({
  3490 + url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
  3491 + , async: false
  3492 + , done: function (res) {
  3493 + if (res.success) {
  3494 + if (res.map) {
  3495 + if (res.map.ip) {
  3496 + li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
  3497 + '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3498 + + res.map.ip + '</span></li>'
  3499 + }
  3500 + if (res.map.resTypeName) {
  3501 + li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
  3502 + '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3503 + + res.map.resTypeName + '</span></li>'
  3504 + }
  3505 + if (res.map.businessName) {
  3506 + li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
  3507 + '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3508 + + res.map.businessName + '</span></li>'
  3509 + }
  3510 + if (res.map.taskName) {
  3511 + li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
  3512 + '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3513 + + res.map.taskName + '</span></li>'
  3514 + }
  3515 + if (res.map.collectorName) {
  3516 + li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
  3517 + '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3518 + + res.map.collectorName + '</span></li>'
  3519 + }
  3520 + if (res.map.domainName) {
  3521 + li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
  3522 + '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3523 + + res.map.domainName + '</span></li>'
  3524 + }
  3525 + if (res.map.extendCol3) {
  3526 + li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
  3527 + '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3528 + + res.map.extendCol3 + '</span></li>'
  3529 + }
  3530 + if (res.map.colonyName) {
  3531 + li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
  3532 + '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3533 + + res.map.colonyName + '</span></li>'
  3534 + }
  3535 + if (res.map.resNameHost) {
  3536 + li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
  3537 + '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3538 + + res.map.resNameHost + '</span></li>'
  3539 + }
  3540 + if (res.map.os) {
  3541 + li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
  3542 + '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3543 + + res.map.os + '</span></li>'
  3544 + }
  3545 + if (res.map.provider) {
  3546 + li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
  3547 + '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3548 + + res.map.provider + '</span></li>'
  3549 + }
  3550 + if (res.map.model) {
  3551 + li += ' <li><span style="text-align:left;width:40%">型号</span>' +
  3552 + '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3553 + + res.map.model + '</span></li>'
  3554 + }
  3555 + if (res.map.resPositon) {
  3556 + li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
  3557 + '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3558 + + res.map.resPositon + '</span></li>'
  3559 + }
  3560 + if (resId) {
  3561 + li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
  3562 + '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3563 + + resId + '</span></li>'
3467 } 3564 }
3468 } 3565 }
3469 } 3566 }
3470 - });  
3471 - var uuid = generateUUID();  
3472 - //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25  
3473 - var resName = res.resName;  
3474 - var resTypeName = res.resTypeName;  
3475 - var adminName = res.adminName;  
3476 - //end lsq 2022-04-25  
3477 -  
3478 - if (li != '') {  
3479 - html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`  
3480 - }  
3481 - if (html != '') {  
3482 - title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >&#xe61e;${html}</i>`  
3483 - }  
3484 - title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`  
3485 - title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`  
3486 - if (response && response.success && response.count > 0) {  
3487 - var favIds = response.map.favIds;  
3488 - title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;  
3489 - } else {  
3490 - title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;  
3491 - }  
3492 - title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;  
3493 - title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;  
3494 - //lsq 2022-04-25 增加ping详情提交按钮  
3495 - title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;  
3496 - if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {  
3497 - /*  
3498 - title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;  
3499 - */  
3500 - }  
3501 - if (res.state == 'new' && hardwareFlag.endsWith("N")) {  
3502 - layer.alert('资源未监控!', {icon: 0});  
3503 - return;  
3504 - }  
3505 - if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {  
3506 - layer.alert('该资源只对接TRAP告警信息!', {icon: 0});  
3507 - return;  
3508 } 3567 }
3509 - //lsq 停机计划跑马灯 2022-08-19  
3510 - title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/src/style/img/shutdown.png'); background-repeat: round;"></span>`  
3511 - title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;  
3512 - title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;  
3513 -  
3514 - obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);  
3515 - },  
3516 - error: function () {  
3517 - layer.closeAll('loading');  
3518 - title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息">&#xe61e;</i>'  
3519 - title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`  
3520 - title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>` 3568 + });
  3569 + var uuid = generateUUID();
  3570 + //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
  3571 + var resName = res.resName;
  3572 + var resTypeName = res.resTypeName;
  3573 + var adminName = res.adminName;
  3574 + //end lsq 2022-04-25
  3575 +
  3576 + if (li != '') {
  3577 + html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
  3578 + }
  3579 + if (html != '') {
  3580 + title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >&#xe61e;${html}</i>`
  3581 + }
  3582 + title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
  3583 + title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
  3584 + if (response && response.success && response.count > 0) {
  3585 + var favIds = response.map.favIds;
  3586 + title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
  3587 + } else {
3521 title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`; 3588 title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
3522 - title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;  
3523 - title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;  
3524 - //lsq 2022-04-25 增加ping详情提交按钮  
3525 - title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;  
3526 - title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;  
3527 - title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;  
3528 - if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {  
3529 - /*  
3530 - title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;  
3531 - */  
3532 - }  
3533 - obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);  
3534 } 3589 }
  3590 + title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;
  3591 + title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
  3592 + //lsq 2022-04-25 增加ping详情提交按钮
  3593 + title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/monitor-web/src/style/img/ping.png" ></a>`;
  3594 + if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
  3595 + /*
  3596 + title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;
  3597 + */
  3598 + }
  3599 + if (res.state == 'new' && hardwareFlag.endsWith("N")) {
  3600 + layer.alert('资源未监控!', {icon: 0});
  3601 + return;
  3602 + }
  3603 + if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
  3604 + layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
  3605 + return;
  3606 + }
  3607 + //lsq 停机计划跑马灯 2022-08-19
  3608 + title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/monitor-web/src/style/img/shutdown.png'); background-repeat: round;"></span>`
  3609 + title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/monitor-web/src/style/img/snapshotadd.png" ></a>`;
  3610 + title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/monitor-web/src/style/img/snapshothistory.png" ></a></div>`;
  3611 + obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
  3612 + }).error(function () {
  3613 + layer.closeAll('loading');
  3614 + title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息">&#xe61e;</i>'
  3615 + title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
  3616 + title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
  3617 + title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
  3618 + title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;
  3619 + title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
  3620 + //lsq 2022-04-25 增加ping详情提交按钮
  3621 + title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/monitor-web/src/style/img/ping.png" ></a>`;
  3622 + title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/monitor-web/src/style/img/snapshotadd.png" ></a>`;
  3623 + title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/monitor-web/src/style/img/snapshothistory.png" ></a></div>`;
  3624 + if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
  3625 + /*
  3626 + title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;
  3627 + */
  3628 + }
  3629 + obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
3535 }); 3630 });
  3631 + // $.ajax({
  3632 + // url: common.domainName + "/api-web/favorites/checkResIsExist",
  3633 + // async: false,
  3634 + // data: {
  3635 + // resId: resId,
  3636 + // access_token: layui.sessions.getToken()['access_token']
  3637 + // },
  3638 + // success: function (response) {
  3639 + // layer.closeAll('loading');
  3640 + // //拼接提示信息
  3641 + // var li = '';
  3642 + // var html = '';
  3643 + // admin.req({
  3644 + // url: common.domainName + '/api-web/manage/resource/getTab?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId
  3645 + // , async: false
  3646 + // , done: function (res) {
  3647 + // if (res.success) {
  3648 + // if (res.map) {
  3649 + // if (res.map.ip) {
  3650 + // li += ' <li><span style="text-align:left;width:40%">IP地址</span>' +
  3651 + // '<span title="' + res.map.ip + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3652 + // + res.map.ip + '</span></li>'
  3653 + // }
  3654 + // if (res.map.resTypeName) {
  3655 + // li += ' <li><span style="text-align:left;width:40%">资源类型</span>' +
  3656 + // '<span title="' + res.map.resTypeName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3657 + // + res.map.resTypeName + '</span></li>'
  3658 + // }
  3659 + // if (res.map.businessName) {
  3660 + // li += ' <li><span style="text-align:left;width:30%">所属业务</span>' +
  3661 + // '<span title="' + res.map.businessName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3662 + // + res.map.businessName + '</span></li>'
  3663 + // }
  3664 + // if (res.map.taskName) {
  3665 + // li += ' <li><span style="text-align:left;width:40%">所属任务</span>' +
  3666 + // '<span title="' + res.map.taskName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3667 + // + res.map.taskName + '</span></li>'
  3668 + // }
  3669 + // if (res.map.collectorName) {
  3670 + // li += ' <li><span style="text-align:left;width:40%">所属采集器</span>' +
  3671 + // '<span title="' + res.map.collectorName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3672 + // + res.map.collectorName + '</span></li>'
  3673 + // }
  3674 + // if (res.map.domainName) {
  3675 + // li += ' <li><span style="text-align:left;width:40%">所属域</span>' +
  3676 + // '<span title="' + res.map.domainName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3677 + // + res.map.domainName + '</span></li>'
  3678 + // }
  3679 + // if (res.map.extendCol3) {
  3680 + // li += ' <li><span style="text-align:left;width:40%">所属平台</span>' +
  3681 + // '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3682 + // + res.map.extendCol3 + '</span></li>'
  3683 + // }
  3684 + // if (res.map.colonyName) {
  3685 + // li += ' <li><span style="text-align:left;width:40%">所属资源池</span>' +
  3686 + // '<span title="' + res.map.colonyName + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3687 + // + res.map.colonyName + '</span></li>'
  3688 + // }
  3689 + // if (res.map.resNameHost) {
  3690 + // li += ' <li><span style="text-align:left;width:40%">所属宿主机</span>' +
  3691 + // '<span title="' + res.map.resNameHost + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3692 + // + res.map.resNameHost + '</span></li>'
  3693 + // }
  3694 + // if (res.map.os) {
  3695 + // li += ' <li><span style="text-align:left;width:40%">操作系统</span>' +
  3696 + // '<span title="' + res.map.os + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3697 + // + res.map.os + '</span></li>'
  3698 + // }
  3699 + // if (res.map.provider) {
  3700 + // li += ' <li><span style="text-align:left;width:40%">厂商</span>' +
  3701 + // '<span title="' + res.map.provider + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3702 + // + res.map.provider + '</span></li>'
  3703 + // }
  3704 + // if (res.map.model) {
  3705 + // li += ' <li><span style="text-align:left;width:40%">型号</span>' +
  3706 + // '<span title="' + res.map.extendCol3 + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3707 + // + res.map.model + '</span></li>'
  3708 + // }
  3709 + // if (res.map.resPositon) {
  3710 + // li += ' <li><span style="text-align:left;width:40%">所属机房</span>' +
  3711 + // '<span title="' + res.map.resPositon + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3712 + // + res.map.resPositon + '</span></li>'
  3713 + // }
  3714 + // if (resId) {
  3715 + // li += ' <li><span style="text-align:left;width:40%">资源ID</span>' +
  3716 + // '<span title="' + resId + '" style="width:60%;text-overflow: ellipsis;white-space: nowrap !important; word-break: break-word;overflow: hidden !important;">'
  3717 + // + resId + '</span></li>'
  3718 + // }
  3719 + // }
  3720 + // }
  3721 + // }
  3722 + // });
  3723 + // var uuid = generateUUID();
  3724 + // //start lsq 资源名称、资源类型名称、责任人字段值传递 2022-04-25
  3725 + // var resName = res.resName;
  3726 + // var resTypeName = res.resTypeName;
  3727 + // var adminName = res.adminName;
  3728 + // //end lsq 2022-04-25
  3729 + //
  3730 + // if (li != '') {
  3731 + // html = `<ul class="info-table hide" id="${uuid}">` + li + `</ul>`
  3732 + // }
  3733 + // if (html != '') {
  3734 + // title += `<i class='iconfont detail_base_info' style='margin-left: 10px' data-id='${uuid}' data-direction="3" >&#xe61e;${html}</i>`
  3735 + // }
  3736 + // title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
  3737 + // title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
  3738 + // if (response && response.success && response.count > 0) {
  3739 + // var favIds = response.map.favIds;
  3740 + // title += `<a class="layui-icon layui-icon-rate-solid" data-id=${resId} data-favids="${favIds}" lay-tips="移出/修改收藏夹"></a>`;
  3741 + // } else {
  3742 + // title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
  3743 + // }
  3744 + // title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;
  3745 + // title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
  3746 + // //lsq 2022-04-25 增加ping详情提交按钮
  3747 + // title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${resName} data-ip=${ip} data-restypename=${resTypeName} data-adminname=${adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
  3748 + // if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
  3749 + // /*
  3750 + // title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;
  3751 + // */
  3752 + // }
  3753 + // if (res.state == 'new' && hardwareFlag.endsWith("N")) {
  3754 + // layer.alert('资源未监控!', {icon: 0});
  3755 + // return;
  3756 + // }
  3757 + // if (res.resType == 'STORAGE_SHARE' && res.provider != 'HUAWEI' && res.provider != 'Inspur'&& res.provider != 'macrosan') {
  3758 + // layer.alert('该资源只对接TRAP告警信息!', {icon: 0});
  3759 + // return;
  3760 + // }
  3761 + // //lsq 停机计划跑马灯 2022-08-19
  3762 + // title +=`<span id="title-shutdown" data-id=${resId} style="flex:1;padding:0 5px;margin-left:10px;background:url('/src/style/img/shutdown.png'); background-repeat: round;"></span>`
  3763 + // title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin:0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
  3764 + // title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
  3765 + //
  3766 + // obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
  3767 + // },
  3768 + // error: function () {
  3769 + // layer.closeAll('loading');
  3770 + // title += '<i data-id=${resId} class="iconfont detail_base_info" style="margin-left: 10px" lay-tips="暂无信息">&#xe61e;</i>'
  3771 + // title += `<a class="layui-icon layui-icon-pause" id=${resId} data-opts="stop" style="display: none" lay-tips="暂停采集"></a>`
  3772 + // title += `<a class="layui-icon layui-icon-play" id=${resId} data-opts="start" style="display: none" lay-tips="恢复采集"></a>`
  3773 + // title += `<a class="layui-icon layui-icon-rate" data-id=${resId} lay-tips="加入收藏夹"></a>`;
  3774 + // title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont">&#XE516;</i></a>`;
  3775 + // title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"></a>`;
  3776 + // //lsq 2022-04-25 增加ping详情提交按钮
  3777 + // title += `<a class="layui-icon res-view-ping" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="历史数据" style="margin-left: 10px;position:relative;top:-3px;"> <img width="20" src="/src/style/img/ping.png" ></a>`;
  3778 + // title += `<div style="width:60px;display:flex;justify-content: flex-end"><a class="layui-icon res-view-addSnapshot" data-id=${resId} lay-tips="创建快照" style=" margin: 0 10px"> <img width="20" src="/src/style/img/snapshotadd.png" ></a>`;
  3779 + // title += `<a class="layui-icon res-view-history" data-id=${resId} data-resname=${res.resName} data-ip=${ip} data-restypename=${res.resTypeName} data-adminname=${res.adminName} lay-tips="快照历史记录" style=""> <img width="20" src="/src/style/img/snapshothistory.png" ></a></div>`;
  3780 + // if (resCategory === 'share' && hardwareFlag.endsWith("Y")) {
  3781 + // /*
  3782 + // title += `<a class="layui-icon res-view-assets-details" data-ip=${ip} data-name=${name} data-restype=${resType} data-id=${resId} lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>`;
  3783 + // */
  3784 + // }
  3785 + // obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type);
  3786 + // }
  3787 + // });
3536 }); 3788 });
3537 }, 3789 },
3538 alarmData: new Object(), 3790 alarmData: new Object(),
3539 loadResAlarm: function (resId) { 3791 loadResAlarm: function (resId) {
3540 - $.ajax({  
3541 - type: 'get', 3792 + admin.req({
3542 url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId, 3793 url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
3543 - contentType: "application/json; charset=utf-8",  
3544 async: false, 3794 async: false,
3545 - success: function (res) { 3795 + data: {},
  3796 + success(res) {
3546 obj.alarmData = res.data; 3797 obj.alarmData = res.data;
  3798 + },
  3799 + error() {
  3800 + //layer.closeAll('loading');
3547 } 3801 }
3548 }); 3802 });
  3803 + // $.ajax({
  3804 + // type: 'get',
  3805 + // url: common.domainName + '/api-web/home/alarm/alarmListPage?page=1&limit=100&access_token=' + layui.sessions.getToken().access_token + "&resId=" + resId,
  3806 + // contentType: "application/json; charset=utf-8",
  3807 + // async: false,
  3808 + // success: function (res) {
  3809 + // obj.alarmData = res.data;
  3810 + // }
  3811 + // });
3549 }, 3812 },
3550 alarmEleMatchStyle: function (flag, kpiId) { 3813 alarmEleMatchStyle: function (flag, kpiId) {
3551 var tempAlarms = obj.alarmData; 3814 var tempAlarms = obj.alarmData;
@@ -147,19 +147,34 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'commonDe @@ -147,19 +147,34 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'commonDe
147 147
148 //删除指标过滤 148 //删除指标过滤
149 function delFilter(param) { 149 function delFilter(param) {
150 - $.ajax({  
151 - url: common.domainName + '/api-web/filterkpi/kpi/remove?access_token=' + accessToken,  
152 - data: param,  
153 - success: function () {  
154 - layer.msg('删除成功', {  
155 - offset: '15px'  
156 - , icon: 1  
157 - , time: 1000  
158 - }, function () {  
159 - reloadTable();  
160 - });  
161 - }  
162 - }) 150 + admin.req({
  151 + url: common.domainName + '/api-web/filterkpi/kpi/remove'
  152 + ,data: param,
  153 + }).done(function (res) {
  154 + layer.msg('删除成功', {
  155 + offset: '15px'
  156 + , icon: 1
  157 + , time: 1000
  158 + }, function () {
  159 + reloadTable();
  160 + });
  161 +
  162 + }).error(function (error) {
  163 + console.log(error);
  164 + });
  165 + // $.ajax({
  166 + // url: common.domainName + '/api-web/filterkpi/kpi/remove?access_token=' + accessToken,
  167 + // data: param,
  168 + // success: function () {
  169 + // layer.msg('删除成功', {
  170 + // offset: '15px'
  171 + // , icon: 1
  172 + // , time: 1000
  173 + // }, function () {
  174 + // reloadTable();
  175 + // });
  176 + // }
  177 + // })
163 } 178 }
164 179
165 //删除指标压制 180 //删除指标压制
@@ -89,7 +89,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laytpl', @@ -89,7 +89,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laytpl',
89 89
90 layer.open({ 90 layer.open({
91 title: '', 91 title: '',
92 - area: ['1690px', '450px'], 92 + area: ['90%', '500px'],
93 type: 1, 93 type: 1,
94 content: laytpl($('#tpl-ip-segment-big-content').html()).render(domainList[domainIndex].ipSegmentList[segmentIndex]), 94 content: laytpl($('#tpl-ip-segment-big-content').html()).render(domainList[domainIndex].ipSegmentList[segmentIndex]),
95 success: function () { 95 success: function () {
@@ -118,7 +118,8 @@ layui.define(['laytpl', 'layer'], function (exports) { @@ -118,7 +118,8 @@ layui.define(['laytpl', 'layer'], function (exports) {
118 // } 118 // }
119 119
120 120
121 - if(options.method == 'post' || options.method == 'POST' || options.type == 'post' || options.type == 'POST'){ 121 + if(options.method == 'post' || options.method == 'POST' || options.type == 'post' || options.type == 'POST'
  122 + || options.type == 'delete' || options.method == 'delete' || options.type == 'DELETE' || options.method == 'DELETE'){
122 layui.use(['common'], function () { 123 layui.use(['common'], function () {
123 var common = layui.common; 124 var common = layui.common;
124 let tokenVal = common.getMjToken(); 125 let tokenVal = common.getMjToken();