|
@@ -1,15 +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({
|
|
@@ -17,25 +11,25 @@ export default new Vuex.Store({
|
|
|
// 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: {}, //当前选中的楼层信息
|
|
|
},
|
|
@@ -117,54 +111,27 @@ export default new Vuex.Store({
|
|
|
},
|
|
|
actions: {
|
|
|
// 获取项目列表、userId
|
|
|
- async getUserInfo({
|
|
|
- commit
|
|
|
- }, palyload) {
|
|
|
+ async getUserInfo({ commit }, palyload) {
|
|
|
await login({}).then((res) => {
|
|
|
- if (res.result == "success") {
|
|
|
+ if (res.result == 'success') {
|
|
|
// token校验成功 拿到权限
|
|
|
//commit("SETISREQUESTtAUTH", true)
|
|
|
- console.log("-----", palyload)
|
|
|
if (res.permissions.length == 0) {
|
|
|
- //权限不足
|
|
|
- console.log("权限不足!!")
|
|
|
- router.push({
|
|
|
- path: "/404",
|
|
|
- query: {
|
|
|
- result: "权限不足"
|
|
|
- }
|
|
|
- })
|
|
|
+ router.push('/404')
|
|
|
}
|
|
|
- commit("SETAUTHMSG", res)
|
|
|
- } else if (res.result == "no_auth") {
|
|
|
- //登录失败
|
|
|
- console.log("登录失败!!")
|
|
|
- commit("SETISREQUESTtAUTH", false)
|
|
|
- router.push({
|
|
|
- path: "/404",
|
|
|
- query: {
|
|
|
- result: "登录失败"
|
|
|
- }
|
|
|
- })
|
|
|
+ commit('SETAUTHMSG', res)
|
|
|
} else {
|
|
|
- //访问出错 500
|
|
|
- console.log("访问出错!!")
|
|
|
- commit("SETISREQUESTtAUTH", false)
|
|
|
- router.push({
|
|
|
- path: "/404",
|
|
|
- query: {
|
|
|
- result: "访问出错"
|
|
|
- }
|
|
|
- })
|
|
|
+ commit('SETISREQUESTtAUTH', false)
|
|
|
+ router.push('/404')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getFloors(context) {
|
|
|
queryFloor({
|
|
|
- plazaId: context.state.plazaId
|
|
|
+ plazaId: context.state.plazaId,
|
|
|
}).then((res) => {
|
|
|
- if (res.result == "success") {
|
|
|
- context.commit("SETFLOORS", res.data)
|
|
|
+ if (res.result == 'success') {
|
|
|
+ context.commit('SETFLOORS', res.data)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -172,7 +139,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) {
|
|
@@ -180,7 +147,7 @@ export default new Vuex.Store({
|
|
|
plazaId: context.state.plazaId,
|
|
|
}
|
|
|
await queryBrand({
|
|
|
- data
|
|
|
+ data,
|
|
|
}).then((res) => {
|
|
|
let obj = {}
|
|
|
if (res.data.data) {
|
|
@@ -189,9 +156,9 @@ export default new Vuex.Store({
|
|
|
obj[i.bunkdesc] = i
|
|
|
})
|
|
|
}
|
|
|
- context.commit("SETBUNKOBJ", obj)
|
|
|
+ context.commit('SETBUNKOBJ', obj)
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
modules: {},
|
|
|
-})
|
|
|
+})
|