Sfoglia il codice sorgente

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

haojianlong 4 anni fa
parent
commit
98dc1332fb

File diff suppressed because it is too large
+ 25 - 0
public/index.html


+ 21 - 9
src/components/Rotation/src/rotation.vue

@@ -19,6 +19,18 @@
         <!-- 不显示指示器 -->
         <!-- :indicator-position='rotationImg.length == 1 ? "none":""' -->
         <el-carousel
+            v-else-if='type!="5"'
+            style='height:100%;width:100%'
+            :interval='5000'
+            indicator-position='none'
+            :arrow='rotationImg.length == 1 ? "never":"always"'
+            @change='changePic'
+        >
+            <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
+                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit: container;' />
+            </el-carousel-item>
+        </el-carousel>
+        <el-carousel
             v-else
             style='height:100%;width:100%'
             :interval='5000'
@@ -27,7 +39,7 @@
             @change='changePic'
         >
             <el-carousel-item v-for='(item,index) in rotationImg' :key='index'>
-                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit: cover;' />
+                <img :src='item.url' alt style='  width: 100%; height: 100%;object-fit:inherit' />
             </el-carousel-item>
         </el-carousel>
     </div>
@@ -42,21 +54,21 @@ export default {
             fileList: [
                 {
                     name: 'food.jpeg',
-                    url: require('@/assets/imgs/2020.png')
+                    url: require('@/assets/imgs/2020.png'),
                 },
                 {
                     name: 'food2.jpeg',
-                    url: require('@/assets/imgs/20200.png')
+                    url: require('@/assets/imgs/20200.png'),
                 },
                 {
                     name: 'food.jpeg',
-                    url: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
+                    url: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
                 },
                 {
                     name: 'food2.jpeg',
-                    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
-                }
-            ]
+                    url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+                },
+            ],
         }
     },
     methods: {
@@ -64,7 +76,7 @@ export default {
             if (this.type == 2) {
                 this.$emit('scan', val + 1)
             }
-        }
+        },
     },
     // 解决两张图片时,轮播顺序反向
     created() {
@@ -76,7 +88,7 @@ export default {
         if (this.type == 2) {
             this.changePic(1)
         }
-    }
+    },
 }
 </script>
 <style lang="less" scoped>

+ 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)

+ 60 - 44
src/store/index.js

@@ -1,46 +1,47 @@
-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({
     state: {
-        // ssoToken: 'admin:liujiandong',
+        ssoToken: 'admin:liulin34',
         // ssoToken: '',
-        ssoToken: null,
+        // ssoToken: null,
         plazaName: "",
         isPreview: false,
-        lastRoute: "",
+        lastRoute: '',
         isrequestAuth: null, // 是否请求登录校验接口
-        permissions: [""], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
+        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">

+ 11 - 14
src/views/overview/index.vue

@@ -82,7 +82,7 @@
                 <div class='view-right-box'>
                     <div class='lb-right'>
                         <div v-if='pic1.length>0' style='height:100%'>
-                            <rotation type='2' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
+                            <rotation type='5' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
                             <div class='lb-icon' @click='picClick("1")'></div>
                             <img class='lb-img' @click='picClick("1")' src='../../assets/imgs/zk.png' alt />
                         </div>
@@ -205,9 +205,7 @@
 import PicModal from './picModal'
 import { queryFact } from '@/api/overview'
 import { mapGetters } from 'vuex'
-import {
-    query
-} from "@/utils/query"
+import { query } from '@/utils/query'
 export default {
     data() {
         return {
@@ -346,7 +344,7 @@ export default {
             // }
         },
         query() {
-            let plazaId = this.$route.query.plazaId ?this.$route.query.plazaId:this.plazaId
+            let plazaId = this.$route.query.plazaId ? this.$route.query.plazaId : this.plazaId
             let params = {
                 getParams: {
                     plazaId: plazaId,
@@ -380,8 +378,8 @@ export default {
                     this.shuzihuayijiao = res.shuzihuayijiao ? res.shuzihuayijiao : ''
                     if (res.plazaName) {
                         this.$store.commit('SETPLAZENAME', res.plazaName)
-                    }else{
-                         this.$store.commit('SETPLAZENAME','')
+                    } else {
+                        this.$store.commit('SETPLAZENAME', '')
                     }
                 }
             })
@@ -425,14 +423,13 @@ export default {
     },
     watch: {
         '$store.state.plazaId': {
-          handler(val,nel){
-           console.log('val',val,nel)
-           this.query()
-          },
-          immediate:true
-        }
+            handler(val, nel) {
+                console.log('val', val, nel)
+                this.query()
+            },
+            immediate: true,
+        },
     },
-
 }
 </script>
 <style lang="less" scoped>

+ 4 - 4
src/views/overview/picModal.vue

@@ -20,7 +20,7 @@ export default {
             rotationImg: [],
             key: 1,
             sizePic: '',
-            imgInfo: {}
+            imgInfo: {},
         }
     },
     methods: {
@@ -32,7 +32,7 @@ export default {
                 let img = new Image()
                 img.src = this.rotationImg[0].url
                 const vm = this
-                img.onload = function() {
+                img.onload = function () {
                     vm.$set(vm.imgInfo, 'width', img.width)
                     vm.$set(vm.imgInfo, 'height', img.height)
                     if (vm.imgInfo.width > vm.imgInfo.height) {
@@ -46,8 +46,8 @@ export default {
         },
         close() {
             this.dialogVisible = false
-        }
-    }
+        },
+    },
 }
 </script>