Authored by xwx

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

@@ -132,6 +132,8 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -132,6 +132,8 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
132 var bizlist = []; 132 var bizlist = [];
133 if (data.data) { 133 if (data.data) {
134 bizlist = data.data; 134 bizlist = data.data;
  135 + <!--1-全部告警 2-严重告警 3-重要告警 4-一般告警-->
  136 +
135 } 137 }
136 138
137 if (bizMap != null && bizMap.health != '3') {//不等于优 139 if (bizMap != null && bizMap.health != '3') {//不等于优
@@ -247,7 +249,17 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -247,7 +249,17 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
247 $("#indexbizhealth [data-index-banner-item='type'] .index-banner-item-tips").unbind('click').on("click", function () { 249 $("#indexbizhealth [data-index-banner-item='type'] .index-banner-item-tips").unbind('click').on("click", function () {
248 var bizId = $(this).data('bizid'); 250 var bizId = $(this).data('bizid');
249 var alink = document.createElement('a'); 251 var alink = document.createElement('a');
250 - alink.setAttribute("lay-href", "/alarm/activewarning/bizId=" + bizId); 252 + // Start 跳转到告警页面带告警级别 LSQ 2021/12/29 19:34
  253 + //alarmLevel 3-严重 2-重要 1-一般 4-全部-''
  254 + var alarmLevelSelect=$('#select-content-ul .select-list.listActive').data('val');
  255 + var alarmLevelVal='';
  256 + if(alarmLevelSelect!=4){
  257 + alarmLevelVal=alarmLevelSelect;
  258 + }else{
  259 + alarmLevelVal='';
  260 + }
  261 + alink.setAttribute("lay-href", "/alarm/activewarning/bizId=" + bizId+'/level='+alarmLevelVal);
  262 + //End LSQ 2021/12/29 19:35
251 document.body.appendChild(alink); 263 document.body.appendChild(alink);
252 alink.click(); 264 alink.click();
253 document.body.removeChild(alink); 265 document.body.removeChild(alink);
@@ -322,6 +334,70 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -322,6 +334,70 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
322 $(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level); 334 $(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level);
323 // $(this).trigger(); 335 // $(this).trigger();
324 }); 336 });
  337 + // Start 告警级别默认为严重告警,点击左下角选择告警级别,页面的小红点切换不同告警的数量,item根据告警数量进行排序 LSQ 2021/12/29 19:37
  338 + $(".select-total").hide();
  339 + $(".select-important").hide();
  340 + $(".select-normal").hide();
  341 + var itemArr=$(".index-banner-item");
  342 + itemArr.map((index,item)=>{
  343 + if($(item).data('serious')=='0'){
  344 + $(item).find('.select-serious').hide();
  345 + }
  346 + $(item).css('order',$(item).data('serious'))
  347 + })
  348 + $("#select-content-ul li").unbind("click").on("click",function (){
  349 + var dataVal=$(this).data('val');
  350 + var dataValLabel=$(this).text();
  351 + $('.select-val span').text(dataValLabel);
  352 + $(this).addClass('listActive').siblings().removeClass("listActive");
  353 + if(dataVal=='4'){
  354 + $(".select-total").show();
  355 + $(".select-important").hide();
  356 + $(".select-normal").hide();
  357 + $(".select-serious").hide();
  358 + itemArr.map((index,item)=>{
  359 + if($(item).data('total')=='0'){
  360 + $(item).find('.select-total').hide();
  361 + }
  362 + $(item).css('order',$(item).data('total'))
  363 + })
  364 + }else if(dataVal==3){
  365 + $(".select-total").hide();
  366 + $(".select-important").hide();
  367 + $(".select-normal").hide();
  368 + $(".select-serious").show();
  369 + itemArr.map((index,item)=>{
  370 + if($(item).data('serious')=='0'){
  371 + $(item).find('.select-serious').hide();
  372 + }
  373 + $(item).css('order',$(item).data('serious'))
  374 + })
  375 + }else if(dataVal==2){
  376 + $(".select-total").hide();
  377 + $(".select-important").show();
  378 + $(".select-normal").hide();
  379 + $(".select-serious").hide();
  380 + itemArr.map((index,item)=>{
  381 + if($(item).data('important')=='0'){
  382 + $(item).find('.select-important').hide();
  383 + }
  384 + $(item).css('order',$(item).data('important'))
  385 + })
  386 + }else if(dataVal==1){
  387 + $(".select-total").hide();
  388 + $(".select-important").hide();
  389 + $(".select-normal").show();
  390 + $(".select-serious").hide();
  391 + itemArr.map((index,item)=>{
  392 + if($(item).data('normal')=='0'){
  393 + $(item).find('.select-normal').hide();
  394 + }
  395 + $(item).css('order',$(item).data('normal'))
  396 + })
  397 + }
  398 +
  399 + })
  400 + //End LSQ 2021/12/29 19:38
325 401
326 // 点击资源数量 402 // 点击资源数量
327 $("#indexbizhealth [data-index-banner-item='resType'] .gj-detail-info li:not([data-level])").unbind('click').on("click", function () { 403 $("#indexbizhealth [data-index-banner-item='resType'] .gj-detail-info li:not([data-level])").unbind('click').on("click", function () {
@@ -342,8 +418,18 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -342,8 +418,18 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
342 if("ALI_CLOUD_PLAT"== restype || "HUAWEI_CLOUD_PLAT" == restype){ 418 if("ALI_CLOUD_PLAT"== restype || "HUAWEI_CLOUD_PLAT" == restype){
343 restype =restype.substring(0,restype.lastIndexOf("_")); 419 restype =restype.substring(0,restype.lastIndexOf("_"));
344 } 420 }
  421 + // Start 跳转到告警页面带告警级别 LSQ 2021/12/29 19:34
  422 + //alarmLevel 3-严重 2-重要 1-一般 4-全部-''
  423 + var alarmLevelSelect=$('#select-content-ul .select-list.listActive').data('val');
  424 + var alarmLevelVal='';
  425 + if(alarmLevelSelect!=4){
  426 + alarmLevelVal=alarmLevelSelect;
  427 + }else{
  428 + alarmLevelVal='';
  429 + }
345 var alink = document.createElement('a'); 430 var alink = document.createElement('a');
346 - alink.setAttribute("lay-href", "/alarm/activewarning/restype=" + restype); 431 + alink.setAttribute("lay-href", "/alarm/activewarning/restype=" + restype+'/level='+alarmLevelVal);
  432 + //End LSQ 2021/12/29 19:42
347 document.body.appendChild(alink); 433 document.body.appendChild(alink);
348 alink.click(); 434 alink.click();
349 document.body.removeChild(alink); 435 document.body.removeChild(alink);
@@ -452,14 +452,12 @@ layui.extend({ @@ -452,14 +452,12 @@ layui.extend({
452 } 452 }
453 453
454 //判断是否为故障诊断的三种类型 454 //判断是否为故障诊断的三种类型
455 - if(toastType=='faultinfo'||toastType=='faultprogress'||toastType=='faultover'){ 455 + if(toastType=='faultinfo'||toastType=='faultover'){
456 var imgUrl=""; 456 var imgUrl="";
457 if(toastType=='faultinfo'){ 457 if(toastType=='faultinfo'){
458 imgUrl="/src/style/img/fault.png"; 458 imgUrl="/src/style/img/fault.png";
459 } 459 }
460 - if(toastType=='faultprogress'){  
461 - imgUrl="/src/style/img/faultover.png";  
462 - } 460 +
463 if(toastType=='faultover'){ 461 if(toastType=='faultover'){
464 imgUrl="/src/style/img/faultprogress.png"; 462 imgUrl="/src/style/img/faultprogress.png";
465 } 463 }
@@ -486,6 +484,35 @@ layui.extend({ @@ -486,6 +484,35 @@ layui.extend({
486 } 484 }
487 }) 485 })
488 }, delay); 486 }, delay);
  487 + }else if(toastType=='faultprogress'){
  488 + var imgUrl="";
  489 + if(toastType=='faultprogress'){
  490 + imgUrl="/src/style/img/faultover.png";
  491 + }
  492 + setTimeout(function () {
  493 + new msgTips({
  494 + dom: ".right-bottom-tips",
  495 + title: title,
  496 + message: `<p style="line-height: 24px;background: url(${imgUrl}) no-repeat;background-size: 100%;height: 160px;background-position-x: right;padding-left: 25px;padding-top: 145px;"><span >${content}</span><span class="title closeFault" style="position: relative;top: -175px;left: 179px;">X</span><span style="position: relative;left: -90px;top: -117px; font-weight: bold;float: right;">${title}</span></p>`,
  497 + duration: 10000,
  498 + space: 10,
  499 + firstSpace: 8,
  500 + limit: 8,
  501 + margin: 15,
  502 + direction: 'right bottom',
  503 + timingFun: 'ease',
  504 + width: '300px',
  505 + toastType: toastType,
  506 + type: 'click',
  507 + action: function () {
  508 + //if (hash) {
  509 + // location.hash = hash;
  510 + location.hash = "/faultDiagnosis/list/faultNo="+content.split(",")[0].split(":")[1];
  511 + //}
  512 + }
  513 + })
  514 + }, delay);
  515 +
489 }else{ 516 }else{
490 setTimeout(function () { 517 setTimeout(function () {
491 new msgTips({ 518 new msgTips({
@@ -7893,7 +7893,7 @@ form[lay-filter="activewarning-form"] .layui-inline { @@ -7893,7 +7893,7 @@ form[lay-filter="activewarning-form"] .layui-inline {
7893 .padding-left-10{ 7893 .padding-left-10{
7894 padding-left:10px; 7894 padding-left:10px;
7895 } 7895 }
7896 -/* Start 自定义select的样式*/ 7896 +/* Start LSQ 自定义select的样式*/
7897 .select-input-my+.layui-form-select .layui-select-title .layui-input::-webkit-input-placeholder { 7897 .select-input-my+.layui-form-select .layui-select-title .layui-input::-webkit-input-placeholder {
7898 color:#999; 7898 color:#999;
7899 } 7899 }
@@ -7909,3 +7909,50 @@ form[lay-filter="activewarning-form"] .layui-inline { @@ -7909,3 +7909,50 @@ form[lay-filter="activewarning-form"] .layui-inline {
7909 background-color:rgb(242, 242, 242); 7909 background-color:rgb(242, 242, 242);
7910 } 7910 }
7911 /* End 自定义select的样式*/ 7911 /* End 自定义select的样式*/
  7912 +/* // Start 首页右下角告警级别选择样式 LSQ 2021/12/29 19:51*/
  7913 +.flex-bottom{
  7914 + display: flex;
  7915 + justify-content: space-between;
  7916 + align-items: center;
  7917 +}
  7918 +.select-margin{
  7919 + margin-right:46px;
  7920 +}
  7921 +.div-select{
  7922 + position: relative;
  7923 + font-size:12px;
  7924 +}
  7925 +.select-val{
  7926 + cursor: pointer;
  7927 +}
  7928 +.select-content{
  7929 + position: absolute;
  7930 + top:-130px;
  7931 + right:0;
  7932 + background: #FFFFFF;
  7933 + border:1px solid #d2d2d2;
  7934 + border-radius: 2px;
  7935 + display: none;
  7936 +}
  7937 +.select-list{
  7938 + padding:10px 15px;
  7939 + cursor: pointer;
  7940 +}
  7941 +.listActive,.select-list:hover{
  7942 + background:#f2f2f2;
  7943 +}
  7944 +.div-select:hover .select-content{
  7945 + display:block;
  7946 +}
  7947 +.arrow-down-alarm{
  7948 + display: inline-block;
  7949 + width:8px;
  7950 + height: 7px;
  7951 + background-image: url("/src/style/img/icon-arrow-down.png");
  7952 + background-position: center;
  7953 + background-size: 100%;
  7954 +}
  7955 +/* //End LSQ 2021/12/29 19:52 */
  7956 +.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{
  7957 + left:-7px;
  7958 +}
@@ -305,6 +305,7 @@ @@ -305,6 +305,7 @@
305 {{# if(item.health == 4){ bizClas = 'icon-banner-worst';healthDesc ="比较严重" } }} 305 {{# if(item.health == 4){ bizClas = 'icon-banner-worst';healthDesc ="比较严重" } }}
306 {{# if(item.health == 5){ bizClas = 'icon-banner-error';healthDesc ="非常严重" } }} 306 {{# if(item.health == 5){ bizClas = 'icon-banner-error';healthDesc ="非常严重" } }}
307 <div class="index-banner-item gj-detail {{acive}}" id="{{item.busId}}" data-id="{{item.busId}}" 307 <div class="index-banner-item gj-detail {{acive}}" id="{{item.busId}}" data-id="{{item.busId}}"
  308 + data-total="{{-item.total}}" data-serious="{{-item.serious}}" data-important="{{-item.important}}" data-normal="{{-item.normal}}"
308 data-topoid="{{item.jtopoId}}" data-index-banner-item="type" data-resnum="{{item.resNUm}}"> 309 data-topoid="{{item.jtopoId}}" data-index-banner-item="type" data-resnum="{{item.resNUm}}">
309 <i class="{{bizClas}} click-icon" data-level="all"></i> 310 <i class="{{bizClas}} click-icon" data-level="all"></i>
310 <div class="index-banner-item-title"> 311 <div class="index-banner-item-title">
@@ -314,9 +315,25 @@ @@ -314,9 +315,25 @@
314 {{# } }} 315 {{# } }}
315 316
316 {{# if(item.total) { }} 317 {{# if(item.total) { }}
317 - <span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警" 318 + <!--<span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
  319 + data-bizid="{{item.busId}}">{{item.total}}</span>-->
  320 + <span class="index-banner-item-tips select-total" lay-tips="当前有{{item.total}}条告警"
318 data-bizid="{{item.busId}}">{{item.total}}</span> 321 data-bizid="{{item.busId}}">{{item.total}}</span>
  322 +
  323 + {{# } }}
  324 + {{# if(item.important) { }}
  325 + <span class="index-banner-item-tips select-important" lay-tips="当前有{{item.important}}条告警"
  326 + data-bizid="{{item.busId}}">{{item.important}}</span>
  327 + {{# } }}
  328 + {{# if(item.normal) { }}
  329 + <span class="index-banner-item-tips select-normal" lay-tips="当前有{{item.normal}}条告警"
  330 + data-bizid="{{item.busId}}">{{item.normal}}</span>
  331 + {{# } }}
  332 + {{# if(item.serious) { }}
  333 + <span class="index-banner-item-tips select-serious" lay-tips="当前有{{item.serious}}条告警"
  334 + data-bizid="{{item.busId}}">{{item.serious}}</span>
319 {{# } }} 335 {{# } }}
  336 +
320 </div> 337 </div>
321 <ul class="gj-detail-info"> 338 <ul class="gj-detail-info">
322 <!-- <li data-bizid="{{item.busId}}">--> 339 <!-- <li data-bizid="{{item.busId}}">-->
@@ -346,12 +363,28 @@ @@ -346,12 +363,28 @@
346 <!-- <span class="index-banner-count">业务共 {{d.count}} </span>--> 363 <!-- <span class="index-banner-count">业务共 {{d.count}} </span>-->
347 <!--业务统计数更改 364 <!--业务统计数更改
348 LSQ 2021/12/28 11:25 365 LSQ 2021/12/28 11:25
  366 + // Start 右下角增加切换告警级别 LSQ 2021/12/29 19:39
349 --> 367 -->
350 - {{# if(d.data[0] && d.data[0].bizList ) { }}  
351 - <span class="index-banner-count">业务共 {{d.data[0].bizList.length}} </span>  
352 - {{# }else{ }}  
353 - <span class="index-banner-count">业务共 0 </span>  
354 - {{# } }} 368 + <div class="flex-bottom">
  369 +
  370 + {{# if(d.data[0] && d.data[0].bizList ) { }}
  371 + <span class="index-banner-count">业务共 {{d.data[0].bizList.length}} </span>
  372 + {{# }else{ }}
  373 + <span class="index-banner-count">业务共 0 </span>
  374 + {{# } }}
  375 + <div class="div-select select-margin " >
  376 + <div class="select-val"><span>严重告警</span> <i class="arrow-down-alarm"></i></div>
  377 + <ul class="select-content" id="select-content-ul">
  378 + <li class="select-list" data-val="4">全部告警</li>
  379 + <li class="select-list listActive" data-val="3">严重告警</li>
  380 + <li class="select-list" data-val="2">重要告警</li>
  381 + <li class="select-list" data-val="1">一般告警</li>
  382 + </ul>
  383 +
  384 + </div>
  385 +
  386 +
  387 + </div>
355 </script> 388 </script>
356 389
357 <!--资源类型监控情况--> 390 <!--资源类型监控情况-->
@@ -424,14 +457,29 @@ @@ -424,14 +457,29 @@
424 if(item.health == 4){ resTypeClass = 'icon-banner-worst';healthDesc ="比较严重"} 457 if(item.health == 4){ resTypeClass = 'icon-banner-worst';healthDesc ="比较严重"}
425 if(item.health == 5){ resTypeClass = 'icon-banner-error';healthDesc ="非常严重"} }} 458 if(item.health == 5){ resTypeClass = 'icon-banner-error';healthDesc ="非常严重"} }}
426 <div class="index-banner-item gj-detail index-banner-item-big" data-restype="{{item.resType}}" 459 <div class="index-banner-item gj-detail index-banner-item-big" data-restype="{{item.resType}}"
  460 + data-total="{{-item.total}}" data-serious="{{-item.serious}}" data-important="{{-item.important}}" data-normal="{{-item.normal}}"
427 data-index-banner-item="resType" data-resnum="{{item.resNum}}"> 461 data-index-banner-item="resType" data-resnum="{{item.resNum}}">
428 <i class="{{resTypeClass}} click-icon" data-level="all"></i> 462 <i class="{{resTypeClass}} click-icon" data-level="all"></i>
429 <div class="index-banner-item-title"> 463 <div class="index-banner-item-title">
430 <p>{{item.resTypeName}}</p> 464 <p>{{item.resTypeName}}</p>
431 {{# if(item.total) { }} 465 {{# if(item.total) { }}
432 - <span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警" 466 + <!-- <span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
  467 + data-restype="{{item.resType}}">{{item.total}}</span>-->
  468 + <span class="index-banner-item-tips select-total" lay-tips="当前有{{item.total}}条告警"
433 data-restype="{{item.resType}}">{{item.total}}</span> 469 data-restype="{{item.resType}}">{{item.total}}</span>
434 {{# } }} 470 {{# } }}
  471 + {{# if(item.important) { }}
  472 + <span class="index-banner-item-tips select-important" lay-tips="当前有{{item.important}}条告警"
  473 + data-restype="{{item.resType}}">{{item.important}}</span>
  474 + {{# } }}
  475 + {{# if(item.normal) { }}
  476 + <span class="index-banner-item-tips select-normal" lay-tips="当前有{{item.normal}}条告警"
  477 + data-restype="{{item.resType}}">{{item.normal}}</span>
  478 + {{# } }}
  479 + {{# if(item.serious) { }}
  480 + <span class="index-banner-item-tips select-serious" lay-tips="当前有{{item.serious}}条告警"
  481 + data-restype="{{item.resType}}">{{item.serious}}</span>
  482 + {{# } }}
435 </div> 483 </div>
436 <ul class="gj-detail-info"> 484 <ul class="gj-detail-info">
437 <li data-restype="{{item.resType}}"> 485 <li data-restype="{{item.resType}}">
@@ -650,7 +650,8 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -650,7 +650,8 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
650 <span data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}" 650 <span data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
651 data-resname="{{d.resName}}" data-pingenable="{{d.pingEnable}}" >{{d.resName}}</span> 651 data-resname="{{d.resName}}" data-pingenable="{{d.pingEnable}}" >{{d.resName}}</span>
652 {{# } }} 652 {{# } }}
653 - <a class="layui-icon layui-icon-picture reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"></a> 653 + <a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" lay-tips="查看资源拓扑"><i class="iconfont" style="font-size: 20px;
  654 + color: #FEB61E;"></i></a>
654 </div> 655 </div>
655 ` 656 `
656 } 657 }
@@ -143,8 +143,7 @@ @@ -143,8 +143,7 @@
143 <!--资产信息--> 143 <!--资产信息-->
144 <div class="title"> 144 <div class="title">
145 <i class="iconfont icon-liebiaomoshi"/> 资产信息 145 <i class="iconfont icon-liebiaomoshi"/> 资产信息
146 -  
147 - <el-dropdown v-if="Object.keys(icon).length > 0" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px"> 146 + <el-dropdown v-if="Object.keys(icon).length > 0 && !isAdmin()" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px">
148 <i class="icon el-icon-plus"/>添加{{icon['bastion'].name}} 147 <i class="icon el-icon-plus"/>添加{{icon['bastion'].name}}
149 <template #dropdown> 148 <template #dropdown>
150 <div style="max-height: 300px;overflow-y: auto"> 149 <div style="max-height: 300px;overflow-y: auto">
@@ -423,7 +423,7 @@ export default { @@ -423,7 +423,7 @@ export default {
423 let isAdmin = () => { 423 let isAdmin = () => {
424 let userRoleArr = proxy.$global.common.getUserRole(); 424 let userRoleArr = proxy.$global.common.getUserRole();
425 let userName = proxy.$global.common.getUserName(); 425 let userName = proxy.$global.common.getUserName();
426 - return userName != 'admin' && userName != 'root' && !userRoleArr.concat('pmp'); 426 + return userName != 'admin' && userName != 'root' && !userRoleArr.includes('pmp');
427 } 427 }
428 428
429 const { 429 const {