Authored by xwx

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

…eb into master-500-dev-xwx
@@ -4798,7 +4798,9 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -4798,7 +4798,9 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
4798 {field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true}, 4798 {field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
4799 { 4799 {
4800 field: 'resName', title: '资源名称', width: resNameWidth, sort: true, 4800 field: 'resName', title: '资源名称', width: resNameWidth, sort: true,
4801 - templet: '<div><span data-zymc="{{ d.resId }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-childrennum="{{d.childrenNum}}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.adminName }}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{ d.resName }}</span></div>' 4801 + templet: '#resindex_resName'
  4802 + //lsq 资源名称用模板 2022-08-29
  4803 + // templet: '<div><span data-zymc="{{ d.resId }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-childrennum="{{d.childrenNum}}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.adminName }}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{ d.resName }}</span></div>'
4802 }, 4804 },
4803 // {field: 'shortName', title: '别名', width: 100, align: 'center', sort: true, templet:'#shortNameTpl'}, 4805 // {field: 'shortName', title: '别名', width: 100, align: 'center', sort: true, templet:'#shortNameTpl'},
4804 {field: 'health', title: '健康状态', width: 86, align: 'center', sort: true, templet: '#healthTpl'}, 4806 {field: 'health', title: '健康状态', width: 86, align: 'center', sort: true, templet: '#healthTpl'},
@@ -1490,7 +1490,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -1490,7 +1490,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
1490 if (data) { 1490 if (data) {
1491 $.each(data.series, function (i, v) { 1491 $.each(data.series, function (i, v) {
1492 if (v.flag != null && v.flag != undefined) { 1492 if (v.flag != null && v.flag != undefined) {
1493 - array.push(`<span id="selectFlag" class="layui-badge layui-bg-blue" style="margin:2px;z-index:99999">${v.flag}</span>` + ""); 1493 + array.push(`<span id="selectFlag" class="layui-badge layui-bg-blue" style="margin:2px;cursor: pointer;z-index:99999">${v.flag}</span>` + "");
1494 } else { 1494 } else {
1495 array.push('<div style="position:absolute;top:50%;left:50%;">无指标</div>') 1495 array.push('<div style="position:absolute;top:50%;left:50%;">无指标</div>')
1496 } 1496 }
@@ -393,7 +393,7 @@ layui.define(['form', 'table', 'admin', 'layer', 'laytpl', 'common', 'view', 'se @@ -393,7 +393,7 @@ layui.define(['form', 'table', 'admin', 'layer', 'laytpl', 'common', 'view', 'se
393 //lsq 增加菜单类型列 2022-08-11 393 //lsq 增加菜单类型列 2022-08-11
394 , {field: 'type', title: '菜单类型', align: 'center', sort: true, 394 , {field: 'type', title: '菜单类型', align: 'center', sort: true,
395 templet: function (d){ 395 templet: function (d){
396 - // 1:监控菜单,2:巡检菜单,3:个人工作台,4:系统菜单,5:跳转菜单,6:报表菜单,7:CMDB菜单 396 + // 1:监控菜单,2:巡检菜单,3:个人工作台,4:系统菜单,5:跳转菜单,6:报表菜单,7:资产菜单
397 switch (d.type) { 397 switch (d.type) {
398 case 1: 398 case 1:
399 return '<span class="layui-badge layui-bg-orange">监控菜单</span>'; 399 return '<span class="layui-badge layui-bg-orange">监控菜单</span>';
@@ -408,7 +408,7 @@ layui.define(['form', 'table', 'admin', 'layer', 'laytpl', 'common', 'view', 'se @@ -408,7 +408,7 @@ layui.define(['form', 'table', 'admin', 'layer', 'laytpl', 'common', 'view', 'se
408 case 6: 408 case 6:
409 return '<span class="layui-badge layui-bg-gray">报表菜单</span>'; 409 return '<span class="layui-badge layui-bg-gray">报表菜单</span>';
410 case 7: 410 case 7:
411 - return '<span class="layui-badge layui-bg-red">CMDB菜单</span>'; 411 + return '<span class="layui-badge layui-bg-red">资产菜单</span>';
412 default: 412 default:
413 return ''; 413 return '';
414 } 414 }
@@ -42,11 +42,9 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli @@ -42,11 +42,9 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
42 }); 42 });
43 form.render(); 43 form.render();
44 44
45 - function autoHeight(el) {  
46 - // var height = el.parents('.layui-card').height();  
47 - // el.css('min-height', height - 75);  
48 - }  
49 - 45 + common.ddicSelect('jgraph-topo_type','JTOPO_TOPOTYPE',function (datalist) {
  46 + form.render('select');
  47 + });
50 //绑定机房 48 //绑定机房
51 admin.req({ 49 admin.req({
52 url: common.domainName + '/api-web/manage/machineroom/page' 50 url: common.domainName + '/api-web/manage/machineroom/page'
@@ -1159,7 +1159,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -1159,7 +1159,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
1159 if (name.length > 0) { 1159 if (name.length > 0) {
1160 name = name.substr(0, name.length - 1); 1160 name = name.substr(0, name.length - 1);
1161 } 1161 }
1162 - if (resType == 'STORAGE_SHARE' && provider != 'HUAWEI' && provider != 'Inspur') { 1162 + if (resType == 'STORAGE_SHARE' && provider != 'HUAWEI' && provider != 'Inspur' && provider != 'macrosan') {
1163 return false; 1163 return false;
1164 } 1164 }
1165 commonDetail.openDetail(resId, resType, name) 1165 commonDetail.openDetail(resId, resType, name)
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <div class="layui-form-item" style="display: flex;align-items: center;"> 27 <div class="layui-form-item" style="display: flex;align-items: center;">
28 <label class="layui-form-label" style="height:40px;">用户绑定</label> 28 <label class="layui-form-label" style="height:40px;">用户绑定</label>
29 <!-- <div class="layui-input-block tags-input" style="height: auto">--> 29 <!-- <div class="layui-input-block tags-input" style="height: auto">-->
30 - <div class=" tags-input" style="height: auto;"> 30 + <div class=" tags-input" style="height: 38px;">
31 <div class="tags" id="selecte_usergroup_id_user"></div> 31 <div class="tags" id="selecte_usergroup_id_user"></div>
32 </div> 32 </div>
33 <!-- style="padding: 0!important;position: relative;top: -28px;left: 98%"【--> 33 <!-- style="padding: 0!important;position: relative;top: -28px;left: 98%"【-->
@@ -34,10 +34,10 @@ @@ -34,10 +34,10 @@
34 <label class="layui-form-label">拓扑类型</label> 34 <label class="layui-form-label">拓扑类型</label>
35 <div class="layui-input-block"> 35 <div class="layui-input-block">
36 <select id="jgraph-topo_type" lay-filter="jgraph-edittopo_topo_type" name="jgraph-topo_type"> 36 <select id="jgraph-topo_type" lay-filter="jgraph-edittopo_topo_type" name="jgraph-topo_type">
37 - <option value="1">业务拓扑</option> 37 + <!-- <option value="1">业务拓扑</option>
38 <option value="2">资源拓扑</option> 38 <option value="2">资源拓扑</option>
39 <option value="3">网络拓扑</option> 39 <option value="3">网络拓扑</option>
40 - <option value="4">机房拓扑</option> 40 + <option value="4">机房拓扑</option>-->
41 </select> 41 </select>
42 </div> 42 </div>
43 </div> 43 </div>
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <div style="width: calc(100% - 150px);padding-left: 6px;text-align: left;"> 41 <div style="width: calc(100% - 150px);padding-left: 6px;text-align: left;">
42 <el-input :size="$global.elementConfig.size.input" @keydown.enter.native="searchFile" clearable 42 <el-input :size="$global.elementConfig.size.input" @keydown.enter.native="searchFile" clearable
43 placeholder="请输入关键字" 43 placeholder="请输入关键字"
44 - style="width: 220px;margin-right:10px" v-model="keyWord"/> 44 + style="width: 220px;margin-right:10px" v-model.trim="keyWord"/>
45 <el-button :size="$global.elementConfig.size.button" @click="searchFile"> 45 <el-button :size="$global.elementConfig.size.button" @click="searchFile">
46 <i class="iconfont icon-sousuo"></i>搜索 46 <i class="iconfont icon-sousuo"></i>搜索
47 </el-button> 47 </el-button>
@@ -652,10 +652,10 @@ export default { @@ -652,10 +652,10 @@ export default {
652 */ 652 */
653 let searchFile = () => { 653 let searchFile = () => {
654 let keyWords = keyWord.value; 654 let keyWords = keyWord.value;
655 - // if (keyWords == '') {  
656 - // proxy.$global.showMsg("请输入关键字!", "warning")  
657 - // return;  
658 - // } 655 + if (keyWords == '') {
  656 + proxy.$global.showMsg("请输入关键字!", "warning")
  657 + return;
  658 + }
659 getPage(props.viewTypeId); 659 getPage(props.viewTypeId);
660 660
661 } 661 }
@@ -11,7 +11,7 @@ export default { @@ -11,7 +11,7 @@ export default {
11 keyWord:'', 11 keyWord:'',
12 resType:'', 12 resType:'',
13 busId:'', 13 busId:'',
14 - time:"today", 14 + time:"week",
15 pageNum: 1, 15 pageNum: 1,
16 pageSize: 10, 16 pageSize: 10,
17 count:0, 17 count:0,
@@ -12,7 +12,7 @@ export default { @@ -12,7 +12,7 @@ export default {
12 resType:'', 12 resType:'',
13 busId:'', 13 busId:'',
14 userName:'', 14 userName:'',
15 - time:"today", 15 + time:"week",
16 pageNum: 1, 16 pageNum: 1,
17 pageSize: 10, 17 pageSize: 10,
18 count:0, 18 count:0,
@@ -27,6 +27,7 @@ layui.define(['xmSelect', 'md5'], function (exports) { @@ -27,6 +27,7 @@ layui.define(['xmSelect', 'md5'], function (exports) {
27 ajScreenStatement: sessionStorage.getItem('ajWeb'), //aj系统地址 27 ajScreenStatement: sessionStorage.getItem('ajWeb'), //aj系统地址
28 workflowName: sessionStorage.getItem('workflow'),//流程系统地址 28 workflowName: sessionStorage.getItem('workflow'),//流程系统地址
29 domainCMDBName: "http://80.12.147.24:8888/hgkjcmdb", //杭州咨源老cmdb系统地址 29 domainCMDBName: "http://80.12.147.24:8888/hgkjcmdb", //杭州咨源老cmdb系统地址
  30 + kelaiTargetUrl: 'https://94.12.78.29/auth/authLogin.do?authUid={USERNAME}&authPwd={PASSWORD}', //科来首页地址
30 lineTimer: null,//性能曲线图全局定时器 31 lineTimer: null,//性能曲线图全局定时器
31 detailTimer: [],//详细页的全局定时器 32 detailTimer: [],//详细页的全局定时器
32 alarmTimer: null,//首页告警刷新定时器 33 alarmTimer: null,//首页告警刷新定时器
@@ -532,8 +532,8 @@ export default { @@ -532,8 +532,8 @@ export default {
532 // 已选择列表 532 // 已选择列表
533 tabFirstList.value = []; 533 tabFirstList.value = [];
534 // 关闭谈画框 534 // 关闭谈画框
535 -  
536 - 535 + // lsq 刷新菜单 2022-08-29
  536 + window.top.location.reload();
537 // window.top.location.href = window.top.location.origin + "/#/analysis/view/id=105" 537 // window.top.location.href = window.top.location.origin + "/#/analysis/view/id=105"
538 window.top.location.href = window.top.location.origin + '/#/' + res.str; 538 window.top.location.href = window.top.location.origin + '/#/' + res.str;
539 } 539 }
@@ -555,12 +555,23 @@ export default { @@ -555,12 +555,23 @@ export default {
555 proxy.$http.get("/api-web/manage/kpi/list", {}, function (res) { 555 proxy.$http.get("/api-web/manage/kpi/list", {}, function (res) {
556 if (res && res.data) { 556 if (res && res.data) {
557 kpiList.value = res.data; 557 kpiList.value = res.data;
  558 + //lsq 给默认数据,第一个数据
  559 + if(kpiList.value.length>0){
  560 + kpiTypeArr.value=[kpiList.value[0].kpiId];
  561 + getParams.value.kpiId=kpiList.value[0].kpiId;
  562 + }
  563 + loeadTable();
558 } 564 }
559 }) 565 })
560 566
561 proxy.$http.get("/api-web/home/business/findAllBusType", {}, function (res) { 567 proxy.$http.get("/api-web/home/business/findAllBusType", {}, function (res) {
562 if (res && res.data) { 568 if (res && res.data) {
563 busTypeList.value = res.data; 569 busTypeList.value = res.data;
  570 + //lsq 给一个默认数据,第一个数据 2022-08-29
  571 + if(busTypeList.value.length>0){
  572 + busTypeArr.value=[busTypeList.value[0].busId];
  573 + getParams.value.busId=busTypeList.value[0].busId;
  574 + }
564 } 575 }
565 }) 576 })
566 577
@@ -577,7 +588,6 @@ export default { @@ -577,7 +588,6 @@ export default {
577 }); 588 });
578 } 589 }
579 }); 590 });
580 -  
581 //LH 591 //LH
582 setTimeout(function () { 592 setTimeout(function () {
583 let arrs = timeRangeArr.value 593 let arrs = timeRangeArr.value
@@ -598,7 +608,7 @@ export default { @@ -598,7 +608,7 @@ export default {
598 608
599 // 挂载完 609 // 挂载完
600 Vue.onMounted(() => { 610 Vue.onMounted(() => {
601 - 611 + init();
602 612
603 if (!id) { 613 if (!id) {
604 activeName.value = 'second'; 614 activeName.value = 'second';
@@ -609,7 +619,6 @@ export default { @@ -609,7 +619,6 @@ export default {
609 //编辑追加场景分类数据加载 619 //编辑追加场景分类数据加载
610 analysisChange(true); 620 analysisChange(true);
611 } 621 }
612 - loeadTable();  
613 622
614 // 先加载时间范围,然后在加载 623 // 先加载时间范围,然后在加载
615 loadTimeRange(function (defCode) { 624 loadTimeRange(function (defCode) {
@@ -620,12 +629,12 @@ export default { @@ -620,12 +629,12 @@ export default {
620 } 629 }
621 }); 630 });
622 }); 631 });
623 - init();  
624 console.log('onMounted'); 632 console.log('onMounted');
625 }) 633 })
626 634
627 635
628 return { 636 return {
  637 + getParams,
629 resTypeList, 638 resTypeList,
630 kpiList, 639 kpiList,
631 busTypeList, 640 busTypeList,
@@ -20,27 +20,25 @@ @@ -20,27 +20,25 @@
20 <el-button :size="$global.elementConfig.size.button" @click="searchData" class="search-text button-flex-div-center" 20 <el-button :size="$global.elementConfig.size.button" @click="searchData" class="search-text button-flex-div-center"
21 type="primary">搜索 21 type="primary">搜索
22 </el-button> 22 </el-button>
23 - 23 + <!--lsq 条件在一行 2022-08-29-->
  24 + <router-link :to="'/analysis/add'" class="analysis link-type">
  25 + <el-button :size="$global.elementConfig.size.button" style="margin-left:6px;" class="button-flex-div-center" type="primary">
  26 + <i class="el-icon-plus"></i>新增
  27 + </el-button>
  28 + </router-link>
  29 + <el-button :size="$global.elementConfig.size.button" @click="handleDelete()" style="margin-left:6px;" class="search-text button-flex-div-center"
  30 + type="primary">删除
  31 + </el-button>
24 </div> 32 </div>
25 33
26 </el-col> 34 </el-col>
27 </el-row> 35 </el-row>
28 - <el-row class="list-title">  
29 - <el-col :span="24" class="text-left">  
30 - <router-link :to="'/analysis/add'" class="analysis link-type">  
31 - <el-button :size="$global.elementConfig.size.button" class="button-flex-div-center" type="primary">  
32 - <i class="el-icon-plus"></i>新增  
33 - </el-button>  
34 - </router-link>  
35 36
36 - <!-- <el-button type="primary" class="button-flex-div-center"><i class="icon-list icon-list-delete"></i>删除</el-button>-->  
37 - </el-col>  
38 - </el-row>  
39 <el-row class="analysis-table-div"> 37 <el-row class="analysis-table-div">
40 <el-col :span="24"> 38 <el-col :span="24">
41 <el-table :data="tableData" @selection-change="handleSelectionChange" border ref="multipleTable" stripe 39 <el-table :data="tableData" @selection-change="handleSelectionChange" border ref="multipleTable" stripe
42 style="width: 100%"> 40 style="width: 100%">
43 - <!-- <el-table-column align="center" type="selection" width="55" />--> 41 + <el-table-column align="center" type="selection" width="55" />
44 <el-table-column align="center" label="配置项名称" prop="configName" sortable/> 42 <el-table-column align="center" label="配置项名称" prop="configName" sortable/>
45 <el-table-column align="center" label="配置项描述" prop="configDepict" sortable/> 43 <el-table-column align="center" label="配置项描述" prop="configDepict" sortable/>
46 <el-table-column align="center" label="时间范围" prop="timeScopeName" sortable></el-table-column> 44 <el-table-column align="center" label="时间范围" prop="timeScopeName" sortable></el-table-column>
@@ -28,7 +28,6 @@ export default { @@ -28,7 +28,6 @@ export default {
28 // 挂载完 28 // 挂载完
29 Vue.onMounted(() => { 29 Vue.onMounted(() => {
30 proxy.getData(); 30 proxy.getData();
31 -  
32 }) 31 })
33 //获取对比分析列表 32 //获取对比分析列表
34 const getData = () => { 33 const getData = () => {
@@ -39,7 +38,6 @@ export default { @@ -39,7 +38,6 @@ export default {
39 } 38 }
40 $.get(proxy.domainName + proxy.apiUrl + '?access_token=' + localStorage.getItem('access_token'), params, function (res) { 39 $.get(proxy.domainName + proxy.apiUrl + '?access_token=' + localStorage.getItem('access_token'), params, function (res) {
41 if (res) { 40 if (res) {
42 - console.log("res", res)  
43 proxy.totalCount = res.count; 41 proxy.totalCount = res.count;
44 proxy.tableData = res.data; 42 proxy.tableData = res.data;
45 proxy.tableData.map((item, index) => { 43 proxy.tableData.map((item, index) => {
@@ -68,14 +66,31 @@ export default { @@ -68,14 +66,31 @@ export default {
68 this.$refs.multipleTable.clearSelection() 66 this.$refs.multipleTable.clearSelection()
69 } 67 }
70 } 68 }
  69 + let multipleSelection=Vue.ref([]);
71 const handleSelectionChange = (val) => { 70 const handleSelectionChange = (val) => {
72 - this.multipleSelection = val 71 + multipleSelection.value = val
73 } 72 }
74 //单个删除 73 //单个删除
75 const handleDelete = (item) => { 74 const handleDelete = (item) => {
76 - 75 + //lsq 增加批量删除 2022-08-29
  76 + let idList='';
  77 + if(item){
  78 + idList=item.id
  79 + }else{
  80 + if(multipleSelection.value && multipleSelection.value.length>0){
  81 + let idArr=[];
  82 + multipleSelection.value.map(item=>{
  83 + idArr.push(item.id)
  84 + })
  85 + if(idArr.length>0){
  86 + idList=idArr.join(',')
  87 + }
  88 + }else{
  89 + proxy.$global.showMsg("请选择数据", "warning");
  90 + }
  91 + }
77 let params = { 92 let params = {
78 - id: item.id 93 + id: idList
79 } 94 }
80 95
81 proxy.$global.confirm("确认删除数据吗?", function () { 96 proxy.$global.confirm("确认删除数据吗?", function () {
@@ -83,13 +98,14 @@ export default { @@ -83,13 +98,14 @@ export default {
83 $.get(proxy.domainName + proxy.apiUrl1 + '?access_token=' + localStorage.getItem('access_token'), params, function () { 98 $.get(proxy.domainName + proxy.apiUrl1 + '?access_token=' + localStorage.getItem('access_token'), params, function () {
84 proxy.$global.showMsg("删除成功", "success"); 99 proxy.$global.showMsg("删除成功", "success");
85 proxy.getData(); 100 proxy.getData();
  101 + // lsq 刷新菜单 2022-08-29
  102 + window.top.location.reload();
86 }) 103 })
87 } else { 104 } else {
88 proxy.$global.showMsg("删除失败", "warning"); 105 proxy.$global.showMsg("删除失败", "warning");
89 } 106 }
90 }) 107 })
91 108
92 -  
93 // $.get(proxy.domainName +proxy.apiUrl1+'?access_token='+localStorage.getItem('access_token'),params,function (res) { 109 // $.get(proxy.domainName +proxy.apiUrl1+'?access_token='+localStorage.getItem('access_token'),params,function (res) {
94 // if(res){ 110 // if(res){
95 // proxy.$global.confirm("确认删除数据吗?", function () { 111 // proxy.$global.confirm("确认删除数据吗?", function () {