Authored by 张凯

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into joke

Showing 24 changed files with 252 additions and 155 deletions
-- 添加告警临时表的唯一索引 列有资源id、时间
ALTER TABLE `b_alarm_trend_temporary` ADD CONSTRAINT unique_resId_and_createTime UNIQUE(resId,createTime);
-- 删除告警临时表重复数据的
delete from b_alarm_trend_temporary where id not in (select id from (select count(1) as number,id,createTime,resId from b_alarm_trend_temporary group by createTime,resId having number=1) as c);
--查询告警临时表又没重复数据
select count(1) as number,id,createTime,resId from b_alarm_trend_temporary group by createTime,resId having number>1;
\ No newline at end of file
... ...
/**
* @desc 阿里云平台
* @author joke
* @date 2020/4/16 22:11
**/
layui.define(['commonDetail','common'], function (exports) {
var commonDetail = layui.commonDetail;
var common = layui.common;
//对外暴露的接口
exports('ali_cloud_plat', function (data) {
var resId = '';
var showFlag = common.getUrlParam("show");
if(showFlag && showFlag == '0'){
resId = common.getUrlParam("resId");
}else{
resId = data.resId;
}
commonDetail.bindTips();
//基本信息
var jbxxKpi = "KPIE13DD9A3,KPIF74D9D2B,KPI72E7FB4B";
//性能信息
var xnxxKpi = "KPI9E5E1B3E,KPIBFA3F5CD,KPI1584BE1C,KPIC40A80AC,KPI5B7998C9,KPI46BAA9BE";
reload()
//渲染页面
function reload() {
//资源状态
commonDetail.renderResHealth("ali_cloud_plat_state",resId);
//基本信息
commonDetail.renderText("ali_cloud_plat_baseinfo",resId,jbxxKpi);
//性能信息
commonDetail.renderTextCols("ali_cloud_plat_xnxxinfo",resId,xnxxKpi,1);
// CPU分配率
commonDetail.renderGauge("ali_cloud_plat_cpu_rate",resId,"KPIBFA3F5CD");
// 内存分配率
commonDetail.renderGauge("ali_cloud_plat_mem_rate",resId,"KPIC40A80AC");
// 存储分配率
commonDetail.renderGauge("ali_cloud_plat_storage_rate",resId,"KPI46BAA9BE");
// CPU分配率走势(12小时)
commonDetail.renderLineCharat("ali_cloud_plat_cpuset_linechart",resId,"KPIBFA3F5CD","CPU分配率","cpu");
// 内存分配率走势(12小时)
commonDetail.renderLineCharat("ali_cloud_plat_memeryset_linechart",resId,"KPIC40A80AC","内存分配率","mem");
// 存储分配率走势(12小时)
commonDetail.renderLineCharat("ali_cloud_plat_storageset_linechart",resId,"KPI46BAA9BE","存储分配率","storage", null, 'KPI6EB26394');
//活动告警
commonDetail.renderActiveAlarms("ali_cloud_plat_alarms",resId);
}
//定时任务
var timer = setInterval(function () {
reload()
},commonDetail.timerTime);
commonDetail.detailTimer.push(timer);
});
});
\ No newline at end of file
... ...
... ... @@ -459,7 +459,7 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
{field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_130, templet: '#cpuRateTpl', sort: true},
{field: 'memorySize', title: '内存大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.memorySize}} GB</div>'},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_130, templet: '#memoryRateTpl', sort: true},
{field: 'ptName', title: '所属平台', minWidth: x_130, align: 'center', sort: true},
// {field: 'ptName', title: '所属平台', minWidth: x_130, align: 'center', sort: true},
{field: 'resTypeName', title: '资源类型', minWidth: x_110, align: 'center'},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', minWidth: x_130, align: 'center', sort: true},
... ...
... ... @@ -153,8 +153,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
}
var $html = addIconByValue(valueStr);
var resStyle = obj.alarmEleMatchStyle(ar.flag, ar.id);
span += ' <span>' + ar.name + '</span>' +
'<span title="' + titleStr + '" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' + resStyle + '">'
span += ' <span style="text-align:left;width:40%">' + ar.name + '</span>' +
'<span title="' + titleStr + '" style="width:60%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' + resStyle + '">'
+ $html + valueStr +'</span>';
//补充空白区域
if (v.length < cols) {
... ...
<!--阿里云集群-->
<article class="page-container template">
<div class="page-panel">
<div class="main">
<div class="layui-card template_detail_content">
<div class="layui-card-body">
<div class="lay-row">
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">资源状态</h5>
<div class="res-state" id="ali_cloud_plat_state"></div>
</div>
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">基本信息<i data-id="ali_cloud_plat_baseinfo" class="iconfont detail_base_info">&#xe61e;</i></h5>
<ul class="info-table" id="ali_cloud_plat_baseinfo"></ul>
</div>
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">资源使用概况</h5>
<ul class="info-table" id="ali_cloud_plat_xnxxinfo"></ul>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">CPU分配率</h5>
<ul id="ali_cloud_plat_cpu_rate" class="pie-wrap dasboard">
<li data-degree="0" class="pie-half pie-half-border-color-3">
<div class="pie-half-text">
<b>0%</b>
<span></span>
</div>
</li>
</ul>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">内存分配率</h5>
<ul id="ali_cloud_plat_mem_rate" class="pie-wrap dasboard">
<li data-degree="0" class="pie-half pie-half-border-color-3">
<div class="pie-half-text">
<b>0%</b>
<span></span>
</div>
</li>
</ul>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">存储分配率</h5>
<ul id="ali_cloud_plat_storage_rate" class="pie-wrap dasboard">
<li data-degree="0" class="pie-half pie-half-border-color-3">
<div class="pie-half-text">
<b>0%</b>
<span></span>
</div>
</li>
</ul>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">CPU分配率走势(12小时)</h5>
<div id="ali_cloud_plat_cpuset_linechart" class="detail_line_chart"></div>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">内存分配率走势(12小时)</h5>
<div id="ali_cloud_plat_memeryset_linechart" class="detail_line_chart"></div>
</div>
<div class="lay-row-item">
<h5 class="lay-row-title">存储分配率走势(12小时)</h5>
<div id="ali_cloud_plat_storageset_linechart" class="detail_line_chart"></div>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">实时告警动态</h5>
<div id="ali_cloud_plat_alarms"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
<textarea id="ali_cloud_plat_param_id" style="display: none;">{{d}}</textarea>
<script>
layui.use('ali_cloud_plat', function (fn) {
var $ = layui.$;
var parm = $("#ali_cloud_plat_param_id").val();
if(parm.indexOf('{{d') != -1){
fn();
}else{
fn(JSON.parse(parm));
}
});
</script>
\ No newline at end of file
... ...
... ... @@ -63,7 +63,7 @@ export default {
let hideElDialog = () =>{
emit('hidedialog');
emit('hidedialog',false);
}
let okFunc = () =>{
... ...
... ... @@ -17,13 +17,13 @@
{{node.label }}
</div>
<div v-if="isAdmin()" :style="{'width':isAdmin()?'60px':'0px'}">
<a @click="editType(data)" style="margin-right: 10px;">
<a @click="editType(data)" v-if="!data.root" style="margin-right: 10px;">
<i class="el-icon-edit"></i>
</a>
<a @click="showFolder(true,false,node) " style="margin-right: 10px;">
<i class="el-icon-plus"></i>
</a>
<a @click="deleteDocument(data.id,'folder')">
<a @click="deleteDocument(data.id,'folder')" v-if="!data.root">
<i class="el-icon-delete"></i>
</a>
</div>
... ... @@ -164,7 +164,7 @@
</el-col>
</el-row>
<cm-dialog :title="addDialogTitle" width="500px" :showDialogVisible="addDialogVisible" :showFooter="false">
<cm-dialog :title="addDialogTitle" width="500px" :showDialogVisible="addDialogVisible" @hidedialog="showFolder" :showFooter="false">
<template v-slot>
<el-form
label-width="120px"
... ...
... ... @@ -246,11 +246,16 @@ export default {
// // 加载第一个节点数据
// getPage(first.id);
let root = {
id: '0',
name: '文档管理',
root:'root',
children: res.data
}
if(props.isRecycle){
root.name = '文档回收站';
}
defaultExpandedKeys.value = [root.id];
addHistoryNode(root);
... ... @@ -481,12 +486,12 @@ export default {
sort: 100
});
let showFolder = (flg, isUser,node) => {
addDialogVisible.value = flg;
let title="";
if(node){
currentNodeData.value = node.data;
title =`修改树节点“${currentNodeData.value.name}“子文件夹`;
}
docForm.value = {
id:'',
name: '',
... ... @@ -494,10 +499,11 @@ export default {
type: '',
sort: 100
};
if(isUser != undefined){
isUserFolder.value = isUser;
addDialogVisible.value = flg;
}
if (addDialogVisible.value) {
if (addDialogVisible.value != undefined) {
title = `新建自定义文件夹`;
}
addDialogTitle.value = title
... ...
... ... @@ -90,7 +90,7 @@
<dl class="layui-nav-child">
<!--调整到刷新旁边,此处去掉 lu 屏蔽 20211130-->
<!-- <dd layadmin-event="toBigScreen" style="text-align: left;"><a><img src="/src/style/img/icon-daping.png" style="width: 16px;height: 16px">&nbsp;&nbsp;大屏</a></dd>-->
<dd layadmin-event="toDZSWJScreen" style="text-align: left;"><a><img src="/src/style/img/icon-dianzishuiwuju.png" style="width: 16px;height: 16px">&nbsp;&nbsp;电子税务大屏</a></dd>
<dd layadmin-event="toDZSWJScreen" style="text-align: left;"><a><img src="/src/style/img/icon-dianzishuiwuju.png" style="width: 16px;height: 16px">&nbsp;&nbsp;电子税务大屏</a></dd>
<!--调整到首页旁边,此处去掉 joke 屏蔽 20211129-->
<!-- <dd layadmin-event="toYTHViewScreen" style="text-align: left;"><a><img src="/src/style/img/icon-yitihuadaping.png" style="width: 16px;height: 16px">&nbsp;&nbsp;一体化视图</a></dd>-->
<dd layadmin-event="toBiZhEalZhSYS" style="text-align: left;"><a><img src="/src/style/img/icon-YWJKD.png" style="width: 16px;height: 16px">&nbsp;&nbsp;业务健康度</a></dd>
... ...
<div>
<span class="el-dropdown-link" @click="showMachineRoomDialog(true)" >
{{textString}}
{{textString}}1111
</span>
<cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
<cm-dialog title="机房布局" :showFooter="false" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
<template v-slot>
<div style="overflow: auto">
<GetMachineRoom v-if="commandNameData" :commandNameData="commandNameData"></GetMachineRoom>
</div>
</template>
</cm-dialog>
... ...
<div>
<span class="el-dropdown-link" @click="showMachineRoomDialog(true)" >
{{textString}}
{{textString}}2222
</span>
<cm-dialog title="收藏" width="500px" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
<cm-dialog title="机柜" :showFooter="false" :showDialogVisible="dialogFlg" @hidedialog="showMachineRoomDialog">
<template v-slot>
<GetMachineRoom v-if="commandNameData" :commandNameData="commandNameData"></GetMachineRoom>
<machineRoomDetail v-if="isDetailShow" :detailData="detailData" :machineData="machineData"></machineRoomDetail>
</template>
</cm-dialog>
... ...
... ... @@ -2,8 +2,8 @@ export default {
name: 'machineRoomDetailComponents',
template: '',
components: {
'GetMachineRoom': Vue.defineAsyncComponent(
() => myImport('views/commonComponents/getMachineRoom/index')
'machineRoomDetail': Vue.defineAsyncComponent(
() => myImport('views/commonComponents/machineRoomDetail/index')
),
},
props: {
... ...
<div class="machine-room">
<div class="room-top">
<el-tabs type="card" @tab-click="handleCommand" v-model="commandVal">
<el-tab-pane v-for="item in commandNameData" :label="item.name" :name="item.val"></el-tab-pane>
<el-tab-pane v-for="item in commandNameData" :label="item.machineRoomName" :name="item.machineRoomCode"></el-tab-pane>
</el-tabs>
<!--<el-dropdown @command="handleCommand" class="elSelf" :popper-append-to-body="false">
<span class="el-dropdown-link">
{{commandName}}
<i class="icon-arrow"></i>
</span>
<template #dropdown>
<el-dropdown-menu class="cpuDropdown">
<el-dropdown-item v-for="item in commandNameData" :command="item.val">{{item.name}}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>-->
</div>
<div class="room-html">
<el-row>
<el-col class="video-item" :span="24" >
<MachineRoom v-if="src" :src="src" ref="machineRoom" ></MachineRoom>
<MachineRoom v-if="src" :src="src" :commandNameDataItem="commandNameDataItem" ref="machineRoom" ></MachineRoom>
</el-col>
</el-row>
</div>
... ...
... ... @@ -22,7 +22,7 @@ export default {
return {
domainName:sessionStorage.getItem('domainName'),
accessToken:localStorage.getItem('access_token'),
commandName:'',//下拉选择默认显示名称
// commandName:'',//下拉选择默认显示名称
htmlName:'',//机房组件名称-html名称
commandVal:'',//下拉选择选中值
src:'',//机房布局html地址
... ... @@ -34,30 +34,34 @@ export default {
const {proxy} = Vue.getCurrentInstance();
proxy.htmlName=Vue.ref();
proxy.commandVal=Vue.ref()
proxy.commandName=Vue.ref();
// proxy.commandName=Vue.ref();
proxy.src=Vue.ref();
const commandNameDataItem=Vue.ref();
const allComponents=Vue.ref();
// 获取状态
const { changeIndex} = indirectManage()
// 挂载完
Vue.onMounted(() => {
proxy.commandVal='one';
proxy.commandVal=props.commandNameData[0].machineRoomCode;
proxy.getMachine(proxy.commandVal);
})
//初始获取默认机房选择信息
const getMachine=(command)=>{
//commandNameData机房机柜数据
let allComponent=[];
props.commandNameData.map((item,index)=>{
if(command==item.val){
proxy.htmlName=item.htmlName;
proxy.commandName=item.name;
proxy.commandVal=item.val;
if(command==item.machineRoomCode){
// proxy.htmlName=item.htmlName;
// proxy.commandName=item.name;
proxy.commandVal=item.machineRoomCode;
proxy.commandNameDataItem=item;
}
})
// proxy.src='/h5/machineroom/'+proxy.htmlName+'.html?access_token='+proxy.accessToken+'&changeIndex='+proxy.changeIndex
//根据htmlName确定引入的机房
proxy.src=proxy.htmlName
proxy.src=proxy.commandVal
}
const handleCommand=(command,event)=>{
... ... @@ -70,7 +74,9 @@ export default {
return{
getMachine,
handleCommand
handleCommand,
commandNameDataItem,
allComponents
}
}
}
\ No newline at end of file
... ...
<!--<iframe v-if="src" style="width:90%;height:720px;" :src="src" frameborder="0" ref="machineIframe" ></iframe>-->
<HuzhouOne v-if="showNum==1" :src="machineData"></HuzhouOne>
<HuzhouTwo v-if="showNum==2" :src="machineData"></HuzhouTwo>
<HuzhouThree v-if="showNum==3" :src="machineData"></HuzhouThree>
<Xiaoshansecond v-if="showNum==4" :src="machineData"></Xiaoshansecond>
<Xiaoshanthird v-if="showNum==5" :src="machineData"></Xiaoshanthird>
<Xiaoshanseven v-if="showNum==6" :src="machineData"></Xiaoshanseven>
<component :is="srcName" :src="machineData" />
\ No newline at end of file
... ...
... ... @@ -19,23 +19,16 @@ export default {
),
'Xiaoshanseven': Vue.defineAsyncComponent(
() => myImport('views/commonComponents/xiaoshanseven/index')
),
)
},
props:['src'],
props:['src','commandNameDataItem'],
data(){
return {
domainName:sessionStorage.getItem('domainName'),
accessToken:localStorage.getItem('access_token'),
isDetailShow:false,//详情页
// changeIndexNav:this.changeIndex,//nav是否点击变化
htmmlNameData:[
{name:'huzhouzaibeione',val:'湖州灾备机房一'},
{name:'huzhouzaibeitwo',val:'湖州灾备机房二'},
{name:'huzhouzaibeithree',val:'湖州灾备机房三'},
{name:'xiaoshansecond',val:'萧山IDC二号机房'},
{name:'xiaoshanthird',val:'萧山IDC三号机房'},
{name:'xiaoshanseven',val:'萧山IDC七号机房'},
],
srcName:this.src,
machineData:'',//机房信息数据
// src:'/h5/machineroom/huzhouzaibeione.html?access_token='+this.accessToken
... ... @@ -54,27 +47,24 @@ export default {
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
const showNum=Vue.ref()
const componentName=Vue.ref();
// 挂载完
Vue.onMounted(() => {
proxy.getName();
})
const getName=()=>{
proxy.htmmlNameData.map((item,index)=>{
if(proxy.srcName==item.name){
proxy.showNum=index+1;
proxy.machineData=item;
}
})
console.log("src",proxy.src,proxy.showNum)
console.log("accept",proxy.srcName, props.commandNameDataItem)
proxy.machineData= props.commandNameDataItem;
}
return{
// src:'/h5/machineroom/'+props.htmlName+'.html?access_token='+proxy.accessToken
getName,
showNum
showNum,
componentName
}
}
... ...
... ... @@ -12,7 +12,7 @@
<div class='img-serve' >
<img src="/vue3/src/assets/images/machineRoom/icon-state.png" alt="" class='state'>
<div class='img-serve-text'>{{item.provider}}</div>
<div class='img-serve-text'>{{item.resName}}</div>
<div class='lamp'>
<img src="/vue3/src/assets/images/machineRoom/icon-weblogical.png" alt="" class='img-weblog'>
<div class='img-lamp'>
... ... @@ -35,7 +35,7 @@
<div class='info-contain'>
<div class='info-text'>机柜信息</div>
<div class='info-text-bot'>
<p>机 房:{{machineData.val}}</p>
<p>机 房:{{machineData.machineRoomName}}</p>
<p>机柜编号:{{detailData.name}}</p>
<p>机柜容量:{{infoData.cabinetCapacity}}</p>
<p>设备数量:{{infoData.deviceNum}}台</p>
... ...
... ... @@ -14,7 +14,8 @@ export default {
isCenter:false,//是否居中--true代表湖州机房,false代表萧山机房
serviceData:[],//机柜的服务器数据
deviceDataInfo:'',//设备详细信息
deviceDatas: [
deviceDatas:[],
/* deviceDatas: [
{
name:'E12',//机柜名称
... ... @@ -158,7 +159,7 @@ export default {
deviceNum:'1',
cabinetCapacity :'42U',
},
],//服务器设备信息
],//服务器设备信息*/
infoData:'',//设备详细信息
// isShowDevice:false,//是否显示设备信息
... ... @@ -173,26 +174,17 @@ export default {
// 挂载完
Vue.onMounted(() => {
if(props.machineData.name.indexOf('huzhou')!=-1){
proxy.isCenter=true;
proxy.theirRoom='湖州灾备';
}else{
proxy.isCenter=false;
proxy.theirRoom='兴议机房';
console.log('&&&',proxy.machineData)
}
proxy.getData();
// proxy.getDeviceInfo();
})
const getData=()=>{
let parmas={
theirRoom:proxy.theirRoom,
theirRoomId:props.machineData.machineRoomId,
theirCabinet:CabinetNum
}
$.get(proxy.domainName+'/api-web/v32/res/cabinet?access_token='+proxy.accessToken,parmas,function (res){
console.log("res1",res)
if(res){
let resData=res.data;
let deviceDatas=[];
... ... @@ -204,7 +196,6 @@ export default {
deviceData:resData
})
proxy.deviceDatas=deviceDatas;
console.log("devdats",proxy.deviceDatas)
proxy.getDeviceInfo()
}
... ... @@ -232,7 +223,7 @@ export default {
itemD.serviceClass='img-serve-'+serveNum;//设备的css的class
itemD.uClass='';
if(leftStr>1){
let bottom=(leftStr-1)*17;
let bottom=(leftStr-1)*16;
itemD.uClass='bottom:'+bottom+'px';
}
... ...
... ... @@ -50,8 +50,8 @@
<div class="grid-content bg-purple-light com-box">
<span>
<img :style="comboximgStyle" src="./src/assets/images/digitalDp/bit_box_2.png">
<span class="com-box-value" :style="combitnumberStyle" style="left: 31%;color: #FEFEFE;" v-if="tenThousandBitFalg > 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 31%;color: #97969B;" v-if="tenThousandBitFalg == 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 32%;color: #FEFEFE;" v-if="tenThousandBitFalg > 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 32%;color: #97969B;" v-if="tenThousandBitFalg == 0">{{tenThousandBit}}</span>
</span>
</div>
</el-col>
... ...
... ... @@ -50,8 +50,8 @@
<div class="grid-content bg-purple-light com-box">
<span>
<img :style="comboximgStyle" src="./src/assets/images/digitalDp/bit_box_2.png">
<span class="com-box-value" :style="combitnumberStyle" style="left: 31%;color: #FEFEFE;" v-if="tenThousandBitFalg > 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 31%;color: #97969B;" v-if="tenThousandBitFalg == 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 32%;color: #FEFEFE;" v-if="tenThousandBitFalg > 0">{{tenThousandBit}}</span>
<span class="com-box-value" :style="combitnumberStyle" style="left: 32%;color: #97969B;" v-if="tenThousandBitFalg == 0">{{tenThousandBit}}</span>
</span>
</div>
</el-col>
... ...
... ... @@ -43,7 +43,7 @@ export default {
{value:v.value,date:v.date}
)
legendData.push(
{value:i+1,date:v.date}
{value:v.number,date:v.date}
)
})
proxy.legendData=legendData
... ... @@ -82,7 +82,7 @@ export default {
},
xAxis: {
type: 'category',
data: proxy.legendData,
data: proxy.legendData.reverse(),
axisLine:{
show:true,//是否显示坐标线
lineStyle: {
... ...
... ... @@ -14,46 +14,6 @@ export default {
jfdata:'',
dialogMachineName:'',
commandNameData:'',
commandNameDataH:[
{
name:'湖州灾备机房一',
htmlName:'huzhouzaibeione',
val:'one'
},
{
name:'湖州灾备机房二',
htmlName:'huzhouzaibeitwo',
val:'two'
},
{
name:'湖州灾备机房三',
htmlName:'huzhouzaibeithree',
val:'three'
}
],//机房布局html数据
commandNameDataX:[
{
name:'萧山IDC二号机房',
htmlName:'xiaoshansecond',
val:'one'
},
{
name:'萧山IDC三号机房',
htmlName:'xiaoshanthird',
val:'two'
},
{
name:'萧山IDC七号机房',
htmlName:'xiaoshanseven',
val:'three'
}
// {
// name:'兴议二号机房',
// htmlName:'xiaoshansecond',
// val:'one'
// }
],
commandName:'',//下拉选择默认显示名称
htmlName:'',//机房组件名称-html名称
commandVal:'',//下拉选择选中值
src:'',//机房布局html地址
... ... @@ -63,7 +23,6 @@ export default {
const {proxy} = Vue.getCurrentInstance();
proxy.htmlName=Vue.ref();
proxy.commandVal=Vue.ref()
proxy.commandName=Vue.ref();
proxy.src=Vue.ref();
// 挂载完
... ... @@ -71,22 +30,7 @@ export default {
$.get(proxy.domainName +proxy.apiUrl+'?access_token='+localStorage.getItem('access_token'),function (res) {
if(res.data){
proxy.jfdata=res.data;
/* const html = $("#sjzx_machineroom_id_Tmpl").render(res.data);
$("#sjzx_machineroom_id").html(html);
//机房点击事件
$(".sjzx_machineroom").on("click",function () {
const name = $(this).attr("name");
layer.open({
type:2
, shade: 0.6 //遮罩透明度
, maxmin: false //允许全屏最小化
, anim: 1 //0-6的动画形式,-1不开启
, content:['http://127.0.0.1:8081/video.html?type='+name+'','no']
, area:["1100px",'720px']
// , title: true //不显示标题栏
// , title: name
})
});*/
}
})
... ... @@ -98,12 +42,7 @@ export default {
const isShowOuter=(item)=>{
proxy.dialogMachineName=item.machineRoomName;
proxy.outerVisible = true;
if(item.layout == 0){
proxy.commandNameData=proxy.commandNameDataH;//湖州机房布局数据
}else{
proxy.commandNameData=proxy.commandNameDataX;//兴议机房布局数据
}
proxy.getData(item);
}
//关闭弹框时清空数据
const closeDialog=()=>{
... ... @@ -111,13 +50,38 @@ export default {
}
/*获取机房数据
* */
let roomSecondData=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.machineRoomId==item.parentId){
roomSecondData.push(item)
}
})
proxy.roomSecondData=roomSecondData;
proxy.commandNameData=proxy.roomSecondData;//机房布局数据
console.log("下层机房数据",proxy.roomSecondData)
}
})
}
return{
centerDialogVisible: Vue.ref(false),
outerVisible: Vue.ref(false),
innerVisible: Vue.ref(false),
isShowOuter,
isShow,
closeDialog
closeDialog,
roomSecondData,
getData
}
}
}
... ...