| 
					
				 | 
			
			
				@@ -1,6 +1,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <!-- 装置关联关系 -->
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <template>
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  <div v-loading="loading" element-loading-text="加载数据中">
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <div
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    v-loading="loading"
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    element-loading-text="加载数据中"
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    style="overflow: hidden"
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  >
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <div class="main-cont" ref="myElement" id="treedom">
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <div class="main-left" ref="leftElement">
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <div
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -53,7 +57,7 @@ import devicePng from "@/assets/image/instruct/device.png"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import LeaderLine from "../../../../public/leader-line.min.js";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import AnimEvent from "../../../../public/anim-event.min.js";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { useRoute } from "vue-router";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { clickImgEvent} from "@/utils/common.js";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { clickImgEvent } from "@/utils/common.js";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const route = useRoute();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const loading = ref(true);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const props = defineProps({
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -118,14 +122,14 @@ const processArray = (arr) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //点击图片的时候筛选出数据
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const clickImg = async (dataItem) => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  loading.value =true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  listData.value =await clickImgEvent(props,dataItem,scdIdValue);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  if(!listData.value||!listData.value.length) return  loading.value = false;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  loading.value = true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  listData.value = await clickImgEvent(props, dataItem, scdIdValue);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (!listData.value || !listData.value.length) return (loading.value = false);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 watch(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   () => props.checkData,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   (newValue, oldV) => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    loading.value =true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    loading.value = true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     listData.value = newValue;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (newValue && leaderLines.value.length > 0) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // leaderLines.value.forEach((line) => line.remove()); //清除连线
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -167,7 +171,7 @@ const clickResetLine = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 将设备列表分成两份
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const bothSide = (data) => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const formatArr = processArray(data);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  if (!formatArr&&formatArr.length) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (!formatArr && formatArr.length) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const arrlenght = formatArr.length;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const long1 = Math.ceil(arrlenght / 2);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   leftList.value = formatArr.splice(0, long1);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -207,7 +211,7 @@ const setLeaderline = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ...lineStyleRight1,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     startPlug: "arrow1",
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     endPlug: "behind",
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const lineStyleRight2 = {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ...lineStyle2,
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     startSocket: "left",
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -272,35 +276,48 @@ const setLeaderline = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //  保存进数组,方便进行遍历删除
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     leaderLines.value.push(line2);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  loading.value =false
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  loading.value = false;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   hiddenLine();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //设置中间盒子的所在位置
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const middleLinePosition = () => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   setTimeout(() => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const heights = myElement.value.scrollHeight;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const leftListLength = leftList.value.length;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const rightListLength = rightList.value.length;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let leftListLength = leftList.value.length;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let rightListLength = rightList.value.length;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log("leftListLength", leftListLength, rightListLength);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const setElementMarginTop = (element, value) => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       element.value.style.marginTop = `${value}px`;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (leftList.value.length > 3 || rightList.value.length > 3) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if(!middleElement.value) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      middleElement.value.style.marginTop = `${(heights - 60) / 2}px`; // 设置元素的垂直位置
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } else {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      setElementMarginTop(leftElement, 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      setElementMarginTop(rightElement, 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      setElementMarginTop(middleElement, 150);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (rightListLength == 1) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      setElementMarginTop(rightElement, 165);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (leftListLength == 1) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      setElementMarginTop(leftElement, 165);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    switch (`${rightListLength}${leftListLength}`) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      case "11":
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(rightElement, 165);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(leftElement, 165);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(middleElement, 150);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        break;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      case "22":
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(rightElement, 92);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(leftElement, 92);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        setElementMarginTop(middleElement, 150);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        break;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default:
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!middleElement.value) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (rightListLength <= 3 && leftListLength <= 3) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          setElementMarginTop(middleElement, 150);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (leftListLength > 2 || rightListLength > 2) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          setElementMarginTop(rightElement, 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          setElementMarginTop(leftElement, 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          middleElement.value.style.marginTop = `${(heights - 60) / 2}px`; // 设置元素的垂直位置
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        break;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const marginTopValues = { 1: 165, 2: 92, 3: 50 };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    setElementMarginTop(rightElement, marginTopValues[rightListLength] || 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    setElementMarginTop(leftElement, marginTopValues[leftListLength] || 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 0);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 };
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-let scdIdValue ='';
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+let scdIdValue = "";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 onMounted(() => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (props.delScdId) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     scdIdValue = props.delScdId;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -317,7 +334,7 @@ onMounted(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 });
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //滚动时重定位线条
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const newPositionLine = () => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  if(!document.getElementById("treedom")) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (!document.getElementById("treedom")) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   document.getElementById("treedom").addEventListener(
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     "scroll",
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     AnimEvent.add(() => {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -346,6 +363,7 @@ const newPositionLine = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //弹窗打开后使得线条在指定区域中
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const hiddenLine = () => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const elmWrapper = document.getElementById("wrapper");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (!elmWrapper) return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   // 移动 line
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   document.body.querySelectorAll("body .leader-line").forEach((node) => {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     elmWrapper.appendChild(node);
 
			 |