“yueshang” 1 rok temu
rodzic
commit
7fa47fc99f

+ 73 - 25
src/pages/netStructPicture/components/CidTree.vue

@@ -13,16 +13,24 @@
       </div>
       </div>
       <div class="tagBox">
       <div class="tagBox">
         <div
         <div
-          class="cont-line tagP"
+          class="cont-line"
           :class="{ clicktag: tagChoose == index }"
           :class="{ clicktag: tagChoose == index }"
           v-for="(item, index) in tagList"
           v-for="(item, index) in tagList"
           :key="index"
           :key="index"
           @click="tagClick(item, index)"
           @click="tagClick(item, index)"
+          @mouseover="startCounting(OpensclTrue?`(${item.ied_name})${item.ied_desc}`:`(${item.ied_name})${item.desc})`)"
+          @mouseleave="clearCounting"
         >
         >
-          <span v-if="!OpensclTrue">{{
-            `(${item.ied_name})${item.desc}`
-          }}</span>
-          <span v-else>{{ `(${item.ied_name})${item.ied_desc}` }}</span>
+          <div class="tagP">
+            <span v-if="!OpensclTrue">{{
+              `(${item.ied_name})${item.desc}`
+            }}</span>
+            <span v-else>{{ `(${item.ied_name})${item.ied_desc}` }}</span>
+          </div>
+          <!-- 左下角全名提示 -->
+          <!-- <div class="tooltips" v-if="istooltip && tagChoose == index">
+             {{ nametip }}
+          </div> -->
         </div>
         </div>
       </div>
       </div>
       <div class="setting">
       <div class="setting">
@@ -78,6 +86,11 @@ const props = defineProps({
     type: Array,
     type: Array,
     default: () => [],
     default: () => [],
   },
   },
+  upName: {
+    //用于判断上传的cid是否产生变化,如有变化清空装置列表的数据
+    type: String,
+    default: "",
+  },
 });
 });
 const emit = defineEmits(["treeBack", "clickCode", "treeBackDefalut"]);
 const emit = defineEmits(["treeBack", "clickCode", "treeBackDefalut"]);
 let tagList = ref(props.iedRelation);
 let tagList = ref(props.iedRelation);
@@ -222,7 +235,7 @@ const codeStatic = async () => {
     ied_name: names,
     ied_name: names,
     comptype: "u",
     comptype: "u",
   });
   });
-  if(!res) return;
+  if (!res) return;
   updateNum(treeData.value, res.data);
   updateNum(treeData.value, res.data);
 };
 };
 const updateNum = (treeNode, data) => {
 const updateNum = (treeNode, data) => {
@@ -232,7 +245,7 @@ const updateNum = (treeNode, data) => {
     if (data && data.hasOwnProperty(node.itemcode)) {
     if (data && data.hasOwnProperty(node.itemcode)) {
       node.num = parseInt(data[node.itemcode]);
       node.num = parseInt(data[node.itemcode]);
     }
     }
-    if (data && node.itemcode == "scd.ied.Relation"&&data["scd.ied.ExtRef"]) {
+    if (data && node.itemcode == "scd.ied.Relation" && data["scd.ied.ExtRef"]) {
       node.num = parseInt(data["scd.ied.ExtRef"]);
       node.num = parseInt(data["scd.ied.ExtRef"]);
     }
     }
     // 如果当前节点有子节点,递归处理子节点
     // 如果当前节点有子节点,递归处理子节点
@@ -244,7 +257,7 @@ const updateNum = (treeNode, data) => {
         .reduce((total, child) => total + child.num, 0);
         .reduce((total, child) => total + child.num, 0);
     }
     }
   }
   }
-  loading.value = false
+  loading.value = false;
 };
 };
 let defaultProps = ref({
 let defaultProps = ref({
   label: "label",
   label: "label",
@@ -314,26 +327,38 @@ const reload = () => {
       tagList.value = res.data;
       tagList.value = res.data;
       tagChoose.value = res.data ? Object.keys(res.data)[0] : "";
       tagChoose.value = res.data ? Object.keys(res.data)[0] : "";
       clickTage.value = res.data ? Object.values(res.data)[0] : "";
       clickTage.value = res.data ? Object.values(res.data)[0] : "";
-      emit("treeBack", clickTage.value)
+      emit("treeBack", clickTage.value);
     });
     });
   }
   }
 };
 };
 const clickTage = ref(null);
 const clickTage = ref(null);
-const tagClick = (row, num) => {
-  loading.value = true;
-  treeData.value.forEach(item=>{
+watch(
+  () => props.upName,
+  (newValue) => {
+    if (newValue) {
+      results();
+    }
+  }
+);
+//重置装置列表数据
+const results = () => {
+  treeData.value.forEach((item) => {
     item.num = 0;
     item.num = 0;
     item.childItemCid = [];
     item.childItemCid = [];
-    if(item.children){
-      item.children.forEach(key=>{
-        key.num=0;
+    if (item.children) {
+      item.children.forEach((key) => {
+        key.num = 0;
         key.childItemCid = [];
         key.childItemCid = [];
-      })
+      });
     }
     }
-  })
+  });
+};
+const tagClick = (row, num) => {
+  loading.value = true;
+  results();
   tagChoose.value = num;
   tagChoose.value = num;
   clickTage.value = row;
   clickTage.value = row;
-  emit("treeBack", row)
+  emit("treeBack", row);
   // cid
   // cid
   //   .findFile({
   //   .findFile({
   //     scd_id: route.query.id,
   //     scd_id: route.query.id,
@@ -360,12 +385,12 @@ const tagClick = (row, num) => {
   //         emit("treeBack", row, fileInfo[0]);
   //         emit("treeBack", row, fileInfo[0]);
   //       }
   //       }
   //     }
   //     }
-      //   let a = res.data.filter((item) => item.type_name == "CID");
-      //   if (a.length > 0) {
-      //     needName.value = a[0].file_name;
-      //     emit("treeBack", needName.value, a[0].id);
-      //   }
-    // });
+  //   let a = res.data.filter((item) => item.type_name == "CID");
+  //   if (a.length > 0) {
+  //     needName.value = a[0].file_name;
+  //     emit("treeBack", needName.value, a[0].id);
+  //   }
+  // });
   if (props.OpensclTrue) {
   if (props.OpensclTrue) {
     codeStatic();
     codeStatic();
   }
   }
@@ -385,6 +410,19 @@ const handleNodeClick = (e) => {
   clickItemcode.value = e.itemcode;
   clickItemcode.value = e.itemcode;
   emit("clickCode", e.itemcode, e);
   emit("clickCode", e.itemcode, e);
 };
 };
+const nametip = ref(null);
+const istooltip = ref(false);
+
+const startCounting = (nametips) => {
+  nametip.value =nametips;
+  setTimeout(() => {
+    istooltip.value = true;
+  }, 1500);
+};
+const clearCounting = () => {
+  istooltip.value = false;
+  nametip.value = ''
+};
 onMounted(() => {
 onMounted(() => {
   tagChoose.value = props.iedRelation ? Object.keys(props.iedRelation)[0] : "";
   tagChoose.value = props.iedRelation ? Object.keys(props.iedRelation)[0] : "";
   clickTage.value = props.iedRelation
   clickTage.value = props.iedRelation
@@ -438,8 +476,9 @@ h3 {
   overflow: hidden;
   overflow: hidden;
   text-overflow: ellipsis;
   text-overflow: ellipsis;
   white-space: nowrap;
   white-space: nowrap;
-  margin-top: 8px;
+  margin-top: 10px;
   font-size: 16px;
   font-size: 16px;
+
 }
 }
 .setting {
 .setting {
   width: 92%;
   width: 92%;
@@ -485,6 +524,7 @@ h3 {
 .cont-line,
 .cont-line,
 :deep(.el-tree-node__label) {
 :deep(.el-tree-node__label) {
   color: #1a2447;
   color: #1a2447;
+  position: relative;
   font-size: 14px;
   font-size: 14px;
 }
 }
 .clicktag {
 .clicktag {
@@ -493,4 +533,12 @@ h3 {
 .tree-label {
 .tree-label {
   color: #134bea;
   color: #134bea;
 }
 }
+.tooltips {
+  position: absolute;
+  border: 1px solid #000;
+  background: #fff;
+  bottom: -57px;
+  right:0;
+  z-index: 999;
+}
 </style>
 </style>

+ 3 - 3
src/pages/netStructPicture/components/Gsix.vue

@@ -50,7 +50,6 @@ watch(
   () => props.clickCodeInfoCid,
   () => props.clickCodeInfoCid,
   (newValue) => {
   (newValue) => {
     if (newValue) {
     if (newValue) {
-      console.log("newValue", newValue);
       if (newValue.childItemCid && newValue.childItemCid.length != 0) {
       if (newValue.childItemCid && newValue.childItemCid.length != 0) {
         loading.value = true;
         loading.value = true;
       } else {
       } else {
@@ -157,6 +156,7 @@ const getData = async () => {
   dones();
   dones();
   const ids = clickRow.value ? clickRow.value.id : "";
   const ids = clickRow.value ? clickRow.value.id : "";
   const names = tagList.value ? tagList.value.ied_name : "";
   const names = tagList.value ? tagList.value.ied_name : "";
+  loading.value = true;
   const res = await compResult({
   const res = await compResult({
     comp_id: ids,
     comp_id: ids,
     ied_name: names,
     ied_name: names,
@@ -188,7 +188,6 @@ const getDataCid = () => {
   } else if (cClickCode.value != "scd.ied" && cidsnode && cidsnode.length > 0) {
   } else if (cClickCode.value != "scd.ied" && cidsnode && cidsnode.length > 0) {
     //除开装置信息
     //除开装置信息
     mapList.value = cidsnode;
     mapList.value = cidsnode;
-    dones();
     if(!mapList.value) return;
     if(!mapList.value) return;
     mapList.value.forEach((item) => {
     mapList.value.forEach((item) => {
       commonGetData(item);
       commonGetData(item);
@@ -449,6 +448,7 @@ const clickUpTypeImg = (arr, event) => {
     ) {
     ) {
       if (typeof arr[0][key] === "object") {
       if (typeof arr[0][key] === "object") {
         // 如果当前属性的值是另一个对象,则进一步检查
         // 如果当前属性的值是另一个对象,则进一步检查
+        if(!arr[0][key]) return;
         for (let subKey in arr[0][key]) {
         for (let subKey in arr[0][key]) {
           //遍历当前对象的所有子属性。
           //遍历当前对象的所有子属性。
           // 检查子属性是否存在于两个输入对象中,并且它们的值是否不同。
           // 检查子属性是否存在于两个输入对象中,并且它们的值是否不同。
@@ -1499,7 +1499,7 @@ onMounted(() => {
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;
   margin-bottom: 45px;
   margin-bottom: 45px;
-  width: 120px;
+  width: 141px;
   height: 23px;
   height: 23px;
 }
 }
 .right-difference {
 .right-difference {

+ 3 - 2
src/pages/netStructPicture/components/SclUpdate.vue

@@ -97,7 +97,7 @@ onMounted(() => {});
     <el-dialog
     <el-dialog
       @close="cancelClick"
       @close="cancelClick"
       v-model="OpensclTrue"
       v-model="OpensclTrue"
-      width="93vw"
+      width="96vw"
       append-to-body
       append-to-body
       draggable
       draggable
       top="5vh"
       top="5vh"
@@ -109,6 +109,7 @@ onMounted(() => {});
         </div>
         </div>
       </template>
       </template>
       <div class="right-main">
       <div class="right-main">
+       <div style="width:15%;">
         <CidTree
         <CidTree
           :UPdate="UPdate"
           :UPdate="UPdate"
           @treeBack="treeBack"
           @treeBack="treeBack"
@@ -118,6 +119,7 @@ onMounted(() => {});
           :OpensclTrue="OpensclTrue"
           :OpensclTrue="OpensclTrue"
           :iedRelation="iedRelation"
           :iedRelation="iedRelation"
         ></CidTree>
         ></CidTree>
+       </div>
         <div class="right-title">
         <div class="right-title">
           <div class="abBox">
           <div class="abBox">
             <div>
             <div>
@@ -183,7 +185,6 @@ onMounted(() => {});
   .right-title {
   .right-title {
     width: 85%;
     width: 85%;
     margin: 20px 0 0 16px;
     margin: 20px 0 0 16px;
-
     background: #f7f8fb;
     background: #f7f8fb;
   }
   }
   .abBox {
   .abBox {

+ 1 - 0
src/pages/netStructPicture/components/basicInfo.vue

@@ -373,6 +373,7 @@ const getNav = async () => {
     ied_name: props.checkData.ied_name,
     ied_name: props.checkData.ied_name,
     name: "DataSet",
     name: "DataSet",
   });
   });
+  if(!navRes) return;
   navList.value = navRes.data;
   navList.value = navRes.data;
 };
 };
 const getMainTitle = async () => {
 const getMainTitle = async () => {

+ 1 - 1
src/pages/netStructPicture/components/netWork.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="container-bg" v-loading="loading" v-if="loadDating">
+  <div class="container-bg" v-loading="loading" element-loading-text="加载数据中" v-if="loading||loadDating">
     <el-container class="main-layout">
     <el-container class="main-layout">
       <el-container class="right-plate">
       <el-container class="right-plate">
         <el-main class="main-cont">
         <el-main class="main-cont">

+ 22 - 7
src/pages/netStructPicture/index.vue

@@ -41,6 +41,7 @@
             @treeBack="treeBack"
             @treeBack="treeBack"
             @clickCode="clickCode"
             @clickCode="clickCode"
             :allCidStart="allCidStart"
             :allCidStart="allCidStart"
+            :upName="upName"
           ></CidTree>
           ></CidTree>
         </div>
         </div>
         <!-- 右侧展示图 -->
         <!-- 右侧展示图 -->
@@ -89,13 +90,17 @@
           </div>
           </div>
           <div v-if="!upName" class="tips-cid">请上传CID文件进行对比</div>
           <div v-if="!upName" class="tips-cid">请上传CID文件进行对比</div>
           <Gsix
           <Gsix
-            v-if="upName && clickCodeValue != 'scd.ied.Relation'"
+            v-if="upName && clickCodeValue != 'scd.ied.Relation'&&!isContrast"
             @clickCode="clickCode"
             @clickCode="clickCode"
             :clickList="backName"
             :clickList="backName"
             :clickCodeInfoCid="clickCodeInfoCid"
             :clickCodeInfoCid="clickCodeInfoCid"
             :isCid="isCid"
             :isCid="isCid"
             :clickCodeValue="clickCodeValue"
             :clickCodeValue="clickCodeValue"
           ></Gsix>
           ></Gsix>
+          <!-- 对比失败 -->
+          <div v-else-if="isContrast" class="fail-contrast">
+            {{ isContrastDes }}
+          </div>
         </div>
         </div>
       </div>
       </div>
       <!-- SCD一致性校核========= -->
       <!-- SCD一致性校核========= -->
@@ -174,6 +179,8 @@ import scdCheck from "@/api/scdCheck/scdCheck";
 let route = useRoute();
 let route = useRoute();
 const isCid = ref(true); //判断是否是CID界面
 const isCid = ref(true); //判断是否是CID界面
 const isCidLoading = ref(false); //判断是否正在解析CID文件
 const isCidLoading = ref(false); //判断是否正在解析CID文件
+const isContrast =ref(false);//判断是否对比成功
+const isContrastDes =ref(false);//对比错误的描述
 const activeName = ref("first"); //默认展示网络结构图
 const activeName = ref("first"); //默认展示网络结构图
 const navtopData = ref([
 const navtopData = ref([
   { name: "CID一致性校核", code: "CID" },
   { name: "CID一致性校核", code: "CID" },
@@ -226,7 +233,10 @@ const handleClick = (val) => {
   clickNavCode.value = "";
   clickNavCode.value = "";
 };
 };
 //点击左侧装置列表树返回的信息,
 //点击左侧装置列表树返回的信息,
+const newChicken = ref(""); //基准文件
 const treeBack = (data, val) => {
 const treeBack = (data, val) => {
+  newChicken.value = `(${data.ied_name}${data.desc})`;
+  isContrast.value = ''
   upName.value = "";
   upName.value = "";
   backName.value = data; //返回的点击行的信息
   backName.value = data; //返回的点击行的信息
   arrName.value = data;
   arrName.value = data;
@@ -286,12 +296,12 @@ const nowUpload = (file, e) => {
                 });
                 });
                 allCidStart.value = res.data.list;
                 allCidStart.value = res.data.list;
                 isCidLoading.value = false;
                 isCidLoading.value = false;
+                isContrast.value = res.data&&res.data.list?false:true;//对比成功并且有数据
+                isContrastDes.value = res.data&&res.data.list?'':'两个对比的CID没有差异'
               } else {
               } else {
-                ElMessage({
-                  type: "error",
-                  message: res.msg,
-                });
                 isCidLoading.value = false;
                 isCidLoading.value = false;
+                isContrast.value = true;//对比失败
+                isContrastDes.value =  res.msg
               }
               }
             });
             });
         } else {
         } else {
@@ -352,10 +362,9 @@ const portExcel = () => {
       }
       }
     });
     });
 };
 };
-const newChicken = ref(""); //基准文件
+
 onMounted(() => {
 onMounted(() => {
   reload();
   reload();
-  newChicken.value = route.query.stationName;
   // Object.values(props.iedRelation)[0]
   // Object.values(props.iedRelation)[0]
 });
 });
 </script>
 </script>
@@ -522,4 +531,10 @@ $height: 40px;
   font-size: 14px;
   font-size: 14px;
   margin: 20px 0;
   margin: 20px 0;
 }
 }
+.fail-contrast{
+  text-align: center;
+  margin-top: 30px;
+  color: red;
+  font-size: 16px;
+}
 </style>
 </style>