Merge branch 'master-prod' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-prod-xwx
Conflicts: hg-monitor-web-base/src/main/resources/static/src/controller/commonDetail.js
Showing
1 changed file
with
344 additions
and
22 deletions
@@ -651,9 +651,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -651,9 +651,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
651 | url: common.domainName + url | 651 | url: common.domainName + url |
652 | }).done(function (res) { | 652 | }).done(function (res) { |
653 | var data = res.data[0]; | 653 | var data = res.data[0]; |
654 | - // var clas = 'res-state-pie--good'; | ||
655 | - var clas = 'res-state-pie--middle'; | ||
656 | - var reslt = "未知"; | 654 | + // var clas = 'res-state-pie--good'; |
655 | + var clas = 'res-state-pie--middle'; | ||
656 | + var reslt = "未知"; | ||
657 | if(data && data !={}){ | 657 | if(data && data !={}){ |
658 | if(data['value'] =='RUNNING'){ | 658 | if(data['value'] =='RUNNING'){ |
659 | clas = 'res-state-pie--good' | 659 | clas = 'res-state-pie--good' |
@@ -1389,17 +1389,156 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -1389,17 +1389,156 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
1389 | linechart.setOption(option); | 1389 | linechart.setOption(option); |
1390 | // 折线图的点击事件 | 1390 | // 折线图的点击事件 |
1391 | linechart.off("click"); | 1391 | linechart.off("click"); |
1392 | - linechart.on('click', function (v) { | ||
1393 | - var params = { | ||
1394 | - resId: resId, | ||
1395 | - kpiId: kpiId.split(',').length==0?kpiId:kpiId.split(',')[v.componentIndex], //当kpiId为多个时,点击时获取对应kpiId | ||
1396 | - flag: data.series[v.componentIndex].flag, | ||
1397 | - warning: false, | ||
1398 | - ident: true, | ||
1399 | - trend: true, | ||
1400 | - name: (kpiNames&&kpiNames.length>0)?kpiNames[v.componentIndex]:kpiName + ' ' + data.series[v.componentIndex].name //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1401 | - }; | ||
1402 | - common.openLineChart(kpiName + ' ' + data.series[v.componentIndex].name, params); | 1392 | +<<<<<<<<< Temporary merge branch 1 |
1393 | + linechart.on('click', function (i) { | ||
1394 | + let array = []; | ||
1395 | + var arrayList; | ||
1396 | + if(kpiName=='网卡上行速率'||kpiName=='网卡下行速率'){ | ||
1397 | + if (data){ | ||
1398 | + $.each(data.series, function (i, v) { | ||
1399 | + if (v.flag!=null && v.flag!=undefined){ | ||
1400 | + array.push(`<span id="selectFlag" class="layui-badge layui-bg-blue" style="margin:2px;z-index:99999">${v.flag}</span>`+""); | ||
1401 | + }else { | ||
1402 | + array.push('<div style="position:absolute;top:50%;left:50%;">无指标</div>') | ||
1403 | + } | ||
1404 | + }); | ||
1405 | + arrayList= array.join(" "); | ||
1406 | + if (data.series.length>1){ | ||
1407 | + let flagSelect =layer.open({ | ||
1408 | +========= | ||
1409 | + //lsq 网卡上行速率/网卡下行速率折线图点击后的title出现null,500-dev迁移过来 2022-06-30 | ||
1410 | + linechart.on('click', function (i) { | ||
1411 | + let array = []; | ||
1412 | + var arrayList; | ||
1413 | + if (kpiName == '网卡上行速率' || kpiName == '网卡下行速率') { | ||
1414 | + if (data) { | ||
1415 | + $.each(data.series, function (i, v) { | ||
1416 | + if (v.flag != null && v.flag != undefined) { | ||
1417 | + array.push(`<span id="selectFlag" class="layui-badge layui-bg-blue" style="margin:2px;z-index:99999">${v.flag}</span>` + ""); | ||
1418 | + } else { | ||
1419 | + array.push('<div style="position:absolute;top:50%;left:50%;">无指标</div>') | ||
1420 | + } | ||
1421 | + }); | ||
1422 | + arrayList = array.join(" "); | ||
1423 | + if (data.series.length > 1) { | ||
1424 | + let flagSelect = layer.open({ | ||
1425 | +>>>>>>>>> Temporary merge branch 2 | ||
1426 | + title: ['指标flag选择'], | ||
1427 | + type: 1, | ||
1428 | + area: ['30%', '15%'], | ||
1429 | + shadeClose: true,//开启遮罩层 | ||
1430 | + id: 'flag_select_div', | ||
1431 | + // content: laytpl(res.body).render(JSON.stringify(params)), | ||
1432 | +<<<<<<<<< Temporary merge branch 1 | ||
1433 | + content: '<div style="padding: 15px 18px">'+arrayList+'</div>', | ||
1434 | + }); | ||
1435 | + $(document).on('click','#selectFlag',function(v) { | ||
1436 | + layer.close(flagSelect); | ||
1437 | + var seriesName= data.series[i.componentIndex].name; | ||
1438 | + if (seriesName == null ||seriesName == undefined) { | ||
1439 | + seriesName = ''; | ||
1440 | + } | ||
1441 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1442 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1443 | +========= | ||
1444 | + content: '<div style="padding: 15px 18px">' + arrayList + '</div>', | ||
1445 | + }); | ||
1446 | + $(document).on('click', '#selectFlag', function (v) { | ||
1447 | + layer.close(flagSelect); | ||
1448 | + var seriesName = data.series[i.componentIndex].name; | ||
1449 | + if (seriesName == null || seriesName == undefined) { | ||
1450 | + seriesName = ''; | ||
1451 | + } | ||
1452 | + var seriesFlag = data.series[i.componentIndex].flag; | ||
1453 | + if (seriesFlag == null || seriesFlag == undefined) { | ||
1454 | +>>>>>>>>> Temporary merge branch 2 | ||
1455 | + seriesFlag = ''; | ||
1456 | + } | ||
1457 | + var params = { | ||
1458 | + resId: resId, | ||
1459 | + kpiId: kpiId, | ||
1460 | + flag: seriesFlag, | ||
1461 | + warning: false, | ||
1462 | + ident: true, | ||
1463 | + trend: true, | ||
1464 | +<<<<<<<<< Temporary merge branch 1 | ||
1465 | + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1466 | + }; | ||
1467 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1468 | + }); | ||
1469 | + }else { | ||
1470 | + var seriesName= data.series[i.componentIndex].name; | ||
1471 | + if (seriesName == null ||seriesName == undefined) { | ||
1472 | + seriesName = ''; | ||
1473 | + } | ||
1474 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1475 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1476 | +========= | ||
1477 | + name: (kpiNames && kpiNames.length > 0) ? kpiNames[i.componentIndex] : kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1478 | + }; | ||
1479 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1480 | + }); | ||
1481 | + } else { | ||
1482 | + var seriesName = data.series[i.componentIndex].name; | ||
1483 | + if (seriesName == null || seriesName == undefined) { | ||
1484 | + seriesName = ''; | ||
1485 | + } | ||
1486 | + var seriesFlag = data.series[i.componentIndex].flag; | ||
1487 | + if (seriesFlag == null || seriesFlag == undefined) { | ||
1488 | +>>>>>>>>> Temporary merge branch 2 | ||
1489 | + seriesFlag = ''; | ||
1490 | + } | ||
1491 | + var params = { | ||
1492 | + resId: resId, | ||
1493 | + kpiId: kpiId, | ||
1494 | + flag: seriesFlag, | ||
1495 | + warning: false, | ||
1496 | + ident: true, | ||
1497 | + trend: true, | ||
1498 | +<<<<<<<<< Temporary merge branch 1 | ||
1499 | + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1500 | +========= | ||
1501 | + name: (kpiNames && kpiNames.length > 0) ? kpiNames[i.componentIndex] : kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1502 | +>>>>>>>>> Temporary merge branch 2 | ||
1503 | + }; | ||
1504 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1505 | + } | ||
1506 | + } | ||
1507 | + | ||
1508 | +<<<<<<<<< Temporary merge branch 1 | ||
1509 | + }else { | ||
1510 | + var seriesName= data.series[i.componentIndex].name; | ||
1511 | + if (seriesName == null ||seriesName == undefined) { | ||
1512 | + seriesName = ''; | ||
1513 | + } | ||
1514 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1515 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1516 | +========= | ||
1517 | + } else { | ||
1518 | + var seriesName = data.series[i.componentIndex].name; | ||
1519 | + if (seriesName == null || seriesName == undefined) { | ||
1520 | + seriesName = ''; | ||
1521 | + } | ||
1522 | + var seriesFlag = data.series[i.componentIndex].flag; | ||
1523 | + if (seriesFlag == null || seriesFlag == undefined) { | ||
1524 | +>>>>>>>>> Temporary merge branch 2 | ||
1525 | + seriesFlag = ''; | ||
1526 | + } | ||
1527 | + var params = { | ||
1528 | + resId: resId, | ||
1529 | + kpiId: kpiId, | ||
1530 | + flag: seriesFlag, | ||
1531 | + warning: false, | ||
1532 | + ident: true, | ||
1533 | + trend: true, | ||
1534 | +<<<<<<<<< Temporary merge branch 1 | ||
1535 | + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1536 | +========= | ||
1537 | + name: (kpiNames && kpiNames.length > 0) ? kpiNames[i.componentIndex] : kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1538 | +>>>>>>>>> Temporary merge branch 2 | ||
1539 | + }; | ||
1540 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1541 | + } | ||
1403 | }); | 1542 | }); |
1404 | }); | 1543 | }); |
1405 | }, | 1544 | }, |
@@ -3185,7 +3324,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3185,7 +3324,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3185 | title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`; | 3324 | title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`; |
3186 | title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"><i class="iconfont"></i></a>`; | 3325 | title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"><i class="iconfont"></i></a>`; |
3187 | if (resCategory === 'share' && hardwareFlag.endsWith("Y")) { | 3326 | if (resCategory === 'share' && hardwareFlag.endsWith("Y")) { |
3327 | +/* | ||
3188 | 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"></i></a>`; | 3328 | 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"></i></a>`; |
3329 | +*/ | ||
3189 | } | 3330 | } |
3190 | if (res.state == 'new' && hardwareFlag.endsWith("N")){ | 3331 | if (res.state == 'new' && hardwareFlag.endsWith("N")){ |
3191 | layer.alert('资源未监控!',{icon:0}); | 3332 | layer.alert('资源未监控!',{icon:0}); |
@@ -3208,7 +3349,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3208,7 +3349,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3208 | title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`; | 3349 | title += `<a class="layui-icon filterList" data-id=${resId} lay-tips="指标过滤清单" style="margin-left: 10px"><i class="iconfont"></i></a>`; |
3209 | title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"><i class="iconfont"></i></a>`; | 3350 | title += `<a class="layui-icon res-view-relation-topo" data-id=${resId} lay-tips="查看资源关系拓扑" style="margin-left: 10px"><i class="iconfont"></i></a>`; |
3210 | if (resCategory === 'share' && hardwareFlag.endsWith("Y")) { | 3351 | if (resCategory === 'share' && hardwareFlag.endsWith("Y")) { |
3352 | +/* | ||
3211 | 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"></i></a>`; | 3353 | 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"></i></a>`; |
3354 | +*/ | ||
3212 | } | 3355 | } |
3213 | obj.openNewWin(url,title,params,editFlag,fn,cancelfn,type); | 3356 | obj.openNewWin(url,title,params,editFlag,fn,cancelfn,type); |
3214 | } | 3357 | } |
@@ -3247,6 +3390,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3247,6 +3390,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3247 | }, | 3390 | }, |
3248 | //打开弹框 | 3391 | //打开弹框 |
3249 | openNewWin:function (url,name,params,editFlag,fn,cancelfn,type,sign_) { | 3392 | openNewWin:function (url,name,params,editFlag,fn,cancelfn,type,sign_) { |
3393 | + // Start Wang 2022/3/2 16:25 获取AJ配置页面信息 | ||
3394 | + var type = 1; | ||
3395 | + var content = ''; | ||
3396 | + admin.req({ | ||
3397 | + url: common.domainName + `/api-web/ajConfig/getConfig?resType=${params.resType}&os=${params.os}&provider=${params.provider}`, | ||
3398 | + async: false, | ||
3399 | + data: {}, | ||
3400 | + success(res) { | ||
3401 | + if(res && res.success && res.object){ | ||
3402 | + var item = res.object; | ||
3403 | + type = 2; | ||
3404 | + | ||
3405 | + var arr = []; | ||
3406 | + arr.push(item.designPage); | ||
3407 | + | ||
3408 | + | ||
3409 | + var param = item.param; | ||
3410 | + if(param){ | ||
3411 | + param = param.replace('#resId',params.resId).replace('#access_token',localStorage.getItem("access_token")); | ||
3412 | + arr.push(param); | ||
3413 | + } | ||
3414 | + // 获取 | ||
3415 | + content = sessionStorage.getItem("ajWeb") + '/#/bigscreen/viewer?reportCode=' + arr.join('&'); | ||
3416 | + } | ||
3417 | + }, | ||
3418 | + error() { | ||
3419 | + //layer.closeAll('loading'); | ||
3420 | + } | ||
3421 | + }); | ||
3422 | + // End Wang 2022/3/2 17:23 | ||
3250 | //新视图设置百分百 | 3423 | //新视图设置百分百 |
3251 | var area= sign_?['100%','100%']:['90%','90%']; | 3424 | var area= sign_?['100%','100%']:['90%','90%']; |
3252 | if(!name){ name = "信息"; } | 3425 | if(!name){ name = "信息"; } |
@@ -3259,11 +3432,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3259,11 +3432,11 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3259 | view('commonViewModel').render(url).then(function (res) { | 3432 | view('commonViewModel').render(url).then(function (res) { |
3260 | layer.open({ | 3433 | layer.open({ |
3261 | title: [name, 'font-size:20px;background-color: #d0ddec;'], | 3434 | title: [name, 'font-size:20px;background-color: #d0ddec;'], |
3262 | - type: 1, | 3435 | + type: type, |
3263 | id: md5(url), | 3436 | id: md5(url), |
3264 | area: area , | 3437 | area: area , |
3265 | shadeClose: true,//开启遮罩层 | 3438 | shadeClose: true,//开启遮罩层 |
3266 | - content: laytpl(res.body).render(JSON.stringify(params)), | 3439 | + content: content == '' ? laytpl(res.body).render(JSON.stringify(params)) : content, |
3267 | btn:btns, | 3440 | btn:btns, |
3268 | move:false, | 3441 | move:false, |
3269 | success:function(layero,index){ | 3442 | success:function(layero,index){ |
@@ -3355,7 +3528,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3355,7 +3528,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3355 | id: 'layer-select-favorites', | 3528 | id: 'layer-select-favorites', |
3356 | content: '<div class="div-select-favorites"><div id="slt-favorites-tree"></div></div>', | 3529 | content: '<div class="div-select-favorites"><div id="slt-favorites-tree"></div></div>', |
3357 | offset: '150px', | 3530 | offset: '150px', |
3358 | - area: ['20%', '15%'], | 3531 | + area: ['20%', '18%'], |
3359 | btn: ['选择', '取消'], | 3532 | btn: ['选择', '取消'], |
3360 | resize: false, | 3533 | resize: false, |
3361 | success: function () { | 3534 | success: function () { |
@@ -3538,6 +3711,68 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3538,6 +3711,68 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3538 | }); | 3711 | }); |
3539 | }); | 3712 | }); |
3540 | }, | 3713 | }, |
3714 | + validatorPhone: function (phone) { | ||
3715 | + if (/^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])d{8}$/.test(phone)) { | ||
3716 | + return { | ||
3717 | + code: 1, | ||
3718 | + msg: "验证通过" | ||
3719 | + } | ||
3720 | + }else if(/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(phone)){ | ||
3721 | + return { | ||
3722 | + code: 1, | ||
3723 | + msg: "验证通过" | ||
3724 | + } | ||
3725 | + }else{ | ||
3726 | + return { | ||
3727 | + code: -1, | ||
3728 | + msg: "手机或者座机号码格式错误" | ||
3729 | + } | ||
3730 | + } | ||
3731 | + | ||
3732 | + | ||
3733 | + }, | ||
3734 | + //身份证号码验证 | ||
3735 | + validatorIDCard: function (idcode) { | ||
3736 | + if (typeof idcode !== 'string') { | ||
3737 | + return { | ||
3738 | + code: -1, | ||
3739 | + msg: "为了避免javascript数值范围误差,idcode 必须是字符串" | ||
3740 | + } | ||
3741 | + } | ||
3742 | + const idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/; | ||
3743 | + // 判断格式是否正确 | ||
3744 | + const format = idcard_patter.test(idcode); | ||
3745 | + if (!format) { | ||
3746 | + return { | ||
3747 | + code: -1, | ||
3748 | + msg: "身份证号码格式错误" | ||
3749 | + } | ||
3750 | + } | ||
3751 | + // 加权因子 | ||
3752 | + const weight_factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; | ||
3753 | + // 校验码 | ||
3754 | + const check_code = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; | ||
3755 | + const last = idcode[17];//最后一位 | ||
3756 | + const seventeen = idcode.substring(0, 17); | ||
3757 | + // ISO 7064:1983.MOD 11-2 | ||
3758 | + // 判断最后一位校验码是否正确 | ||
3759 | + const arr = seventeen.split(""); | ||
3760 | + const len = arr.length; | ||
3761 | + let num = 0; | ||
3762 | + for (let i = 0; i < len; i++) { | ||
3763 | + num += arr[i] * weight_factor[i]; | ||
3764 | + } | ||
3765 | + // 获取余数 | ||
3766 | + const resisue = num % 11; | ||
3767 | + const last_no = check_code[resisue]; | ||
3768 | + // 返回验证结果,校验码和格式同时正确才算是合法的身份证号码 | ||
3769 | + const result = last === last_no ? true : false; | ||
3770 | + return { | ||
3771 | + code: result ? 1 : -1, | ||
3772 | + msg: !result ? "身份证号码格式错误" : "" | ||
3773 | + } | ||
3774 | + | ||
3775 | + }, | ||
3541 | //获取维保信息 | 3776 | //获取维保信息 |
3542 | renderMaintenanceInfo: function (targetId, resId, resType, fn) { | 3777 | renderMaintenanceInfo: function (targetId, resId, resType, fn) { |
3543 | var flag = false; //默认没有父级 | 3778 | var flag = false; //默认没有父级 |
@@ -3587,9 +3822,24 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3587,9 +3822,24 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3587 | var direction = $(this).data('direction'); | 3822 | var direction = $(this).data('direction'); |
3588 | direction || (direction = 2); | 3823 | direction || (direction = 2); |
3589 | var len = $(`#${targetId}`).find("li").eq(0).find("span").length; | 3824 | var len = $(`#${targetId}`).find("li").eq(0).find("span").length; |
3590 | - var w = "400px"; | 3825 | +<<<<<<<<< Temporary merge branch 1 |
3826 | + var w = "420px"; | ||
3591 | if(len && len > 2){ | 3827 | if(len && len > 2){ |
3592 | - w = '720px'; | 3828 | + w = '740px'; |
3829 | +========= | ||
3830 | + var w = "400px"; | ||
3831 | + //lsq 判断是否两列显示 2022-06-28 | ||
3832 | + var count=$(this).data('count'); | ||
3833 | + if(count>12){ | ||
3834 | + //两列显示 | ||
3835 | + w = '820px'; | ||
3836 | + $(`#${targetId}`).addClass('info-table-two') | ||
3837 | + }else{ | ||
3838 | + //一列显示 | ||
3839 | + if(len && len > 2){ | ||
3840 | + w = '720px'; | ||
3841 | + } | ||
3842 | +>>>>>>>>> Temporary merge branch 2 | ||
3593 | } | 3843 | } |
3594 | var $content = $(`#${targetId}`).clone(); | 3844 | var $content = $(`#${targetId}`).clone(); |
3595 | $content.find('[lay-tips]').removeAttr('lay-tips'); | 3845 | $content.find('[lay-tips]').removeAttr('lay-tips'); |
@@ -3605,7 +3855,20 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3605,7 +3855,20 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3605 | //添加遮罩层 默认透明度为0.3 | 3855 | //添加遮罩层 默认透明度为0.3 |
3606 | shade: [0.1, '#00000000'], | 3856 | shade: [0.1, '#00000000'], |
3607 | //是否点击遮罩关闭 | 3857 | //是否点击遮罩关闭 |
3608 | - shadeClose: true | 3858 | + shadeClose: false, |
3859 | + closeBtn:true, | ||
3860 | + success:function(){ | ||
3861 | + let resId=$(`#${targetId}` + `_detail_row_menu.statusMenu`).data('resid') | ||
3862 | + $(`#${targetId}` + `_detail_row_menu.statusMenu`).hover(function () { | ||
3863 | + var $that = $(this); | ||
3864 | + var $btn = $that.find(".detail_row_menu"); | ||
3865 | + if ($btn.length > 0) { | ||
3866 | + $(".layui-card-body").find(".detail_row_menu:not(.hide)").addClass("hide") | ||
3867 | + $btn.removeClass("hide"); | ||
3868 | + } | ||
3869 | + }); | ||
3870 | + filterSuppressMonitor(resId) | ||
3871 | + } | ||
3609 | }); | 3872 | }); |
3610 | //xwx update 资源视图基本信息弹出框bug修改 2021-10-22 --end | 3873 | //xwx update 资源视图基本信息弹出框bug修改 2021-10-22 --end |
3611 | window.detailTips = detailTips; | 3874 | window.detailTips = detailTips; |
@@ -3683,7 +3946,16 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3683,7 +3946,16 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3683 | <option value="1">=选择告警策略=</option> | 3946 | <option value="1">=选择告警策略=</option> |
3684 | </select> | 3947 | </select> |
3685 | </div> | 3948 | </div> |
3686 | - <div class="layui-form-mid layui-word-aux"><a style="height: 50px;line-height: 50px;" class="layui-btn layui-btn-normal" id="form_detail_add_policy"><i class="layui-icon"></i></a></div> | 3949 | + <div style="display: flex;"> |
3950 | + <div class="layui-form-mid layui-word-aux"> | ||
3951 | + <a style="height: 50px;line-height: 50px;" class="layui-btn layui-btn-normal" id="form_detail_add_policy"><i class="layui-icon"></i></a> | ||
3952 | + </div> | ||
3953 | + <div class="layui-form-mid layui-word-aux" id="show_corn_info_policy" | ||
3954 | + style="padding: 0!important;position: relative;line-height: 38px;display: flex;justify-content: center;margin: 0px;margin-left: 5px;"> | ||
3955 | + <i class="layui-icon form-btn-icon"></i> | ||
3956 | + </div> | ||
3957 | + </div> | ||
3958 | + | ||
3687 | </div> | 3959 | </div> |
3688 | <div class="layui-form-item icon-label-item"> | 3960 | <div class="layui-form-item icon-label-item"> |
3689 | <label class="layui-form-label" style="text-align: center !important;width: 120px">告警订阅</label> | 3961 | <label class="layui-form-label" style="text-align: center !important;width: 120px">告警订阅</label> |
@@ -3695,7 +3967,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3695,7 +3967,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3695 | </div> | 3967 | </div> |
3696 | </form> `; | 3968 | </form> `; |
3697 | 3969 | ||
3698 | - common.openWindow('user-add-form-id',$con,"告警设置","45%",'50%',['保存','取消'],function(){ | 3970 | + common.openWindow('user-add-form-id',$con,"告警设置","50%",'50%',['保存','取消'],function(){ |
3699 | var kpiPolicy = $("#detil_kpi_policy").val(); | 3971 | var kpiPolicy = $("#detil_kpi_policy").val(); |
3700 | var kpiSubscribe = $("#detil_kpi_subscribe").val(); | 3972 | var kpiSubscribe = $("#detil_kpi_subscribe").val(); |
3701 | if(!kpiPolicy || !kpiSubscribe){ | 3973 | if(!kpiPolicy || !kpiSubscribe){ |
@@ -3728,6 +4000,25 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3728,6 +4000,25 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3728 | bindAlarmPolicyList(undefined,params.kpiId); | 4000 | bindAlarmPolicyList(undefined,params.kpiId); |
3729 | bindAlarmSubscribeList(); | 4001 | bindAlarmSubscribeList(); |
3730 | 4002 | ||
4003 | + $('#show_corn_info_policy').unbind("click").on("click",function (){ | ||
4004 | + layer.open({ | ||
4005 | + type: 1 | ||
4006 | + , title: '告警策略' | ||
4007 | + , closeBtn: 1 | ||
4008 | + , area: ['20%', '20%'] | ||
4009 | + , shade: 0.8 | ||
4010 | + , id: 'lay_cron_detail_add_policy' //设定一个id,防止重复弹出 | ||
4011 | + , content: '<div id="icon_tips_alarm_Content" style="color:#000000">\n' + | ||
4012 | + ' <p style="margin: 10px auto; padding: 0px;">\n' + | ||
4013 | + ' <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">重点说明</span></strong>\n' + | ||
4014 | + ' </p>\n' + | ||
4015 | + ' <p style="margin: 10px auto; padding: 0px;">\n' + | ||
4016 | + ' <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">(1)</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"></span></strong> </span> 策略类型只包含非默认的策略' + | ||
4017 | + ' </p>\n' + | ||
4018 | + ' </div>' | ||
4019 | + }); | ||
4020 | + }); | ||
4021 | + | ||
3731 | //自定义告警策略 | 4022 | //自定义告警策略 |
3732 | $("#form_detail_add_policy").unbind("click").on("click",function (){ | 4023 | $("#form_detail_add_policy").unbind("click").on("click",function (){ |
3733 | params.from = 'detail'; | 4024 | params.from = 'detail'; |
@@ -3991,6 +4282,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3991,6 +4282,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3991 | function filterSuppressMonitor(resId,isStatusMenubox){ | 4282 | function filterSuppressMonitor(resId,isStatusMenubox){ |
3992 | //菜单按钮点击事件 | 4283 | //菜单按钮点击事件 |
3993 | $("a.detail_row_menu").off("click").on("click",function (e) { | 4284 | $("a.detail_row_menu").off("click").on("click",function (e) { |
4285 | + if (e.preventDefault()) { | ||
4286 | + e.preventDefault(); | ||
4287 | + } | ||
4288 | + if (e.stopPropagation()) { | ||
4289 | + e.stopPropagation(); | ||
4290 | + } | ||
3994 | $("#detail_menubox_id").remove(); | 4291 | $("#detail_menubox_id").remove(); |
3995 | var $menu = $(this); | 4292 | var $menu = $(this); |
3996 | var hideM = $menu.data('hidem'); | 4293 | var hideM = $menu.data('hidem'); |
@@ -4130,6 +4427,31 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -4130,6 +4427,31 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
4130 | },300) | 4427 | },300) |
4131 | 4428 | ||
4132 | }); | 4429 | }); |
4430 | + //lsq 新增的8个指标中数值点击打开性能曲线图 2022-06-28 | ||
4431 | + $(".isProbeDown").unbind('click').click(function (e) { | ||
4432 | + if (e.preventDefault()) { | ||
4433 | + e.preventDefault(); | ||
4434 | + } | ||
4435 | + if (e.stopPropagation()) { | ||
4436 | + e.stopPropagation(); | ||
4437 | + } | ||
4438 | + let kpiId=$(this).data('kpiid'); | ||
4439 | + let flag=$(this).data('flag'); | ||
4440 | + let warning=$(this).data('warning'); | ||
4441 | + let ident=$(this).data('ident'); | ||
4442 | + let trend=$(this).data('trend'); | ||
4443 | + let name=$(this).data('name'); | ||
4444 | + var params = { | ||
4445 | + resId: resId, | ||
4446 | + kpiId: kpiId, | ||
4447 | + flag: flag, | ||
4448 | + warning: warning, | ||
4449 | + ident: ident, | ||
4450 | + trend: trend, | ||
4451 | + name: name | ||
4452 | + }; | ||
4453 | + common.openLineChart(name, params); | ||
4454 | + }); | ||
4133 | //点击空白处隐藏弹出菜单 | 4455 | //点击空白处隐藏弹出菜单 |
4134 | $(document).click(function(event){ | 4456 | $(document).click(function(event){ |
4135 | var _con = $('a.detail_row_menu'); // 设置目标区域 | 4457 | var _con = $('a.detail_row_menu'); // 设置目标区域 |
-
Please register or login to post a comment