Преглед на файлове

修改端子边线样式及一些提示优化

liling преди 1 година
родител
ревизия
a0d4cb439d
променени са 2 файла, в които са добавени 49 реда и са изтрити 18 реда
  1. 24 10
      src/pages/components/drawModal/AbilityModal.vue
  2. 25 8
      src/pages/components/drawModal/LineDouble.vue

+ 24 - 10
src/pages/components/drawModal/AbilityModal.vue

@@ -237,17 +237,31 @@ export default {
             flow.delAll({
                 model_id: modelIds.value - 0
             }).then(res => {
-                setTimeout(() => {
-                    flow.getModelAndIed({//获取所有功能
-                        model_id: modelIds.value - 0,
-                        ied_type: iedTypes.value
-                    }).then(res => {
-                        if (res.code == 0) {
-                            loading.close()
-                            tableData.value = res.data
-                        }
+                loading.close()
+                if (res.code !=0) {
+                    ElMessage({
+                        message: res.msg,
+                        type: 'error'
                     })
-                }, 5000);
+                    return
+                }
+                flow.getModelAndIed({//获取所有功能
+                    model_id: modelIds.value - 0,
+                    ied_type: iedTypes.value
+                }).then(res => {
+                    if (res.code == 0) {                            
+                        tableData.value = res.data
+                        ElMessage({
+                            message: "端子已全部成功删除",
+                            type: "success"
+                        });
+                    }else{
+                        ElMessage({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                })
             })
         }
         function saveIedType() {

+ 25 - 8
src/pages/components/drawModal/LineDouble.vue

@@ -150,9 +150,17 @@ export default {
                 model_id: modelIds.value - 0,
                 ied_type: starts.value.ied_type,
                 sv_or_goose: gv.value,
-                in_or_out: "输出"
+                in_or_out: "输出",
+                ref_ied_type:ends.value.ied_type
             }).then(res => {
-                if (res.data) {
+                //if ( res.data) {
+                //liling:避免提示空错误提示,res.data为空不代表接口有错误,所以先判断接口code值
+                pastLoading.value = false
+                if ( res.code==0) {
+                    if ( res.data==null) {
+                        curList.value = [];
+                        return;
+                    }
                     let tmpList = [];
                     //对结果进行重排排序:将已关联到输出装置的端子排在前面
                     res.data.forEach((item, index) => {
@@ -164,7 +172,7 @@ export default {
                         }
                     })
                     curList.value = tmpList
-                    pastLoading.value = false
+                    //pastLoading.value = false
                 } else {
                     ElMessage({
                         message: res.msg,
@@ -176,10 +184,17 @@ export default {
                 model_id: modelIds.value - 0,
                 ied_type: ends.value.ied_type,
                 sv_or_goose: gv.value,
-                in_or_out: "接收"
+                in_or_out: "接收",
+                ref_ied_type:starts.value.ied_type
             }).then(res => {
                 console.log(res.data, '!!!!!');
-                if (res.data) {
+                //if ( res.data) {
+                //liling:避免提示空错误提示,res.data为空不代表接口有错误,所以先判断接口code值
+                if ( res.code==0) {
+                    if ( res.data==null) {
+                        outList.value = [];
+                        return;
+                    }
                     //对结果进行重排排序:将已关联到输出装置的端子排在前面
                     let tmpList = [];
                     res.data.forEach((item, index) => {
@@ -200,12 +215,12 @@ export default {
                                 end: item.id
                             };
                             let starts = document.getElementById(line.start);
-                            let ends = document.getElementById(line.end);
+                            let ends = document.getElementById(line.end).parentNode;
                             console.log(starts, ends, '??????');
                             // 检查 starts 和 ends 是否存在
                             if (starts && ends) {
                                 leaderLineList.value.push(new LeaderLine(starts, ends, {
-                                    color: "black",
+                                    color: "#ccc",
                                     size: 2,
                                     path: "straight",
                                     startSocket: "right",
@@ -228,6 +243,7 @@ export default {
                 }
             });
             curList.value.sort((obj1, obj2) => {
+                if(outList.value[0]==null) return 1;
                 const nameB = outList.value[0].fcda_name;
                 if (obj1.fcda_name === nameB) return -1; // 将 name 与数组 b 中第一个对象的 name 属性相等的对象移到数组的第一位
                 if (obj2.fcda_name === nameB) return 1;
@@ -587,8 +603,9 @@ export default {
 
 :deep(.el-checkbox) {
     width: 300px !important;
-    height: 50px !important;
+    height: 42px !important;
     margin-right: 0 !important;
+    margin-bottom: 10px !important;
 }
 
 :deep(.el-checkbox__label) {