liyangzheng hai 1 ano
pai
achega
4c452f9da0

+ 2 - 0
src/main.js

@@ -22,6 +22,8 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
     app.component(key, component)
 }
 app.use(ElementPlus, { locale: zhCn });//使element全局变为中文
+//全局点击遮罩层不关闭
+app._context.components.ElDialog.props.closeOnClickModal.default = false
 app.use(router)
 app.use(store);
 LogicFlow.use(BpmnElement);

+ 20 - 16
src/pages/netStructPicture/components/ScdNow.vue

@@ -13,7 +13,7 @@
               alt=""
               class="circel-png"
             />
-            <span v-if="scdVer && scdVer[1] != ''">{{ scdVer[0] }}</span>
+            <span v-if="scdVer && scdVer[1] != ''">{{ scdVer[1] }}</span>
             <span v-else>无</span>
           </div>
           <img :src="jiantouPng" alt="" class="jiantou" />
@@ -164,7 +164,7 @@ const lineWrite = () => {
   hiddenLine2();
 };
 const clickRow = ref(false);
-const clickRowData = ref({});//对比列表点击的数据
+const clickRowData = ref({}); //对比列表点击的数据
 watch(
   () => props.clickViewData,
   (newValue) => {
@@ -173,8 +173,13 @@ watch(
       clickRowData.value = newValue;
       clickRow.value = true;
       detailData.value = null;
-      lineList.value.forEach((item) => item.remove());
       lineList.value = [];
+      const elmWrapper = document.getElementById("wrapperscd");
+      if (elmWrapper) {
+        elmWrapper.querySelectorAll(".leader-line").forEach((node) => {
+          node.remove();
+        });
+      }
     }
   }
 );
@@ -227,14 +232,14 @@ const done = (emits) => {
   openBig.value = emits;
   checkDialogData.value = null;
   scdView.value = false;
-  delScdId.value = ''
+  delScdId.value = "";
 };
 const iedRelationData = ref({}); //左侧所有数据
 const scdView = ref(false); //是否是点击Scd文件一致性校核进入的
-const delScdId = ref('');//点击删除的scd_id
-const lookAddOrDel =async (comData,del) => {
+const delScdId = ref(""); //点击删除的scd_id
+const lookAddOrDel = async (comData, del) => {
   iedRelationData.value = {};
-  checkDialogData.value =null;
+  checkDialogData.value = null;
   scdView.value = true;
   const iedDetail = {};
   for (let k = 0; k < comData.length; k++) {
@@ -249,12 +254,12 @@ const lookAddOrDel =async (comData,del) => {
   for (let key of keys) {
     iedRelationData.value[key] = iedDetail[key];
   }
-  if(del=='del'&&clickRowData.value.target_id){
-    delScdId.value= clickRowData.value.target_id
-  }else{
-    delScdId.value=route.query.id
+  if (del == "del" && clickRowData.value.target_id) {
+    delScdId.value = clickRowData.value.target_id;
+  } else {
+    delScdId.value = route.query.id;
   }
-   // 对键进行排序===
+  // 对键进行排序===
   const iedRes = await scdIedRelation({
     scd_id: delScdId.value,
     ied_name: comData[0].ied_name,
@@ -262,15 +267,14 @@ const lookAddOrDel =async (comData,del) => {
   });
   checkDialogData.value = iedRes.data[comData[0].ied_name];
   openBig.value = true;
-
-}
+};
 const lookAdd = async (comData) => {
-  lookAddOrDel(comData)
+  lookAddOrDel(comData);
   // lookType.value = 1;
   // emit("nowBack", lookType.value);
 };
 const lookDel = (comData) => {
-  lookAddOrDel(comData,'del')
+  lookAddOrDel(comData, "del");
   // lookType.value = 3;
   // emit("nowBack", lookType.value);
 };

+ 152 - 49
src/pages/netStructPicture/components/scdTree.vue

@@ -15,23 +15,42 @@
       </div>
     </div>
     <div class="tableBox">
-      <el-table ref="multipleTableRef" :data="tableList" style="width: 100%; height: calc(100vh - 320px)" stripe
-        @selection-change="handleSelectionChange" @select-all="chooseAll" :header-cell-style="{
+      <el-table
+        ref="multipleTableRef"
+        :data="tableList"
+        style="width: 100%; height: calc(100vh - 320px)"
+        stripe
+        @selection-change="handleSelectionChange"
+        :header-cell-style="{
           background: '#F7F8FB !important',
           color: '#7484AB',
           borderBottom: '1px solid #A3ADE0 !important',
           fontWeight: '400',
-        }">
-        <el-table-column type="selection" width="55" />
-        <el-table-column label="对比scd" width="190" :show-overflow-tooltip="true">
+        }"
+      >
+        <el-table-column width="55" type="selection" />
+        <el-table-column
+          label="对比scd"
+          width="190"
+          :show-overflow-tooltip="true"
+        >
           <template #default="scope">{{ scope.row.name }}</template>
         </el-table-column>
-        <el-table-column property="CREATED_TIME" label="时间" width="auto" :show-overflow-tooltip="true" />
+        <el-table-column
+          property="CREATED_TIME"
+          label="时间"
+          width="auto"
+          :show-overflow-tooltip="true"
+        />
         <el-table-column fixed="right" label="操作" width="120">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="searchScdCheck(scope.row)"><el-icon>
-                <View />
-              </el-icon>查看</el-button>
+            <el-button
+              link
+              type="primary"
+              size="small"
+              @click="searchScdCheck(scope.row)"
+              ><el-icon> <View /> </el-icon>查看</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -46,22 +65,55 @@
       </LookScd>
     </div> -->
     <!-- 新的对比弹窗 -->
-    <el-dialog @close="cancelClick" v-model="lookScdModal" width="30vw" style="height: 400px" append-to-body draggable>
+    <el-dialog
+      @close="cancelClick"
+      v-model="lookScdModal"
+      width="30vw"
+      style="height: 400px"
+      append-to-body
+      draggable
+    >
       <template #header>
         <div class="my-header">
           <div class="title">请选择对比的SCD文件</div>
         </div>
       </template>
-      <div class="uploda-file" v-loading="loadingAdd" element-loading-text="上传文件中...">
+      <div
+        class="uploda-file"
+        v-loading="loadingAdd"
+        element-loading-text="上传文件中..."
+      >
         <span class="file-title">选择文件</span>
-        <el-input v-model="chooseFile" class="w-50 m-2" placeholder="点击右侧按钮上传文件" clearable @clear="clearFile">
+        <el-input
+          v-model="chooseFile"
+          class="w-50 m-2"
+          placeholder="点击右侧按钮上传文件"
+          clearable
+          @clear="clearFile"
+        >
           <template #suffix>
-            <img v-if="chooseFile" :src="uploadSPng" alt="" style="width: 20px; height: 20px" />
-            <img v-if="loadingAddError" :src="uploadEPng" alt="" style="width: 20px; height: 20px" />
+            <img
+              v-if="chooseFile"
+              :src="uploadSPng"
+              alt=""
+              style="width: 20px; height: 20px"
+            />
+            <img
+              v-if="loadingAddError"
+              :src="uploadEPng"
+              alt=""
+              style="width: 20px; height: 20px"
+            />
           </template>
         </el-input>
-        <el-upload v-model:file-list="fileList" :limit="1" class="upload-demo" :http-request="uploadFile"
-          :on-exceed="exceed" :show-file-list="false">
+        <el-upload
+          v-model:file-list="fileList"
+          :limit="1"
+          class="upload-demo"
+          :http-request="uploadFile"
+          :on-exceed="exceed"
+          :show-file-list="false"
+        >
           <template #trigger>
             <div class="upload-title">
               <img :src="uploadPng" alt="" />
@@ -87,7 +139,11 @@
           确认上传
         </div> -->
 
-        <div class="sures sures-success" v-if="!isAnalysis && AnalysisProcess" @click="yesAnalysisClick">
+        <div
+          class="sures sures-success"
+          v-if="!isAnalysis && AnalysisProcess"
+          @click="yesAnalysisClick"
+        >
           开始对比
         </div>
         <div class="sures" v-else @click="noAnalysisClick">开始对比</div>
@@ -132,7 +188,7 @@ import uploadEPng from "@/assets/image/scdcheck/upload_error.png";
 import { useRoute } from "vue-router";
 import createds from "@/utils/scdMqtt.js";
 const route = useRoute();
-const emit = defineEmits(["scdTreeBack","scdView","scdJpadList"]);
+const emit = defineEmits(["scdTreeBack", "scdView", "scdJpadList"]);
 let tableList = ref([]);
 let multipleTableRef = ref();
 let alreadyTriggered = ref(false);
@@ -144,8 +200,11 @@ const fileList = ref([]); //上传的文件
 const loadingAdd = ref(false); //文件上传的加载状态
 const loadingAddError = ref(false); //文件上传的加载状态
 const chooseFile = ref("");
+const chooseContrast = ref(null);
 const handleSelectionChange = (e) => {
+  console.log('e==', e)
   //复选
+  chooseContrast.value = e;
 };
 const chooseAll = (e) => {
   //全选
@@ -153,6 +212,12 @@ const chooseAll = (e) => {
 const checkNow = (e) => {
   //scd比对
   lookScdModal.value = true;
+  contrast.value = false;
+  chooseContrast.value = null;
+  AnalysisProcess.value = false;
+  isAnalysis.value = false;
+  chooseFile.value = "";
+
 };
 const excelPort = () => {
   //导出excel
@@ -171,9 +236,22 @@ const excelPort = () => {
       }
     });
 };
-const reloadCheck = () => {
+const contrast = ref(false); //是否是重新对比
+const reloadCheck =async () => {
+  contrast.value = true;
+  mesg.value = null;
   //重新比对
-  checkNow();
+  if (
+    !chooseContrast.value ||
+    (chooseContrast.value && chooseContrast.value.length == 0)
+  ) {
+    ElMessage({
+      type: "warning",
+      message: "请选择一条历史校验记录或创建新一致性校验!",
+    });
+  } else {
+    yesAnalysisClick();
+  }
 };
 const exceed = (files) => {
   if (fileList.value.length > 0) {
@@ -217,12 +295,12 @@ const uploadFile = async (e) => {
     });
   }
 };
-  //查看scd对比
-  let data = {};
+//查看scd对比
+let data = {};
 const searchScdCheck = async (row) => {
-  data = {}
+  data = {};
   data = row;
-  emit('scdView',data)
+  emit("scdView", data);
   const loading = ElLoading.service({
     lock: true,
     text: "正在查询数据",
@@ -232,7 +310,7 @@ const searchScdCheck = async (row) => {
     comp_id: row.id,
   });
   if (res.code == 0) {
-    emit('scdJpadList',res.data)
+    emit("scdJpadList", res.data);
     loading.close();
   }
 };
@@ -242,6 +320,7 @@ const lookScdBack = (data, row) => {
   lookScdArr.value = row;
   emit("scdTreeBack", lookScdArr.value);
 };
+
 const aktType = () => {
   //初始化数据
   scdCheck
@@ -258,7 +337,7 @@ const isAnalysis = ref(false); //解析是否成功
 const AnalysisProcess = ref(false); //解析是否完成
 const startMqtt = (val) => {
   //val = 订阅地址
-  //设置订阅地址
+  //设置订阅地址checkNo
   PublicMqtt.value = new createds(val);
   //初始化mqtt
   PublicMqtt.value.init();
@@ -280,6 +359,7 @@ const getMessage = () => {
       });
     } else {
       isAnalysis.value = false;
+      contrast.value = false;
     }
     console.log(mesg.value, "返回的数据", topic);
   });
@@ -316,6 +396,7 @@ watch(
     }
   }
 );
+const referenceData = ref(null)
 //解析完成开始对比的点击
 const yesAnalysisClick = () => {
   ElMessageBox.confirm(
@@ -333,27 +414,48 @@ const yesAnalysisClick = () => {
         message: "正在进行SCD的一致性比对...请稍候",
         duration: 0,
       });
-      const anRes = await compStart({
-        type: "SCD",
-        station_id: route.query.stationId,
-        source_scd_id: route.query.id,
-        target_scd_id: mesg.value.rootid,
-        comp_id: 0,
-      });
-      if (anRes.code == 0) {
-        ElNotification.closeAll();
-        loadingAdd.value = false;
-        aktType();
-        ElMessage({
-          type: "success",
-          message: "对比完成!",
-        });
+      let anRes;
+      if (mesg.value&&!contrast.value) {
+      //为了得到基准文件的soureid
+      referenceData.value = tableList.value.filter(item=>item.source_id==mesg.value.rootid);
+      console.log(' referenceData.value', referenceData.value)
+        anRes = await compStart({
+          type: "SCD",
+          station_id: route.query.stationId,
+          source_scd_id: route.query.id,
+          target_scd_id: mesg.value.rootid,
+          comp_id: 0,
+        })
+      }else if(chooseContrast.value){
+        console.log('chooseContrast.value', chooseContrast.value)
+       anRes = await compStart({
+          type: "SCD",
+          station_id: route.query.stationId,
+          source_scd_id: chooseContrast.value[0].source_id,
+          target_scd_id: chooseContrast.value[0].target_id,
+          comp_id: chooseContrast.value[0].id
+        })
       }
+        if (anRes.code == 0) {
+          loadingAdd.value = false;
+          aktType();
+          ElMessage({
+            type: "success",
+            message: "对比完成!",
+          });
+          ElNotification.closeAll();
+          lookScdModal.value = false;
+        } else {
+          ElMessage({
+            type: "error",
+            message: err.msg,
+          });
+        }
+
     })
-    .catch((err) => {
-    });
+    .catch((err) => {});
 };
-//解析失败活未完成开始对比的点击
+//解析失败未完成开始对比的点击
 const noAnalysisClick = () => {
   ElMessage({
     type: "warning",
@@ -368,7 +470,7 @@ onMounted(() => {
 </script>
 
 <style scoped lang="scss">
-.btnBox>div,
+.btnBox > div,
 .upload-title {
   height: 50px;
   display: flex;
@@ -398,13 +500,13 @@ onMounted(() => {
   display: flex;
   margin-bottom: 12px;
 
-  &>div:first-child,
-  &>div:nth-child(2) {
+  & > div:first-child,
+  & > div:nth-child(2) {
     width: 102px;
     background-size: 102px 45px;
   }
 
-  &>div:last-child {
+  & > div:last-child {
     width: 128px;
     background-size: 128px 45px;
   }
@@ -452,7 +554,8 @@ onMounted(() => {
   background: #255ce7;
 }
 
-.sureUpload {}
+.sureUpload {
+}
 
 .file-title {
   width: 90px;