Authored by 王涛

Merge branch 'master-v32-xwx' into 'master'

[909] 活动告警显示硬件设备告警信息



See merge request !554
... ... @@ -846,6 +846,28 @@ layui.define(['xmSelect', 'md5'], function (exports) {
});
});
},
//打开机房机柜页面
openRoom:function (room){
let urlParams='';
for(let key in room){
if(room[key]){
urlParams+=key+'='+room[key]+'&'
}
}
urlParams=urlParams.substr(0,urlParams.length-1)
layer.open({
title: '机房信息',
type: 2,
area: ['80%', '90%'],
shadeClose: true,//开启遮罩层
id: 'roomRes_div',
// content: laytpl(res.body).render(JSON.stringify(params)),
content: ['/vue3/index.html#/machineRoomRes?'+urlParams, 'no'],
cancel: function () {
clearTimeout(obj.lineTimer);
}
});
},
//打开性能柱状图
openBarChart: function (title, params) {
if (!title) {
... ...
... ... @@ -867,6 +867,19 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
};
common.openLineChart(name, params);
});
//指标名称点击事件
$('[data-theirRoom]').unbind("click").on('click', function () {
var room ={
resId: $(this).data("resid"),
theirRoom: $(this).data("theirroom"),
theirRoomId: $(this).data("theirroomid"),
theirCabinet: $(this).data("theircabinet"),
startU: $(this).data("startu"),
endU: $(this).data("endu"),
parentId: $(this).data("parentid"),
}
common.openRoom(room);
});
//告警操作日志
$('[data-warn-view]').unbind('click').on('click', function () {
... ...
... ... @@ -180,6 +180,11 @@ const routes = [{
name: 'ajConfigView',
component: () => myImport('views/ajConfig/view/index')
},
{
path: '/machineRoomRes',
name: 'machineRoomRes',
component: () => myImport('views/machineRoomRes/index')
}
];
// hash模式: createWebHashHistory
... ...
... ... @@ -82,6 +82,7 @@ export default {
try {
const ele = proxy.$refs[`machineRoom`];
var info = $(ele.$refs['roomDetail'].$refs['roomTable']);
info.find(`td`).prepend('<i class="el-icon-arrow-down" style="color: #1E9FFF"></i>')
var params = {
theirRoomId : proxy.commandNameDataItem.machineRoomId
}
... ...
<!--机房布局-->
<div style="margin-left: 15px;margin-top: 6px; ">
<GetMachineRoom v-if="commandNameData" :commandNameData="commandNameData"></GetMachineRoom>
</div>
... ...
export default {
name: 'dataCenter',
template: '',
components: {
'GetMachineRoom': Vue.defineAsyncComponent(
() => myImport('views/commonComponents/getMachineRoom/index')
),
},
data(){
return {
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let roomSecondData=Vue.ref([]);
let commandNameData=Vue.ref();
const getData=(roomRow)=>{
proxy.$http.get('/api-web/machineroom/list',{},function (res){
if(res && res.data){
let roomSecondDataArr=res.data;
let roomSecondData=[];
roomSecondDataArr.map((item,index)=>{
if(item.parentId!='0' && roomRow.parentId==item.parentId){
roomSecondData.push(item)
}
})
proxy.roomSecondData=roomSecondData;
proxy.commandNameData=proxy.roomSecondData;//机房布局数据
console.log("下层机房数据",proxy.roomSecondData)
}
})
}
// 挂载完
Vue.onMounted(() => {
let params=proxy.$route.query;
getData(params);
})
return{
getData,
roomSecondData,
commandNameData
}
}
}
... ...