guoxiaohuan пре 4 година
родитељ
комит
2de792ef52
3 измењених фајлова са 34 додато и 26 уклоњено
  1. 14 15
      src/components/Legend/src/legend.vue
  2. 8 0
      src/store/index.js
  3. 12 11
      src/views/equipment/fenbuPic.vue

+ 14 - 15
src/components/Legend/src/legend.vue

@@ -69,7 +69,7 @@
                 effect='dark'
                 content='新增分布图1'
                 placement='left'
-                v-if='floorSelect.length!=floors.length && type==0'
+                v-if='floorSelect2.length!=floors.length && type==0'
             >
                 <p class='tltk' style='margin-left: -5px;' @click='addFloor'>
                     <img src='@/assets/imgs/bjj.png' alt />
@@ -143,7 +143,7 @@ export default {
             'remarksText',
             'plazaId',
             'fmapID',
-            'floorSelect',
+            'floorSelect2',
             'isMessage',
             'ssoToken',
             'showView',
@@ -195,7 +195,7 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,调用接口查询,显示右下角小红点
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gcname !== oldV.gcname) {
+                if (newV.gname !== oldV.gname) {
                     clearInterval(this.timer)
                     this.getDraftNum()
                     this.timer = setInterval(() => {
@@ -243,10 +243,10 @@ export default {
          */
         async getDraftNum() {
             let res = null,
-                floorId = this.$store.state.currentFloor.gcname || this.$cookie.get('floorMapId'),
+                floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
                 categoryId = this.categoryId || this.$cookie.get('categoryId')
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (floorId = this.floorInfo.gname)
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
@@ -273,8 +273,8 @@ export default {
         },
         formatFloor() {
             this.floorSelectAble = []
-            this.floorSelectAble = this.floorSelect.filter((item) => {
-                const hit = this.floors.find((i) => i.gcname == item.id)
+            this.floorSelectAble = this.floorSelect2.filter((item) => {
+                const hit = this.floors.find((i) => i.gname == item.id)
                 return !hit
             })
         },
@@ -354,8 +354,8 @@ export default {
             let categoryId = this.$cookie.get('categoryId') //系统
 
             // 弹窗组件内传入floorInfo, 楼层参数处理
-            if (this.floorInfo.gcname && !this.floor) {
-                FloorID = this.floorInfo.gcname
+            if (this.floorInfo.gname && !this.floor) {
+                FloorID = this.floorInfo.gname
                 floorName = this.floorInfo.code
                 seq = this.floorInfo.seq
                 categoryId = this.categoryId
@@ -363,7 +363,7 @@ export default {
             //弹窗组件点击新增楼层,确认的楼层 楼层字段处理
             if (this.floor) {
                 // 从store中筛选出选中的楼层信息
-                let floorInfo = this.$store.state.floorsArr.filter((item) => item.gcname === this.floor)[0]
+                let floorInfo = this.$store.state.floorsArr.filter((item) => item.gname === this.floor)[0]
                 FloorID = this.floor
                 floorName = floorInfo.code
                 seq = floorInfo.seq
@@ -374,7 +374,6 @@ export default {
             if (!this.plazaId) {
                 return
             }
-            // http://localhost:8091/wandaEditer/editer?categoryId%3DFZQZL%26projectId%3D1001724%26BuildingID%3D1%26FloorID%3Df8%26FloorName%3DF8%26fmapID%3D1001724_31%26seq%3D750%26token%3Dadmin%3Aliujiandong
             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, 'edit')
@@ -398,10 +397,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gcname,
+                floorId: this.$store.state.currentFloor.gname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then((res) => {
                 // this.$store.commit('SETREMARKSTEXT', '')
                 this.$store.commit('SETPLANNUM', '')
@@ -451,10 +450,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gcname,
+                floorId: this.$store.state.currentFloor.gname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
+            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
             queryStatis({ data, postParams }).then((res) => {
                 this.loading1 = false
                 this.editTable = res.data.Data ? res.data.Data : []

+ 8 - 0
src/store/index.js

@@ -26,6 +26,7 @@ export default new Vuex.Store({
         projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
+        floorSelect2: [], //分布图楼层下拉框
         fmapID: '',
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功
         isMessage: true, //是否有发布的图
@@ -51,6 +52,7 @@ export default new Vuex.Store({
         lastRoute: (state) => state.lastRoute,
         floorsArr: (state) => state.floorsArr,
         floorSelect: (state) => state.floorSelect,
+        floorSelect2: (state) => state.floorSelect2,
         plazaId: (state) => state.plazaId,
         plazas: (state) => state.plazas,
         fmapID: (state) => state.fmapID,
@@ -102,6 +104,7 @@ export default new Vuex.Store({
         SETFLOORS(state, data) {
             let numArr = []
             state.floorSelect = []
+            state.floorSelect2 = []
             state.floorsArr = data
             if (data.length > 0) {
                 data.forEach((e) => {
@@ -109,8 +112,13 @@ export default new Vuex.Store({
                         id: e.gcname,
                         name: e.code,
                     }
+                    let obj2 = {
+                        id: e.gname,
+                        name: e.code,
+                    }
                     // 下拉框的楼层数组
                     state.floorSelect.push(obj)
+                    state.floorSelect2.push(obj2)
                     // 获取默认展示楼层
                     if (e.seq > 0) {
                         numArr.push(e.seq)

+ 12 - 11
src/views/equipment/fenbuPic.vue

@@ -2,7 +2,7 @@
     <div class='fenbu-box'>
         <!-- 图例 -->
         <div class='legend-boxs'>
-            <Legend :innerLeng='1' :floorInfo="floorInfo"  :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'>
@@ -26,17 +26,17 @@ export default {
             show: false,
             floorInfo: {
                 gname: 'f1',
-                code: 'F1'
+                code: 'F1',
             },
             loadName: '',
             type: '',
             floors: [],
-            modalHeight: 500 //适配底图
+            modalHeight: 500, //适配底图
         }
     },
     props: ['typecode'],
     computed: {
-        ...mapGetters(['floorsArr'])
+        ...mapGetters(['floorsArr']),
     },
     mounted() {
         if (window.screen.width > 1366) {
@@ -61,7 +61,7 @@ export default {
                 Distinct: true,
                 PageNumber: 1,
                 PageSize: 500,
-                Projection: ['floorId']
+                Projection: ['floorId'],
             }
             if (this.typecode == 'FBT1') {
                 postParams.Filters = `projectId =${this.$store.state.plazaId};categoryId='FZQZL';isPub=true`
@@ -71,20 +71,20 @@ export default {
             }
             let floor = []
             this.floors = []
-            queryPics({ postParams }).then(res => {
+            queryPics({ postParams }).then((res) => {
                 if (res.Total == 0) {
                     this.floors = []
                 } else {
                     floor = res.Content
-                    this.floorsArr.forEach(el => {
-                        floor.forEach(ele => {
+                    this.floorsArr.forEach((el) => {
+                        floor.forEach((ele) => {
                             if (ele.FloorId == el.gname) {
                                 this.floors.push({
                                     gname: el.gname,
                                     gcode: el.gcode,
                                     name: el.name,
                                     code: el.code,
-                                    seq: el.seq
+                                    seq: el.seq,
                                 })
                             }
                         })
@@ -92,6 +92,7 @@ export default {
                 }
                 this.floorInfo = this.floors[0]
                 // this.init()
+                console.log(this.floors)
             })
         },
         init() {
@@ -102,8 +103,8 @@ export default {
             this.getFloorData()
             // 注释掉 floorMap init ,由楼层中的emitFloor方法去执行floorMap
             // this.$refs.floorMap.init(this.floorInfo.gname)
-        }
-    }
+        },
+    },
 }
 </script>
 <style lang="less">