瀏覽代碼

合并冲突

YaolongHan 4 年之前
父節點
當前提交
3ce916e8d9

+ 4 - 0
public/index.html

@@ -38,6 +38,10 @@
             background: #f7f9fa !important;
         }
 
+        .fm-menu-left-bar {
+            z-index: 99;
+        }
+
         .my-leaflet-div-icon {
             white-space: nowrap;
         }

+ 5 - 8
src/components/floorList.vue

@@ -48,11 +48,6 @@ export default {
             num: 0,
             floorMapIdName: '',
             floor: {
-                code: 'F1',
-                gcode: '1F',
-                gname: 'f1',
-                name: '第1层',
-                seq: 100
             },
             currentFloorId: null,
             marginTop: 0,
@@ -81,10 +76,12 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['legendTable'])
+        ...mapGetters(['legendTable','floorObj'])
     },
     mounted() {
-        window.vm = this
+        if (Object.keys(this.floorObj).length > 0) {
+            this.floor = this.floorObj 
+        }
         this.init()
     },
     methods: {
@@ -111,7 +108,7 @@ export default {
             this.floorsArr.map(item => {
                 this.floorIdArr.push(item.seq)
             })
-            this.currentFloorId = Number(this.$cookie.get('currentFloorId') || 100)
+            this.currentFloorId = Number(this.$cookie.get('currentFloorId') || this.floorObj.seq)
             // bug fix 修复 fenbuPic 弹窗中,楼层不能选中的问题
             // 如果 floorIdArr 不在 floorIdArr数组中,或者changeDataFlag为false(弹窗组件中的楼层组件),使用 floorIdArr[0], 而不使用 cookie
             let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)

+ 33 - 27
src/components/floorMap/index.vue

@@ -102,40 +102,46 @@ export default {
                     this.scene.addItem(imgItem)
                     this.view.scene = this.scene
                     // this.view.fitSceneToView()
+                } else {
+                    // 屋顶图不为图片
+                    this.readBaseMap(floor);
                 }
             } else {
                 if (window.fengmapData.gnameToGid[floor]) {
-                    window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], (res) => {
-                        if (res.err) {
-                            console.log('errr', res.err)
-                            return
-                        }
-                        this.fParser = new SFloorParser(null)
-                        this.fParser.parseData(res)
-                        this.fParser.spaceList.forEach((t) => {
-                            this.scene.addItem(t)
-                            t.nameSize = 12
-                            t.nameColor = '#2a2a2a'
-                            if (t.data.Name && this.bunkObj[t.data.Name]) {
-                                t.name = this.bunkObj[t.data.Name].brandname
-                            } else {
-                                // t.name = t.data.Name
-                                t.name = ''
-                            }
-                        })
-                        this.fParser.wallList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.virtualWallList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.doorList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.columnList.forEach((t) => this.scene.addItem(t))
-                        this.fParser.casementList.forEach((t) => this.scene.addItem(t))
-                        this.view.scene = this.scene
-                        // this.view.fitSceneToView()
-                        this.readGraph()
-                    })
+                    this.readBaseMap(floor);
                 } else {
                     console.log('楼层不正确')
                 }
             }
+        },// 解析底图
+        readBaseMap(floor){
+            window.fengmapData.parseData(window.fengmapData.gnameToGid[floor], res => {
+                if (res.err) {
+                    console.log('errr', res.err)
+                    return
+                }
+                this.fParser = new SFloorParser(null)
+                this.fParser.parseData(res)
+                this.fParser.spaceList.forEach(t => {
+                    this.scene.addItem(t)
+                    t.nameSize = 12
+                    t.nameColor = '#2a2a2a'
+                    if (t.data.Name && this.bunkObj[t.data.Name]) {
+                        t.name = this.bunkObj[t.data.Name].brandname
+                    } else {
+                        // t.name = t.data.Name
+                        t.name = ''
+                    }
+                })
+                this.fParser.wallList.forEach(t => this.scene.addItem(t))
+                this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
+                this.fParser.doorList.forEach(t => this.scene.addItem(t))
+                this.fParser.columnList.forEach(t => this.scene.addItem(t))
+                this.fParser.casementList.forEach(t => this.scene.addItem(t))
+                this.view.scene = this.scene
+                // this.view.fitSceneToView()
+                this.readGraph()
+            })
         },
         readGraph() {
             this.readGroup(this.floorid)

+ 57 - 41
src/store/index.js

@@ -1,9 +1,9 @@
-import Vue from "vue"
-import Vuex from "vuex"
-import { login, queryFloor, queryfmapID } from "@/api/login.js"
-import { queryBrand } from "@/api/public.js"
-import axios from "axios"
-import router from "../router"
+import Vue from 'vue'
+import Vuex from 'vuex'
+import { login, queryFloor, queryfmapID } from '@/api/login.js'
+import { queryBrand } from '@/api/public.js'
+import axios from 'axios'
+import router from '../router'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
@@ -13,34 +13,35 @@ export default new Vuex.Store({
         // ssoToken: null,
         plazaName: "",
         isPreview: false,
-        lastRoute: "",
+        lastRoute: '',
         isrequestAuth: null, // 是否请求登录校验接口
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: "", //用户名称:艾宇;
-            orgCode: "",
-            username: "lengqiang", //账户名称
+            employeename: '', //用户名称:艾宇;
+            orgCode: '',
+            username: 'lengqiang', //账户名称
         },
-        plazaId: "", //项目Id
-        projectName: "", //全局项目名称
+        plazaId: '', //项目Id
+        projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: "",
+        fmapID: '',
         haveFengMap: -1, //是否有蜂鸟地图的数据 -1为等待 0 为失败 1 为成功
         isMessage: true, //是否有发布的图
         scpzTable: [], //土建装饰图例展示
         legendTable: [], //除土建装饰图例展示
-        remarksText: "", //备注
+        remarksText: '', //备注
         // defaultComment: '',
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
         accessLevel: -1, // 权限级别
         showView: 1,
-        categoryId: "GDXT", //当前选中的系统
+        categoryId: 'GDXT', //当前选中的系统
         isGetmap: false, //是否可以请求底图(在项目中方可请求)
-        planNum: "", //主要设备房 展示备注需要
-        typeNum: "", //图例数量 展示备注需要
+        planNum: '', //主要设备房 展示备注需要
+        typeNum: '', //图例数量 展示备注需要
+        floorObj: {},
     },
     getters: {
         plazaName: (state) => state.plazaName,
@@ -65,6 +66,7 @@ export default new Vuex.Store({
         typeNum: (state) => state.typeNum,
         isrequestAuth: (state) => state.isrequestAuth,
         permissions: (state) => state.permissions,
+        floorObj: (state) => state.floorObj,
     },
     mutations: {
         SETPLAZENAME(state, data) {
@@ -98,6 +100,10 @@ export default new Vuex.Store({
             state.isMessage = data
         },
         SETFLOORS(state, data) {
+            console.log(data)
+            let numArr = [],
+                minNum = '',
+                floor = {}
             state.floorSelect = []
             state.floorsArr = data
             if (data.length > 0) {
@@ -106,8 +112,18 @@ export default new Vuex.Store({
                         id: e.gname,
                         name: e.code,
                     }
+                    // 下拉框的楼层数组
                     state.floorSelect.push(obj)
+                    // 获取默认展示楼层
+                    if (e.seq > 0) {
+                        numArr.push(e.seq)
+                    }
                 })
+                if (Math.min.apply(Math, numArr)) {
+                    state.floorObj = data.find((item) => {
+                        return item.seq == Math.min.apply(Math, numArr)
+                    })
+                }
             }
         },
         SETMAPID(state, data) {
@@ -168,36 +184,36 @@ export default new Vuex.Store({
                 .then((res) => {
                     // 获取用户当前权限
                     console.log(res.result)
-                    if (res.result === "success") {
-                        commit("STOREACCESSLEVEL", res.level)
-                        commit("SETAUTHMSG", res)
+                    if (res.result === 'success') {
+                        commit('STOREACCESSLEVEL', res.level)
+                        commit('SETAUTHMSG', res)
                         let level = res.level
-                        console.log("window.opener", window.opener)
+                        console.log('window.opener', window.opener)
                         if (window.opener && window.opener.__fromGroupPage) {
                             let data = window.opener.__fromGroupPage
                             level = data.level
-                            commit("SETPLAZENAME", data.plazaName)
-                            localStorage.setItem("PLAZAID", data.plazaId)
-                            commit("STOREPLAZAID", data.plazaId)
+                            commit('SETPLAZENAME', data.plazaName)
+                            localStorage.setItem('PLAZAID', data.plazaId)
+                            commit('STOREPLAZAID', data.plazaId)
                             router.push({
-                                path: "./home/homepage",
+                                path: './home/homepage',
                             })
                         } else {
                             if (level === 0) {
                                 if (res.treeData[0].ccode) {
-                                    localStorage.setItem("PLAZAID", res.treeData[0].ccode)
-                                    commit("STOREPLAZAID", res.treeData[0].ccode)
-                                    commit("SETPLAZENAME", res.treeData[0].cname)
+                                    localStorage.setItem('PLAZAID', res.treeData[0].ccode)
+                                    commit('STOREPLAZAID', res.treeData[0].ccode)
+                                    commit('SETPLAZENAME', res.treeData[0].cname)
                                 }
                                 router.push({
-                                    path: "./home/overview",
+                                    path: './home/overview',
                                     query: {
                                         plazaId: res.treeData[0].ccode,
                                     },
                                 })
                             } else {
                                 router.push({
-                                    path: "./group",
+                                    path: './group',
                                 })
                             }
                         }
@@ -211,7 +227,7 @@ export default new Vuex.Store({
                     }
                 })
                 .catch((err) => {
-                    console.log("getuserfo catch", err)
+                    console.log('getuserfo catch', err)
                     // router.push({
                     //     path: '/404',
                     // })
@@ -223,9 +239,9 @@ export default new Vuex.Store({
                 returnTree: true,
             })
                 .then((res) => {
-                    if (res.result === "success") {
+                    if (res.result === 'success') {
                         // commit('STOREACCESSLEVEL', res.level)
-                        commit("SETAUTHMSG", res)
+                        commit('SETAUTHMSG', res)
                         window.wd_fm_info = {
                             profile: {
                                 username: encodeURIComponent(res.username),
@@ -234,7 +250,7 @@ export default new Vuex.Store({
                     }
                 })
                 .catch((err) => {
-                    console.log("getuserfo catch", err)
+                    console.log('getuserfo catch', err)
                     // router.push({
                     //     path: '/404',
                     // })
@@ -243,23 +259,23 @@ export default new Vuex.Store({
         },
         async getFloors(context) {
             await queryFloor({
-                plazaId: localStorage.getItem("PLAZAID") || context.state.plazaId,
+                plazaId: localStorage.getItem('PLAZAID') || context.state.plazaId,
             }).then((res) => {
-                if (res.result == "success") {
-                    context.commit("SETFLOORS", res.data)
+                if (res.result == 'success') {
+                    context.commit('SETFLOORS', res.data)
                 }
             })
         },
         async getfmapID(context) {
             await queryfmapID({
-                mapId: localStorage.getItem("PLAZAID") || context.state.plazaId,
+                mapId: localStorage.getItem('PLAZAID') || context.state.plazaId,
             }).then((res) => {
-                context.commit("SETMAPID", `${localStorage.getItem("PLAZAID") || context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${localStorage.getItem('PLAZAID') || context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
             let data = {
-                plazaId: `${localStorage.getItem("PLAZAID") || context.state.plazaId}`,
+                plazaId: `${localStorage.getItem('PLAZAID') || context.state.plazaId}`,
             }
             await queryBrand({
                 data,
@@ -271,7 +287,7 @@ export default new Vuex.Store({
                         obj[i.bunkdesc] = i
                     })
                 }
-                context.commit("SETBUNKOBJ", obj)
+                context.commit('SETBUNKOBJ', obj)
             })
         },
     },

+ 5 - 23
src/views/equipment/index.vue

@@ -90,10 +90,6 @@ export default {
             categoryId: 'GDXT',
             systemName: '供电系统',
             floorInfo: {
-                code: 'F1',
-                gcode: '1F',
-                gname: 'f1',
-                seq: 100
             },
             smsxt: '1001',
             dialogInfo: {},
@@ -273,23 +269,12 @@ export default {
             }
         }
     },
-    /* mounted() {
-        if (this.$route.query.smsxt) {
-            this.smsxt = this.$route.query.smsxt
-            this.system.forEach(el => {
-                if (el.smsxt == this.smsxt) {
-                    this.everySystem = el.children
-                    this.systemName = el.name
-                    this.systemId = el.id
-                }
-            })``
-        }
-        this.everySystem = this.system[0].children
-        this.init()
-        this.$refs.floorMap.init(this.floorInfo.gname)
-    }, */
     mounted() {
         window._vm = this
+        if (Object.keys(this.floorObj).length > 0) {
+            this.floorInfo = this.floorObj 
+            this.$refs.floorMap.init(this.floorInfo.gname)
+        }
         if (this.$route.query.smsxt) {
             console.log(this.$route.query.smsxt)
             this.smsxt = this.$route.query.smsxt
@@ -310,16 +295,13 @@ export default {
             this.everySystem = item.children
             this.systemName = item.name
             this.smsxt = item.smsxt
-            // this.$refs.floorMap.init(this.floorInfo.gname)
             this.querySmsxt()
             this.viewLengend()
         }
         this.init()
-        console.log(this.floorInfo.gname)
-        this.$refs.floorMap.init(this.floorInfo.gname)
     },
     computed: {
-        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable'])
+        ...mapGetters(['floorsArr', 'plazaId', 'showView', 'legendTable','floorObj'])
     }
 }
 </script>

+ 9 - 8
src/views/floorFunc/index.vue

@@ -21,16 +21,13 @@ export default {
     data() {
         return {
             show: true,
-            floorInfo: {
-                gname: 'f1',
-                code: 'F1'
-            },
+            floorInfo: {},
             loadName: '',
-            type: ''
+            type: '',
         }
     },
     computed: {
-        ...mapGetters(['floorsArr'])
+        ...mapGetters(['floorsArr', 'floorObj']),
     },
     methods: {
         emitFloor(item) {
@@ -43,12 +40,16 @@ export default {
         },
         init() {
             this.loadName = `楼层功能-${this.floorInfo.code}`
-        }
+        },
     },
     mounted() {
+        if (Object.keys(this.floorObj).length > 0) {
+            this.floorInfo = this.floorObj
+        }
+        console.log('floorObj', this.floorObj)
         this.init()
         this.$refs.floorMap.init(this.floorInfo.gname)
-    }
+    },
 }
 </script>
 <style lang="less">

+ 18 - 18
src/views/legendLibrary/addLegend.vue

@@ -85,13 +85,13 @@ export default {
                 Size: { Height: '32', Width: '32' },
                 InfoTypeId: [], //铺位可视化typeid
                 InfoLocal: [], //工程信息化位置与设备分类
-                InfoSystem: [] //工程信息化专业/系统
+                InfoSystem: [], //工程信息化专业/系统
             },
             title: '',
             GraphCategoryId: 'DTXT',
             modalShow4: false,
             treeData: [],
-            tableData: []
+            tableData: [],
         }
     },
     components: { addForm, addList },
@@ -101,17 +101,17 @@ export default {
             this.GraphCategoryId = GraphCategoryId
             //console.log(title)
             let getParams = {
-                categoryId: String(this.GraphCategoryId)
+                categoryId: String(this.GraphCategoryId),
             }
             if (GraphCategoryId) {
-                groupByCategory({ getParams }).then(res => {
+                groupByCategory({ getParams }).then((res) => {
                     this.treeData = []
-                    this.treeData = res.Data.map(i => this.getTree(i))
+                    this.treeData = res.Data.map((i) => this.getTree(i))
                 })
                 //获取图例列表
                 let postParams = this.GraphCategoryId
                 let data = {}
-                queryRelation({ data, postParams }).then(res => {
+                queryRelation({ data, postParams }).then((res) => {
                     this.tableData = res.data.Content
                 })
                 //treeSelect
@@ -127,7 +127,7 @@ export default {
 
                     InfoTypeId: [], //铺位可视化typeid
                     InfoLocal: [], //工程信息化位置与设备分类
-                    InfoSystem: [] //工程信息化专业/系统
+                    InfoSystem: [], //工程信息化专业/系统
                 }
             } else if (title == '添加图例库') {
                 this.dialogVisible = true
@@ -144,7 +144,7 @@ export default {
 
                     InfoTypeId: [], //铺位可视化typeid
                     InfoLocal: [], //工程信息化位置与设备分类
-                    InfoSystem: [] //工程信息化专业/系统
+                    InfoSystem: [], //工程信息化专业/系统
                 }
             } else if (title == '修改图例库') {
                 this.dialogVisible = true
@@ -152,7 +152,7 @@ export default {
                 this.InfosList = []
                 this.InfoTypeIdList = []
                 // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
-                this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id }) => id)] : []
+                this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id, type }) => id + type)] : []
                 this.InfoTypeIdList = row.InfoTypeId
 
                 // 图例库规则中的transform
@@ -164,7 +164,7 @@ export default {
             return {
                 id: data.Id,
                 name: data.Name,
-                children: data.Children && data.Children.length > 0 ? data.Children.map(i => this.getTree(i)) : []
+                children: data.Children && data.Children.length > 0 ? data.Children.map((i) => this.getTree(i)) : [],
             }
         },
         cancal() {
@@ -178,7 +178,7 @@ export default {
                 Size: { Height: '32', Width: '32' },
                 InfoTypeId: [], //铺位可视化typeid
                 InfoLocal: [], //工程信息化位置与设备分类
-                InfoSystem: [] //工程信息化专业/系统
+                InfoSystem: [], //工程信息化专业/系统
             }
             this.InfoTypeIdList = []
             this.InfosList = []
@@ -223,26 +223,26 @@ export default {
             let tableList = [],
                 list = [],
                 totalLst = []
-            dataObj.forEach(i => {
+            dataObj.forEach((i) => {
                 list.push({
                     Id: i.id,
-                    name: i.name
+                    name: i.name,
                 })
             })
             tableList = [...list, ...this.tableData]
             tableList.forEach((i, index) => {
                 totalLst.push({
                     GraphElementId: i.Id,
-                    OrderId: index
+                    OrderId: index,
                 })
             })
 
             let postParams = {
                 GraphCategoryId: this.GraphCategoryId[0],
-                GraphRelations: totalLst
+                GraphRelations: totalLst,
             }
             console.log(totalLst, 'list')
-            updateRelation({ postParams }).then(res => {
+            updateRelation({ postParams }).then((res) => {
                 if (res.Result == 'success') {
                     this.$message.success('添加成功!')
                     this.$emit('mesg')
@@ -251,8 +251,8 @@ export default {
         },
         treeCancel() {
             this.modalShow4 = false
-        }
-    }
+        },
+    },
 }
 </script>