|
@@ -0,0 +1,400 @@
|
|
|
+<!-- 输入输出控制块的发送和接收 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div v-if="isPhoto == 'SVsend'" class="cont-table">
|
|
|
+ <el-table
|
|
|
+ :data="svTableCtrl"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ @row-click="svSendRowClick"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ ref="myTable"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="attr_name" label="控制块名称" width="180" />
|
|
|
+ <el-table-column prop="attr_dat_set" label="数据集">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `[${scope.row.datset_desc}]${scope.row.attr_dat_set}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address.APPID" label="APPID" />
|
|
|
+ <el-table-column prop="address.MAC_Address" label="MAC地址" />
|
|
|
+ <el-table-column prop="address.VLAN_ID" label="VLAN-ID" />
|
|
|
+ </el-table>
|
|
|
+ <div class="title">
|
|
|
+ SMV端子列表详情(共<span v-if="svTableFcd">{{ svTableFcd.length }}</span
|
|
|
+ >条)
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="svTableFcd"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="do_desc" label="内部端子描述" width="180" />
|
|
|
+ <el-table-column label="内部端子地址">
|
|
|
+ <template #default="scope">
|
|
|
+ {{
|
|
|
+ `${scope.row.ld_inst}/${scope.row.prefix}${scope.row.ld_inst}${scope.row.ln_class}${scope.row.ln_inst}.${scope.row.do_name}`
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外部IED名称">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `${scope.row.out_ied_name}.${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="out_do_desc" label="外部端子描述" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="isPhoto == 'SVreceive'" class="cont-table">
|
|
|
+ <el-table
|
|
|
+ :data="svReceive"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ @row-click="svSendRowClick2"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ ref="myTable2"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="address.APPID" label="输入IED">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `[${scope.row.out_ied_name}]${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="out_smv_ctrl_name"
|
|
|
+ label="控制块名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column prop="out_dataset_name" label="数据集" />
|
|
|
+ <el-table-column prop="out_smv_ctrl_address.APPID" label="APPID" />
|
|
|
+ </el-table>
|
|
|
+ <div class="title">
|
|
|
+ SMV端子列表详情(共<span v-if="svReceiveTableCtrl">{{
|
|
|
+ svReceiveTableCtrl.length
|
|
|
+ }}</span
|
|
|
+ >条)
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="svReceiveTableCtrl"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="do_desc" label="内部端子描述" width="180" />
|
|
|
+ <el-table-column label="内部端子地址">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ scope.row.int_addr }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外部IED名称">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `${scope.row.out_ied_name}.${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="out_do_desc" label="外部端子描述" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="isPhoto == 'GOOSEsend'" class="cont-table">
|
|
|
+ <el-table
|
|
|
+ :data="gooseCtrl"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ @row-click="svSendRowClick3"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ ref="myTable3"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="attr_name" label="控制块名称" width="180" />
|
|
|
+ <el-table-column prop="address.APPID" label="数据集">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `[${scope.row.attr_dat_set}]${scope.row.datset_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address.APPID" label="APPID" />
|
|
|
+ <el-table-column prop="address.MAC_Address" label="MAC地址" />
|
|
|
+ <el-table-column prop="address.VLAN_ID" label="VLAN-ID" />
|
|
|
+ </el-table>
|
|
|
+ <div class="title">
|
|
|
+ GOOSE端子列表详情(共<span v-if="gooseList">{{ gooseList.length }}</span
|
|
|
+ >条)
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="gooseList"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="do_desc" label="内部端子描述" width="180" />
|
|
|
+ <el-table-column label="内部端子地址">
|
|
|
+ <template #default="scope">
|
|
|
+ {{
|
|
|
+ `${scope.row.ld_inst}/${scope.row.prefix}${scope.row.ld_inst}${scope.row.ln_class}${scope.row.ln_inst}.${scope.row.do_name}`
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外部IED名称">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `${scope.row.out_ied_name}.${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="out_do_desc" label="外部端子描述" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div v-else class="cont-table">
|
|
|
+ <el-table
|
|
|
+ :data="gooseReCtrl"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ @row-click="svSendRowClick3"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ ref="myTable4"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="address.APPID" label="输入IED">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `[${scope.row.out_ied_name}]${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="out_gse_ctrl_name"
|
|
|
+ label="控制块名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column prop="out_dataset_name" label="数据集" />
|
|
|
+ <el-table-column prop="out_gse_ctrl_address.APPID" label="APPID" />
|
|
|
+ </el-table>
|
|
|
+ <div class="title">
|
|
|
+ GOOSE端子列表详情(共<span v-if="svReceiveTableCtrl">{{
|
|
|
+ svReceiveTableCtrl.length
|
|
|
+ }}</span
|
|
|
+ >条)
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="gooseList"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :cell-style="{ color: '#000' }"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" label="序号" width="80" />
|
|
|
+ <el-table-column prop="do_desc" label="内部端子描述" width="180" />
|
|
|
+ <el-table-column label="内部端子地址">
|
|
|
+ <template #default="scope">
|
|
|
+ {{
|
|
|
+ `${scope.row.ld_inst}/${scope.row.prefix}${scope.row.ld_inst}${scope.row.ln_class}${scope.row.ln_inst}.${scope.row.do_name}`
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="外部IED名称">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ `${scope.row.out_ied_name}.${scope.row.out_ied_desc}` }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="out_do_desc" label="外部端子描述" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+ <script setup>
|
|
|
+import { onMounted, watch, ref, nextTick, defineEmits, inject } from "vue";
|
|
|
+import {
|
|
|
+ //send发送
|
|
|
+ iedSVSendCtrlblock,
|
|
|
+ iedSVSendfcdalist,
|
|
|
+ smvCtrlblockReceive,
|
|
|
+ gooseSendctrlblock,
|
|
|
+ gooseSendfcdalist,
|
|
|
+ gooseReceivefcdalist,
|
|
|
+} from "@/api/iedNetwork";
|
|
|
+const props = defineProps({
|
|
|
+ checkData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {},
|
|
|
+ },
|
|
|
+ isPhoto: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ svInfo: {
|
|
|
+ type: Array,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
+});
|
|
|
+const scdIdValue = inject("scdId");
|
|
|
+const myTable = ref(null);
|
|
|
+const myTable2 = ref(null);
|
|
|
+const myTable3 = ref(null);
|
|
|
+const myTable4 = ref(null);
|
|
|
+//获取send发送数据
|
|
|
+const svTableCtrl = ref(null);
|
|
|
+const svTableFcd = ref(null);
|
|
|
+const ctrlId = ref(null);
|
|
|
+const goodCtrlId = ref(null);
|
|
|
+const gooseCtrl = ref(null);
|
|
|
+const getSvSendCtrl = async () => {
|
|
|
+ const svResCtrl = await iedSVSendCtrlblock({
|
|
|
+ scd_id: scdIdValue,
|
|
|
+ ied_name: props.checkData.ied_name,
|
|
|
+ });
|
|
|
+ svTableCtrl.value = svResCtrl.data ? svResCtrl.data.SampledValueControl : [];
|
|
|
+ ctrlId.value =
|
|
|
+ svTableCtrl.value.length > 0 ? svTableCtrl.value[0].node_id : null;
|
|
|
+ gooseCtrl.value = svResCtrl.data ? svResCtrl.data.GSEControl : [];
|
|
|
+ goodCtrlId.value =
|
|
|
+ gooseCtrl.value.length > 0 ? gooseCtrl.value[0].node_id : null;
|
|
|
+ if (ctrlId.value) {
|
|
|
+ getSvSendFcd();
|
|
|
+ }
|
|
|
+ if (goodCtrlId.value) {
|
|
|
+ getGooseList();
|
|
|
+ }
|
|
|
+};
|
|
|
+const getSvSendFcd = async () => {
|
|
|
+ svTableFcd.value = [];
|
|
|
+ const svResFcd = await iedSVSendfcdalist({
|
|
|
+ scd_id: scdIdValue,
|
|
|
+ ied_name: props.checkData.ied_name,
|
|
|
+ ctrlid: ctrlId.value,
|
|
|
+ });
|
|
|
+ svTableFcd.value = svResFcd.data;
|
|
|
+};
|
|
|
+const svSendRowClick = (row, column) => {
|
|
|
+ ctrlId.value = row.node_id;
|
|
|
+ getSvSendFcd();
|
|
|
+};
|
|
|
+//sv接收
|
|
|
+// const svSendCtrlId = ref(null);
|
|
|
+const svReceiveTableCtrl = ref([]);
|
|
|
+const svReceive = ref([]);
|
|
|
+const smvCtrlblockRe = async () => {
|
|
|
+ const svRecResCtrl = await smvCtrlblockReceive({
|
|
|
+ scd_id: scdIdValue,
|
|
|
+ ied_name: props.checkData.ied_name,
|
|
|
+ });
|
|
|
+ svReceiveTableCtrl.value = svRecResCtrl.data;
|
|
|
+ svReceive.value = [];
|
|
|
+ if (svRecResCtrl.data.length > 0) {
|
|
|
+ svReceive.value.push(svRecResCtrl.data[0]);
|
|
|
+ }
|
|
|
+};
|
|
|
+const svSendRowClick2 = (row, column) => {
|
|
|
+ // svSendCtrlId.value = row.node_id;
|
|
|
+ // smvCtrlblockRe();
|
|
|
+};
|
|
|
+//GOOSE发送
|
|
|
+const gooseList = ref(null);
|
|
|
+const getGooseList = async () => {
|
|
|
+ const gooseRes = await gooseSendfcdalist({
|
|
|
+ scd_id: scdIdValue,
|
|
|
+ ied_name: props.checkData.ied_name,
|
|
|
+ ctrlid: goodCtrlId.value,
|
|
|
+ });
|
|
|
+ gooseList.value = gooseRes.data;
|
|
|
+};
|
|
|
+const svSendRowClick3 = (row, column) => {
|
|
|
+ goodCtrlId.value = row.node_id;
|
|
|
+ getGooseList();
|
|
|
+};
|
|
|
+//GOOSE接收
|
|
|
+const gooseReList = ref(null);
|
|
|
+const gooseReCtrl = ref([]);
|
|
|
+const getGooseReList = async () => {
|
|
|
+ gooseReCtrl.value = [];
|
|
|
+ const gooseRes = await gooseReceivefcdalist({
|
|
|
+ scd_id: scdIdValue,
|
|
|
+ ied_name: props.checkData.ied_name,
|
|
|
+ });
|
|
|
+ gooseRes.data.forEach((item) => {
|
|
|
+ const alreadyExists = gooseReCtrl.value.some((arrItem) => {
|
|
|
+ return (
|
|
|
+ item.out_dataset_name == arrItem.out_dataset_name &&
|
|
|
+ item.out_gse_ctrl_name == arrItem.out_gse_ctrl_name &&
|
|
|
+ item.out_ied_desc == arrItem.out_ied_desc &&
|
|
|
+ item.out_ied_name == arrItem.out_ied_name
|
|
|
+ );
|
|
|
+ });
|
|
|
+ if (!alreadyExists) {
|
|
|
+ gooseReCtrl.value.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ gooseReList.value = gooseRes.data.map((item) => {
|
|
|
+ if (gooseRes.data.length > 0) {
|
|
|
+ return (
|
|
|
+ item.out_dataset_name == gooseRes.data[0].out_dataset_name &&
|
|
|
+ item.out_gse_ctrl_name == gooseRes.data[0].out_gse_ctrl_name &&
|
|
|
+ item.out_ied_desc == gooseRes.data[0].out_ied_desc &&
|
|
|
+ item.out_ied_name == gooseRes.data[0].out_ied_name
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log("gooseReList.value", gooseReList.value);
|
|
|
+};
|
|
|
+watch(
|
|
|
+ () => props.svInfo,
|
|
|
+ (newValue) => {}
|
|
|
+);
|
|
|
+watch(
|
|
|
+ () => props.checkData,
|
|
|
+ (newValue) => {
|
|
|
+ svTableCtrl.value = [];
|
|
|
+ svReceiveTableCtrl.value = [];
|
|
|
+ svTableFcd.value = [];
|
|
|
+ gooseList.value = [];
|
|
|
+ gooseReList.value = [];
|
|
|
+ getSvSendCtrl();
|
|
|
+ smvCtrlblockRe();
|
|
|
+ getGooseReList();
|
|
|
+ }
|
|
|
+);
|
|
|
+watch(
|
|
|
+ () => props.isPhoto,
|
|
|
+ (newValue) => {
|
|
|
+ nextTick(() => {
|
|
|
+ switch (newValue) {
|
|
|
+ case "SVsend":
|
|
|
+ myTable.value.setCurrentRow(svTableCtrl.value[0]);
|
|
|
+ break;
|
|
|
+ case "SVreceive":
|
|
|
+ myTable2.value.setCurrentRow(svReceive.value[0]);
|
|
|
+ break;
|
|
|
+ case "GOOSEsend":
|
|
|
+ myTable3.value.setCurrentRow(gooseCtrl.value[0]);
|
|
|
+ break;
|
|
|
+ case "GOOSEreceive":
|
|
|
+ myTable4.value.setCurrentRow(gooseReCtrl.value[0]);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+);
|
|
|
+onMounted(() => {
|
|
|
+ getSvSendCtrl();
|
|
|
+ smvCtrlblockRe();
|
|
|
+ getGooseReList();
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.cont-table {
|
|
|
+ height: 65vh;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+:deep(.el-table) {
|
|
|
+ flex-basis: 45%;
|
|
|
+}
|
|
|
+.title {
|
|
|
+ margin: 16px;
|
|
|
+ color: #51637f;
|
|
|
+}
|
|
|
+</style>
|