Parcourir la source

add clear space relation

haojianlong il y a 5 ans
Parent
commit
b8c5a1abe6
1 fichiers modifiés avec 31 ajouts et 1 suppressions
  1. 31 1
      src/components/business_space/graphy/business.vue

+ 31 - 1
src/components/business_space/graphy/business.vue

@@ -50,6 +50,7 @@
             <div class="div50">
             <el-button @click="clearDimension" plain>取 消</el-button>
             <el-button @click="bussinDea" type="primary">查看详情</el-button>
+            <el-button @click="clearRelation" type="primary">清除关系</el-button>
             </div>
         </div>
         <!-- 点击业务空间后点击元空间 -->
@@ -930,7 +931,7 @@
             saveChange() {
                 let id = ""
                 this.idList.map(item => {
-                    if (!!item.parentId) {
+                    if (item.parentId) {
                         id = item.parentId
                     }
                 })
@@ -1254,6 +1255,35 @@
                 Link.click();
                 // 然后移除
                 document.body.removeChild(Link);
+            },
+            // 清除按钮
+            clearRelation(){
+                let spaceid = this.idList[0].id
+                let param = {
+                    data: {
+                        criterias: [{
+                            to_id: spaceid, //选填
+                            graph_id: this.graphyId, //选填
+                            rel_type: this.spaceType.rel_type //选填
+                        }]
+                    },
+                    ProjId: this.projectId,
+                    secret: this.secret
+                };
+                this.loading.show = true;
+                deleteRelation(param).then(res => {
+                    if (res.data.Result == "success") {
+                        this.loading.show = false;
+                        this.$message.success('清除成功')
+                        this.idList = [];
+                        this.getHasSpace();
+                    } else {
+                        this.$message.error(res.data.ResultMsg);
+                    }
+                })
+                .catch(() => {
+                    this.$message.error("请求失败");
+                });
             }
         },
         filters: {