Browse Source

修改cid文件上传的bug,修改scd线条不显示的bug等

“yueshang” 1 year ago
parent
commit
a16804dd1c

+ 68 - 15
src/pages/netStructPicture/components/CidTree.vue

@@ -18,7 +18,15 @@
           v-for="(item, index) in tagList"
           :key="index"
           @click="tagClick(item, index)"
-          @mouseover="startCounting(OpensclTrue?`(${item.ied_name})${item.ied_desc}`:`(${item.ied_name})${item.desc})`)"
+          @mouseover="
+            startCounting(
+              OpensclTrue
+                ? `(${item.ied_name})${item.ied_desc}`
+                : `(${item.ied_name})${item.desc})`,
+              item,
+              index
+            )
+          "
           @mouseleave="clearCounting"
         >
           <div class="tagP">
@@ -27,10 +35,9 @@
             }}</span>
             <span v-else>{{ `(${item.ied_name})${item.ied_desc}` }}</span>
           </div>
-          <!-- 左下角全名提示 -->
-          <!-- <div class="tooltips" v-if="istooltip && tagChoose == index">
-             {{ nametip }}
-          </div> -->
+          <div v-if="istooltip && showFullNameIndex == index" class="tooltips">
+            {{ nametip }}
+          </div>
         </div>
       </div>
       <div class="setting">
@@ -38,6 +45,7 @@
           :data="treeData"
           :props="defaultProps"
           highlight-current
+          ref="trees"
           @node-click="handleNodeClick"
         >
           <template #default="{ node, data }">
@@ -276,6 +284,8 @@ watch(
   (newValue) => {
     if (newValue) {
       tagList.value = newValue;
+      tagChoose.value = newValue ? Object.keys(newValue)[0] : "";
+      clickTage.value = newValue ? Object.values(newValue)[0] : "";
     }
   }
 );
@@ -340,11 +350,30 @@ watch(
     }
   }
 );
-//重置装置列表数据
+//监听scd弹框是否打开
+watch(
+  () => props.OpensclTrue,
+  (newValue) => {
+    if (newValue == false) {
+      results();
+      //关闭展开的节点
+      const nodes = trees.value.store._getAllNodes();
+      nodes.forEach((item) => {
+        item.expanded = false;
+      });
+      //关闭展开的节点
+    }
+    if (newValue) {
+      codeStatic();
+    }
+  }
+);
+//重置差异项数据
 const results = () => {
   treeData.value.forEach((item) => {
     item.num = 0;
     item.childItemCid = [];
+    clickItemcode.value = "";
     if (item.children) {
       item.children.forEach((key) => {
         key.num = 0;
@@ -352,9 +381,23 @@ const results = () => {
       });
     }
   });
+  //关闭展开的节点
+  const nodes = trees.value.store._getAllNodes();
+  nodes.forEach((item) => {
+    item.expanded = false;
+  });
+  //关闭展开的节点
 };
+const trees = ref(null);
+
 const tagClick = (row, num) => {
   loading.value = true;
+  // //关闭展开的节点
+  // const nodes = trees.value.store._getAllNodes();
+  // nodes.forEach((item) => {
+  //   item.expanded = false;
+  // });
+  // //关闭展开的节点
   results();
   tagChoose.value = num;
   clickTage.value = row;
@@ -402,27 +445,38 @@ watch(
   (newValue) => {
     if (newValue) {
       clickRow.value = newValue;
+      console.log("clickRow.value", props.iedRelation);
+
+      // clickTage.value
     }
   }
 );
 const clickItemcode = ref("");
+// 点击差异
 const handleNodeClick = (e) => {
   clickItemcode.value = e.itemcode;
   emit("clickCode", e.itemcode, e);
 };
 const nametip = ref(null);
 const istooltip = ref(false);
-
-const startCounting = (nametips) => {
-  nametip.value =nametips;
-  setTimeout(() => {
+const showFullNameIndex = ref(null);
+const timer = ref(null);
+//鼠标移上去后1.5秒显示全称
+const startCounting = (nametips, item, index) => {
+  timer.value = setTimeout(() => {
     istooltip.value = true;
+    console.log("index", index);
+    showFullNameIndex.value = index;
+    nametip.value = nametips;
   }, 1500);
 };
 const clearCounting = () => {
+  clearTimeout(timer.value);
   istooltip.value = false;
-  nametip.value = ''
+  showFullNameIndex.value = null;
+  nametip.value = "";
 };
+//鼠标移上去后1.5秒显示全称
 onMounted(() => {
   tagChoose.value = props.iedRelation ? Object.keys(props.iedRelation)[0] : "";
   clickTage.value = props.iedRelation
@@ -478,7 +532,6 @@ h3 {
   white-space: nowrap;
   margin-top: 10px;
   font-size: 16px;
-
 }
 .setting {
   width: 92%;
@@ -535,10 +588,10 @@ h3 {
 }
 .tooltips {
   position: absolute;
+  bottom: -50px;
+  right: 0px;
+  background-color: #fff;
   border: 1px solid #000;
-  background: #fff;
-  bottom: -57px;
-  right:0;
   z-index: 999;
 }
 </style>

+ 67 - 35
src/pages/netStructPicture/components/Gsix.vue

@@ -39,10 +39,15 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  uploadAnniu: {
+    //cid中是否点击了上传按钮
+    type: Boolean,
+    default: false,
+  },
 });
 
 const clickRow = ref(props.clickRowDatas);
-let tagList = ref(null); //左侧更改的设备列表
+let tagList = ref(props.iedRelation?Object.values(props.iedRelation)[0]:''); //左侧更改的设备列表
 
 //CID数据,点击差异的每一条数据
 const CodeInfoCid = ref(props.clickCodeInfoCid);
@@ -60,6 +65,14 @@ watch(
     }
   }
 );
+//点击了上传按钮并点击了确认清空线条
+watch(
+  () => props.uploadAnniu,
+  () => {
+    clickLineResult();
+    clickLineResultMain();
+  }
+);
 //对比文件:头部对比的单个数据
 watch(
   () => props.clickRowDatas,
@@ -76,6 +89,7 @@ watch(
     if (newValue) {
       dones();
       tagList.value = newValue;
+      console.log(' tagList.value3333',  tagList.value)
       clickLineResult();
       clickLineResultMain();
       if (clickRow.value && clickRow.value.id) {
@@ -101,15 +115,14 @@ const cClickCode = ref(props.clickCodeValue); //点击侧边栏差异项的code
 watch(
   () => props.clickCodeValue,
   (newValue) => {
+    cClickCode.value = newValue;
     if (newValue) {
-      console.log('newValue', newValue)
       isDiffdescUpAdd.value = false; //点击侧边栏的时候站控层的这个先置为空
       isDiffdescUpDel.value = false;
-      cClickCode.value = newValue;
       CodeImg(newValue); //找到差异项对应的图片进行展示
       clickLineResult(); //重置
       clickLineResultMain(); //重置
-      if (clickRow.value && clickRow.value.id) {
+      if (clickRow.value && clickRow.value.id && newValue) {
         getData();
       } else if (CodeInfoCid.value) {
         getDataCid();
@@ -163,7 +176,7 @@ const getData = async () => {
     comptype: "u",
     itemcode: cClickCode.value,
   });
-  if (!res||!res.data || !res.data.length) return (loading.value = false);
+  if (!res || !res.data || !res.data.length) return (loading.value = false);
   if (res.data && cClickCode.value != "scd.ied") {
     res.data.forEach((item) => {
       let text;
@@ -180,7 +193,7 @@ const getData = async () => {
   });
 };
 const getDataCid = () => {
-  dones()
+  dones();
   const cidsnode = CodeInfoCid.value.childItemCid;
   if (cClickCode.value == "scd.ied" && cidsnode && cidsnode.length > 0) {
     //装置基本信息
@@ -188,7 +201,7 @@ const getDataCid = () => {
   } else if (cClickCode.value != "scd.ied" && cidsnode && cidsnode.length > 0) {
     //除开装置信息
     mapList.value = cidsnode;
-    if(!mapList.value) return;
+    if (!mapList.value) return;
     mapList.value.forEach((item) => {
       commonGetData(item);
     });
@@ -397,7 +410,7 @@ const clickUpTypeImgUpAdd = (arr, event) => {
   }
   //新增 的数据
   let itemsToAdd = [];
-  if(! CommunicationS1.value) return;
+  if (!CommunicationS1.value) return;
   CommunicationS1.value.forEach((item) => {
     if (item.nnerTextRight == "空") {
       itemsToAdd.push({ ...item, add: true });
@@ -448,7 +461,7 @@ const clickUpTypeImg = (arr, event) => {
     ) {
       if (typeof arr[0][key] === "object") {
         // 如果当前属性的值是另一个对象,则进一步检查
-        if(!arr[0][key]) return;
+        if (!arr[0][key]) return;
         for (let subKey in arr[0][key]) {
           //遍历当前对象的所有子属性。
           // 检查子属性是否存在于两个输入对象中,并且它们的值是否不同。
@@ -907,10 +920,7 @@ watch(
 //连线===
 onMounted(() => {
   CodeImg(props.clickCodeValue);
-  if (props.iedRelation) {
-    tagList.value = Object.values(props.iedRelation)[0];
-  }
-  if (clickRow.value && clickRow.value.id&&!props.isCid) {
+  if (clickRow.value && clickRow.value.id && !props.isCid) {
     getData();
   }
 });
@@ -952,14 +962,19 @@ onMounted(() => {
             :id="item.diff_object_name.replace(/[^\w\s]/g, '')"
           >
             <div class="item-img">
-              <img :src="codeImg" alt="" class="type-img"   @click="
-              clickUpTypeImgLeft(
-                item.diff_desc,
-                $event,
-                item.diff_object_name,
-                item
-              )
-            "/>
+              <img
+                :src="codeImg"
+                alt=""
+                class="type-img"
+                @click="
+                  clickUpTypeImgLeft(
+                    item.diff_desc,
+                    $event,
+                    item.diff_object_name,
+                    item
+                  )
+                "
+              />
               <img loading="lazy" :src="modify0" alt="" class="type-img-mini" />
             </div>
             <div class="wraps">{{ item.diff_object_name }}</div>
@@ -972,8 +987,8 @@ onMounted(() => {
             id="leftBasic"
           >
             <div class="item-img">
-              <img loading="lazy"  :src="codeImg" alt="" class="type-img" />
-              <img loading="lazy"  :src="modify0" alt="" class="type-img-mini" />
+              <img loading="lazy" :src="codeImg" alt="" class="type-img" />
+              <img loading="lazy" :src="modify0" alt="" class="type-img-mini" />
             </div>
             <div class="wraps">基本信息</div>
           </div>
@@ -987,7 +1002,13 @@ onMounted(() => {
             :ref="(el) => setdomLeftMain(el, item.diff_object_name)"
           >
             <div class="item-img">
-              <img loading="lazy" :src="codeImg" alt="" class="type-img"  @click="clickTypeImg(item, $event)"/>
+              <img
+                loading="lazy"
+                :src="codeImg"
+                alt=""
+                class="type-img"
+                @click="clickTypeImg(item, $event)"
+              />
               <img loading="lazy" :src="newly0" alt="" class="type-img-mini" />
             </div>
             <div class="wraps">{{ item.diff_object_name }}</div>
@@ -1035,19 +1056,23 @@ onMounted(() => {
             v-for="(item, index) in dataU"
             :key="index"
             class="left-item-cont"
-            
             :id="item.diff_object_name.replace(/[^\w\s]/g, '')"
             :ref="(el) => setdomRightMain(el, item.diff_object_name)"
           >
             <div class="item-img">
-              <img :src="codeImg" alt="" class="type-img" @click="
-              clickUpTypeImgRight(
-                item.diff_desc,
-                $event,
-                item.diff_object_name,
-                item
-              )
-            "/>
+              <img
+                :src="codeImg"
+                alt=""
+                class="type-img"
+                @click="
+                  clickUpTypeImgRight(
+                    item.diff_desc,
+                    $event,
+                    item.diff_object_name,
+                    item
+                  )
+                "
+              />
               <img loading="lazy" :src="modify0" alt="" class="type-img-mini" />
             </div>
             <div class="wraps">{{ item.diff_object_name }}</div>
@@ -1075,7 +1100,13 @@ onMounted(() => {
             :ref="(el) => setdomRightMain(el, item.diff_object_name)"
           >
             <div class="item-img">
-              <img loading="lazy" :src="codeImg" alt="" class="type-img" @click="clickTypeImgDel(item, $event)" />
+              <img
+                loading="lazy"
+                :src="codeImg"
+                alt=""
+                class="type-img"
+                @click="clickTypeImgDel(item, $event)"
+              />
               <img loading="lazy" :src="del0" alt="" class="type-img-mini" />
             </div>
             <div class="wraps">{{ item.diff_object_name }}</div>
@@ -1499,8 +1530,9 @@ onMounted(() => {
   align-items: center;
   justify-content: center;
   margin-bottom: 45px;
-  width: 141px;
+  width: 120px;
   height: 23px;
+  word-wrap: break-word;
 }
 .right-difference {
   position: absolute;

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

@@ -70,12 +70,13 @@ watch(
 );
 const cancelClick = () => {
   OpensclTrue.value = false;
-  clickCodeValue.value = "";
+  clickCodeValue.value = null;//点击装置列表后装置code置为空
   emit("doneScl");
 };
 const clickList = ref(null);
 const treeBack = (data, val) => {
   clickList.value = data;
+  console.log('data11111111111', data)
 };
 const treeBackDefalut = (data) => {
   // clickList.value = data;
@@ -84,6 +85,7 @@ const treeBackDefalut = (data) => {
 const clickCodeValue = ref(null);
 const clickCode = (code) => {
   clickCodeValue.value = code;
+  console.log('clickCodeValue.value', clickCodeValue.value)
 };
 const result = (newData) => {
   checkData.value = newData;

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

@@ -113,6 +113,7 @@
           :http-request="uploadFile"
           :on-exceed="exceed"
           :show-file-list="false"
+          :disabled="isLoadingNew"
         >
           <template #trigger>
             <div class="upload-title">

+ 38 - 27
src/pages/netStructPicture/components/virtualnformation.vue

@@ -1,8 +1,13 @@
 <!-- 虚端子关系 -->
 <template>
-  <div class="main">
+  <div
+    class="main"
+    v-loading="loading"
+    element-loading-text="加载数据中"
+    element-loading-background="#f7f8fb"
+  >
     <!-- 关联图 -->
-    <div class="main-cont" id="treedom3">
+    <div class="main-cont" id="treedom3" style="overflow: hidden">
       <div class="main-left">
         <div v-for="(item, index) in leftList" :key="index" class="conts">
           <div class="cont-title">
@@ -180,7 +185,7 @@ const svInfo = ref(null);
 //处理两边的数据
 const processBoth = (list, svResInfo, inoutType) => {
   const iedNames = {};
-  if(!list||!svResInfo.data) return;
+  // if(!list||!svResInfo.data) return;
   list.forEach(async (item, index) => {
     item.titleItems = [];
     svResInfo.data.forEach((key) => {
@@ -200,7 +205,7 @@ const processBoth = (list, svResInfo, inoutType) => {
           ied_name: item.ied_name,
           reset: 1,
         });
-        if(!iedRes||!item.ied_name||!iedRes.data[item.ied_name]) return;
+        if (!iedRes || !item.ied_name || !iedRes.data[item.ied_name]) return;
         item.descName = iedRes.data[item.ied_name].desc;
       } else {
         const iedRes = await scdIedRelation({
@@ -208,7 +213,7 @@ const processBoth = (list, svResInfo, inoutType) => {
           ied_name: item.ied_name,
           reset: 1,
         });
-        if(!iedRes||!item.ied_name||!iedRes.data[item.ied_name]) return;
+        if (!iedRes || !item.ied_name || !iedRes.data[item.ied_name]) return;
         item.descName = iedRes.data[item.ied_name].desc;
       }
     }
@@ -257,26 +262,29 @@ watch(
   () => props.clickList,
   (newValue) => {
     if (newValue) {
+      loading.value = true;
       tagList.value = newValue;
-      clickResetLine3()
-      getNetworkInfo3();
-    }
-  }
-);
-const cClickCode = ref(props.clickCodeValue); //点击侧边栏差异项的code
-watch(
-  () => props.clickCodeValue,
-  (newValue) => {
-    if (newValue) {
-      cClickCode.value = newValue;
       clickResetLine3();
       getNetworkInfo3();
+      console.log("first======", newValue);
     }
   }
 );
+const cClickCode = ref(props.clickCodeValue); //点击侧边栏差异项的code
+// watch(
+//   () => props.clickCodeValue,
+//   (newValue) => {
+//     console.log("first333333======", newValue);
+//     if (newValue) {
+//       cClickCode.value = newValue;
+//       clickResetLine3();
+//       getNetworkInfo3();
+//     }
+//   }
+// );
 // //scd一致性对比====
 const bothdataList = ref([]); //处理得到总的两边的数据
-const middleTitelDesc = ref('');//中间数据的标题
+const middleTitelDesc = ref(""); //中间数据的标题
 //得到中间的子版块数据
 const getNetworkInfo3 = async () => {
   bothdataList.value = [];
@@ -297,7 +305,7 @@ const getNetworkInfo3 = async () => {
     ied_name: names,
     reset: 1,
   });
-middleTitelDesc.value = iedRes&&iedRes.data?iedRes.data[names].desc:''
+  middleTitelDesc.value = iedRes && iedRes.data ? iedRes.data[names].desc : "";
   //省略号===
   const data = {
     attr_ld_inst: "",
@@ -310,7 +318,7 @@ middleTitelDesc.value = iedRes&&iedRes.data?iedRes.data[names].desc:''
     isDecollate: true,
   };
   //省略号===
-  if(!svResInfo||!svResInfo.data) return;
+  if(!svResInfo||!svResInfo.data) return loading.value = false;
   svResInfo.data.sort(function (a, b) {
     return a.no - b.no; // 从小到大排序
   });
@@ -327,7 +335,7 @@ middleTitelDesc.value = iedRes&&iedRes.data?iedRes.data[names].desc:''
       }
     }
   });
-  if(!props.recordDelIedVer) return;
+  // if(!props.recordDelIedVer) return;
   // recordDelIedVer  删除的全部数据
   props.recordDelIedVer.forEach((itemdel) => {
     svResInfo.data.forEach((item) => {
@@ -341,7 +349,12 @@ middleTitelDesc.value = iedRes&&iedRes.data?iedRes.data[names].desc:''
   if (svResInfo.data.length > 0) {
     processBoth(leftList.value, svResInfo, "in");
     processBoth(rightList.value, svResInfo, "out");
+    //不加条件切换下方tab时会出现bug
+    nextTick(() => {
+      setLine();
+    });
   }
+
   //处理中间的数据有省略号的
   let newData = [];
   for (let i = 0; i < svResInfo.data.length; i++) {
@@ -404,6 +417,7 @@ const setLeaderline = () => {
       }
     }
   }
+  loading.value = false;
   hiddenLine();
 };
 //滚动时重定位线条
@@ -411,7 +425,7 @@ const newPositionLine = () => {
   document.getElementById("treedom3").addEventListener(
     "scroll",
     AnimEvent.add(() => {
-      if(!leaderLines3.value) return;
+      if (!leaderLines3.value) return;
       leaderLines3.value.forEach((line) => {
         if (line) {
           hiddenLine();
@@ -426,7 +440,7 @@ const newPositionLine = () => {
   document.getElementById("treedom3").addEventListener(
     "resize",
     AnimEvent.add(function () {
-      if(!diffline) return;
+      if (!diffline) return;
       diffline.forEach((line) => {
         hiddenLine();
         line.position();
@@ -439,7 +453,7 @@ const newPositionLine = () => {
 //弹窗打开后使得线条在指定区域中
 const hiddenLine = () => {
   const elmWrapper = document.getElementById("wrapper");
-  if(!elmWrapper) return;
+  if (!elmWrapper) return;
   // 移动 line
   document.body.querySelectorAll("body .leader-line").forEach((node) => {
     elmWrapper.appendChild(node);
@@ -451,6 +465,7 @@ const hiddenLine = () => {
     (rectWrapper.left + window.scrollY) * -1
   }px, ${(rectWrapper.top + window.scrollX) * -1}px)`;
 };
+const loading = ref(true);
 const setLine = () => {
   setTimeout(() => {
     setLeaderline();
@@ -471,10 +486,6 @@ let scdIdValue = "";
 onMounted(() => {
   scdIdValue = route.query.id;
   getNetworkInfo3();
-  //不加条件切换下方tab时会出现bug
-  nextTick(() => {
-    setLine();
-  });
 });
 watch(
   () => props.OpensclTrue,

+ 70 - 63
src/pages/netStructPicture/index.vue

@@ -90,12 +90,13 @@
           </div>
           <div v-if="!upName" class="tips-cid">请上传CID文件进行对比</div>
           <Gsix
-            v-if="upName && clickCodeValue != 'scd.ied.Relation'&&!isContrast"
+            v-if="upName && clickCodeValue != 'scd.ied.Relation' && !isContrast"
             @clickCode="clickCode"
             :clickList="backName"
             :clickCodeInfoCid="clickCodeInfoCid"
             :isCid="isCid"
             :clickCodeValue="clickCodeValue"
+            :uploadAnniu="uploadAnniu"
           ></Gsix>
           <!-- 对比失败 -->
           <div v-else-if="isContrast" class="fail-contrast">
@@ -179,8 +180,8 @@ import scdCheck from "@/api/scdCheck/scdCheck";
 let route = useRoute();
 const isCid = ref(true); //判断是否是CID界面
 const isCidLoading = ref(false); //判断是否正在解析CID文件
-const isContrast =ref(false);//判断是否对比成功
-const isContrastDes =ref(false);//对比错误的描述
+const isContrast = ref(false); //判断是否对比成功
+const isContrastDes = ref(false); //对比错误的描述
 const activeName = ref("first"); //默认展示网络结构图
 const navtopData = ref([
   { name: "CID一致性校核", code: "CID" },
@@ -190,7 +191,7 @@ const navtopData = ref([
   { name: "虚端子关系图", code: "virtual" },
 ]);
 const activeNav = ref(null);
-const upload = ref(null);//上传按钮的ref
+const upload = ref(null); //上传按钮的ref
 const backName = ref({}); //树组件返回名称
 let mustVal = ref(false);
 let upName = ref(""); //上传的文件名称
@@ -235,11 +236,13 @@ const handleClick = (val) => {
 //点击左侧装置列表树返回的信息,
 const newChicken = ref(""); //基准文件
 const treeBack = (data, val) => {
-  newChicken.value = `(${data.ied_name}${data.desc})`;
-  isContrast.value = ''
+  console.log("data", data);
+  newChicken.value = `(${data.ied_name})${data.desc}`;
+  isContrast.value = "";
   upName.value = "";
   backName.value = data; //返回的点击行的信息
   arrName.value = data;
+  uploadAnniu.value = false;
   // backId.value = val.id;
 };
 const closeX = () => {
@@ -247,12 +250,8 @@ const closeX = () => {
   activeNav.value = null;
 };
 const allCidStart = ref([]);
+const uploadAnniu = ref(false); //代表点击了上传按钮,用于清空上次的连线
 const nowUpload = (file, e) => {
-  upload.value.clearFiles();
-  console.log('files====', file)
-  upFile.value = file.file;
-  upName.value = file.file.name;
-  clickCodeInfoCid.value = [];
   ElMessageBox.confirm(
     "该操作耗时较长,校验开始后将清除原有校验结果且无法中止,确定开始吗?",
     "Warning",
@@ -261,58 +260,66 @@ const nowUpload = (file, e) => {
       cancelButtonText: "取消",
       type: "warning",
     }
-  ).then(async () => {
-    ElNotification({
-      title: "信息",
-      message: "正在进行CID的一致性比对...请稍候",
-      duration: 0,
-    });
-    isCidLoading.value = true;
-    cid
-      .fileUpload({
-        station_id: nowStation.value - 0,
-        file: upFile.value,
-        attachment_type: "cid",
-        ied_name: backName.value.ied_name,
-      })
-      .then((res) => {
-        if (res.code == 0) {
-          allCidStart.value = [];
-          let idp = `${backName.value.ied_name},${res.data.fileid}`;
-          scdCheck
-            .scdStart({
-              type: "CID",
-              station_id: route.query.stationId,
-              source_scd_id: route.query.id,
-              station_id: nowStation.value - 0,
-              ids: idp,
-            })
-            .then((res) => {
-              ElNotification.closeAll();
-              if (res&&res.code == 0) {
-                ElMessage({
-                  type: "success",
-                  message: "对比成功!",
-                });
-                allCidStart.value = res.data.list;
-                isCidLoading.value = false;
-                isContrast.value = res.data&&res.data.list?false:true;//对比成功并且有数据
-                isContrastDes.value = res.data&&res.data.list?'':'两个对比的CID没有差异'
-              } else {
-                isCidLoading.value = false;
-                isContrast.value = true;//对比失败
-                isContrastDes.value =  res.msg
-              }
-            });
-        } else {
-          ElMessage({
-            type: "error",
-            message: res.msg,
-          });
-          isCidLoading.value = false;
-        }
+  )
+    .then(async () => {
+      upload.value.clearFiles(); //清空上次上传的文件
+      clickCodeInfoCid.value = [];
+      uploadAnniu.value = true;
+      upFile.value = file.file;
+      upName.value = file.file.name;
+      ElNotification({
+        title: "信息",
+        message: "正在进行CID的一致性比对...请稍候",
+        duration: 0,
       });
-  }).catch(err=>{});
+      isCidLoading.value = true;
+      cid
+        .fileUpload({
+          station_id: nowStation.value - 0,
+          file: upFile.value,
+          attachment_type: "cid",
+          ied_name: backName.value.ied_name,
+        })
+        .then((res) => {
+          if (res.code == 0) {
+            allCidStart.value = [];
+            let idp = `${backName.value.ied_name},${res.data.fileid}`;
+            scdCheck
+              .scdStart({
+                type: "CID",
+                station_id: route.query.stationId,
+                source_scd_id: route.query.id,
+                station_id: nowStation.value - 0,
+                ids: idp,
+              })
+              .then((res) => {
+                ElNotification.closeAll();
+                if (res && res.code == 0) {
+                  ElMessage({
+                    type: "success",
+                    message: "对比成功!",
+                  });
+                  allCidStart.value = res.data.list;
+                  isCidLoading.value = false;
+                  isContrast.value = res.data && res.data.list ? false : true; //对比成功并且有数据
+                  isContrastDes.value =
+                    res.data && res.data.list ? "" : "两个对比的CID没有差异";
+                } else {
+                  isCidLoading.value = false;
+                  isContrast.value = true; //对比失败
+                  isContrastDes.value = res.msg;
+                }
+              });
+          } else {
+            ElMessage({
+              type: "error",
+              message: res.msg,
+            });
+            isCidLoading.value = false;
+          }
+        });
+    })
+    .catch((err) => {});
 };
 
 const handleRemove = (file, e) => {};
@@ -531,7 +538,7 @@ $height: 40px;
   font-size: 14px;
   margin: 20px 0;
 }
-.fail-contrast{
+.fail-contrast {
   text-align: center;
   margin-top: 30px;
   color: red;