|
@@ -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;
|