Forráskód Böngészése

fix bug :系统原理图中的分布图, legend组件调用接口,上传楼层id不对

yx 4 éve
szülő
commit
62e31d92c7
2 módosított fájl, 33 hozzáadás és 1 törlés
  1. 32 0
      src/components/Legend/src/legend.vue
  2. 1 1
      src/views/equipment/fenbuPic.vue

+ 32 - 0
src/components/Legend/src/legend.vue

@@ -173,6 +173,13 @@ export default {
         innerLeng: {
             type: Number,
             default: 0
+        },
+        // 弹窗组件内部传入的楼层信息
+        floorInfo: {
+            type: Object,
+            default() {
+                return {}
+            }
         }
     },
     components: { lengendView, legendRemarks, lengendEdit },
@@ -201,6 +208,19 @@ export default {
                 }
             },
             deep: true
+        },
+        // 弹窗组件内传入floorInfo,查询 getDraftNum
+        floorInfo: {
+            handler(newV,oldV) {
+                 if (newV !== oldV) {
+                    clearInterval(this.timer)
+                    this.getDraftNum()
+                    this.timer = setInterval(() => {
+                        this.getDraftNum()
+                    }, this.interval)
+                }
+            },
+            deep: true
         }
     },
     '$refs.viewLengend': {
@@ -217,6 +237,8 @@ export default {
             let res = null,
                 floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
                 categoryId = this.categoryId || this.$cookie.get('categoryId')
+            // 弹窗组件内传入floorInfo,使用其楼层id
+            this.floorInfo.gname && (floorId = this.floorInfo.gname)
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
@@ -325,6 +347,12 @@ export default {
             const editerUrl = conf[process.env.NODE_ENV + '_editerUrl']
             let floorName = this.floorName ? this.floorName : this.$cookie.get('floorNow')
             let seq = this.$cookie.get('currentFloorId')
+            // 弹窗组件内传入floorInfo,使用其楼层id
+            if (this.floorInfo.gname) {
+                FloorID = this.floorInfo.gname
+                floorName = this.floorInfo.code
+                seq = this.floorInfo.seq
+            }
             let data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&FloorName=${floorName}&fmapID=${this.fmapID}&seq=${seq}&token=${this.ssoToken}`
             let url = editerUrl + 'editer?' + encodeURIComponent(data)
             window.open(url, true)
@@ -350,6 +378,8 @@ export default {
                 buildingId: '1',
                 floorId: this.$store.state.currentFloor.gname
             }
+            // 弹窗组件内传入floorInfo,使用其楼层id
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then(res => {
                 this.loading = false
                 let viewTable = []
@@ -402,6 +432,8 @@ export default {
                 buildingId: '1',
                 floorId: this.$store.state.currentFloor.gname
             }
+            // 弹窗组件内传入floorInfo,使用其楼层id
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then(res => {
                 this.loading1 = false
                 this.editTable = res.data.Data ? res.data.Data : []

+ 1 - 1
src/views/equipment/fenbuPic.vue

@@ -2,7 +2,7 @@
     <div class='fenbu-box'>
         <!-- 图例 -->
         <div class='legend-boxs'>
-            <Legend :innerLeng='1' :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
+            <Legend :innerLeng='1' :floorInfo="floorInfo"  :floors='floors' type='0' :categoryId='`${typecode=="FBT1"?"FZQZL":"XFBFYCFL"}`'></Legend>
             <floor-list v-if='floors.length>0' :changeDataFlag='false' :floorsArr='floors' @emitFloor='emitFloor' :id='"floor"'></floor-list>
         </div>
         <div v-show='floors.length>0' class='canvas-box'>