Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web into …
…master-v32-lushangqing
Showing
7 changed files
with
96 additions
and
0 deletions
@@ -846,6 +846,28 @@ layui.define(['xmSelect', 'md5'], function (exports) { | @@ -846,6 +846,28 @@ layui.define(['xmSelect', 'md5'], function (exports) { | ||
846 | }); | 846 | }); |
847 | }); | 847 | }); |
848 | }, | 848 | }, |
849 | + //打开机房机柜页面 | ||
850 | + openRoom:function (room){ | ||
851 | + let urlParams=''; | ||
852 | + for(let key in room){ | ||
853 | + if(room[key]){ | ||
854 | + urlParams+=key+'='+room[key]+'&' | ||
855 | + } | ||
856 | + } | ||
857 | + urlParams=urlParams.substr(0,urlParams.length-1) | ||
858 | + layer.open({ | ||
859 | + title: '机房信息', | ||
860 | + type: 2, | ||
861 | + area: ['80%', '90%'], | ||
862 | + shadeClose: true,//开启遮罩层 | ||
863 | + id: 'roomRes_div', | ||
864 | + // content: laytpl(res.body).render(JSON.stringify(params)), | ||
865 | + content: ['/vue3/index.html#/machineRoomRes?'+urlParams, 'no'], | ||
866 | + cancel: function () { | ||
867 | + clearTimeout(obj.lineTimer); | ||
868 | + } | ||
869 | + }); | ||
870 | + }, | ||
849 | //打开性能柱状图 | 871 | //打开性能柱状图 |
850 | openBarChart: function (title, params) { | 872 | openBarChart: function (title, params) { |
851 | if (!title) { | 873 | if (!title) { |
@@ -867,6 +867,19 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', | @@ -867,6 +867,19 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', | ||
867 | }; | 867 | }; |
868 | common.openLineChart(name, params); | 868 | common.openLineChart(name, params); |
869 | }); | 869 | }); |
870 | + //指标名称点击事件 | ||
871 | + $('[data-theirRoom]').unbind("click").on('click', function () { | ||
872 | + var room ={ | ||
873 | + resId: $(this).data("resid"), | ||
874 | + theirRoom: $(this).data("theirroom"), | ||
875 | + theirRoomId: $(this).data("theirroomid"), | ||
876 | + theirCabinet: $(this).data("theircabinet"), | ||
877 | + startU: $(this).data("startu"), | ||
878 | + endU: $(this).data("endu"), | ||
879 | + parentId: $(this).data("parentid"), | ||
880 | + } | ||
881 | + common.openRoom(room); | ||
882 | + }); | ||
870 | 883 | ||
871 | //告警操作日志 | 884 | //告警操作日志 |
872 | $('[data-warn-view]').unbind('click').on('click', function () { | 885 | $('[data-warn-view]').unbind('click').on('click', function () { |
@@ -180,6 +180,11 @@ const routes = [{ | @@ -180,6 +180,11 @@ const routes = [{ | ||
180 | name: 'ajConfigView', | 180 | name: 'ajConfigView', |
181 | component: () => myImport('views/ajConfig/view/index') | 181 | component: () => myImport('views/ajConfig/view/index') |
182 | }, | 182 | }, |
183 | + { | ||
184 | + path: '/machineRoomRes', | ||
185 | + name: 'machineRoomRes', | ||
186 | + component: () => myImport('views/machineRoomRes/index') | ||
187 | + } | ||
183 | ]; | 188 | ]; |
184 | 189 | ||
185 | // hash模式: createWebHashHistory | 190 | // hash模式: createWebHashHistory |
@@ -82,6 +82,7 @@ export default { | @@ -82,6 +82,7 @@ export default { | ||
82 | try { | 82 | try { |
83 | const ele = proxy.$refs[`machineRoom`]; | 83 | const ele = proxy.$refs[`machineRoom`]; |
84 | var info = $(ele.$refs['roomDetail'].$refs['roomTable']); | 84 | var info = $(ele.$refs['roomDetail'].$refs['roomTable']); |
85 | + info.find(`td`).prepend('<i class="el-icon-arrow-down" style="color: #1E9FFF"></i>') | ||
85 | var params = { | 86 | var params = { |
86 | theirRoomId : proxy.commandNameDataItem.machineRoomId | 87 | theirRoomId : proxy.commandNameDataItem.machineRoomId |
87 | } | 88 | } |
1 | +export default { | ||
2 | + name: 'dataCenter', | ||
3 | + template: '', | ||
4 | + components: { | ||
5 | + 'GetMachineRoom': Vue.defineAsyncComponent( | ||
6 | + () => myImport('views/commonComponents/getMachineRoom/index') | ||
7 | + ), | ||
8 | + }, | ||
9 | + data(){ | ||
10 | + return { | ||
11 | + | ||
12 | + } | ||
13 | + }, | ||
14 | + setup(props, {attrs, slots, emit}) { | ||
15 | + const {proxy} = Vue.getCurrentInstance(); | ||
16 | + let roomSecondData=Vue.ref([]); | ||
17 | + let commandNameData=Vue.ref(); | ||
18 | + const getData=(roomRow)=>{ | ||
19 | + proxy.$http.get('/api-web/machineroom/list',{},function (res){ | ||
20 | + if(res && res.data){ | ||
21 | + let roomSecondDataArr=res.data; | ||
22 | + let roomSecondData=[]; | ||
23 | + | ||
24 | + roomSecondDataArr.map((item,index)=>{ | ||
25 | + if(item.parentId!='0' && roomRow.parentId==item.parentId){ | ||
26 | + roomSecondData.push(item) | ||
27 | + } | ||
28 | + }) | ||
29 | + proxy.roomSecondData=roomSecondData; | ||
30 | + | ||
31 | + proxy.commandNameData=proxy.roomSecondData;//机房布局数据 | ||
32 | + | ||
33 | + console.log("下层机房数据",proxy.roomSecondData) | ||
34 | + } | ||
35 | + }) | ||
36 | + } | ||
37 | + // 挂载完 | ||
38 | + Vue.onMounted(() => { | ||
39 | + let params=proxy.$route.query; | ||
40 | + getData(params); | ||
41 | + | ||
42 | + }) | ||
43 | + return{ | ||
44 | + getData, | ||
45 | + roomSecondData, | ||
46 | + commandNameData | ||
47 | + } | ||
48 | + } | ||
49 | +} | ||
50 | + |
-
Please register or login to post a comment