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','
var bizlist = [];
if (data.data) {
bizlist = data.data;
<!--1-全部告警 2-严重告警 3-重要告警 4-一般告警-->
}
if (bizMap != null && bizMap.health != '3') {//不等于优
... ... @@ -247,7 +249,17 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
$("#indexbizhealth [data-index-banner-item='type'] .index-banner-item-tips").unbind('click').on("click", function () {
var bizId = $(this).data('bizid');
var alink = document.createElement('a');
alink.setAttribute("lay-href", "/alarm/activewarning/bizId=" + bizId);
// Start 跳转到告警页面带告警级别 LSQ 2021/12/29 19:34
//alarmLevel 3-严重 2-重要 1-一般 4-全部-''
var alarmLevelSelect=$('#select-content-ul .select-list.listActive').data('val');
var alarmLevelVal='';
if(alarmLevelSelect!=4){
alarmLevelVal=alarmLevelSelect;
}else{
alarmLevelVal='';
}
alink.setAttribute("lay-href", "/alarm/activewarning/bizId=" + bizId+'/level='+alarmLevelVal);
//End LSQ 2021/12/29 19:35
document.body.appendChild(alink);
alink.click();
document.body.removeChild(alink);
... ... @@ -322,6 +334,70 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
$(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level);
// $(this).trigger();
});
// Start 告警级别默认为严重告警,点击左下角选择告警级别,页面的小红点切换不同告警的数量,item根据告警数量进行排序 LSQ 2021/12/29 19:37
$(".select-total").hide();
$(".select-important").hide();
$(".select-normal").hide();
var itemArr=$(".index-banner-item");
itemArr.map((index,item)=>{
if($(item).data('serious')=='0'){
$(item).find('.select-serious').hide();
}
$(item).css('order',$(item).data('serious'))
})
$("#select-content-ul li").unbind("click").on("click",function (){
var dataVal=$(this).data('val');
var dataValLabel=$(this).text();
$('.select-val span').text(dataValLabel);
$(this).addClass('listActive').siblings().removeClass("listActive");
if(dataVal=='4'){
$(".select-total").show();
$(".select-important").hide();
$(".select-normal").hide();
$(".select-serious").hide();
itemArr.map((index,item)=>{
if($(item).data('total')=='0'){
$(item).find('.select-total').hide();
}
$(item).css('order',$(item).data('total'))
})
}else if(dataVal==3){
$(".select-total").hide();
$(".select-important").hide();
$(".select-normal").hide();
$(".select-serious").show();
itemArr.map((index,item)=>{
if($(item).data('serious')=='0'){
$(item).find('.select-serious').hide();
}
$(item).css('order',$(item).data('serious'))
})
}else if(dataVal==2){
$(".select-total").hide();
$(".select-important").show();
$(".select-normal").hide();
$(".select-serious").hide();
itemArr.map((index,item)=>{
if($(item).data('important')=='0'){
$(item).find('.select-important').hide();
}
$(item).css('order',$(item).data('important'))
})
}else if(dataVal==1){
$(".select-total").hide();
$(".select-important").hide();
$(".select-normal").show();
$(".select-serious").hide();
itemArr.map((index,item)=>{
if($(item).data('normal')=='0'){
$(item).find('.select-normal').hide();
}
$(item).css('order',$(item).data('normal'))
})
}
})
//End LSQ 2021/12/29 19:38
// 点击资源数量
$("#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','
if("ALI_CLOUD_PLAT"== restype || "HUAWEI_CLOUD_PLAT" == restype){
restype =restype.substring(0,restype.lastIndexOf("_"));
}
// Start 跳转到告警页面带告警级别 LSQ 2021/12/29 19:34
//alarmLevel 3-严重 2-重要 1-一般 4-全部-''
var alarmLevelSelect=$('#select-content-ul .select-list.listActive').data('val');
var alarmLevelVal='';
if(alarmLevelSelect!=4){
alarmLevelVal=alarmLevelSelect;
}else{
alarmLevelVal='';
}
var alink = document.createElement('a');
alink.setAttribute("lay-href", "/alarm/activewarning/restype=" + restype);
alink.setAttribute("lay-href", "/alarm/activewarning/restype=" + restype+'/level='+alarmLevelVal);
//End LSQ 2021/12/29 19:42
document.body.appendChild(alink);
alink.click();
document.body.removeChild(alink);
... ...
... ... @@ -452,14 +452,12 @@ layui.extend({
}
//判断是否为故障诊断的三种类型
if(toastType=='faultinfo'||toastType=='faultprogress'||toastType=='faultover'){
if(toastType=='faultinfo'||toastType=='faultover'){
var imgUrl="";
if(toastType=='faultinfo'){
imgUrl="/src/style/img/fault.png";
}
if(toastType=='faultprogress'){
imgUrl="/src/style/img/faultover.png";
}
if(toastType=='faultover'){
imgUrl="/src/style/img/faultprogress.png";
}
... ... @@ -486,6 +484,35 @@ layui.extend({
}
})
}, delay);
}else if(toastType=='faultprogress'){
var imgUrl="";
if(toastType=='faultprogress'){
imgUrl="/src/style/img/faultover.png";
}
setTimeout(function () {
new msgTips({
dom: ".right-bottom-tips",
title: title,
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>`,
duration: 10000,
space: 10,
firstSpace: 8,
limit: 8,
margin: 15,
direction: 'right bottom',
timingFun: 'ease',
width: '300px',
toastType: toastType,
type: 'click',
action: function () {
//if (hash) {
// location.hash = hash;
location.hash = "/faultDiagnosis/list/faultNo="+content.split(",")[0].split(":")[1];
//}
}
})
}, delay);
}else{
setTimeout(function () {
new msgTips({
... ...
... ... @@ -7893,7 +7893,7 @@ form[lay-filter="activewarning-form"] .layui-inline {
.padding-left-10{
padding-left:10px;
}
/* Start 自定义select的样式*/
/* Start LSQ 自定义select的样式*/
.select-input-my+.layui-form-select .layui-select-title .layui-input::-webkit-input-placeholder {
color:#999;
}
... ... @@ -7909,3 +7909,50 @@ form[lay-filter="activewarning-form"] .layui-inline {
background-color:rgb(242, 242, 242);
}
/* End 自定义select的样式*/
/* // Start 首页右下角告警级别选择样式 LSQ 2021/12/29 19:51*/
.flex-bottom{
display: flex;
justify-content: space-between;
align-items: center;
}
.select-margin{
margin-right:46px;
}
.div-select{
position: relative;
font-size:12px;
}
.select-val{
cursor: pointer;
}
.select-content{
position: absolute;
top:-130px;
right:0;
background: #FFFFFF;
border:1px solid #d2d2d2;
border-radius: 2px;
display: none;
}
.select-list{
padding:10px 15px;
cursor: pointer;
}
.listActive,.select-list:hover{
background:#f2f2f2;
}
.div-select:hover .select-content{
display:block;
}
.arrow-down-alarm{
display: inline-block;
width:8px;
height: 7px;
background-image: url("/src/style/img/icon-arrow-down.png");
background-position: center;
background-size: 100%;
}
/* //End LSQ 2021/12/29 19:52 */
.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{
left:-7px;
}
\ No newline at end of file
... ...
... ... @@ -305,6 +305,7 @@
{{# if(item.health == 4){ bizClas = 'icon-banner-worst';healthDesc ="比较严重" } }}
{{# if(item.health == 5){ bizClas = 'icon-banner-error';healthDesc ="非常严重" } }}
<div class="index-banner-item gj-detail {{acive}}" id="{{item.busId}}" data-id="{{item.busId}}"
data-total="{{-item.total}}" data-serious="{{-item.serious}}" data-important="{{-item.important}}" data-normal="{{-item.normal}}"
data-topoid="{{item.jtopoId}}" data-index-banner-item="type" data-resnum="{{item.resNUm}}">
<i class="{{bizClas}} click-icon" data-level="all"></i>
<div class="index-banner-item-title">
... ... @@ -314,9 +315,25 @@
{{# } }}
{{# if(item.total) { }}
<span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
<!--<span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
data-bizid="{{item.busId}}">{{item.total}}</span>-->
<span class="index-banner-item-tips select-total" lay-tips="当前有{{item.total}}条告警"
data-bizid="{{item.busId}}">{{item.total}}</span>
{{# } }}
{{# if(item.important) { }}
<span class="index-banner-item-tips select-important" lay-tips="当前有{{item.important}}条告警"
data-bizid="{{item.busId}}">{{item.important}}</span>
{{# } }}
{{# if(item.normal) { }}
<span class="index-banner-item-tips select-normal" lay-tips="当前有{{item.normal}}条告警"
data-bizid="{{item.busId}}">{{item.normal}}</span>
{{# } }}
{{# if(item.serious) { }}
<span class="index-banner-item-tips select-serious" lay-tips="当前有{{item.serious}}条告警"
data-bizid="{{item.busId}}">{{item.serious}}</span>
{{# } }}
</div>
<ul class="gj-detail-info">
<!-- <li data-bizid="{{item.busId}}">-->
... ... @@ -346,12 +363,28 @@
<!-- <span class="index-banner-count">业务共 {{d.count}} </span>-->
<!--业务统计数更改
LSQ 2021/12/28 11:25
// Start 右下角增加切换告警级别 LSQ 2021/12/29 19:39
-->
{{# if(d.data[0] && d.data[0].bizList ) { }}
<span class="index-banner-count">业务共 {{d.data[0].bizList.length}} </span>
{{# }else{ }}
<span class="index-banner-count">业务共 0 </span>
{{# } }}
<div class="flex-bottom">
{{# if(d.data[0] && d.data[0].bizList ) { }}
<span class="index-banner-count">业务共 {{d.data[0].bizList.length}} </span>
{{# }else{ }}
<span class="index-banner-count">业务共 0 </span>
{{# } }}
<div class="div-select select-margin " >
<div class="select-val"><span>严重告警</span> <i class="arrow-down-alarm"></i></div>
<ul class="select-content" id="select-content-ul">
<li class="select-list" data-val="4">全部告警</li>
<li class="select-list listActive" data-val="3">严重告警</li>
<li class="select-list" data-val="2">重要告警</li>
<li class="select-list" data-val="1">一般告警</li>
</ul>
</div>
</div>
</script>
<!--资源类型监控情况-->
... ... @@ -424,14 +457,29 @@
if(item.health == 4){ resTypeClass = 'icon-banner-worst';healthDesc ="比较严重"}
if(item.health == 5){ resTypeClass = 'icon-banner-error';healthDesc ="非常严重"} }}
<div class="index-banner-item gj-detail index-banner-item-big" data-restype="{{item.resType}}"
data-total="{{-item.total}}" data-serious="{{-item.serious}}" data-important="{{-item.important}}" data-normal="{{-item.normal}}"
data-index-banner-item="resType" data-resnum="{{item.resNum}}">
<i class="{{resTypeClass}} click-icon" data-level="all"></i>
<div class="index-banner-item-title">
<p>{{item.resTypeName}}</p>
{{# if(item.total) { }}
<span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
<!-- <span class="index-banner-item-tips" lay-tips="当前有{{item.total}}条告警"
data-restype="{{item.resType}}">{{item.total}}</span>-->
<span class="index-banner-item-tips select-total" lay-tips="当前有{{item.total}}条告警"
data-restype="{{item.resType}}">{{item.total}}</span>
{{# } }}
{{# if(item.important) { }}
<span class="index-banner-item-tips select-important" lay-tips="当前有{{item.important}}条告警"
data-restype="{{item.resType}}">{{item.important}}</span>
{{# } }}
{{# if(item.normal) { }}
<span class="index-banner-item-tips select-normal" lay-tips="当前有{{item.normal}}条告警"
data-restype="{{item.resType}}">{{item.normal}}</span>
{{# } }}
{{# if(item.serious) { }}
<span class="index-banner-item-tips select-serious" lay-tips="当前有{{item.serious}}条告警"
data-restype="{{item.resType}}">{{item.serious}}</span>
{{# } }}
</div>
<ul class="gj-detail-info">
<li data-restype="{{item.resType}}">
... ...
... ... @@ -650,7 +650,8 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
<span data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
data-resname="{{d.resName}}" data-pingenable="{{d.pingEnable}}" >{{d.resName}}</span>
{{# } }}
<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>
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" lay-tips="查看资源拓扑"><i class="iconfont" style="font-size: 20px;
color: #FEB61E;"></i></a>
</div>
`
}
... ...
... ... @@ -143,8 +143,7 @@
<!--资产信息-->
<div class="title">
<i class="iconfont icon-liebiaomoshi"/> 资产信息
<el-dropdown v-if="Object.keys(icon).length > 0" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px">
<el-dropdown v-if="Object.keys(icon).length > 0 && !isAdmin()" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px">
<i class="icon el-icon-plus"/>添加{{icon['bastion'].name}}
<template #dropdown>
<div style="max-height: 300px;overflow-y: auto">
... ...
... ... @@ -423,7 +423,7 @@ export default {
let isAdmin = () => {
let userRoleArr = proxy.$global.common.getUserRole();
let userName = proxy.$global.common.getUserName();
return userName != 'admin' && userName != 'root' && !userRoleArr.concat('pmp');
return userName != 'admin' && userName != 'root' && !userRoleArr.includes('pmp');
}
const {
... ...