Ver código fonte

修改 根据选择空间批量创建bug

haojianlong 5 anos atrás
pai
commit
8fadb8fd1d
1 arquivos alterados com 21 adições e 14 exclusões
  1. 21 14
      src/components/business_space/newGraphy/graphy.vue

+ 21 - 14
src/components/business_space/newGraphy/graphy.vue

@@ -520,12 +520,12 @@ export default {
     // 编辑空间详情
     editeSpaceDetail() {
       let item = this.curZoneItem.data;
-        let query = {
-          RoomID: item.RoomID,
-          zone: this.tab.code,
-          isMyTab: 1,
-          buildFloorSelectd: this.buildFloor
-        }
+      let query = {
+        RoomID: item.RoomID,
+        zone: this.tab.code,
+        isMyTab: 1,
+        buildFloorSelectd: this.buildFloor
+      }
       this.$router.push({
         path: "/ledger/spaceDetail",
         query: query
@@ -630,17 +630,24 @@ export default {
     },
     // 批量更新业务空间和元空间的关系
     groupCreRelaZoneAndISp(Spaces) {
-      let param = {
-        data: {
-          Content: Spaces
-        },
-        type: this.tab.code
-      }
-      groupCreRelaZoneAndISp(param, res => {
+      Spaces = Spaces.filter(item => item.IspaceId);
+      if (Spaces.length) {
+        let param = {
+          data: {
+            Content: Spaces
+          },
+          type: this.tab.code
+        }
+        groupCreRelaZoneAndISp(param, res => {
+          this.$message.success('创建成功')
+          this.canvasLoading = false;
+          this.init(2)
+        })
+      } else {
         this.$message.success('创建成功')
         this.canvasLoading = false;
         this.init(2)
-      })
+      }
     },
     // 批量创建
     groupCreateBSP(spaces) {