dedsudiyu 2 年之前
父節點
當前提交
53e4600247

+ 8 - 0
src/api/evacuation3_2/index.js

@@ -111,3 +111,11 @@ export function subjectList(data) {
     data: data
   })
 }
+//根据名称查询实验室
+export function lineVertex(data) {
+  return request({
+    url: '/laboratory/lineVertex',
+    method: 'post',
+    data: data
+  })
+}

二進制
src/assets/ZDimages/evacuation3_2/icon_aqtd_m.png


+ 68 - 54
src/utils/evacuationLayout.js

@@ -73,8 +73,8 @@ let maxHeight = null
 let minWidth = null
 let maxWidth = null
 //门尺寸数据
-let minDoorNum = null
-let maxDoorNum = null
+let doorHeight = null
+let doorWidth = null
 //灯尺寸数据
 let minLightNum = null
 let maxLightNum = null
@@ -92,8 +92,8 @@ export function setJsData(data) {
   maxHeight = data.maxHeight
   minWidth = data.minWidth
   maxWidth = data.maxWidth
-  minDoorNum = data.minDoorNum
-  maxDoorNum = data.maxDoorNum
+  doorWidth = data.doorWidth
+  doorHeight = data.doorHeight
   minLightNum = data.minLightNum
   maxLightNum = data.maxLightNum
   tentaclesLength = data.tentaclesLength
@@ -112,6 +112,7 @@ export function setJsData(data) {
 export function addDoorPoint(newMapList) {
   let labNum = 0;
   let escapeNum = 0;
+  let lightNum = 0;
   for (let i = 0; i < newMapList.length; i++) {
     if (newMapList[i].type == 1 || newMapList[i].type == 3) {
       if(newMapList[i].type == 1){
@@ -125,17 +126,17 @@ export function addDoorPoint(newMapList) {
       let x = 0
       let y = 0
       if (newMapList[i].doorList[0].toward == 'top') {
-        x = newMapList[i].x + newMapList[i].doorList[0].x + (maxDoorNum / 2)
+        x = newMapList[i].x + newMapList[i].doorList[0].x + (doorWidth / 2)
         y = newMapList[i].y - tentaclesLength
       } else if (newMapList[i].doorList[0].toward == 'bottom') {
-        x = newMapList[i].x + newMapList[i].doorList[0].x + (maxDoorNum / 2)
+        x = newMapList[i].x + newMapList[i].doorList[0].x + (doorWidth / 2)
         y = newMapList[i].y + newMapList[i].h + tentaclesLength
       } else if (newMapList[i].doorList[0].toward == 'left') {
         x = newMapList[i].x - tentaclesLength
-        y = newMapList[i].y + newMapList[i].doorList[0].y + (maxDoorNum / 2)
+        y = newMapList[i].y + newMapList[i].doorList[0].y + (doorHeight / 2)
       } else if (newMapList[i].doorList[0].toward == 'right') {
         x = newMapList[i].x + newMapList[i].w + tentaclesLength
-        y = newMapList[i].y + newMapList[i].doorList[0].y + (maxDoorNum / 2)
+        y = newMapList[i].y + newMapList[i].doorList[0].y + (doorHeight / 2)
       }
       for (let j = 0; j < newMapList.length; j++) {
         if (newMapList[j].type == 2) {
@@ -270,6 +271,12 @@ export function addDoorPoint(newMapList) {
           }
         }
       }
+      for (let s = 0; s < newMapList[i].lightList.length; s++){
+        if( newMapList[i].lightList[s].type == "light"){
+          newMapList[i].lightList[s].key = 'light'+lightNum;
+          lightNum++
+        }
+      }
     }
   }
   return { mapList: newMapList, newList: connectionPoint(newMapList) }
@@ -306,7 +313,7 @@ export function calculateDoorPoint(bigObj, minObj, type) {
   let obj = { x: null, y: null }
   if (bigObj.w > bigObj.h) {
     if (type == 'top' || type == 'bottom') {
-      obj.x = minObj.x - bigObj.x + minObj.doorList[0].x + maxDoorNum / 2
+      obj.x = minObj.x - bigObj.x + minObj.doorList[0].x + doorWidth / 2
       obj.y = bigObj.h / 2
     } else if (type == 'left') {
       obj.x = bigObj.w - 6
@@ -324,7 +331,7 @@ export function calculateDoorPoint(bigObj, minObj, type) {
       obj.y = 2
     } else if (type == 'left' || type == 'right') {
       obj.x = bigObj.w / 2
-      obj.y = minObj.y - bigObj.y + minObj.doorList[0].y + maxDoorNum / 2
+      obj.y = minObj.y - bigObj.y + minObj.doorList[0].y + doorHeight / 2
     }
   }
   return obj
@@ -351,19 +358,24 @@ export function connectionPoint(newMapList) {
         if (newMapList[i].lightList[j].type == 'lab') {
           doorNum++
           newMapList[i].lightList[j].name = 'lab' + doorNum
+          newMapList[i].lightList[j].type = 'lab'
         }
         if (newMapList[i].lightList[j].type == 'escape') {
           doorNumOne++
           newMapList[i].lightList[j].name = 'escape' + doorNumOne
+          newMapList[i].lightList[j].type = 'escape'
         } else if (newMapList[i].lightList[j].type == 'light') {
           lightNum++
           newMapList[i].lightList[j].name = 'light' + lightNum
+          newMapList[i].lightList[j].type = 'light'
         } else if (newMapList[i].lightList[j].type == 'traffic') {
           trafficNum++
           newMapList[i].lightList[j].name = 'traffic' + trafficNum
+          newMapList[i].lightList[j].type = 'traffic'
         } else if (newMapList[i].lightList[j].type == 'connect') {
           trafficNumOne++
           newMapList[i].lightList[j].name = 'connect' + trafficNumOne
+          newMapList[i].lightList[j].type = 'connect'
         }
       }
     }
@@ -394,6 +406,8 @@ export function calculateAssociatedLength(newMapList, bigObj, minObj) {
   }
   if(minObj.type == 'escape' || minObj.type == 'lab'){
     obj.key = minObj.key;
+  }else if(minObj.type == 'light'){
+    obj.key = minObj.key;
   }
   //按顺序写入假数据
   for (let i = 0; i < newMapList.length; i++) {
@@ -659,12 +673,12 @@ export function doorMoveJudge(mapList, boxIndex,minIndex, event, scrollLeft, scr
   let obj = JSON.parse(JSON.stringify(mapList[boxIndex]))
   //计算靠近方向
   if (num === yt) {
-    obj.h = minDoorNum;
-    obj.w = maxDoorNum;
+    obj.h = doorHeight;
+    obj.w = doorWidth;
     obj.doorList[minIndex].toward = 'top';
-    obj.doorList[minIndex].x = (x - mapList[boxIndex].x - (maxDoorNum / 2)) < 0 ? 0 : (
-          (x - mapList[boxIndex].x + (maxDoorNum / 2)) > mapList[boxIndex].w ? mapList[boxIndex].w - maxDoorNum :
-          x - mapList[boxIndex].x - (maxDoorNum / 2))
+    obj.doorList[minIndex].x = (x - mapList[boxIndex].x - (doorWidth / 2)) < 0 ? 0 : (
+          (x - mapList[boxIndex].x + (doorWidth / 2)) > mapList[boxIndex].w ? mapList[boxIndex].w - doorWidth :
+          x - mapList[boxIndex].x - (doorWidth / 2))
     obj.doorList[minIndex].y = 2
     if(childrenOverlapCheck(obj)){
       return obj.doorList[minIndex]
@@ -672,26 +686,26 @@ export function doorMoveJudge(mapList, boxIndex,minIndex, event, scrollLeft, scr
       return false
     }
   } else if (num === yb) {
-    obj.h = minDoorNum;
-    obj.w = maxDoorNum;
+    obj.h = doorHeight;
+    obj.w = doorWidth;
     obj.doorList[minIndex].toward = 'bottom';
-    obj.doorList[minIndex].x = (x - mapList[boxIndex].x - (maxDoorNum / 2)) < 0 ? 0 : (
-          (x - mapList[boxIndex].x + (maxDoorNum / 2)) > mapList[boxIndex].w ? mapList[boxIndex].w - maxDoorNum :
-            x - mapList[boxIndex].x - (maxDoorNum / 2))
-    obj.doorList[minIndex].y = mapList[boxIndex].h - minDoorNum - 2
+    obj.doorList[minIndex].x = (x - mapList[boxIndex].x - (doorWidth / 2)) < 0 ? 0 : (
+          (x - mapList[boxIndex].x + (doorWidth / 2)) > mapList[boxIndex].w ? mapList[boxIndex].w - doorWidth :
+            x - mapList[boxIndex].x - (doorWidth / 2))
+    obj.doorList[minIndex].y = mapList[boxIndex].h - doorHeight - 2
     if(childrenOverlapCheck(obj)){
       return obj.doorList[minIndex]
     }else{
       return false
     }
   } else if (num === xl) {
-    obj.h = maxDoorNum;
-    obj.w = minDoorNum;
+    obj.h = doorHeight;
+    obj.w = doorWidth;
     obj.doorList[minIndex].toward = 'left';
     obj.doorList[minIndex].x = 2
-    obj.doorList[minIndex].y = (y - mapList[boxIndex].y - (maxDoorNum / 2)) < 0 ? 0 : (
-        (y - mapList[boxIndex].y + (maxDoorNum / 2)) > mapList[boxIndex].h ? mapList[boxIndex].h - maxDoorNum :
-          y - mapList[boxIndex].y - (maxDoorNum / 2))
+    obj.doorList[minIndex].y = (y - mapList[boxIndex].y - (doorHeight / 2)) < 0 ? 0 : (
+        (y - mapList[boxIndex].y + (doorHeight / 2)) > mapList[boxIndex].h ? mapList[boxIndex].h - doorHeight :
+          y - mapList[boxIndex].y - (doorHeight / 2))
     if(childrenOverlapCheck(obj)){
       return obj.doorList[minIndex]
     }else{
@@ -701,10 +715,10 @@ export function doorMoveJudge(mapList, boxIndex,minIndex, event, scrollLeft, scr
     obj.h = maxWidth;
     obj.w = minWidth;
     obj.doorList[minIndex].toward = 'right';
-    obj.doorList[minIndex].x = mapList[boxIndex].w - minDoorNum - 2
-    obj.doorList[minIndex].y = (y - mapList[boxIndex].y - (maxDoorNum / 2)) < 0 ? 0 : (
-        (y - mapList[boxIndex].y + (maxDoorNum / 2)) > mapList[boxIndex].h ? mapList[boxIndex].h - maxDoorNum :
-          y - mapList[boxIndex].y - (maxDoorNum / 2))
+    obj.doorList[minIndex].x = mapList[boxIndex].w - doorWidth - 2
+    obj.doorList[minIndex].y = (y - mapList[boxIndex].y - (doorHeight / 2)) < 0 ? 0 : (
+        (y - mapList[boxIndex].y + (doorHeight / 2)) > mapList[boxIndex].h ? mapList[boxIndex].h - doorHeight :
+          y - mapList[boxIndex].y - (doorHeight / 2))
     if(childrenOverlapCheck(obj)){
       return obj.doorList[minIndex]
     }else{
@@ -959,9 +973,9 @@ export function addDoor(event, mapList, scrollLeft, scrollTop, grab) {
           index: i,
           type: 'door',
           toward: 'top',
-          w: maxDoorNum,
-          h: minDoorNum,
-          x: x - mapList[i].x - (maxDoorNum / 2),
+          w: doorWidth,
+          h: doorHeight,
+          x: x - mapList[i].x - (doorWidth / 2),
           y: 2
         }
       } else if (num === yb) {
@@ -969,30 +983,30 @@ export function addDoor(event, mapList, scrollLeft, scrollTop, grab) {
           index: i,
           type: 'door',
           toward: 'bottom',
-          w: maxDoorNum,
-          h: minDoorNum,
-          x: x - mapList[i].x - (maxDoorNum / 2),
-          y: mapList[i].h - minDoorNum - 2
+          w: doorWidth,
+          h: doorHeight,
+          x: x - mapList[i].x - (doorWidth / 2),
+          y: mapList[i].h - doorHeight - 2
         }
       } else if (num === xl) {
         return {
           index: i,
           type: 'door',
           toward: 'left',
-          w: minDoorNum,
-          h: maxDoorNum,
+          w: doorWidth,
+          h: doorHeight,
           x: 2,
-          y: y - mapList[i].y - (maxDoorNum / 2)
+          y: y - mapList[i].y - (doorHeight / 2)
         }
       } else if (num === xr) {
         return {
           index: i,
           type: 'door',
           toward: 'right',
-          w: minDoorNum,
-          h: maxDoorNum,
-          x: mapList[i].w - minDoorNum - 2,
-          y: y - mapList[i].y - (maxDoorNum / 2)
+          w: doorWidth,
+          h: doorHeight,
+          x: mapList[i].w - doorWidth - 2,
+          y: y - mapList[i].y - (doorHeight / 2)
         }
       }
     }
@@ -1228,16 +1242,16 @@ export function doorDragJudge(obj) {
   for (let i = 0; i < obj.doorList.length; i++) {
     if (obj.doorList[i].toward == 'left') {
       obj.doorList[i].x = 0
-      obj.doorList[i].y = (obj.doorList[i].y + maxDoorNum) >= obj.h ? obj.h - maxDoorNum : obj.doorList[i].y
+      obj.doorList[i].y = (obj.doorList[i].y + doorHeight) >= obj.h ? obj.h - doorHeight : obj.doorList[i].y
     } else if (obj.doorList[i].toward == 'right') {
-      obj.doorList[i].x = obj.w - minDoorNum
-      obj.doorList[i].y = (obj.doorList[i].y + maxDoorNum) >= obj.h ? obj.h - maxDoorNum : obj.doorList[i].y
+      obj.doorList[i].x = obj.w - doorWidth
+      obj.doorList[i].y = (obj.doorList[i].y + doorHeight) >= obj.h ? obj.h - doorHeight : obj.doorList[i].y
     } else if (obj.doorList[i].toward == 'top') {
-      obj.doorList[i].x = (obj.doorList[i].x + maxDoorNum) >= obj.w ? obj.w - maxDoorNum : obj.doorList[i].x
+      obj.doorList[i].x = (obj.doorList[i].x + doorWidth) >= obj.w ? obj.w - doorWidth : obj.doorList[i].x
       obj.doorList[i].y = 0
     } else if (obj.doorList[i].toward == 'bottom') {
-      obj.doorList[i].x = (obj.doorList[i].x + maxDoorNum) >= obj.w ? parseInt(obj.w - maxDoorNum) : parseInt(obj.doorList[i].x)
-      obj.doorList[i].y = obj.h - minDoorNum
+      obj.doorList[i].x = (obj.doorList[i].x + doorWidth) >= obj.w ? parseInt(obj.w - doorWidth) : parseInt(obj.doorList[i].x)
+      obj.doorList[i].y = obj.h - doorHeight
     }
   }
   if (childrenOverlapCheck(obj)) {
@@ -1359,17 +1373,17 @@ export function checkDoorTo(mapList) {
       let x = 0
       let y = 0
       if (mapList[i].doorList[0].toward == 'top') {
-        x = mapList[i].x + mapList[i].doorList[0].x + (maxDoorNum / 2)
+        x = mapList[i].x + mapList[i].doorList[0].x + (doorWidth / 2)
         y = mapList[i].y - (minHeight / 2)
       } else if (mapList[i].doorList[0].toward == 'bottom') {
-        x = mapList[i].x + mapList[i].doorList[0].x + (maxDoorNum / 2)
+        x = mapList[i].x + mapList[i].doorList[0].x + (doorWidth / 2)
         y = mapList[i].y + mapList[i].h + (minHeight / 2)
       } else if (mapList[i].doorList[0].toward == 'left') {
         x = mapList[i].x - (minHeight / 2)
-        y = mapList[i].y + mapList[i].doorList[0].y + (maxDoorNum / 2)
+        y = mapList[i].y + mapList[i].doorList[0].y + (doorHeight / 2)
       } else if (mapList[i].doorList[0].toward == 'right') {
         x = mapList[i].x + mapList[i].w + (minHeight / 2)
-        y = mapList[i].y + mapList[i].doorList[0].y + (maxDoorNum / 2)
+        y = mapList[i].y + mapList[i].doorList[0].y + (doorHeight / 2)
       }
       let num = 0
       for (let j = 0; j < mapList.length; j++) {

文件差異過大導致無法顯示
+ 144 - 68
src/views/comprehensive/laboratoryManagement/building/buildingDetails.vue


文件差異過大導致無法顯示
+ 1329 - 686
src/views/comprehensive/laboratoryManagement/building/newIndex.vue