“yueshang” 1 년 전
부모
커밋
13e086079e

+ 3 - 0
src/pages/netStructPicture/components/inoutControl.vue

@@ -169,6 +169,7 @@ const getIedChild = async () => {
     ied_name: props.checkData.ied_name,
     forcerefresh: 0,
   });
+  if(!listData2.value.list||!childRes.data) return;
   if (childRes.data) {
     //左右侧内部侧数据组装
     listData2.value.list.forEach((item, index) => {
@@ -283,6 +284,7 @@ const processArray = (arr) => {
   // ref_ied_id作为键,obj作为值
   const uniqueObjects = new Map();
   // 遍历数组
+  if(!arr) return;
   for (const obj of arr) {
     const { ref_ied_id } = obj;
     // 如果当前对象的 ref_ied_id 属性已经存在于 uniqueObjects 中
@@ -320,6 +322,7 @@ const clickResetLine2 = () => {
 // 将设备列表分成两份
 const bothSide = (data) => {
   const formatArr = processArray(data);
+  if(!formatArr) return;
   const arrlenght = formatArr.length;
   const long1 = Math.ceil(arrlenght / 2);
   leftList.value = formatArr.splice(0, long1);

+ 1 - 0
src/pages/netStructPicture/components/inoutSendOrRv.vue

@@ -310,6 +310,7 @@ const getGooseReList = async () => {
     scd_id: scdIdValue,
     ied_name: props.checkData.ied_name,
   });
+  if(!gooseRes.data) return;
   if (gooseRes.data.length > 0) {
     gooseRes.data.forEach((item) => {
       item.children = [];

+ 2 - 0
src/pages/netStructPicture/components/relationShip.vue

@@ -93,6 +93,7 @@ const setdomRight = (el, item) => {
 const processArray = (arr) => {
   // ref_ied_id作为键,obj作为值
   const uniqueObjects = new Map();
+  if(!arr) return;
   // 遍历数组
   for (const obj of arr) {
     const { ref_ied_id } = obj;
@@ -160,6 +161,7 @@ const clickResetLine = () => {
 // 将设备列表分成两份
 const bothSide = (data) => {
   const formatArr = processArray(data);
+  if(!formatArr) return;
   const arrlenght = formatArr.length;
   const long1 = Math.ceil(arrlenght / 2);
   leftList.value = formatArr.splice(0, long1);

+ 1 - 0
src/pages/netStructPicture/components/virtualRelation.vue

@@ -230,6 +230,7 @@ const clickResetLine3 = () => {
 const bothSide = (data) => {
   leftList.value = [];
   rightList.value = [];
+  if(!data) return;
   data.forEach((item) => {
     if (item.ref_type == 2 || item.ref_type == 1) {
       item.titleItems = [];