Procházet zdrojové kódy

受影响业务空间确认成功回调调整

haojianlong před 5 roky
rodič
revize
ba71bec4fb

+ 11 - 4
src/components/business_space/newGraphy/graphy.vue

@@ -52,7 +52,7 @@
           <div v-show="type==4">
             <el-button plain @click="cancelGraphy">取 消</el-button>
             <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
-            <el-button type="primary" @click="confirmAndSave">保存并确认业务空间</el-button>
+            <el-button type="primary" v-show='curZoneItem.isInfected' @click="confirmAndSave">保存并确认业务空间</el-button>
           </div>
           <!-- 批量创建所选业务空间 -->
           <div v-show="type==5">
@@ -650,11 +650,12 @@ export default {
         zone: this.tab.code,
         data: {
           Content: [this.curZoneItem.data],
-          Projection: ['Outline', 'State']
+          Projection: ['State']
         },
       }
       updateZone(pa, res => {
-        this.$emit('updataState', '');
+        this.curZoneItem.isInfected = false;
+        this.$emit('updateState');
         this.$message.success('更新成功');
       })
     },
@@ -668,7 +669,7 @@ export default {
       let selectSpace = this.scene.getSelectedSpaces();
       let selectLikeSpace = this.scene.getSelectedLikeSpace();
       //更新业务空间
-      let zoneObj = { Outline: [], Height: 0, State: this.confirmAndSaveFlag ? 1 : 0 }, IspaceIdList = [];
+      let zoneObj = { Outline: [], Height: 0, State: this.confirmAndSaveFlag ? 0 : this.curZoneItem.Infected ? 1 : 0 }, IspaceIdList = [];
       // 空间
       selectSpace.map(t => {
         zoneObj.Outline.push(t.data.OutLine);
@@ -810,6 +811,12 @@ export default {
       createRelateInZoneAndISp(pa, res => {
         this.$message.success('创建成功');
         this.init(2);
+        if (this.confirmAndSaveFlag) {
+          this.confirmAndSaveFlag = false;
+          this.curZoneItem.selected = false;
+          this.curZoneItem = {};
+          this.$emit('updateState');
+        }
       })
     },
     // 批量更新业务空间和元空间的关系

+ 11 - 3
src/views/ledger/spacelist/index.vue

@@ -41,7 +41,8 @@
         </div>
       </el-row>
       <div v-show="isMyTab == 1" style="width:100%;height:100%">
-        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"></graphy>
+        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"
+          @updateState="updateStateSuc"></graphy>
       </div>
       <div v-show="isMyTab == 2">
         <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
@@ -131,8 +132,8 @@ export default {
       childBackParam: {},
       needCalculate: false, // 关系是否需要计算
       mutiCount: 0,
-      infectedTotal: 1,
-      infectedCurfloor: '-'
+      infectedTotal: 0,
+      infectedCurfloor: 0
     };
   },
   created() {
@@ -351,6 +352,13 @@ export default {
     },
     relaSuc() {
       this.init();
+    },
+    // 受影响业务空间确认成功回调
+    updateStateSuc() {
+      this.getBuilding()
+      this.getTypes(this.buildFloorSelectd[1]);
+      this.infectedTotal--;
+      this.infectedCurfloor--;
     }
   },
   watch: {