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