...
|
...
|
@@ -16,23 +16,23 @@ export default { |
|
|
deviceDataInfo:'',//设备详细信息
|
|
|
deviceDatas: [
|
|
|
{
|
|
|
name:'E12',
|
|
|
name:'E12',//机柜名称
|
|
|
|
|
|
cabinetCapacity :'42U',
|
|
|
deviceData:[
|
|
|
cabinetCapacity :'42U',//机柜总U位数-目前都是42U
|
|
|
deviceData:[//机柜所有的服务器
|
|
|
{
|
|
|
name:'物理服务器',
|
|
|
resName:'管理决策二包(数据集市39)',
|
|
|
brandName:'浪潮',
|
|
|
model:'TS860',
|
|
|
serialNumber:'216365930',
|
|
|
ServiceIP:'80.12.73.39',
|
|
|
purpose:'管理决策二包使用',
|
|
|
uPosition:'1-8U',
|
|
|
name:'物理服务器',//服务器名称
|
|
|
resName:'管理决策二包(数据集市39)',//服务器资源名称
|
|
|
brandName:'浪潮',//品牌
|
|
|
model:'TS860',//型号
|
|
|
serialNumber:'216365930',//序列号
|
|
|
ServiceIP:'80.12.73.39',//业务ip
|
|
|
purpose:'管理决策二包使用',//用途
|
|
|
uPosition:'1-8U',//U位
|
|
|
}
|
|
|
],
|
|
|
deviceNum:'1',
|
|
|
alarmNum:'0'
|
|
|
deviceNum:'1',//设备数量
|
|
|
alarmNum:'0'//警告量
|
|
|
},
|
|
|
{
|
|
|
name:'E13',
|
...
|
...
|
@@ -168,29 +168,59 @@ export default { |
|
|
setup(props, {attrs, slots, emit}) {
|
|
|
const {proxy} = Vue.getCurrentInstance();
|
|
|
const isShowDevice=Vue.ref(false);
|
|
|
|
|
|
const theirRoom=Vue.ref('');//机房名称
|
|
|
const CabinetNum=props.detailData.name;//机柜编号
|
|
|
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
if(props.machineData.name.indexOf('huzhou')!=-1){
|
|
|
proxy.isCenter=true;
|
|
|
proxy.theirRoom='湖州灾备';
|
|
|
}else{
|
|
|
proxy.isCenter=false;
|
|
|
proxy.theirRoom='兴议机房';
|
|
|
|
|
|
}
|
|
|
proxy.getDeviceInfo();
|
|
|
proxy.getData();
|
|
|
// proxy.getDeviceInfo();
|
|
|
|
|
|
})
|
|
|
const getData=()=>{
|
|
|
let parmas={
|
|
|
theirRoom:proxy.theirRoom,
|
|
|
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=[];
|
|
|
deviceDatas.push({
|
|
|
name:CabinetNum,//机柜名称
|
|
|
cabinetCapacity :'42U',//机柜总U位数-目前都是42U
|
|
|
deviceNum:resData.length,//设备数量
|
|
|
alarmNum:'0',//警告量
|
|
|
deviceData:resData
|
|
|
})
|
|
|
proxy.deviceDatas=deviceDatas;
|
|
|
console.log("devdats",proxy.deviceDatas)
|
|
|
proxy.getDeviceInfo()
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const getDeviceInfo=()=>{
|
|
|
proxy.deviceDatas.map((item,index)=>{
|
|
|
if(CabinetNum==item.name){
|
|
|
proxy.infoData=item;
|
|
|
proxy.serviceData=item.deviceData
|
|
|
item.deviceData.map((itemD,indexD)=>{
|
|
|
let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U
|
|
|
let leftStrArr=strArr[0].split('-');//[0]1 [1]4
|
|
|
let leftStr=leftStrArr[0];
|
|
|
let rightStr=leftStrArr[1];
|
|
|
// let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U
|
|
|
// let leftStrArr=strArr[0].split('-');//[0]1 [1]4
|
|
|
let leftStr=itemD.startU;//leftStrArr[0];
|
|
|
let rightStr=itemD.endU;//leftStrArr[1];
|
|
|
itemD.serviceHeight=rightStr;//nU的设备
|
|
|
let serveNum=1;
|
|
|
if(leftStr==1){
|
...
|
...
|
@@ -219,7 +249,9 @@ export default { |
|
|
return{
|
|
|
showDevice,
|
|
|
isShowDevice,
|
|
|
getDeviceInfo
|
|
|
getDeviceInfo,
|
|
|
getData,
|
|
|
theirRoom
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|