Authored by 鲁尚清

机柜详情页面接口联调,所有机柜可点击进入详情

@@ -1494,13 +1494,13 @@ export default { @@ -1494,13 +1494,13 @@ export default {
1494 Vue.onMounted(() => { 1494 Vue.onMounted(() => {
1495 }) 1495 })
1496 const goDetail=(item)=>{ 1496 const goDetail=(item)=>{
1497 - proxy.allowClickData.map((itemName,index)=>{  
1498 - if(item.name==itemName){ 1497 + // proxy.allowClickData.map((itemName,index)=>{
  1498 + // if(item.name==itemName){
1499 proxy.isDetailShow=true; 1499 proxy.isDetailShow=true;
1500 console.log("detail",item) 1500 console.log("detail",item)
1501 proxy.detailData=item; 1501 proxy.detailData=item;
1502 - }  
1503 - }) 1502 + // }
  1503 + // })
1504 1504
1505 } 1505 }
1506 1506
@@ -263,12 +263,12 @@ export default { @@ -263,12 +263,12 @@ export default {
263 263
264 }) 264 })
265 const goDetail=(item)=>{ 265 const goDetail=(item)=>{
266 - proxy.allowClickData.map((itemName,index)=>{  
267 - if(item.name==itemName){ 266 + // proxy.allowClickData.map((itemName,index)=>{
  267 + // if(item.name==itemName){
268 proxy.isDetailShow=true; 268 proxy.isDetailShow=true;
269 proxy.detailData=item; 269 proxy.detailData=item;
270 - }  
271 - }) 270 + // }
  271 + // })
272 } 272 }
273 273
274 return{ 274 return{
@@ -313,12 +313,12 @@ export default { @@ -313,12 +313,12 @@ export default {
313 313
314 }) 314 })
315 const goDetail=(item)=>{ 315 const goDetail=(item)=>{
316 - proxy.allowClickData.map((itemName,index)=>{  
317 - if(item.name==itemName){ 316 + // proxy.allowClickData.map((itemName,index)=>{
  317 + // if(item.name==itemName){
318 proxy.isDetailShow=true; 318 proxy.isDetailShow=true;
319 proxy.detailData=item; 319 proxy.detailData=item;
320 - }  
321 - }) 320 + // }
  321 + // })
322 } 322 }
323 323
324 return{ 324 return{
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <div class='img-serve' > 12 <div class='img-serve' >
13 13
14 <img src="/vue3/src/assets/images/machineRoom/icon-state.png" alt="" class='state'> 14 <img src="/vue3/src/assets/images/machineRoom/icon-state.png" alt="" class='state'>
15 - <div class='img-serve-text'>{{item.name}}</div> 15 + <div class='img-serve-text'>{{item.provider}}</div>
16 <div class='lamp'> 16 <div class='lamp'>
17 <img src="/vue3/src/assets/images/machineRoom/icon-weblogical.png" alt="" class='img-weblog'> 17 <img src="/vue3/src/assets/images/machineRoom/icon-weblogical.png" alt="" class='img-weblog'>
18 <div class='img-lamp'> 18 <div class='img-lamp'>
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 <p>品 牌:{{deviceDataInfo.brandName}}</p> 54 <p>品 牌:{{deviceDataInfo.brandName}}</p>
55 <p>型 号:{{deviceDataInfo.model}}</p> 55 <p>型 号:{{deviceDataInfo.model}}</p>
56 <p>序 列 号:{{deviceDataInfo.serialNumber}}</p> 56 <p>序 列 号:{{deviceDataInfo.serialNumber}}</p>
57 - <p>业 务 IP:{{deviceDataInfo.ServiceIP}}</p> 57 + <p>业 务 IP:{{deviceDataInfo.ip}}</p>
58 <p>用 途:{{deviceDataInfo.purpose}}</p> 58 <p>用 途:{{deviceDataInfo.purpose}}</p>
59 </div> 59 </div>
60 </div> 60 </div>
@@ -16,23 +16,23 @@ export default { @@ -16,23 +16,23 @@ export default {
16 deviceDataInfo:'',//设备详细信息 16 deviceDataInfo:'',//设备详细信息
17 deviceDatas: [ 17 deviceDatas: [
18 { 18 {
19 - name:'E12', 19 + name:'E12',//机柜名称
20 20
21 - cabinetCapacity :'42U',  
22 - deviceData:[ 21 + cabinetCapacity :'42U',//机柜总U位数-目前都是42U
  22 + deviceData:[//机柜所有的服务器
23 { 23 {
24 - name:'物理服务器',  
25 - resName:'管理决策二包(数据集市39)',  
26 - brandName:'浪潮',  
27 - model:'TS860',  
28 - serialNumber:'216365930',  
29 - ServiceIP:'80.12.73.39',  
30 - purpose:'管理决策二包使用',  
31 - uPosition:'1-8U', 24 + name:'物理服务器',//服务器名称
  25 + resName:'管理决策二包(数据集市39)',//服务器资源名称
  26 + brandName:'浪潮',//品牌
  27 + model:'TS860',//型号
  28 + serialNumber:'216365930',//序列号
  29 + ServiceIP:'80.12.73.39',//业务ip
  30 + purpose:'管理决策二包使用',//用途
  31 + uPosition:'1-8U',//U位
32 } 32 }
33 ], 33 ],
34 - deviceNum:'1',  
35 - alarmNum:'0' 34 + deviceNum:'1',//设备数量
  35 + alarmNum:'0'//警告量
36 }, 36 },
37 { 37 {
38 name:'E13', 38 name:'E13',
@@ -168,29 +168,59 @@ export default { @@ -168,29 +168,59 @@ export default {
168 setup(props, {attrs, slots, emit}) { 168 setup(props, {attrs, slots, emit}) {
169 const {proxy} = Vue.getCurrentInstance(); 169 const {proxy} = Vue.getCurrentInstance();
170 const isShowDevice=Vue.ref(false); 170 const isShowDevice=Vue.ref(false);
171 - 171 + const theirRoom=Vue.ref('');//机房名称
172 const CabinetNum=props.detailData.name;//机柜编号 172 const CabinetNum=props.detailData.name;//机柜编号
173 173
174 // 挂载完 174 // 挂载完
175 Vue.onMounted(() => { 175 Vue.onMounted(() => {
176 if(props.machineData.name.indexOf('huzhou')!=-1){ 176 if(props.machineData.name.indexOf('huzhou')!=-1){
177 proxy.isCenter=true; 177 proxy.isCenter=true;
  178 + proxy.theirRoom='湖州灾备';
178 }else{ 179 }else{
179 proxy.isCenter=false; 180 proxy.isCenter=false;
  181 + proxy.theirRoom='兴议机房';
  182 +
180 } 183 }
181 - proxy.getDeviceInfo(); 184 + proxy.getData();
  185 + // proxy.getDeviceInfo();
182 186
183 }) 187 })
  188 + const getData=()=>{
  189 + let parmas={
  190 + theirRoom:proxy.theirRoom,
  191 + theirCabinet:CabinetNum
  192 + }
  193 + $.get(proxy.domainName+'/api-web/v32/res/cabinet?access_token='+proxy.accessToken,parmas,function (res){
  194 +
  195 + console.log("res1",res)
  196 + if(res){
  197 + let resData=res.data;
  198 + let deviceDatas=[];
  199 + deviceDatas.push({
  200 + name:CabinetNum,//机柜名称
  201 + cabinetCapacity :'42U',//机柜总U位数-目前都是42U
  202 + deviceNum:resData.length,//设备数量
  203 + alarmNum:'0',//警告量
  204 + deviceData:resData
  205 + })
  206 + proxy.deviceDatas=deviceDatas;
  207 + console.log("devdats",proxy.deviceDatas)
  208 + proxy.getDeviceInfo()
  209 +
  210 + }
  211 + })
  212 + }
  213 +
184 const getDeviceInfo=()=>{ 214 const getDeviceInfo=()=>{
185 proxy.deviceDatas.map((item,index)=>{ 215 proxy.deviceDatas.map((item,index)=>{
186 if(CabinetNum==item.name){ 216 if(CabinetNum==item.name){
187 proxy.infoData=item; 217 proxy.infoData=item;
188 proxy.serviceData=item.deviceData 218 proxy.serviceData=item.deviceData
189 item.deviceData.map((itemD,indexD)=>{ 219 item.deviceData.map((itemD,indexD)=>{
190 - let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U  
191 - let leftStrArr=strArr[0].split('-');//[0]1 [1]4  
192 - let leftStr=leftStrArr[0];  
193 - let rightStr=leftStrArr[1]; 220 + // let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U
  221 + // let leftStrArr=strArr[0].split('-');//[0]1 [1]4
  222 + let leftStr=itemD.startU;//leftStrArr[0];
  223 + let rightStr=itemD.endU;//leftStrArr[1];
194 itemD.serviceHeight=rightStr;//nU的设备 224 itemD.serviceHeight=rightStr;//nU的设备
195 let serveNum=1; 225 let serveNum=1;
196 if(leftStr==1){ 226 if(leftStr==1){
@@ -219,7 +249,9 @@ export default { @@ -219,7 +249,9 @@ export default {
219 return{ 249 return{
220 showDevice, 250 showDevice,
221 isShowDevice, 251 isShowDevice,
222 - getDeviceInfo 252 + getDeviceInfo,
  253 + getData,
  254 + theirRoom
223 } 255 }
224 } 256 }
225 } 257 }
@@ -26,7 +26,7 @@ export default { @@ -26,7 +26,7 @@ export default {
26 detailData:'',//详情数据 26 detailData:'',//详情数据
27 htmlName:'xiaoshansecond', 27 htmlName:'xiaoshansecond',
28 machineData:this.src, 28 machineData:this.src,
29 - allowClickData:['E12','E13'],//允许进入详情的机柜 29 + allowClickData:['E12','E13','F14'],//允许进入详情的机柜
30 tableData:[ 30 tableData:[
31 [ 31 [
32 32
@@ -477,12 +477,12 @@ export default { @@ -477,12 +477,12 @@ export default {
477 477
478 }) 478 })
479 const goDetail=(item)=>{ 479 const goDetail=(item)=>{
480 - proxy.allowClickData.map((itemName,index)=>{  
481 - if(item.name==itemName){ 480 + // proxy.allowClickData.map((itemName,index)=>{
  481 + // if(item.name==itemName){
482 proxy.isDetailShow=true; 482 proxy.isDetailShow=true;
483 proxy.detailData=item; 483 proxy.detailData=item;
484 - }  
485 - }) 484 + // }
  485 + // })
486 } 486 }
487 487
488 return{ 488 return{
@@ -1082,12 +1082,12 @@ export default { @@ -1082,12 +1082,12 @@ export default {
1082 1082
1083 }) 1083 })
1084 const goDetail=(item)=>{ 1084 const goDetail=(item)=>{
1085 - proxy.allowClickData.map((itemName,index)=>{  
1086 - if(item.name==itemName){ 1085 + // proxy.allowClickData.map((itemName,index)=>{
  1086 + // if(item.name==itemName){
1087 proxy.isDetailShow=true; 1087 proxy.isDetailShow=true;
1088 proxy.detailData=item; 1088 proxy.detailData=item;
1089 - }  
1090 - }) 1089 + // }
  1090 + // })
1091 } 1091 }
1092 1092
1093 return{ 1093 return{
@@ -621,12 +621,12 @@ export default { @@ -621,12 +621,12 @@ export default {
621 621
622 }) 622 })
623 const goDetail=(item)=>{ 623 const goDetail=(item)=>{
624 - proxy.allowClickData.map((itemName,index)=>{  
625 - if(item.name==itemName){ 624 + // proxy.allowClickData.map((itemName,index)=>{
  625 + // if(item.name==itemName){
626 proxy.isDetailShow=true; 626 proxy.isDetailShow=true;
627 proxy.detailData=item; 627 proxy.detailData=item;
628 - }  
629 - }) 628 + // }
  629 + // })
630 } 630 }
631 631
632 return{ 632 return{