소스 검색

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

shaun-sheep 4 년 전
부모
커밋
47260034ef
2개의 변경된 파일33개의 추가작업 그리고 28개의 파일을 삭제
  1. 23 23
      src/store/index.js
  2. 10 5
      src/views/overview/index.vue

+ 23 - 23
src/store/index.js

@@ -1,34 +1,34 @@
-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 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'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: "admin:lengqiang",
+        ssoToken: 'admin:lengqiang',
         // ssoToken: null,
         isPreview: false,
-        lastRoute: "",
+        lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: "", //用户名称:艾宇;
-            orgCode: "",
-            username: "lengqiang", //账户名称
+            employeename: '', //用户名称:艾宇;
+            orgCode: '',
+            username: 'lengqiang', //账户名称
         },
-        plazaId: "1000423", //项目Id
-        projectName: "", //全局项目名称
+        plazaId: '1000423', //项目Id
+        projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: "",
+        fmapID: '',
         haveFengMap: false, //是否有蜂鸟地图的数据
         isMessage: true, //是否有发布的图
         scpzTable: [], //土建系统图例展示
         legendTable: [], //除土建系统图例展示
-        remarksText: "", //备注
+        remarksText: '', //备注
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
     },
@@ -112,19 +112,19 @@ export default new Vuex.Store({
         // 获取项目列表、userId
         async getUserInfo({ commit }, palyload) {
             await login({ username: palyload }).then((res) => {
-                if (res.result == "success") {
-                    commit("SETISREQUESTtAUTH", true)
-                    commit("SETAUTHMSG", res)
+                if (res.result == 'success') {
+                    commit('SETISREQUESTtAUTH', true)
+                    commit('SETAUTHMSG', res)
                 } else {
-                    console.log("接口报错!!")
-                    commit("SETISREQUESTtAUTH", false)
+                    console.log('接口报错!!')
+                    commit('SETISREQUESTtAUTH', false)
                 }
             })
         },
         getFloors(context) {
             queryFloor({ plazaId: context.state.plazaId }).then((res) => {
-                if (res.result == "success") {
-                    context.commit("SETFLOORS", res.data)
+                if (res.result == 'success') {
+                    context.commit('SETFLOORS', res.data)
                 }
             })
         },
@@ -132,7 +132,7 @@ export default new Vuex.Store({
             await queryfmapID({
                 mapId: context.state.plazaId,
             }).then((res) => {
-                context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
@@ -147,7 +147,7 @@ export default new Vuex.Store({
                         obj[i.bunkdesc] = i
                     })
                 }
-                context.commit("SETBUNKOBJ", obj)
+                context.commit('SETBUNKOBJ', obj)
             })
         },
     },

+ 10 - 5
src/views/overview/index.vue

@@ -237,11 +237,16 @@ export default {
     },
     mounted() {
         //预览是否开启
-        let previewUrl = location.href.split('?')[1]
-        if (previewUrl) {
-            previewUrl = Boolean(previewUrl.split('=')[1])
-            this.$store.commit('SETISPREVIEW', previewUrl)
-        }
+        // let previewUrl = location.href.split('?')[1]
+        // if (previewUrl) {
+        //     previewUrl = Boolean(previewUrl.split('=')[1])
+        //     this.$store.commit('SETISPREVIEW', previewUrl)
+        // }
+        let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
+            plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
+        console.log('previewUrl:', previewUrl)
+        console.log('plazaId:', plazaId)
+        this.$store.commit('SETISPREVIEW', previewUrl)
         this.query()
     },
     computed: {