Authored by 鲁尚清

Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web into …

…master-v32-lushangqing
Showing 17 changed files with 323 additions and 19 deletions
@@ -24,6 +24,7 @@ layui.define(['xmSelect', 'md5'], function (exports) { @@ -24,6 +24,7 @@ layui.define(['xmSelect', 'md5'], function (exports) {
24 domainAssetsManage: sessionStorage.getItem('domainAssetsManage'), // 资产系统地址 24 domainAssetsManage: sessionStorage.getItem('domainAssetsManage'), // 资产系统地址
25 graphEditorOrigin: sessionStorage.getItem('graphEditorOrigin'), // 拓扑系统地址 25 graphEditorOrigin: sessionStorage.getItem('graphEditorOrigin'), // 拓扑系统地址
26 workflowName: sessionStorage.getItem('workflow'),//流程系统地址 26 workflowName: sessionStorage.getItem('workflow'),//流程系统地址
  27 + domainCMDBName: "http://120.236.178.177:7180/HGKJCMDB", //杭州咨源老cmdb系统地址
27 lineTimer: null,//性能曲线图全局定时器 28 lineTimer: null,//性能曲线图全局定时器
28 detailTimer: [],//详细页的全局定时器 29 detailTimer: [],//详细页的全局定时器
29 alarmTimer: null,//首页告警刷新定时器 30 alarmTimer: null,//首页告警刷新定时器
@@ -2151,7 +2151,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -2151,7 +2151,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
2151 renderStoreAlarms:function (tableId,resId){ 2151 renderStoreAlarms:function (tableId,resId){
2152 var alarmlist = table.render({ 2152 var alarmlist = table.render({
2153 elem: '#' + tableId 2153 elem: '#' + tableId
2154 - , url: common.domainName + '/api-web/bResultRealtimeCollector/getStore' 2154 + , url: common.domainName + '/api-web/busType/getStore'
2155 , where: { 2155 , where: {
2156 access_token: obj.sessions.getToken().access_token, 2156 access_token: obj.sessions.getToken().access_token,
2157 ResId: resId 2157 ResId: resId
@@ -61,10 +61,11 @@ @@ -61,10 +61,11 @@
61 <button type="button" id="searchBtn" class="layui-btn layui-btn-sm layuiadmin-btn-comm">筛选 61 <button type="button" id="searchBtn" class="layui-btn layui-btn-sm layuiadmin-btn-comm">筛选
62 </button> 62 </button>
63 </div> 63 </div>
64 - <div class="work-tab-right">  
65 - <button type="button" id="workIndexFlowBtn" class="layui-btn layui-btn-sm layui-btn-primary">发起流程  
66 - </button>  
67 - </div> 64 + <!--去除发起流程 joke add 20211130-->
  65 +<!-- <div class="work-tab-right">-->
  66 +<!-- <button type="button" id="workIndexFlowBtn" class="layui-btn layui-btn-sm layui-btn-primary">发起流程-->
  67 +<!-- </button>-->
  68 +<!-- </div>-->
68 <div class="layui-tab-content"> 69 <div class="layui-tab-content">
69 <div class="layui-tab-item layui-show"> 70 <div class="layui-tab-item layui-show">
70 <div class="mt15" id="workIndexFlowByMe"></div> 71 <div class="mt15" id="workIndexFlowByMe"></div>
@@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
4 <div style="border-radius: 3px;background-color: white" 4 <div style="border-radius: 3px;background-color: white"
5 :style="{'height':height+'px','max-height':height + 'px','overflow':'auto'}"> 5 :style="{'height':height+'px','max-height':height + 'px','overflow':'auto'}">
6 <div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold"> 6 <div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold">
7 - <el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档管理</el-link> 7 + <slot name="title">
  8 + <el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档管理</el-link>
  9 + </slot>
8 </div> 10 </div>
9 <!----> 11 <!---->
10 <el-tree ref="tree" style="padding:6px;" :props="props" :data="treeData" node-key="id" 12 <el-tree ref="tree" style="padding:6px;" :props="props" :data="treeData" node-key="id"
  1 +/**
  2 +* @desc 华为云网络设备(防火墙、交换机)
  3 +* @author wangfeng
  4 +* @date 2020/2/4 14:36
  5 +**/
  6 +layui.define(['commonDetail','common'], function (exports) {
  7 + var commonDetail = layui.commonDetail;
  8 + var common = layui.common;
  9 + //对外暴露的接口
  10 + exports('huawei_cloud_nethardware', function (data) {
  11 + var resId = '';
  12 + var resType = '';
  13 + var showFlag = common.getUrlParam("show");
  14 + if(showFlag && showFlag == '0'){
  15 + resId = common.getUrlParam("resId");
  16 + resType = common.getUrlParam("resType");
  17 + }else{
  18 + resId = data.resId;
  19 + resType = data.resType;
  20 + }
  21 + commonDetail.bindTips();
  22 + //基本信息
  23 + var jbxxKpi = "KPIE13DD9A3,KPIF74D9D2B,KPIFABFD741,KPIB718ADEC,KPI5858832B,KPI2DC9105C,KPI4419E8A1,KPIA47DE8B4,KPI7E81DFB5,KPI6F17667E, KPIF21A9F60, KPI81BAB2C4, KPI5364695E, KPI14E5F9B4, KPIC70A1E3D";
  24 +
  25 + reload()
  26 +
  27 + //渲染页面
  28 + function reload() {
  29 + //基本信息
  30 + commonDetail.renderTextCols("hauwei_cloude_nethardware_baseinfo",resId,jbxxKpi,2);
  31 + //维保信息 joke add 20200528
  32 + commonDetail.renderMaintenanceInfo('hauwei_cloude_nethardware_wbinfo',resId,resType);
  33 + //CPU平均使用率
  34 + commonDetail.renderGauge("hauwei_cloude_nethardware_cpurate",resId,"KPI961A9688");
  35 + //内存平均使用率
  36 + commonDetail.renderGauge("hauwei_cloude_nethardware_memrate",resId,"KPIE78B29FF");
  37 + // commonDetail.renderCircular("hauwei_cloude_nethardware_memrate",resId,"KPIE78B29FF","内存平均使用率","%");
  38 + //响应时长
  39 + commonDetail.renderLineCharat("hauwei_cloude_nethardware_responestimes",resId,"KPI7480987F","响应时长","");
  40 + //活动告警
  41 + commonDetail.renderActiveAlarms("hauwei_cloude_nethardware_activealarms",resId);
  42 + }
  43 +
  44 + //定时任务
  45 + var timer = setInterval(function () {
  46 + reload()
  47 + },commonDetail.timerTime);
  48 + commonDetail.detailTimer.push(timer);
  49 +
  50 + });
  51 +});
  1 +<!--华为网络设备-->
  2 +<article class="page-container template">
  3 + <div class="page-panel">
  4 + <div class="main">
  5 + <div class="layui-card template_detail_content">
  6 + <div class="layui-card-body">
  7 + <div class="lay-row">
  8 + <div class="lay-row-item lay-row-item--auto-width">
  9 + <h5 class="lay-row-title">基本信息<i data-id="hauwei_cloude_nethardware_baseinfo" class="iconfont detail_base_info">&#xe61e;</i></h5>
  10 + <ul class="info-table" id="hauwei_cloude_nethardware_baseinfo"></ul>
  11 + </div>
  12 + <div class="lay-row-item lay-row-item--small">
  13 + <h5 class="lay-row-title">维保信息</h5>
  14 + <ul class="info-table" id="hauwei_cloude_nethardware_wbinfo"></ul>
  15 + </div>
  16 + </div>
  17 + <div class="lay-row">
  18 + <div class="lay-row-item lay-row-item--small">
  19 + <h5 class="lay-row-title">CPU平均使用率</h5>
  20 + <ul id="hauwei_cloude_nethardware_cpurate" class="pie-wrap dasboard">
  21 + <li data-degree="83" class="pie-half pie-half-border-color-3">
  22 + <div class="pie-half-text">
  23 + <b>0%</b>
  24 + <span>CPU平均使用率</span>
  25 + </div>
  26 + </li>
  27 + </ul>
  28 + </div>
  29 + <div class="lay-row-item lay-row-item--small">
  30 + <h5 class="lay-row-title">内存平均使用率</h5>
  31 +<!-- <div id="hauwei_cloude_nethardware_memrate" class="detail_circular_chart"></div>-->
  32 + <!--<div class="circular-half-text">-->
  33 + <!--<span>内存使用率</span>-->
  34 + <!--</div>-->
  35 + <ul id="hauwei_cloude_nethardware_memrate" class="pie-wrap dasboard">
  36 + <li data-degree="83" class="pie-half pie-half-border-color-3">
  37 + <div class="pie-half-text">
  38 + <b>0%</b>
  39 + <span>内存使用率</span>
  40 + </div>
  41 + </li>
  42 + </ul>
  43 + </div>
  44 + <div class="lay-row-item lay-row-item--auto-width">
  45 + <h5 class="lay-row-title">响应时长</h5>
  46 + <div id="hauwei_cloude_nethardware_responestimes" class="detail_line_chart"></div>
  47 + </div>
  48 + </div>
  49 + <div class="lay-row">
  50 + <div class="lay-row-item">
  51 + <h5 class="lay-row-title">实时告警动态</h5>
  52 + <div id="hauwei_cloude_nethardware_activealarms"></div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + </div>
  59 +</article>
  60 +<textarea id="huawei_cloud_nethardware_param_id" style="display: none;">{{d}}</textarea>
  61 +<script>
  62 + layui.use('huawei_cloud_nethardware', function (fn) {
  63 + var $ = layui.$;
  64 + var parm = $("#huawei_cloud_nethardware_param_id").val();
  65 + if(parm.indexOf('{{d') != -1){
  66 + fn();
  67 + }else{
  68 + fn(JSON.parse(parm));
  69 + }
  70 + });
  71 +</script>
  1 +<div>
  2 + <span class="el-dropdown-link" @click="showMachineRoomDialog(true)" >
  3 + {{textString}}
  4 + </span>
  5 +
  6 + <cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
  7 + <template v-slot>
  8 + <GetMachineRoom v-if="commandNameData" :commandNameData="commandNameData"></GetMachineRoom>
  9 + </template>
  10 + </cm-dialog>
  11 +
  12 +</div>
  1 +export default {
  2 + name: 'machineRoomComponents',
  3 + template: '',
  4 + components: {
  5 + 'GetMachineRoom': Vue.defineAsyncComponent(
  6 + () => myImport('views/commonComponents/getMachineRoom/index')
  7 + ),
  8 + },
  9 + props: {
  10 + // 资源名称
  11 + textString: {
  12 + type: String,
  13 + default: 0
  14 + },
  15 + resId: {
  16 + type: String,
  17 + default: ''
  18 + },
  19 + resTypeId: {
  20 + type: String,
  21 + default: ''
  22 + },
  23 + resType: {
  24 + type: String,
  25 + default: ''
  26 + },
  27 + optionData: {
  28 + type: Array,
  29 + default: []
  30 + }
  31 +
  32 + },
  33 + data() {
  34 + return {}
  35 + },
  36 + setup(props, {attrs, slots, emit}) {
  37 +
  38 + const {proxy} = Vue.getCurrentInstance();
  39 +
  40 + let dialogFlg = Vue.ref(false);
  41 + let commandNameData = Vue.ref([
  42 + {
  43 + name: '萧山IDC二号机房',
  44 + htmlName: 'xiaoshansecond',//html页面的名称
  45 + val: 'one'
  46 + },
  47 + {
  48 + name: '萧山IDC三号机房',
  49 + htmlName: 'xiaoshanthird',
  50 + val: 'two'
  51 + },
  52 + {
  53 + name: '萧山IDC七号机房',
  54 + htmlName: 'xiaoshanseven',
  55 + val: 'three'
  56 + }
  57 + ]);
  58 +
  59 + let showMachineRoomDialog = (flg) => {
  60 + dialogFlg.value = flg;
  61 +debugger
  62 +console.log(props.optionData);
  63 + }
  64 +
  65 + return {
  66 + dialogFlg,
  67 + commandNameData,
  68 + showMachineRoomDialog,
  69 + }
  70 + }
  71 +}
  1 +<div>
  2 + <span class="el-dropdown-link" @click="showMachineRoomDialog(true)" >
  3 + {{textString}}
  4 + </span>
  5 +
  6 + <cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
  7 + <template v-slot>
  8 + <GetMachineRoom v-if="commandNameData" :commandNameData="commandNameData"></GetMachineRoom>
  9 + </template>
  10 + </cm-dialog>
  11 +
  12 +</div>
  1 +export default {
  2 + name: 'machineRoomDetailComponents',
  3 + template: '',
  4 + components: {
  5 + 'GetMachineRoom': Vue.defineAsyncComponent(
  6 + () => myImport('views/commonComponents/getMachineRoom/index')
  7 + ),
  8 + },
  9 + props: {
  10 + // 资源名称
  11 + textString: {
  12 + type: String,
  13 + default: 0
  14 + },
  15 + resId: {
  16 + type: String,
  17 + default: ''
  18 + },
  19 + resTypeId: {
  20 + type: String,
  21 + default: ''
  22 + },
  23 + resType: {
  24 + type: String,
  25 + default: ''
  26 + },
  27 + optionData: {
  28 + type: Array,
  29 + default: []
  30 + }
  31 +
  32 + },
  33 + data() {
  34 + return {}
  35 + },
  36 + setup(props, {attrs, slots, emit}) {
  37 +
  38 + const {proxy} = Vue.getCurrentInstance();
  39 +
  40 + let dialogFlg = Vue.ref(false);
  41 + let commandNameData = Vue.ref([
  42 + {
  43 + name: '萧山IDC二号机房',
  44 + htmlName: 'xiaoshansecond',//html页面的名称
  45 + val: 'one'
  46 + },
  47 + {
  48 + name: '萧山IDC三号机房',
  49 + htmlName: 'xiaoshanthird',
  50 + val: 'two'
  51 + },
  52 + {
  53 + name: '萧山IDC七号机房',
  54 + htmlName: 'xiaoshanseven',
  55 + val: 'three'
  56 + }
  57 + ]);
  58 +
  59 + let showMachineRoomDialog = (flg) => {
  60 + dialogFlg.value = flg;
  61 + }
  62 +
  63 + return {
  64 + dialogFlg,
  65 + commandNameData,
  66 + showMachineRoomDialog,
  67 + }
  68 + }
  69 +}
@@ -23,6 +23,10 @@ export default { @@ -23,6 +23,10 @@ export default {
23 type: String, 23 type: String,
24 default: 0 24 default: 0
25 }, 25 },
  26 + optionData: {
  27 + type: Array,
  28 + default: []
  29 + }
26 }, 30 },
27 data() { 31 data() {
28 return { 32 return {
@@ -33,6 +33,10 @@ export default { @@ -33,6 +33,10 @@ export default {
33 type: String, 33 type: String,
34 default: '' 34 default: ''
35 }, 35 },
  36 + optionData: {
  37 + type: Array,
  38 + default: []
  39 + }
36 40
37 }, 41 },
38 data() { 42 data() {
@@ -110,25 +114,14 @@ export default { @@ -110,25 +114,14 @@ export default {
110 return; 114 return;
111 } 115 }
112 116
113 - // 查询topoId  
114 - // proxy.$http.get(`/api-web/mxgraph/generateByResId`, {resId: props.resId}, function (res) {  
115 - // if (res && res.success) {  
116 - // let topoId = res.str;  
117 - // proxy.$global.openGraphEditor(topoId)  
118 - // } else {  
119 - // proxy.$global.showMsg('生成资源拓扑失败!', "error");  
120 - // }  
121 - // });  
122 proxy.$global.viewResTopo(props.resId) 117 proxy.$global.viewResTopo(props.resId)
123 } 118 }
124 119
125 let openDetail = () => { 120 let openDetail = () => {
126 -debugger  
127 if (props.resId == '') { 121 if (props.resId == '') {
128 proxy.$global.showMsg("资源编号不存在,请确认!","warning") 122 proxy.$global.showMsg("资源编号不存在,请确认!","warning")
129 return; 123 return;
130 } 124 }
131 -  
132 proxy.$global.openDetail(props.resId,props.resType,props.title); 125 proxy.$global.openDetail(props.resId,props.resType,props.title);
133 } 126 }
134 127
@@ -18,6 +18,10 @@ export default { @@ -18,6 +18,10 @@ export default {
18 type: String, 18 type: String,
19 default: '' 19 default: ''
20 }, 20 },
  21 + optionData: {
  22 + type: Array,
  23 + default: []
  24 + }
21 25
22 }, 26 },
23 data() { 27 data() {
@@ -77,6 +77,8 @@ @@ -77,6 +77,8 @@
77 <el-option label="资源名称" :value="'resNameComponents'"></el-option> 77 <el-option label="资源名称" :value="'resNameComponents'"></el-option>
78 <el-option label="状态组件" :value="'statusComponents'"></el-option> 78 <el-option label="状态组件" :value="'statusComponents'"></el-option>
79 <el-option label="使用率组件" :value="'rateComponents'"></el-option> 79 <el-option label="使用率组件" :value="'rateComponents'"></el-option>
  80 + <el-option label="机房组件" :value="'machineRoomComponents'"></el-option>
  81 + <el-option label="机柜组件" :value="'machineRoomDetailComponents'"></el-option>
80 </el-select> 82 </el-select>
81 </div> 83 </div>
82 84
@@ -203,6 +203,12 @@ export default { @@ -203,6 +203,12 @@ export default {
203 'statusComponents': Vue.defineAsyncComponent( 203 'statusComponents': Vue.defineAsyncComponent(
204 () => myImport('components/page/res/statusComponents/index') 204 () => myImport('components/page/res/statusComponents/index')
205 ), 205 ),
  206 + 'machineRoomComponents': Vue.defineAsyncComponent(
  207 + () => myImport('components/page/res/machineRoomComponents/index')
  208 + ),
  209 + 'machineRoomDetailComponents': Vue.defineAsyncComponent(
  210 + () => myImport('components/page/res/machineRoomDetailComponents/index')
  211 + ),
206 }, 212 },
207 data() { 213 data() {
208 return { 214 return {
1 <div class="container"> 1 <div class="container">
2 - <cm-document :isRecycle="true"></cm-document> 2 + <cm-document :isRecycle="true">
  3 + <template #title>
  4 + <el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档回收站</el-link>
  5 + </template>
  6 + </cm-document>
3 </div> 7 </div>
@@ -35,7 +35,8 @@ @@ -35,7 +35,8 @@
35 <component v-if="row[prop] && row[prop].props && row[prop].props.colComponents != null && row[prop].props.colComponents != ''" v-bind:is="row[prop].props.colComponents" 35 <component v-if="row[prop] && row[prop].props && row[prop].props.colComponents != null && row[prop].props.colComponents != ''" v-bind:is="row[prop].props.colComponents"
36 :resId="row.resId" 36 :resId="row.resId"
37 :resTypeId="currentNode.id" 37 :resTypeId="currentNode.id"
38 - :textString="row[prop] == undefined ? '' : row[prop].value"></component> 38 + :textString="row[prop] == undefined ? '' : row[prop].value"
  39 + :optionData="row"></component>
39 <el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop] == undefined ? '' : row[prop].value }}</el-link> 40 <el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop] == undefined ? '' : row[prop].value }}</el-link>
40 </template> 41 </template>
41 </cm-table-page> 42 </cm-table-page>