|
@@ -1,132 +1,251 @@
|
|
|
<template>
|
|
|
- <div class="bigBox">
|
|
|
- <div class="header">
|
|
|
- <h1>{{ needFlashName + "——" + needScdName + "——CRC效验结果" }}</h1>
|
|
|
- </div>
|
|
|
- <div class="antherHeader">
|
|
|
- <span style="margin-right: 10px;">SCD文件CRC:<em>{{ scdAndCrc.scdcrc }}</em></span>
|
|
|
- <span style="margin-right: 10px;">SCD效验CRC:<em>{{ scdAndCrc.checkcrc }}</em></span>
|
|
|
- <span >效验结果:<em :style="{ color: isTrue ? 'green' : 'red' }">{{ isTrue?'一致':"不一致" }}</em></span>
|
|
|
- </div>
|
|
|
- <div class="table">
|
|
|
- <el-table :data="tableList" stripe style="width: 100%;height: calc(100vh - 260px);">
|
|
|
- <el-table-column width="80" label="序号">
|
|
|
- <template #default="scope">
|
|
|
- {{ scope.$index + 1 }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="iedname" label="装置名称" width="120" />
|
|
|
- <el-table-column prop="ieddesc" label="装置描述" :show-overflow-tooltip="true" width="260" />
|
|
|
- <el-table-column prop="manufacturer" label="厂家" width="100" />
|
|
|
- <el-table-column prop="type" label="型号" />
|
|
|
- <el-table-column prop="iedversion" label="ied版本" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column prop="" label="CCD CRC">
|
|
|
- <template #default="scope">
|
|
|
- 无
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="scdcrc" label="SCD CRC" />
|
|
|
- <el-table-column prop="checkcrc" label="效验CRC" />
|
|
|
- <el-table-column label="效验结果">
|
|
|
- <template #default="scope">
|
|
|
- <span :style="{ color: scope.row.scdcrc === scope.row.checkcrc ? 'green' : 'red' }">
|
|
|
- {{ scope.row.scdcrc === scope.row.checkcrc ? '一致' : '不一致' }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
+ <div class="bigBox">
|
|
|
+ <div class="header">
|
|
|
+ <div v-if="needFlashName">
|
|
|
+ {{ needFlashName + " — " + needScdName + " — CRC效验结果" }}
|
|
|
+ </div>
|
|
|
+ <div v-else>CRC效验结果</div>
|
|
|
+ <span class="closeX" @click="closeX">×</span>
|
|
|
</div>
|
|
|
+ <div class="antherHeader">
|
|
|
+ <span
|
|
|
+ >SCD文件CRC:<span class="desc">{{ scdAndCrc.scdcrc }}</span>
|
|
|
+ <span class="line"></span
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ >SCD效验CRC:<span class="desc">{{ scdAndCrc.checkcrc }}</span>
|
|
|
+ <span class="line"></span
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ >效验结果:<em :style="{ color: isTrue ? 'green' : '#E50505' }">{{
|
|
|
+ isTrue ? "一致" : "不一致"
|
|
|
+ }}</em></span
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="selectValue"
|
|
|
+ class="m-2"
|
|
|
+ placeholder="Select"
|
|
|
+ size="large"
|
|
|
+ style="width: 100px; margin-left: 25px"
|
|
|
+ @change="selectClick"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="table-data">
|
|
|
+ <el-table
|
|
|
+ :data="tableList"
|
|
|
+ stripe
|
|
|
+ height="90%"
|
|
|
+ style="width: 100%;overflow-y: auto;"
|
|
|
+ :cell-style="{ color: '#1A2447', border: 'none', height: '40px' }"
|
|
|
+ :header-cell-style="{
|
|
|
+ color: '#7484AB',
|
|
|
+ borderBottom: '1px solid #A3ADE0',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-table-column width="80" label="序号">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="iedname" label="装置名称" width="120" />
|
|
|
+ <el-table-column
|
|
|
+ prop="ieddesc"
|
|
|
+ label="装置描述"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ width="260"
|
|
|
+ />
|
|
|
+ <el-table-column prop="manufacturer" label="厂家" width="100" />
|
|
|
+ <el-table-column prop="type" label="型号" />
|
|
|
+ <el-table-column
|
|
|
+ prop="iedversion"
|
|
|
+ label="ied版本"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ />
|
|
|
+ <el-table-column prop="" label="CCD CRC">
|
|
|
+ <template> 无 </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="scdcrc" label="SCD CRC" />
|
|
|
+ <el-table-column prop="checkcrc" label="效验CRC" />
|
|
|
+ <el-table-column label="效验结果">
|
|
|
+ <template #default="scope">
|
|
|
+ <span
|
|
|
+ :style="{
|
|
|
+ color:
|
|
|
+ scope.row.scdcrc === scope.row.checkcrc
|
|
|
+ ? '#3BE078'
|
|
|
+ : '#E50505',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ {{ scope.row.scdcrc === scope.row.checkcrc ? "一致" : "不一致" }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
-import { ref, onMounted, watch, onBeforeUnmount, toRefs } from 'vue';
|
|
|
-import scd from "@/api/scd"
|
|
|
-import { ElMessage, ElLoading } from 'element-plus';
|
|
|
-export default {
|
|
|
- props: {
|
|
|
- nowScdId: {
|
|
|
- type: String || Number,
|
|
|
- required: true
|
|
|
- }
|
|
|
- },
|
|
|
- setup(props, { emit }) {
|
|
|
- let needScdId = ref("")//需要的scdid
|
|
|
- let needScdName = ref("")//需要的scd名称
|
|
|
- let needFlashName = ref("")//需要的变电站名称
|
|
|
- let tableList = ref([])//crc效验结果表格数据
|
|
|
- let scdAndCrc = ref({})//scdcrc
|
|
|
- let isTrue = ref(false)//一致或不一致
|
|
|
- watch(() => props.nowScdId, (newVal) => {
|
|
|
- needScdId.value = newVal
|
|
|
- })
|
|
|
- function reload() {
|
|
|
- needScdId.value = props.nowScdId
|
|
|
- let loading = ElLoading.service({
|
|
|
- lock: true,
|
|
|
- text: '正在查询数据',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)',
|
|
|
- })
|
|
|
- Promise.all([
|
|
|
- scd.getCrc({ scd_id: needScdId.value - 0 }),
|
|
|
- scd.getScdById({ scd_id: needScdId.value - 0 })
|
|
|
- ]).then(([res, resTo]) => {
|
|
|
- if (res.data == null || resTo.data == null) {
|
|
|
- loading.close()
|
|
|
- ElMessage({
|
|
|
- message: "暂无数据",
|
|
|
- type: "info"
|
|
|
- })
|
|
|
- return
|
|
|
- } else {
|
|
|
- tableList.value = res.data.list
|
|
|
- needScdName.value = resTo.data.scd_name
|
|
|
- needFlashName.value = resTo.data.station_name
|
|
|
- scdAndCrc.value = res.data.scdcrc
|
|
|
- const isConsistent = tableList.value.every(item => {
|
|
|
- return item.scdcrc === item.checkcrc;
|
|
|
- });
|
|
|
- isTrue.value = isConsistent
|
|
|
- loading.close()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- onMounted(() => {
|
|
|
- reload()
|
|
|
- })
|
|
|
- return {
|
|
|
- reload,//初始化组件
|
|
|
- needScdId,//需要的scdid
|
|
|
- needScdName,//需要的scd名称
|
|
|
- tableList,//crc效验结果表格数据
|
|
|
- needFlashName,//需要的变电站名称
|
|
|
- scdAndCrc,//scdcrc
|
|
|
- isTrue,//一致或不一致
|
|
|
- }
|
|
|
+<script setup>
|
|
|
+import { ref, onMounted, watch, onBeforeUnmount, toRefs, nextTick } from "vue";
|
|
|
+import scd from "@/api/scd";
|
|
|
+import { ElMessage, ElLoading } from "element-plus";
|
|
|
+const props = defineProps({
|
|
|
+ nowScdId: {
|
|
|
+ type: String,
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+});
|
|
|
+const emit = defineEmits(["sclBack"]);
|
|
|
+let needScdId = ref(""); //需要的scdid
|
|
|
+let needScdName = ref(""); //需要的scd名称
|
|
|
+let needFlashName = ref(""); //需要的变电站名称
|
|
|
+let tableList = ref([]); //crc效验结果表格数据
|
|
|
+let scdAndCrc = ref({}); //scdcrc
|
|
|
+let isTrue = ref(false); //一致或不一致
|
|
|
+watch(
|
|
|
+ () => props.nowScdId,
|
|
|
+ (newVal) => {
|
|
|
+ needScdId.value = newVal;
|
|
|
+ }
|
|
|
+);
|
|
|
+const selectValue = ref("1");
|
|
|
+const options = [
|
|
|
+ {
|
|
|
+ value: "1",
|
|
|
+ label: "全部",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "2",
|
|
|
+ label: "不一致",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "3",
|
|
|
+ label: "一致",
|
|
|
+ },
|
|
|
+];
|
|
|
+const originalData = ref([]);
|
|
|
+const reload = () => {
|
|
|
+ needScdId.value = props.nowScdId;
|
|
|
+ let loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: "正在查询数据",
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
+ });
|
|
|
+ Promise.all([
|
|
|
+ scd.getCrc({ scd_id: needScdId.value - 0 }),
|
|
|
+ scd.getScdById({ scd_id: needScdId.value - 0 }),
|
|
|
+ ]).then(([res, resTo]) => {
|
|
|
+ if (res.data == null || resTo.data == null) {
|
|
|
+ loading.close();
|
|
|
+ ElMessage({
|
|
|
+ message: "暂无数据",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ originalData.value = [...res.data.list];
|
|
|
+ tableList.value = res.data.list;
|
|
|
+ needScdName.value = resTo.data.scd_name;
|
|
|
+ needFlashName.value = resTo.data.station_name;
|
|
|
+ scdAndCrc.value = res.data.scdcrc;
|
|
|
+ const isConsistent = tableList.value.every((item) => {
|
|
|
+ return item.scdcrc === item.checkcrc;
|
|
|
+ });
|
|
|
+ isTrue.value = isConsistent;
|
|
|
+ loading.close();
|
|
|
}
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
+//选择全部还是不一致等
|
|
|
+const selectClick = (value) => {
|
|
|
+ // 备份最初的数据
|
|
|
+ if (value == "3") { // 一致
|
|
|
+ tableList.value = originalData.value.filter(
|
|
|
+ (item) => item.checkcrc == item.scdcrc
|
|
|
+ );
|
|
|
+ } else if (value == "2") { // 不一致
|
|
|
+ tableList.value = originalData.value.filter(
|
|
|
+ (item) => item.checkcrc != item.scdcrc
|
|
|
+ );
|
|
|
+ } else { // 全部
|
|
|
+ tableList.value = originalData.value;
|
|
|
+ }
|
|
|
+};
|
|
|
+const closeX = () => {
|
|
|
+ emit("sclBack", 2);
|
|
|
+};
|
|
|
+onMounted(() => {
|
|
|
+ reload();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-em{
|
|
|
- list-style: none;
|
|
|
- font-style: normal;
|
|
|
+<style scoped lang="scss">
|
|
|
+em {
|
|
|
+ list-style: none;
|
|
|
+ font-style: normal;
|
|
|
}
|
|
|
.bigBox {
|
|
|
- width: 97%;
|
|
|
- height: calc(100vh - 230px);
|
|
|
- margin-left: 18px;
|
|
|
+ width: 97%;
|
|
|
+ height: calc(100vh - 230px);
|
|
|
+ margin-left: 32px;
|
|
|
}
|
|
|
|
|
|
.header {
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- text-align: center;
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
|
|
|
.antherHeader {
|
|
|
- width: 100%;
|
|
|
- height: auto;
|
|
|
- text-align: center;
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ justify-content: center;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #1a2447;
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 16px 0;
|
|
|
+ .desc {
|
|
|
+ color: #255ce7;
|
|
|
+ margin-left: 6px;
|
|
|
+ // padding-right: 25px;
|
|
|
+ // border-right:1px solid #516380;
|
|
|
+ }
|
|
|
+ .line {
|
|
|
+ display: inline-block;
|
|
|
+ width: 1px;
|
|
|
+ height: 14px;
|
|
|
+ margin: 0 25px;
|
|
|
+ background: #516380;
|
|
|
+ }
|
|
|
+}
|
|
|
+.header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 16px;
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ padding: 12px 0 20px 0;
|
|
|
+ border-bottom: 1px solid #a3ade0;
|
|
|
+ color: #1a2447;
|
|
|
+}
|
|
|
+.closeX {
|
|
|
+ font-size: 24px;
|
|
|
+ color: #7484ab;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.table-data {
|
|
|
+ height: 100%;
|
|
|
+ margin-left: 16px;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
</style>
|