Authored by 鲁尚清

Merge branch 'master-500-dev' of http://192.168.1.136:82/monitor_v3/hg-monitor-w…

…eb into master-500-dev-lushangqing
@@ -98,6 +98,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -98,6 +98,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
98 //两种虚拟机合并成一种 98 //两种虚拟机合并成一种
99 //var newResType = resType === 'VIRTUALIZATION_VHOST' ? 'VIRTUALIZATION_VHOST,VIRTUALIZATION_VMWARE_VHOST' : resType; 99 //var newResType = resType === 'VIRTUALIZATION_VHOST' ? 'VIRTUALIZATION_VHOST,VIRTUALIZATION_VMWARE_VHOST' : resType;
100 var newResType = resType; 100 var newResType = resType;
  101 + if (newResType.indexOf("VHOST")!= -1){
  102 + newResType="VHOST"
  103 + }
101 $(".biz_reslist_search").show(); 104 $(".biz_reslist_search").show();
102 $(".biz_reslist_treetable_search").hide(); 105 $(".biz_reslist_treetable_search").hide();
103 $("#bizResListTableContent").show(); 106 $("#bizResListTableContent").show();
@@ -78,6 +78,21 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -78,6 +78,21 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
78 }); 78 });
79 }); 79 });
80 80
  81 + loadCollProtocolSelect();
  82 + function loadCollProtocolSelect(){
  83 + $.ajax({
  84 + url:common.domainName+'/api-web/manage/protocol/page?page=1&limit=10000&access_token=' + accessToken,
  85 + success:function (res) {
  86 + if(res && res.data){
  87 + res.data.forEach(function (v) {
  88 + var options = `<option value="${v.protocolCode}">${v.protocolName}</option>`
  89 + $('[lay-filter="collProtocol"]').append(options);
  90 + })
  91 + }
  92 + }
  93 + })
  94 + }
  95 +
81 //左侧树 96 //左侧树
82 function loadResTree(data) { 97 function loadResTree(data) {
83 tree.render({ 98 tree.render({
@@ -701,6 +716,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -701,6 +716,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
701 form.on('select(resManageStateSelect)',function (data) { 716 form.on('select(resManageStateSelect)',function (data) {
702 reloadTable(); 717 reloadTable();
703 }) 718 })
  719 + form.on('select(collProtocol)',function (data) {
  720 + reloadTable();
  721 + })
704 form.on('select(slt_res_manage_superior)',function (data) { 722 form.on('select(slt_res_manage_superior)',function (data) {
705 reloadTable(); 723 reloadTable();
706 }) 724 })
@@ -761,8 +779,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -761,8 +779,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
761 } 779 }
762 } 780 }
763 , {field: 'shortName', title: '别名', align: 'center', sort: true, hide: 'true'} 781 , {field: 'shortName', title: '别名', align: 'center', sort: true, hide: 'true'}
764 - , {field: 'ip', title: 'IP地址', align: 'center',width: 140, sort: true}]  
765 - 782 + , {field: 'ip', title: 'IP地址', align: 'center',width: 140, sort: true}
  783 + , {field: 'collProtocol', title: '采集协议', align: 'center', sort: true}]
766 if (resType === 'HOST_X86SERVER') { 784 if (resType === 'HOST_X86SERVER') {
767 cols[4].title = '业务IP'; 785 cols[4].title = '业务IP';
768 cols.push({field: 'manageIp', title: '管理IP', align: 'center',width: 140, sort: true}); 786 cols.push({field: 'manageIp', title: '管理IP', align: 'center',width: 140, sort: true});
@@ -826,7 +844,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -826,7 +844,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
826 busId: $("#resManageIndexForm").find("input[name='busId']").val(), 844 busId: $("#resManageIndexForm").find("input[name='busId']").val(),
827 state: $("#resManageIndexForm").find("select[name='state']").val(), 845 state: $("#resManageIndexForm").find("select[name='state']").val(),
828 parentId: $("#resManageIndexForm").find("select[name='parentId']").val(), 846 parentId: $("#resManageIndexForm").find("select[name='parentId']").val(),
829 - collectionState: $("#resManageIndexForm").find("select[name='collectionState']").val(), 847 + collectionstate: $("#resManageIndexForm").find("select[name='collectionState']").val(),
830 pageName:'resmanage' 848 pageName:'resmanage'
831 } 849 }
832 , height: 'full-200' 850 , height: 'full-200'
@@ -1698,7 +1716,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -1698,7 +1716,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
1698 busId: bizId, 1716 busId: bizId,
1699 state: $("#resManageIndexForm").find("select[name='state']").val(), 1717 state: $("#resManageIndexForm").find("select[name='state']").val(),
1700 parentId: $("#resManageIndexForm").find("select[name='parentId']").val(), 1718 parentId: $("#resManageIndexForm").find("select[name='parentId']").val(),
1701 - collectionState: $("#resManageIndexForm").find("select[name='collectionState']").val(), 1719 + collectionstate: $("#resManageIndexForm").find("select[name='collectionState']").val(),
  1720 + collProtocolList:$("#resManageIndexForm").find("select[name='collProtocol']").val(),
1702 sortKey: sortKey, 1721 sortKey: sortKey,
1703 pageName:'resmanage' 1722 pageName:'resmanage'
1704 1723
@@ -94,6 +94,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' @@ -94,6 +94,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
94 protocol:protocol, 94 protocol:protocol,
95 editMode: 'true', 95 editMode: 'true',
96 resCategory: 'resources', 96 resCategory: 'resources',
  97 + state: $("#resManageIndexForm").find("select[name='state']").val(),
  98 + collectionstate: $("#resManageIndexForm").find("select[name='collectionState']").val(),
97 pageName:'reslist' 99 pageName:'reslist'
98 } 100 }
99 , height: 'full-350' 101 , height: 'full-350'
@@ -109,6 +111,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' @@ -109,6 +111,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
109 {type: 'numbers', title: '序号', align: 'center'} 111 {type: 'numbers', title: '序号', align: 'center'}
110 , {field: 'resName', title: '资源名称', minWidth: 300, align: 'center'} 112 , {field: 'resName', title: '资源名称', minWidth: 300, align: 'center'}
111 , {field: 'ip', title: 'IP地址', align: 'center'} 113 , {field: 'ip', title: 'IP地址', align: 'center'}
  114 + , {field: 'os', title: 'os', align: 'center'}
  115 + , {field: 'collProtocol', title: '采集协议', align: 'center'}
112 , {field: 'adminName', title: '负责人', align: 'center'} 116 , {field: 'adminName', title: '负责人', align: 'center'}
113 , {field: 'resTypeName', title: '资源类型', align: 'center'} 117 , {field: 'resTypeName', title: '资源类型', align: 'center'}
114 , {field: 'healthDesc', title: '资源状态', align: 'center'} 118 , {field: 'healthDesc', title: '资源状态', align: 'center'}
@@ -142,17 +146,29 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' @@ -142,17 +146,29 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
142 function bindSelectEvent() { 146 function bindSelectEvent() {
143 //选择业务搜索 147 //选择业务搜索
144 form.on('select(reslist_resListBizTypes)', function(data){ 148 form.on('select(reslist_resListBizTypes)', function(data){
145 - busId = data.value;  
146 reloadTable(resType); 149 reloadTable(resType);
147 }); 150 });
148 // 资源状态 151 // 资源状态
149 form.on('select(reslist_resStatus)', function(data){ 152 form.on('select(reslist_resStatus)', function(data){
150 reloadTable(resType); 153 reloadTable(resType);
151 }); 154 });
  155 + // 监控状态
  156 + form.on('select(state)', function(data){
  157 + reloadTable(resType);
  158 + });
152 // 厂商 159 // 厂商
153 form.on('select(reslist_provider)', function(data){ 160 form.on('select(reslist_provider)', function(data){
154 reloadTable(resType); 161 reloadTable(resType);
155 }); 162 });
  163 +
  164 + // 绑定
  165 + // Start Wang 2022/3/25 14:04 当资源列表选择绑定类型后,下列表的数据导致不能修改,默认设置为空
  166 + $("#resManageIndexForm").find("select[name='collectionState']").val('');
  167 + form.on('select(resManageCollectionState)', function(data){
  168 + // 内容变更后设置对应的值
  169 + $("#resManageIndexForm").find("select[name='collectionState']").val(data.value);
  170 + reloadTable(resType);
  171 + });
156 } 172 }
157 //刷新表格 173 //刷新表格
158 function reloadTable(resType) { 174 function reloadTable(resType) {
@@ -171,6 +187,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' @@ -171,6 +187,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect'
171 targetType: targetType, 187 targetType: targetType,
172 protocolFlag:protocolFlag, 188 protocolFlag:protocolFlag,
173 protocol:protocol, 189 protocol:protocol,
  190 + state: $("#resManageIndexForm").find("select[name='state']").val(),
  191 + collectionstate: $("#resManageIndexForm").find("select[name='collectionState']").val(),
174 editMode: 'true' 192 editMode: 'true'
175 }, 193 },
176 done: function (res) { 194 done: function (res) {
@@ -2640,6 +2640,7 @@ grayColor{ @@ -2640,6 +2640,7 @@ grayColor{
2640 order: 1; 2640 order: 1;
2641 /*width: 250px;*/ 2641 /*width: 250px;*/
2642 min-width: 250px; 2642 min-width: 250px;
  2643 + max-width: 300px;
2643 overflow: hidden; 2644 overflow: hidden;
2644 /*margin-left: 10px;*/ 2645 /*margin-left: 10px;*/
2645 margin-left: 5px; 2646 margin-left: 5px;
@@ -7272,7 +7273,7 @@ form[lay-filter="tax-statistical-statement-condition"] { @@ -7272,7 +7273,7 @@ form[lay-filter="tax-statistical-statement-condition"] {
7272 } 7273 }
7273 /****** 动环配置 结束 ******/ 7274 /****** 动环配置 结束 ******/
7274 7275
7275 -/*资源视图、业务视图左侧树选中时添加背景颜色类似菜单树选择的样式*/ 7276 +/*资源视图、左侧树选中时添加背景颜色类似菜单树选择的样式*/
7276 .resIndexLeft .tree-node-select,.bizIndexLeft .tree-node-select { 7277 .resIndexLeft .tree-node-select,.bizIndexLeft .tree-node-select {
7277 font-size: 17px; 7278 font-size: 17px;
7278 font-weight: bold; 7279 font-weight: bold;
@@ -42,19 +42,19 @@ @@ -42,19 +42,19 @@
42 </div> 42 </div>
43 <div class="layui-inline"> 43 <div class="layui-inline">
44 <div class="layui-input-inline"> 44 <div class="layui-input-inline">
45 - <select name="state" lay-filter="resManageStateSelect">  
46 - <option value="">=资源状态=</option> 45 + <select name="state" lay-filter="resManageStateSelect">
  46 + <option value="">=资源监控状态=</option>
47 <option value="new">新增</option> 47 <option value="new">新增</option>
48 <option value="monitor">监控</option> 48 <option value="monitor">监控</option>
49 <option value="stop">暂停监控</option> 49 <option value="stop">暂停监控</option>
50 -<!-- <option value="alarmIgnore">告警压制中</option>--> 50 + <!-- <option value="alarmIgnore">告警压制中</option>-->
51 </select> 51 </select>
52 </div> 52 </div>
53 </div> 53 </div>
54 <div class="layui-inline"> 54 <div class="layui-inline">
55 <div class="layui-input-inline"> 55 <div class="layui-input-inline">
56 <select name="parentId" id="slt_res_manage_superior" lay-filter="slt_res_manage_superior"> 56 <select name="parentId" id="slt_res_manage_superior" lay-filter="slt_res_manage_superior">
57 - 57 +
58 </select> 58 </select>
59 </div> 59 </div>
60 </div> 60 </div>
@@ -62,8 +62,15 @@ @@ -62,8 +62,15 @@
62 <div class="layui-input-inline"> 62 <div class="layui-input-inline">
63 <select name="collectionState" lay-filter="resManageCollectionState"> 63 <select name="collectionState" lay-filter="resManageCollectionState">
64 <option value="">=任务绑定状态=</option> 64 <option value="">=任务绑定状态=</option>
65 - <option value="1">已绑定</option>  
66 - <option value="0">未绑定</option> 65 + <option value="yes">已绑定</option>
  66 + <option value="no">未绑定</option>
  67 + </select>
  68 + </div>
  69 + </div>
  70 + <div class="layui-inline">
  71 + <div class="layui-input-inline">
  72 + <select name="collProtocol" lay-filter="collProtocol">
  73 + <option value="">=采集协议=</option>
67 </select> 74 </select>
68 </div> 75 </div>
69 </div> 76 </div>
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <div class="layui-card"> 5 <div class="layui-card">
6 <div class="layui-card-header"> 6 <div class="layui-card-header">
7 <div class="layui-status"> 7 <div class="layui-status">
8 - <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="res-list-query-form"> 8 + <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="res-list-query-form" id="resManageIndexForm">
9 <div class="layui-form-item"> 9 <div class="layui-form-item">
10 <div class="layui-inline"> 10 <div class="layui-inline">
11 <div class="layui-input-inline layui-input-inline--long"> 11 <div class="layui-input-inline layui-input-inline--long">
@@ -17,11 +17,10 @@ @@ -17,11 +17,10 @@
17 <div id="reslist_restype"></div> 17 <div id="reslist_restype"></div>
18 </div> 18 </div>
19 </div> 19 </div>
20 -  
21 <div class="layui-inline"> 20 <div class="layui-inline">
22 <div class="layui-input-inline"> 21 <div class="layui-input-inline">
23 <select name="reslist_resStatus" id="reslist_resStatus" lay-filter="reslist_resStatus" lay-verify="required"> 22 <select name="reslist_resStatus" id="reslist_resStatus" lay-filter="reslist_resStatus" lay-verify="required">
24 - <option value="">=资源状态=</option> 23 + <option value="">=资源健康状态=</option>
25 <option value="1"></option> 24 <option value="1"></option>
26 <option value="2"></option> 25 <option value="2"></option>
27 <option value="3"></option> 26 <option value="3"></option>
@@ -37,11 +36,12 @@ @@ -37,11 +36,12 @@
37 </div> 36 </div>
38 <div class="layui-inline"> 37 <div class="layui-inline">
39 <div class="layui-input-inline"> 38 <div class="layui-input-inline">
40 - <select name="label" id="state" lay-filter="state">  
41 - <option value="">=监控状态=</option>  
42 - <option value="new">未监控</option>  
43 - <option value="monitor">监控中</option>  
44 - <option value="stop">暂停</option> 39 + <select name="state" lay-filter="state">
  40 + <option value="">=资源监控状态=</option>
  41 + <option value="new">新增</option>
  42 + <option value="monitor">监控</option>
  43 + <option value="stop">暂停监控</option>
  44 + <!-- <option value="alarmIgnore">告警压制中</option>-->
45 </select> 45 </select>
46 </div> 46 </div>
47 </div> 47 </div>
@@ -52,6 +52,15 @@ @@ -52,6 +52,15 @@
52 </select> 52 </select>
53 </div> 53 </div>
54 </div> 54 </div>
  55 + <div class="layui-inline">
  56 + <div class="layui-input-inline">
  57 + <select name="collectionState" lay-filter="resManageCollectionState">
  58 + <option value="">=任务绑定状态=</option>
  59 + <option value="yes">已绑定</option>
  60 + <option value="no">未绑定</option>
  61 + </select>
  62 + </div>
  63 + </div>
55 </div> 64 </div>
56 </form> 65 </form>
57 </div> 66 </div>
@@ -83,4 +92,4 @@ @@ -83,4 +92,4 @@
83 } 92 }
84 }); 93 });
85 94
86 -</script>  
  95 +</script>
@@ -15,7 +15,6 @@ const timeRange = () => { @@ -15,7 +15,6 @@ const timeRange = () => {
15 proxy.$http.post(`/api-web/manage/ddic/findSucDdics/time_scope`, {}, function (res) { 15 proxy.$http.post(`/api-web/manage/ddic/findSucDdics/time_scope`, {}, function (res) {
16 if (res && res.data) { 16 if (res && res.data) {
17 timeRangeArr.value = res.data; 17 timeRangeArr.value = res.data;
18 -  
19 if (callback) { 18 if (callback) {
20 callback(res.data[0].ddicCode); 19 callback(res.data[0].ddicCode);
21 } 20 }
@@ -280,12 +279,20 @@ export default { @@ -280,12 +279,20 @@ export default {
280 loadTimeRange, 279 loadTimeRange,
281 } = timeRange(); 280 } = timeRange();
282 281
  282 +
  283 +
283 let timeRangeChange = (item) => { 284 let timeRangeChange = (item) => {
284 - let code = item.ddicCode;  
285 - loadFrequency(code); 285 + setTimeout(function(){
  286 + let code = item.ddicCode;
  287 + loadFrequency(code);
  288 + },300);
  289 +
286 290
287 // 加载echar 291 // 加载echar
288 - getChartData(); 292 + setTimeout(function(){
  293 + getChartData();
  294 + },600);
  295 +
289 } 296 }
290 297
291 //根菜单选择事件 298 //根菜单选择事件
@@ -319,6 +326,7 @@ export default { @@ -319,6 +326,7 @@ export default {
319 326
320 let getChartData = () => { 327 let getChartData = () => {
321 328
  329 + console.log("======form.value.scene===00000000--------",form.value.scene);
322 let timeScope = ''; 330 let timeScope = '';
323 try { 331 try {
324 timeScope = form.value.scene.timeScope.replaceAll("time_scope_", "") 332 timeScope = form.value.scene.timeScope.replaceAll("time_scope_", "")
@@ -572,15 +580,18 @@ export default { @@ -572,15 +580,18 @@ export default {
572 }); 580 });
573 581
574 //LH 582 //LH
  583 + setTimeout(function(){
  584 + let arrs= timeRangeArr.value
  585 + timeRangeChange(arrs[0]);
  586 + },300)
  587 +
575 } 588 }
576 //查询对比分析基础数据 589 //查询对比分析基础数据
577 let getBContrastInfoById=(id)=>{ 590 let getBContrastInfoById=(id)=>{
578 proxy.$http.get(`/api-web/ContrastAnalysis/getBContrastInfoById`,{id:id}, function (res) { 591 proxy.$http.get(`/api-web/ContrastAnalysis/getBContrastInfoById`,{id:id}, function (res) {
579 if (res.success) { 592 if (res.success) {
580 - console.log("=============",res);  
581 form.value.scene.name=res.object.configName; 593 form.value.scene.name=res.object.configName;
582 form.value.scene.desc=res.object.configDepict; 594 form.value.scene.desc=res.object.configDepict;
583 - // console.log("==================",res);  
584 595
585 } 596 }
586 }); 597 });
@@ -589,7 +600,7 @@ export default { @@ -589,7 +600,7 @@ export default {
589 // 挂载完 600 // 挂载完
590 Vue.onMounted(() => { 601 Vue.onMounted(() => {
591 602
592 - init(); 603 +
593 604
594 if(!id){ 605 if(!id){
595 activeName.value = 'second'; 606 activeName.value = 'second';
@@ -611,6 +622,7 @@ export default { @@ -611,6 +622,7 @@ export default {
611 } 622 }
612 }); 623 });
613 }); 624 });
  625 + init();
614 console.log('onMounted'); 626 console.log('onMounted');
615 }) 627 })
616 628