瀏覽代碼

scd文件一致性校验,新的对比完善

“yueshang” 1 年之前
父節點
當前提交
b93b7948a3

+ 9 - 0
src/api/scdCheck/scdCheck2.js

@@ -21,3 +21,12 @@ export function tmpParse(data) {
     }
   })
 }
+//scd文件开始对比
+export function compStart(data) {
+  return request({
+    url: '/scd/comp/start',
+    method: 'post',
+    data
+  })
+}
+

+ 1 - 0
src/pages/mission/components/HaveMis.vue

@@ -157,6 +157,7 @@ export default {
         query: {
           id: row.scd_id,
           name: row.name,
+          parentData:JSON.stringify(row),
           stationId: row.station_id,
           stationName: row.scd_name,
         },

+ 8 - 1
src/pages/netStructPicture/components/scdMap.vue

@@ -2,7 +2,9 @@
     <div>
         <div class="fileBox">
             <div>
-                <span style="border-right: 1px solid #516380;padding-right: 200px;">基准文件:<span style="color:#09162C;">{{ chicken }}</span></span>
+                <span style="border-right: 1px solid #516380;padding-right: 200px;">基准文件:
+                    <!-- {{ chicken }} -->
+                    <span style="color:#09162C;">{{ newChicken}}</span></span>
             </div>
             <div>
                 <span>对比文件:<span style="color:#09162C;">{{ kun }}</span></span>
@@ -87,6 +89,7 @@ import ScdDel from './ScdDel.vue';
 import ScdEdit from './ScdEdit.vue';
 import ScdNow from './ScdNow.vue';
 import { ElLoading } from 'element-plus';
+import { useRoute } from "vue-router";
 export default {
     props: {
         antherBack: {
@@ -101,6 +104,7 @@ export default {
     setup(props, { emit }) {
         let arrNew = ref([])
         let chicken = ref('')
+        const route = useRoute();
         let kun = ref('')
         let lineList = []//线条显示
         let lookType = ref(0)//0为查看整体,1为新增,2为修改,3为删除
@@ -146,7 +150,9 @@ export default {
                 loading.close()
             }, 2000)
         }
+        const newChicken = ref('')
         onMounted(() => {
+            newChicken.value = route.query.stationName;
             lastList()
             openFullScreen2()
         })
@@ -163,6 +169,7 @@ export default {
             lookType,//0为查看整体,1为新增,2为修改,3为删除
             nowBack,
             openFullScreen2,//加载
+            newChicken
         }
     },
     components: {

+ 68 - 7
src/pages/netStructPicture/components/scdTree.vue

@@ -79,7 +79,11 @@
           <div class="title">请选择对比的SCD文件</div>
         </div>
       </template>
-      <div class="uploda-file" v-loading="loadingAdd">
+      <div
+        class="uploda-file"
+        v-loading="loadingAdd"
+        element-loading-text="上传文件中..."
+      >
         <span class="file-title">选择文件</span>
         <el-input
           v-model="chooseFile"
@@ -135,12 +139,15 @@
         >
           确认上传
         </div> -->
+
         <div
-          class="sures"
-          :class="{ 'sures-success': !isAnalysis && AnalysisProcess }"
+          class="sures sures-success"
+          v-if="!isAnalysis && AnalysisProcess"
+          @click="yesAnalysisClick"
         >
           开始对比
         </div>
+        <div class="sures" v-else @click="noAnalysisClick">开始对比</div>
       </div>
     </el-dialog>
   </div>
@@ -157,10 +164,15 @@ import {
   onUnmounted,
 } from "vue";
 import scdCheck from "@/api/scdCheck/scdCheck";
-import { uploadfile, tmpParse } from "@/api/scdCheck/scdCheck2";
+import { uploadfile, tmpParse, compStart } from "@/api/scdCheck/scdCheck2";
 import scd from "@/api/scd";
 import systemRow from "@/api/systemRow";
-import { ElMessage, ElLoading } from "element-plus";
+import {
+  ElMessage,
+  ElLoading,
+  ElMessageBox,
+  ElNotification,
+} from "element-plus";
 import LookScd from "../modalCom/LookScd.vue";
 import dervicePng from "@/assets/image/scdcheck/derive.png";
 import againPng from "@/assets/image/scdcheck/again.png";
@@ -357,7 +369,55 @@ watch(
     }
   }
 );
+//解析完成开始对比的点击
+const yesAnalysisClick = () => {
+  console.log("parentData.value", parentData.value);
+  ElMessageBox.confirm(
+    "该操作耗时较长,校验开始后将清除原有校验结果且无法中止,确定开始吗?",
+    "Warning",
+    {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    }
+  )
+    .then(async () => {
+      ElNotification({
+        title: "信息",
+        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: "对比完成!",
+        });
+      }
+    })
+    .catch((err) => {
+      console.log("err", err);
+    });
+};
+//解析失败活未完成开始对比的点击
+const noAnalysisClick = () => {
+  ElMessage({
+    type: "warning",
+    message: "请上传文件并等待文件解析完成!",
+  });
+};
+const parentData = ref(null);
 onMounted(() => {
+  parentData.value = JSON.parse(route.query.parentData);
   aktType();
 });
 </script>
@@ -420,7 +480,6 @@ onMounted(() => {
   flex-direction: column;
   justify-content: center;
   align-items: center;
-
 }
 .sures {
   background: #dfe8ff;
@@ -452,7 +511,6 @@ onMounted(() => {
   margin-left: 67px;
   margin-top: 10px;
   color: #255ce7;
-
 }
 .analysis.success {
   color: #3be078;
@@ -460,4 +518,7 @@ onMounted(() => {
 .analysis.fail {
   color: #e50505;
 }
+:deep(.el-message-box) {
+  vertical-align: inherit !important;
+}
 </style>

+ 4 - 2
src/pages/netStructPicture/index.vue

@@ -30,7 +30,8 @@
                     padding-right: 300px;
                     font-size: 12px;
                   ">
-                  基准文件:{{ arrName }}
+                  基准文件:
+                  {{ arrName }}
                 </span>
               </div>
               <div>
@@ -102,13 +103,14 @@ import scdTree from "./components/scdTree.vue";
 import scdMap from "./components/scdMap.vue";
 import CrcCheck from "./newTitle/CrcCheck";
 import SlcCheck from "./newTitle/SlcCheck.vue";
-import { useRoute } from "vue-router";
+import { useRoute} from "vue-router";
 import cid from "@/api/cid/cid";
 import { ElMessage } from "element-plus";
 import systemRow from "@/api/systemRow";
 import scdCheck from "@/api/scdCheck/scdCheck";
 import virtualRelation from "./components/virtualRelation.vue"; //虚端
 let route = useRoute();
+
 const activeName = ref("first"); //默认展示网络结构图
 const navtopData = ref([
   { name: "CID一致性校核", code: "CID" },