Browse Source

提交scd

“yueshang” 1 year ago
parent
commit
fbf97d39c5

+ 24 - 8
src/pages/netStructPicture/components/CidTree.vue

@@ -39,7 +39,8 @@
             ><span
               :class="{ 'tree-label': clickItemcode == data.itemcode }"
               style="position: absolute; right: 10px"
-              ><span v-if="OpensclTrue">{{ data.num }}</span><span v-else>{{ data.childItemCid?data.childItemCid.length:0 }}</span></span
+              ><span v-if="OpensclTrue">{{ data.num }}</span
+              ><span v-else>{{ data.num }}</span></span
             >
           </template>
         </el-tree>
@@ -272,12 +273,11 @@ watch(
       treeData.value.forEach((node) => {
         addChildItems(node, newValue);
       });
-      console.log("treeData.value==========", treeData.value);
     }
   }
 );
 
-//使用递归
+//Cid使用递归
 const addChildItems = (node, data) => {
   if (!node.childItemCid) {
     node.childItemCid = [];
@@ -294,6 +294,14 @@ const addChildItems = (node, data) => {
     node.children.forEach((childNode) => {
       addChildItems(childNode, data);
     });
+    // 计算并设置 num 值
+    let childrenNum = 0;
+    node.children.forEach((childNode) => {
+      childrenNum += childNode.childItemCid.length;
+    });
+    node.num = childrenNum;
+  } else {
+    node.num = node.childItemCid.length;
   }
 };
 const reload = () => {
@@ -303,12 +311,23 @@ const reload = () => {
       tagList.value = res.data;
       tagChoose.value = res.data ? Object.keys(res.data)[0] : "";
       clickTage.value = res.data ? Object.values(res.data)[0] : "";
-      console.log("tageList.value", tagList.value);
+      console.log(clickTage.value,tagChoose.value)
+      emit("treeBack", clickTage.value)
     });
   }
 };
 const clickTage = ref(null);
 const tagClick = (row, num) => {
+  treeData.value.forEach(item=>{
+    item.num = 0;
+    item.childItemCid = [];
+    if(item.children){
+      item.children.forEach(key=>{
+        key.num=0;
+        key.childItemCid = [];
+      })
+    }
+  })
   tagChoose.value = num;
   clickTage.value = row;
   cid
@@ -333,7 +352,6 @@ const tagClick = (row, num) => {
       let fileInfo;
       if (res.data) {
         fileInfo = res.data.filter((item) => item.scd_id == route.query.id);
-        console.log("res", fileInfo);
         if (fileInfo.length > 0) {
           emit("treeBack", row, fileInfo[0]);
         }
@@ -360,12 +378,10 @@ watch(
 );
 const clickItemcode = ref("");
 const handleNodeClick = (e) => {
-  console.log('e', e)
   clickItemcode.value = e.itemcode;
-  emit("clickCode", e.itemcode,e);
+  emit("clickCode", e.itemcode, e);
 };
 onMounted(() => {
-  console.log("props.iedRelation", props.iedRelation);
   tagChoose.value = props.iedRelation ? Object.keys(props.iedRelation)[0] : "";
   clickTage.value = props.iedRelation
     ? Object.values(props.iedRelation)[0]

+ 53 - 17
src/pages/netStructPicture/components/Gsix.vue

@@ -24,7 +24,7 @@ const props = defineProps({
     default: () => {},
   },
   clickList: {
-    type: Object,
+    type: [Object, String],
     default: () => {},
   },
   clickCodeValue: {
@@ -33,8 +33,12 @@ const props = defineProps({
   },
   //在CID处点击差异得到的数据
   clickCodeInfoCid: {
-    type: Array,
-    default: () => {},
+    type: [Array, Object],
+    default: () => [],
+  },
+  isCid: {
+    type: Boolean,
+    default: false,
   },
 });
 
@@ -66,6 +70,7 @@ watch(
   () => props.clickList,
   (newValue) => {
     if (newValue) {
+      dones();
       tagList.value = newValue;
       clickLineResult();
       clickLineResultMain();
@@ -126,7 +131,7 @@ const mapList = ref(null);
 const leftI = ref([]); //新增
 const dataU = ref([]); //修改
 const rightD = ref([]); //删除
-const loading = ref(true);
+const loading = ref(props.isCid ? false : true);
 const dones = () => {
   //重置
   leftI.value = [];
@@ -168,18 +173,19 @@ const getData = async () => {
   // loading.value = false;
 };
 const getDataCid = () => {
-  console.log("clickCodeValue", cClickCode.value);
   const cidsnode = CodeInfoCid.value.childItemCid;
   if (cClickCode.value == "scd.ied" && cidsnode && cidsnode.length > 0) {
+    //装置基本信息
     mapList.value = cidsnode[0].diff_desc;
-  } else if (cidsnode) {
+  } else if (cClickCode.value != "scd.ied" && cidsnode && cidsnode.length > 0) {
+    //除开装置信息
     mapList.value = cidsnode;
+    console.log("cidsnode----------", cidsnode);
+    dones();
     mapList.value.forEach((item) => {
       commonGetData(item);
     });
   }
-  console.log("leftI.value", leftI.value);
-  console.log("leftI.value", rightD.value);
   nextTick(() => {
     middleLine.value.style.height = 0;
     middleLine.value.style.height = mianItem.value.scrollHeight + "px";
@@ -188,7 +194,7 @@ const getDataCid = () => {
 const commonGetData = (item) => {
   isDiffdescUpAdd.value = false;
   isDiffdescUpDel.value = false;
-  dones();
+  console.log("item+++++", item);
   switch (item.diff_opt) {
     case "i": //新增
       leftI.value.push(item);
@@ -200,6 +206,14 @@ const commonGetData = (item) => {
       dataU.value.push(item);
       break;
   }
+  console.log(
+    "leftI.value",
+    leftI.value,
+    "rightD.value",
+    rightD.value,
+    "dataU.value",
+    dataU.value
+  );
 };
 //点击新增或删除的图片
 const DelClick = ref({});
@@ -317,7 +331,6 @@ const clickUpTypeImgRight = (arr, event, name, list) => {
   }
 };
 const CommunicationS1 = ref([]); //站控层的修改时有新增和修改的数据
-// const CommunicationS1 = ref([]); //站控层的修改时有新增和删除的数据
 const clickUpTypeImgUpDel = (arr, event) => {
   arr[1].DAI.forEach((item1) => {
     let found = false;
@@ -712,7 +725,7 @@ const setLeaderlines = (types) => {
     //左侧点击修改数据
     for (const [key, value] of domListUpLeftName.value) {
       for (const [key2, value2] of domListUpMiddleName.value) {
-        //又有新增又有修改,站控层
+        //又有新增又有修改,站控层===
         if (typeof key == "string" && key.includes("add") && key == key2) {
           let line4; //从左往右的线条
           line4 = new LeaderLine(startDom, value, lineStyleAdd);
@@ -722,7 +735,9 @@ const setLeaderlines = (types) => {
           leaderLineShow.value.push(lineValue5);
           hiddenLine2();
         }
+        //又有新增又有修改,站控层===
         for (const [key3, value3] of domListUpRightName.value) {
+          //修改和删除
           if (typeof key2 == "string" && key2.includes("del") && key2 == key3) {
             let line4; //从右往左的线条
             line4 = new LeaderLine(value3, sameDom, lineStyleDel);
@@ -761,14 +776,17 @@ const setLeaderlines = (types) => {
     const lineStylSame = {
       ...lineStyleAdd,
       color: "#FFA011",
-      startSocket: "left",
-      endSocket: "right",
+      startSocket: "right",
+      endSocket: "left",
     };
-    //左侧点击修改数据
+    //右侧点击修改数据
+    console.log('domListUpRightName.value', domListUpRightName.value)
     for (const [key, value] of domListUpRightName.value) {
       for (const [key2, value2] of domListUpMiddleName.value) {
         for (const [key3, value3] of domListUpLeftName.value) {
+          console.log('key,key,key3', key,key,key3)
           if (key == key2 && key2 == key3) {
+ 
             let line; //从左往右的线条
             line = new LeaderLine(value, startDom, lineStylUp);
             leaderLineShow.value.push(line);
@@ -784,6 +802,23 @@ const setLeaderlines = (types) => {
             //弹窗打开后使得线条在指定区域中
             hiddenLine2();
           }
+          if (
+              typeof key3 == "string" &&
+              key3.includes("add") &&
+              key3 == key2
+            ) {
+
+              console.log('lallal', 11111111)
+              let line4; //从左往右的线条
+              line4 = new LeaderLine(value3, value2, lineStyleAdd);
+              leaderLineShow.value.push(line4);
+              let lineValue5;
+              lineValue5 = new LeaderLine(sameDom[0], value3, lineStyleAdd);
+              leaderLineShow.value.push(lineValue5);
+              hiddenLine2();
+            }
+            // 又有新增又有修改,站控层===
+          
         }
       }
     }
@@ -1166,7 +1201,7 @@ onMounted(() => {
             style="
               border: 2px dashed #134bea;
               justify-content: start;
-              margin-left: 30px;
+              margin-left: 10px;
             "
             :ref="(el) => setdomUPMiddleName(el, key + key + 'add')"
             v-if="value.add"
@@ -1217,7 +1252,7 @@ onMounted(() => {
             style="
               border: 2px dashed #e50505;
               justify-content: start;
-              margin-right: 30px;
+              margin-right: 50px;
             "
             :ref="(el) => setdomUPMiddleName(el, key + key + 'del')"
             v-if="value.del"
@@ -1361,7 +1396,8 @@ onMounted(() => {
   .ied-name {
     position: absolute;
     top: 50%;
-    transform: translateY(-100%);
+    // transform: translateY(-100%);
+    transform: translateY(-50%);
     left: 5%;
   }
   .left-item-min {

+ 1 - 5
src/pages/netStructPicture/components/SclUpdate.vue

@@ -37,7 +37,6 @@ const iedRelation = ref(null);
 watch(
   () => props.iedRelationData,
   (newValue) => {
-    console.log("iedRelationscllll", newValue);
     iedRelation.value = newValue;
     //如果没有点击装置列表直接点击了code的默认装置第一个装置列表的数据
     clickList.value = Object.values(props.iedRelationData)[0];
@@ -57,7 +56,6 @@ const clickRowDatas = ref(null);
 watch(
   () => props.clickRowData,
   (newValue) => {
-    console.log("newValue", newValue);
     if (newValue) {
       clickRowDatas.value = newValue;
     }
@@ -67,7 +65,6 @@ const checkData = ref(props.checkDialogData);
 watch(
   () => props.checkDialogData,
   (newValue, oldValue) => {
-    console.log("props.checkDialogData", newValue, oldValue);
     checkData.value = newValue;
   }
 );
@@ -79,7 +76,6 @@ const cancelClick = () => {
 const clickList = ref(null);
 const treeBack = (data, val) => {
   clickList.value = data;
-  console.log("data====", data);
 };
 const treeBackDefalut = (data) => {
   // clickList.value = data;
@@ -132,7 +128,7 @@ onMounted(() => {});
             </div>
             <div style="padding-left: 30px">
               <span
-                >对比文件:<span style="color: #09162">{{
+                >对比文件:<span style="color: #09162c">{{
                   clickRowDatas.target_name
                 }}</span></span
               >

+ 0 - 3
src/pages/netStructPicture/components/virtualnformation.vue

@@ -210,7 +210,6 @@ const processBoth = (list, svResInfo, inoutType) => {
       }
     }
   });
-  console.log("list=========", list);
 };
 let leaderLines3 = ref([]); //控制线条显示
 const leftList = ref([]);
@@ -266,7 +265,6 @@ watch(
   () => props.clickCodeValue,
   (newValue) => {
     if (newValue) {
-      console.log("newValue========", newValue);
       cClickCode.value = newValue;
       clickResetLine3();
       getNetworkInfo3();
@@ -340,7 +338,6 @@ middleTitelDesc.value = iedRes.data[names].desc
     processBoth(leftList.value, svResInfo, "in");
     processBoth(rightList.value, svResInfo, "out");
   }
-  console.log(leftList.value, "first============", props.clickRowDatas);
   //处理中间的数据有省略号的
   let newData = [];
   for (let i = 0; i < svResInfo.data.length; i++) {

+ 49 - 37
src/pages/netStructPicture/index.vue

@@ -29,13 +29,13 @@
     </el-tabs>
     <div>
       <!-- CID一致性校核========= -->
-      <div class="disappear" v-if="activeNav == 0">
+      <div class="disappear" v-if="activeNav == 0" v-loading="isCidLoading">
         <!-- 左侧树形数据 -->
         <div style="width: 15%">
-          <CidTree 
-          @treeBack="treeBack"
-          @clickCode="clickCode"
-          :allCidStart="allCidStart"
+          <CidTree
+            @treeBack="treeBack"
+            @clickCode="clickCode"
+            :allCidStart="allCidStart"
           ></CidTree>
         </div>
         <!-- 右侧展示图 -->
@@ -56,7 +56,7 @@
             </div>
             <div style="padding-left: 30px">
               <span
-                >对比文件:<span style="color: #09162">{{ upName }}</span></span
+                >对比文件:<span style="color: #09162c">{{ upName }}</span></span
               >
             </div>
             <div class="uploadBox">
@@ -82,18 +82,18 @@
               </el-upload>
             </div>
           </div>
-          <!-- :clickRowDatas="clickRowDatas"
-            :iedRelation="iedRelation"" -->
+          <div v-if="!upName" class="tips-cid">请上传CID文件进行对比</div>
           <Gsix
-            v-if="clickCodeValue != 'scd.ied.Relation'"
+            v-if="upName && clickCodeValue != 'scd.ied.Relation'"
             @clickCode="clickCode"
             :clickList="backName"
             :clickCodeInfoCid="clickCodeInfoCid"
+            :isCid="isCid"
             :clickCodeValue="clickCodeValue"
           ></Gsix>
         </div>
       </div>
-      <!-- CID一致性校核========= -->
+      <!-- SCD一致性校核========= -->
       <div class="scdCheck" v-if="activeNav == 1">
         <div class="mostHead mostHead-scd" v-if="activeNav == 1">
           <div class="scd-title">SCD文件一次性检测</div>
@@ -167,7 +167,8 @@ import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
 import systemRow from "@/api/systemRow";
 import scdCheck from "@/api/scdCheck/scdCheck";
 let route = useRoute();
-
+const isCid = ref(true); //判断是否是CID界面
+const isCidLoading = ref(false);//判断是否正在解析CID文件
 const activeName = ref("first"); //默认展示网络结构图
 const navtopData = ref([
   { name: "CID一致性校核", code: "CID" },
@@ -218,12 +219,12 @@ const handleClick = (val) => {
   activeName.value = val.props.name;
   clickNavCode.value = "";
 };
-//点击树返回的信息,
+//点击左侧装置列表树返回的信息,
 const treeBack = (data, val) => {
-  console.log("data",data);
+  upName.value = "";
   backName.value = data; //返回的点击行的信息
   arrName.value = data;
-  backId.value = val.id;
+  // backId.value = val.id;
 };
 const closeX = () => {
   activeName.value = "first";
@@ -233,7 +234,7 @@ const allCidStart = ref([]);
 const nowUpload = (file, e) => {
   upFile.value = file.file;
   upName.value = file.file.name;
-  clickCodeInfoCid.value={};
+  clickCodeInfoCid.value = [];
   ElMessageBox.confirm(
     "该操作耗时较长,校验开始后将清除原有校验结果且无法中止,确定开始吗?",
     "Warning",
@@ -248,6 +249,7 @@ const nowUpload = (file, e) => {
       message: "正在进行CID的一致性比对...请稍候",
       duration: 0,
     });
+    isCidLoading.value = true;
     cid
       .fileUpload({
         station_id: nowStation.value - 0,
@@ -268,27 +270,30 @@ const nowUpload = (file, e) => {
               ids: idp,
             })
             .then((res) => {
+              console.log("res", res);
               ElNotification.closeAll();
-              ElMessage({
-                type: "success",
-                message: "对比成功!",
-              });
-              allCidStart.value = res.data.list;
-              console.log('allCidStart.value', allCidStart.value)
-            })
-            .catch((err) => {
-              ElMessage({
-                type: "error",
-                message: err.msg,
-              });
+              if (res.code == 0) {
+                ElMessage({
+                  type: "success",
+                  message: "对比成功!",
+                });
+                allCidStart.value = res.data.list;
+                isCidLoading.value = false;
+              } else {
+                ElMessage({
+                  type: "error",
+                  message: res.msg,
+                });
+                isCidLoading.value = false;
+              }
             });
+        } else {
+          ElMessage({
+            type: "error",
+            message: res.msg,
+          });
+          isCidLoading.value = false;
         }
-      })
-      .catch((err) => {
-        ElMessage({
-          type: "error",
-          message: err.msg,
-        });
       });
   });
 };
@@ -307,12 +312,12 @@ const scdView = (row) => {
 };
 //点击差异项的code
 const clickCodeValue = ref(null);
-const clickCodeInfoCid = ref({});
-const clickCode = (code,e) => {
+const clickCodeInfoCid = ref([]);
+const clickCode = (code, e) => {
   clickCodeValue.value = code;
-  if(e){
+  if (e) {
     clickCodeInfoCid.value = e;
-    console.log('esssssssss', e)
+    console.log("esssssssss", e);
   }
   allCidStart.value = [];
 };
@@ -345,6 +350,7 @@ const newChicken = ref(""); //基准文件
 onMounted(() => {
   reload();
   newChicken.value = route.query.stationName;
+  // Object.values(props.iedRelation)[0]
 });
 </script>
 
@@ -495,6 +501,7 @@ $height: 40px;
   padding-bottom: 8px;
   margin-bottom: 0;
   .export-bottom {
+    cursor: pointer;
     display: inline-block;
     border: 1px solid #255ce7;
     background: #f6f9ff;
@@ -504,4 +511,9 @@ $height: 40px;
     font-size: 14px;
   }
 }
+.tips-cid {
+  text-align: center;
+  font-size: 14px;
+  margin: 20px 0;
+}
 </style>