guoxiaohuan 4 éve
szülő
commit
e72a48fd76

+ 22 - 24
src/api/httputils.js

@@ -1,9 +1,7 @@
 import axios from 'axios'
 import store from '@/store'
 import router from '@/router'
-import {
-    MessageBox
-} from 'element-ui'
+import { MessageBox } from 'element-ui'
 
 var CancelToken = axios.CancelToken
 var cancel
@@ -23,17 +21,17 @@ const axiosservice = axios.create({
 axiosservice.interceptors.request.use(
     (config) => {
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
-        let isPreview = null
-        let token = store.getters['ssoToken'];
-        if (store.getters['isPreview'] == "null" || store.getters['isPreview'] == "" || store.getters['isPreview'] == null) {
-            isPreview = false
-        } else {
-            isPreview = store.getters['isPreview']
-        }
+        // let isPreview = null
+        let token = store.getters['ssoToken']
+        // if (store.getters['isPreview'] == "null" || store.getters['isPreview'] == "" || store.getters['isPreview'] == null) {
+        //     isPreview = false
+        // } else {
+        //     isPreview = store.getters['isPreview']
+        // }
         if (config.url.indexOf('/data') > -1) {
             config.headers = {
                 'sso-token': token,
-                isPreview: isPreview, //默认false,当预览开启的时候是true
+                isPreview: true, //默认false,当预览开启的时候是true
             }
         }
         return config
@@ -44,16 +42,16 @@ axiosservice.interceptors.request.use(
 )
 
 axiosservice.interceptors.response.use(
-    function (res) {
+    function(res) {
         //在这里对返回的数据进行处理
-        let resp = res.data;
+        let resp = res.data
         if (resp.result === 'unauthc') {
             store.commit('logined', false)
             MessageBox.confirm('未登陆或登陆信息已失效, 是否重新登陆?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'error',
-                })
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'error',
+            })
                 .then((resp) => {
                     window.location.reload()
                 })
@@ -63,14 +61,14 @@ axiosservice.interceptors.response.use(
         } else if (resp.error == 'Unauthorized') {
             MessageBox.alert('无权操作', {
                 title: '警告',
-                type: 'error'
+                type: 'error',
             })
         }
         return res
     },
-    function (err) {
+    function(err) {
         if (err.response.status == 401) {
-            store.commit('SETISREQUESTtAUTH', 'err');
+            store.commit('SETISREQUESTtAUTH', 'err')
             router.push({
                 path: '404',
             })
@@ -166,7 +164,7 @@ export default {
         // 响应类型:arraybuffer, blob
         axiosservice
             .post(url, requestData, {
-                responseType: 'blob'
+                responseType: 'blob',
             })
             .then((resp) => {
                 let headers = resp.headers
@@ -177,7 +175,7 @@ export default {
                 } else {
                     //console.log("下载文件:", resp)
                     const blob = new Blob([resp.data], {
-                        type: contentType
+                        type: contentType,
                     })
                     const contentDisposition = resp.headers['content-disposition']
                     let fileName = 'unknown'
@@ -187,7 +185,7 @@ export default {
                     downFile(blob, fileName)
                 }
             })
-            .catch(function (error) {})
+            .catch(function(error) {})
     },
     axios: axiosservice,
-}
+}

+ 12 - 11
src/components/Legend/src/legend.vue

@@ -195,7 +195,7 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,调用接口查询,显示右下角小红点
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gname !== oldV.gname) {
+                if (newV.gcname !== oldV.gcname) {
                     clearInterval(this.timer)
                     this.getDraftNum()
                     this.timer = setInterval(() => {
@@ -243,10 +243,10 @@ export default {
          */
         async getDraftNum() {
             let res = null,
-                floorId = this.$store.state.currentFloor.gname || this.$cookie.get('floorMapId'),
+                floorId = this.$store.state.currentFloor.gcname || this.$cookie.get('floorMapId'),
                 categoryId = this.categoryId || this.$cookie.get('categoryId')
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gname && (floorId = this.floorInfo.gname)
+            this.floorInfo.gcname && (floorId = this.floorInfo.gcname)
             // 增加校验 floorId,防止上传 undefined
             if (!floorId) {
                 return true
@@ -274,7 +274,7 @@ export default {
         formatFloor() {
             this.floorSelectAble = []
             this.floorSelectAble = this.floorSelect.filter((item) => {
-                const hit = this.floors.find((i) => i.gname == item.id)
+                const hit = this.floors.find((i) => i.gcname == item.id)
                 return !hit
             })
         },
@@ -354,8 +354,8 @@ export default {
             let categoryId = this.$cookie.get('categoryId') //系统
 
             // 弹窗组件内传入floorInfo, 楼层参数处理
-            if (this.floorInfo.gname && !this.floor) {
-                FloorID = this.floorInfo.gname
+            if (this.floorInfo.gcname && !this.floor) {
+                FloorID = this.floorInfo.gcname
                 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.gname === this.floor)[0]
+                let floorInfo = this.$store.state.floorsArr.filter((item) => item.gcname === this.floor)[0]
                 FloorID = this.floor
                 floorName = floorInfo.code
                 seq = floorInfo.seq
@@ -374,6 +374,7 @@ 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')
@@ -397,10 +398,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gname,
+                floorId: this.$store.state.currentFloor.gcname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
+            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
             queryStatis({ data, postParams }).then((res) => {
                 // this.$store.commit('SETREMARKSTEXT', '')
                 this.$store.commit('SETPLANNUM', '')
@@ -450,10 +451,10 @@ export default {
                 projectId: this.$store.state.plazaId,
                 flag: flag,
                 buildingId: '1',
-                floorId: this.$store.state.currentFloor.gname,
+                floorId: this.$store.state.currentFloor.gcname,
             }
             // 弹窗组件内传入floorInfo,使用其楼层id
-            this.floorInfo.gname && (data.floorId = this.floorInfo.gname)
+            this.floorInfo.gcname && (data.floorId = this.floorInfo.gcname)
             queryStatis({ data, postParams }).then((res) => {
                 this.loading1 = false
                 this.editTable = res.data.Data ? res.data.Data : []

+ 2 - 2
src/components/floorList.vue

@@ -155,10 +155,10 @@ export default {
                 // 如果 changeDataFlag为true(不是在 分布图弹窗组件中的 楼层组件),设置cookie,vuex
                 if (this.changeDataFlag) {
                     this.$cookie.set('floorNow', currentFloor.code || '', 3)
-                    this.$cookie.set('floorMapId', currentFloor.gname, 3)
+                    this.$cookie.set('floorMapId', currentFloor.gcname, 3)
                     this.$cookie.set('currentFloorId', currentFloor.seq, 3)
                     this.floorId = this.$cookie.get('floorNow') || currentFloor.code
-                    this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
+                    this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gcname
                     store.commit('SETCURRENTFLOOR', currentFloor)
                 }
                 this.$emit('emitFloor', currentFloor)

+ 12 - 12
src/components/floorListOther.vue

@@ -55,20 +55,20 @@ export default {
             floor: {
                 code: 'F1',
                 gcode: '1F',
-                gname: 'f1',
+                gcname: 'f1',
                 name: '第1层',
-                seq: 100
+                seq: 100,
             },
             currentFloorId: null,
             marginTop: 0,
             startTime: '',
-            endTime: ''
+            endTime: '',
         }
     },
     props: {
         floorsArr: {
-            type: Array
-        }
+            type: Array,
+        },
     },
     mounted() {
         this.init()
@@ -88,7 +88,7 @@ export default {
                 return false
             }
             this.floorIdArr = []
-            this.floorsArr.map(item => {
+            this.floorsArr.map((item) => {
                 this.floorIdArr.push(item.seq)
             })
             this.currentFloorId = this.floorsArr[0].seq
@@ -101,7 +101,7 @@ export default {
          */
         changeFloor(flag) {
             const len = this.floorIdArr.length
-            let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
+            let index = this.floorIdArr.findIndex((item) => item === this.currentFloorId)
             // 点击上箭头
             if (flag === 1) {
                 index--
@@ -152,12 +152,12 @@ export default {
          */
         handleCookie() {
             // return true
-            let currentFloor = this.floorsArr.filter(item => item.seq == this.currentFloorId)[0]
+            let currentFloor = this.floorsArr.filter((item) => item.seq == this.currentFloorId)[0]
             // this.$cookie.set('floorNow', currentFloor.code, 3)
-            // this.$cookie.set('floorMapId', currentFloor.gname, 3)
+            // this.$cookie.set('floorMapId', currentFloor.gcname, 3)
             // this.$cookie.set('currentFloorId', currentFloor.seq, 3)
             // this.floorId = this.$cookie.get('floorNow') || currentFloor.code
-            // this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
+            // this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gcname
             this.$emit('emitFloor', currentFloor)
         },
         /**
@@ -197,8 +197,8 @@ export default {
                 // 前 showNumber 条的margin-top设置为0
                 this.marginTop = 0
             }
-        }
-    }
+        },
+    },
 }
 </script>
 <style lang="less" scoped>

+ 25 - 28
src/components/floorMap/index.vue

@@ -300,29 +300,26 @@ export default {
                         })
                         this.scene.addItem(imgItem)
                         this.view.scene = this.scene
-                    // this.view.fitSceneToView()
+                        // this.view.fitSceneToView()
                     } else {
-                      // 多张图
-                      try {
-                        // 初始化0
-                        this.count = 0;
-                        ProjectRf[pj].forEach(t => {
-                          const item = new SImageItem(
-                            null,
-                            `${this.mapServerURL}/webtheme/${this.fmapID}/${t.name}`
-                          );
-                          item.width = t.width
-                          item.height = t.height
-                          item.moveTo(t.x, t.y)
-                          item.connect("imgLoadOver", this, () => {
-                            this.countRf(ProjectRf[pj].length);
-                          });
-                          this.scene.addItem(item);
-                        })
-                        this.view.scene = this.scene;
-                      } catch(e) {
-                        console.log(e);
-                      }
+                        // 多张图
+                        try {
+                            // 初始化0
+                            this.count = 0
+                            ProjectRf[pj].forEach((t) => {
+                                const item = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.fmapID}/${t.name}`)
+                                item.width = t.width
+                                item.height = t.height
+                                item.moveTo(t.x, t.y)
+                                item.connect('imgLoadOver', this, () => {
+                                    this.countRf(ProjectRf[pj].length)
+                                })
+                                this.scene.addItem(item)
+                            })
+                            this.view.scene = this.scene
+                        } catch (e) {
+                            console.log(e)
+                        }
                     }
                 } else {
                     // 屋顶图不为图片
@@ -337,14 +334,14 @@ export default {
             }
         }, // 解析底图
         // 解析楼地板
-        loadBoard(floor){
-            window.fengmapData.loadFloor(floor, res => {
+        loadBoard(floor) {
+            window.fengmapData.loadFloor(floor, (res) => {
                 const zone = new SBoardItem(null, res)
-                this.scene.addItem(zone);
+                this.scene.addItem(zone)
             })
         },
         readBaseMap(floor) {
-            this.loadBoard(window.fengmapData.gnameToGid[floor]);
+            this.loadBoard(window.fengmapData.gnameToGid[floor])
             window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], (res) => {
                 if (res.err) {
                     console.log('errr', res.err)
@@ -492,9 +489,9 @@ export default {
         countRf(len) {
             this.count++
             if (len == this.count) {
-                this.readGraph();
+                this.readGraph()
             } else {
-                console.log('所有图片未加载完成');
+                console.log('所有图片未加载完成')
             }
         },
         clearGraphy() {

+ 1 - 1
src/store/index.js

@@ -106,7 +106,7 @@ export default new Vuex.Store({
             if (data.length > 0) {
                 data.forEach((e) => {
                     let obj = {
-                        id: e.gname,
+                        id: e.gcname,
                         name: e.code,
                     }
                     // 下拉框的楼层数组

+ 20 - 20
src/views/equipment/table/djspTable.vue

@@ -56,11 +56,11 @@ export default {
             innerVisible: false, //详情弹框
             shopsnum: '',
             welldes: '',
-            floorAllSelect: []
+            floorAllSelect: [],
         }
     },
     computed: {
-        ...mapGetters(['floorSelect', 'plazaId'])
+        ...mapGetters(['floorSelect', 'plazaId']),
     },
     props: ['param'],
     methods: {
@@ -69,12 +69,12 @@ export default {
                 if (row.col0count > 0) {
                     return {
                         rowspan: row.col0count,
-                        colspan: 1
+                        colspan: 1,
                     }
                 } else {
                     return {
                         rowspan: 0,
-                        colspan: 0
+                        colspan: 0,
                     }
                 }
             }
@@ -86,7 +86,7 @@ export default {
         getList() {
             let getParams = {
                 orderBy: `floor,0;welldesm,1;meterbox,1;`,
-                plazaId: this.plazaId
+                plazaId: this.plazaId,
             }
             if (this.floor && this.floor != 1) {
                 getParams.floor = this.floor
@@ -101,25 +101,25 @@ export default {
             if (getParams.keyword == '') {
                 delete getParams.keyword
             }
-            queryShops({ getParams }).then(res => {
+            queryShops({ getParams }).then((res) => {
                 console.log(res)
                 this.tableData = []
                 let floor = {}
                 res.data &&
-                    res.data.forEach(i => {
+                    res.data.forEach((i) => {
                         console.log(i)
-                        Object.keys(i).forEach(key => (floor[key] = 0)) // 初始化每一楼层个数为0
-                        Object.values(i).forEach(j => {
-                            Object.values(j).forEach(k => {
+                        Object.keys(i).forEach((key) => (floor[key] = 0)) // 初始化每一楼层个数为0
+                        Object.values(i).forEach((j) => {
+                            Object.values(j).forEach((k) => {
                                 console.log(k)
                                 this.tableData.push(k)
                             })
                         })
                     })
 
-                this.tableData.map(n => {
+                this.tableData.map((n) => {
                     if (floor[n.floor] === 0) {
-                        const count = this.tableData.filter(m => m.floor === n.floor).length
+                        const count = this.tableData.filter((m) => m.floor === n.floor).length
                         floor[n.floor] = count
                         n.col0count = count
                     } else {
@@ -133,12 +133,12 @@ export default {
             this.floorAllSelect = []
             this.floorAllSelect.push({
                 name: '全部',
-                id: '1'
+                id: '1',
             })
-            this.floorSelect.forEach(el => {
+            this.floorSelect.forEach((el) => {
                 this.floorAllSelect.push(el)
             })
-        }
+        },
     },
     watch: {
         param(newV, oldV) {
@@ -153,19 +153,19 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gname !== oldV.gname) {
-                    this.floor = newV.gname
+                if (newV.gcname !== oldV.gcname) {
+                    this.floor = newV.gcname
                     this.getList()
                 }
             },
-            deep: true
-        }
+            deep: true,
+        },
     },
     mounted() {
         // this.floor = this.$cookie.get('floorMapId')
         this.getList()
         this.getFloorAllSelect()
-    }
+    },
 }
 </script>
 <style lang="less" scoped>

+ 2 - 2
src/views/equipment/table/eqDetaileDialog.vue

@@ -102,7 +102,7 @@
                 background
                 layout='prev, pager, next'
                 :total='total'
-                :current-page.sync="sonpage"
+                :current-page.sync='sonpage'
                 :page-size='size'
                 @prev-click='pageChanged'
                 @next-click='pageChanged'
@@ -287,7 +287,7 @@ export default {
             }
             //下拉筛选
             if (this.floor && this.floor != 1) {
-                postParams.gname = this.floor
+                postParams.gcname = this.floor
             }
             if (this.sbglgs && this.sbglgs != 1) {
                 postParams.sbglgs = this.sbglgs

+ 4 - 4
src/views/equipment/table/eqListTable.vue

@@ -106,7 +106,7 @@ export default {
             tableData: [],
             total: 0,
             currentPage: 1,
-            sonpage:1,
+            sonpage: 1,
             size: 10,
             innerVisible: false, //详情弹框
             keyword: '',
@@ -149,7 +149,7 @@ export default {
             }
             //下拉
             if (this.floor && this.floor != 1) {
-                postParams.gname = this.floor
+                postParams.gcname = this.floor
             }
             //输入框搜索
             data.keyword = ''
@@ -201,8 +201,8 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gname !== oldV.gname) {
-                    this.floor = newV.gname
+                if (newV.gcname !== oldV.gcname) {
+                    this.floor = newV.gcname
                     this.getList()
                 }
             },

+ 4 - 4
src/views/equipment/table/standTable.vue

@@ -99,7 +99,7 @@ export default {
             tableData: [],
             total: 0,
             currentPage: 1,
-            sonpage:1,
+            sonpage: 1,
             size: 10,
             keyword: '',
             floor: '1',
@@ -155,7 +155,7 @@ export default {
             }
             //下拉
             if (this.floor && this.floor != 1) {
-                postParams.gname = this.floor
+                postParams.gcname = this.floor
             }
             //输入框搜索
             data.keyword = ''
@@ -205,8 +205,8 @@ export default {
         // 监听 vuex 中currentFloor的变化,切换楼层后,更新下拉菜单
         '$store.state.currentFloor': {
             handler(newV, oldV) {
-                if (newV.gname !== oldV.gname) {
-                    this.floor = newV.gname
+                if (newV.gcname !== oldV.gcname) {
+                    this.floor = newV.gcname
                     this.getList()
                 }
             },

+ 4 - 0
src/views/floorFunc/index.vue

@@ -41,14 +41,18 @@ export default {
         },
         init() {
             this.loadName = `楼层功能-${this.floorInfo.code}`
+            console.log(this.floorsArr.length)
+            console.log(this.$cookie.get('currentFloorId'))
             if (this.floorsArr.length > 0 && this.$cookie.get('currentFloorId')) {
                 this.floorInfo = this.floorsArr.find((item) => {
                     return this.$cookie.get('currentFloorId') == item.seq
                 })
+            } else {
             }
         },
     },
     mounted() {
+        console.log(this.floorInfo)
         this.init()
         this.$refs.floorMap.init(this.floorInfo.gname)
     },

+ 4 - 4
src/views/other/index.vue

@@ -73,9 +73,9 @@ export default {
             this.systemName = item.name
         },
         emitFloor(item) {
-            this.queryPicter(item.gname)
+            this.queryPicter(item.gcname)
             this.floorInfo = item
-            this.picFloor = this.floorInfo.gname
+            this.picFloor = this.floorInfo.gcname
         },
         dialogVisible(item) {
             this.$refs.gcfzDialog.showModal(item)
@@ -102,7 +102,7 @@ export default {
                         tableName: 'glsms_proimgup',
                         params: {
                             module: '1004',
-                            floor: e.gname,
+                            floor: e.gcname,
                         },
                     }
                     postParams.push(obj)
@@ -115,7 +115,7 @@ export default {
                 data.forEach((el) => {
                     if (el.count > 0) {
                         this.floorsArr.forEach((item) => {
-                            if (item.gname == el.params.floor) {
+                            if (item.gcname == el.params.floor) {
                                 this.floorData.push(item)
                             }
                         })

+ 1 - 1
src/views/room/detail.vue

@@ -266,7 +266,7 @@ export default {
                 // type_code: this.row.type_code
             }
             // if (this.floorChange) {
-            //     postParams.gname = this.floorChange
+            //     postParams.gcname = this.floorChange
             // }
             // if (this.row.floorcode) {
             //     postParams.floorcode = this.row.floorcode

+ 1 - 1
src/views/room/index.vue

@@ -671,7 +671,7 @@ export default {
                 }
             }
             // if (this.floorChange) {
-            //     postParams.gname = this.floorChange
+            //     postParams.gcname = this.floorChange
             // }
             queryHxsb({ data, postParams }).then((res) => {
                 this.loading2 = false