12312312
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div :id="mapid" class="map"></div>
|
||||
<div class="changeMap_box" v-if="props.isShow">
|
||||
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况" style="--el-switch-color:#13ce66;--el-switch-off-color:#ff4949;" />
|
||||
<el-switch v-model="conditionRoute" @change="handleSwitch" active-text="打开路况" inactive-text="关闭路况"
|
||||
style="--el-switch-color: #13ce66; --el-switch-off-color: #ff4949" />
|
||||
<!-- <el-carousel type="card" height="75px" :autoplay="false" indicator-position="none" :initial-index="3" @change="onMapImageChange">
|
||||
<el-carousel-item>
|
||||
<div class="mapImageItem">
|
||||
@ -88,27 +89,32 @@ onMounted(() => {
|
||||
|
||||
map = new EliMap({
|
||||
id: props.mapid,
|
||||
crs: "EPSG:3857",
|
||||
crs: "EPSG:4490",
|
||||
style: {
|
||||
glyphs: "./fonts/{fontstack}/{range}.pbf",
|
||||
center: [94.36,29.65],
|
||||
zoom: 10
|
||||
center: [94.36057012, 29.64276831],
|
||||
zoom: 15
|
||||
},
|
||||
transformRequest: (url) => {
|
||||
if (url.indexOf("TileMatrix=") != -1) {
|
||||
const arr = url.split("TileMatrix=");
|
||||
const arr1 = arr[1].split("&");
|
||||
const nurl = `${arr[0]}&TileMatrix=${Number(arr1[0])}&${arr1[1]}&${arr1[2]}`;
|
||||
|
||||
}
|
||||
}
|
||||
minZoom: 7,
|
||||
maxZoom: 18,
|
||||
});
|
||||
|
||||
window.map = map;
|
||||
map.mapboxGLMap.on("load", () => {
|
||||
map.addGaudLayer({
|
||||
url: 'http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
|
||||
})
|
||||
map.addWMTSLayer(
|
||||
"/PGIS_S_TileMapServer/Maps/XZDJ_SL/EzMap",
|
||||
{
|
||||
Service: "getImage",
|
||||
Type: "RGB",
|
||||
ZoomOffset: "0",
|
||||
V: "0.3",
|
||||
Zoom: "{z}",
|
||||
Row: "{y}",
|
||||
Col: "{x}"
|
||||
},
|
||||
{
|
||||
tileSize: 300
|
||||
}
|
||||
);
|
||||
zoomTarget.value = map.mapboxGLMap.getZoom();
|
||||
});
|
||||
mapUtil.value = new MapUtil(map);
|
||||
@ -128,8 +134,6 @@ onMounted(() => {
|
||||
});
|
||||
// 撒点
|
||||
emitter.on("addPointArea", (obj) => {
|
||||
console.log(obj);
|
||||
|
||||
mapUtil.value.makerSki(obj);
|
||||
});
|
||||
// 鼠标滑过提示文字的点位
|
||||
@ -168,7 +172,7 @@ onMounted(() => {
|
||||
});
|
||||
// 回显线
|
||||
emitter.on("echoLine", (res) => {
|
||||
mapUtil.value.createLine(res);
|
||||
mapUtil.value.createLine(res, res.flag);
|
||||
});
|
||||
//创建边界面(geojson)
|
||||
emitter.on("setBoundarys", (res) => {
|
||||
@ -199,11 +203,6 @@ onMounted(() => {
|
||||
mapUtil.value.diffusionCircle(res);
|
||||
});
|
||||
|
||||
// 清除全部覆盖物
|
||||
emitter.on("removeElementAll", () => {
|
||||
mapUtil.value.removeElementAll();
|
||||
});
|
||||
|
||||
// 展示盘曲
|
||||
emitter.on("showGapText", (obj) => {
|
||||
mapUtil.value.gapText(obj);
|
||||
@ -302,7 +301,6 @@ onUnmounted(() => {
|
||||
emitter.off("diffusionCircle");
|
||||
emitter.off("SsCircle");
|
||||
emitter.off("ClearssCircle");
|
||||
emitter.off("removeElementAll");
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -325,29 +323,35 @@ onUnmounted(() => {
|
||||
right: 398px;
|
||||
bottom: 4px;
|
||||
z-index: 9;
|
||||
|
||||
.mapImageItem {
|
||||
border: 1px solid #08aae8;
|
||||
background: rgb(9, 26, 70);
|
||||
|
||||
&>img {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
&>div {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
.zoomTargetBox {
|
||||
margin-top: 10px;
|
||||
margin-left: 23px;
|
||||
}
|
||||
|
||||
::v-deep .el-input-number__decrease,
|
||||
::v-deep .el-input-number__increase {
|
||||
background: #133362;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background: #0c1641;
|
||||
}
|
@ -6,7 +6,7 @@ import {
|
||||
removeAllItem
|
||||
} from "@/utils/storage";
|
||||
// 白名单
|
||||
const whiteList = ['/login','/','/StationLevel', '/oatuh_login','/editPassword', '/404', '/401']
|
||||
const whiteList = ['/login','/oatuh_login','/','/StationLevel','/editPassword', '/404', '/401']
|
||||
/**
|
||||
* 路由前置守卫
|
||||
* to 去哪里
|
||||
@ -14,42 +14,45 @@ const whiteList = ['/login','/','/StationLevel', '/oatuh_login','/editPassword',
|
||||
* next 往下走
|
||||
*/
|
||||
let onRun = true;
|
||||
// router.beforeEach(async (to, from, next) => {
|
||||
// // 存在 token ,进入主页
|
||||
// // if (store.state.user.token) {
|
||||
// // 快捷访问
|
||||
// if (store.getters.token) {
|
||||
// // 判断用户资料是否获取
|
||||
// // 若不存在用户信息,则需要获取用户信息
|
||||
// // 触发获取用户信息的 action,并获取用户当前权限
|
||||
// await store.commit('permission/setRouteReady', true)
|
||||
// // 添加完动态路由之后,需要在进行一次主动跳转
|
||||
// const afterMenuList = await getItem('menusPermission');
|
||||
// // 处理用户权限,筛选出需要添加的权限
|
||||
// if (store.state.permission.routes == 0) {
|
||||
// const filterRoutes = await store.dispatch('permission/filterRoutes', afterMenuList)
|
||||
// filterRoutes.forEach(item => {
|
||||
// router.addRoute(item)
|
||||
// })
|
||||
// next({
|
||||
// ...to,
|
||||
// replace: true
|
||||
// })
|
||||
// } else {
|
||||
// next()
|
||||
// }
|
||||
// // 利用 addRoute 循环添加
|
||||
// } else {
|
||||
// const isOatuh = getItem('isOatuh')
|
||||
// // 没有token的情况下,可以进入白名单
|
||||
// if (whiteList.indexOf(to.path) > -1) {
|
||||
// next()
|
||||
// } else {
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 存在 token ,进入主页
|
||||
console.log(store.getters.token,'===store.getters.token');
|
||||
|
||||
// if (store.state.user.token) {
|
||||
// 快捷访问
|
||||
if (store.getters.token) {
|
||||
// 判断用户资料是否获取
|
||||
// 若不存在用户信息,则需要获取用户信息
|
||||
// 触发获取用户信息的 action,并获取用户当前权限
|
||||
await store.commit('permission/setRouteReady', true)
|
||||
// 添加完动态路由之后,需要在进行一次主动跳转
|
||||
const afterMenuList = await getItem('menusPermission');
|
||||
// 处理用户权限,筛选出需要添加的权限
|
||||
if (store.state.permission.routes == 0) {
|
||||
const filterRoutes = await store.dispatch('permission/filterRoutes', afterMenuList)
|
||||
filterRoutes.forEach(item => {
|
||||
router.addRoute(item)
|
||||
})
|
||||
next({
|
||||
...to,
|
||||
replace: true
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
// 利用 addRoute 循环添加
|
||||
} else {
|
||||
const isOatuh = getItem('isOatuh')
|
||||
// 没有token的情况下,可以进入白名单
|
||||
if (whiteList.indexOf(to.path) > -1) {
|
||||
next()
|
||||
} else {
|
||||
next('/oatuh_login')
|
||||
// if (isOatuh) {
|
||||
// next('/oatuh_login')
|
||||
// } else {
|
||||
// next('/login')
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -142,7 +142,7 @@ export default {
|
||||
systemId,
|
||||
})
|
||||
.then((data) => {
|
||||
|
||||
debugger
|
||||
if (data.deptList.length === 1) {
|
||||
this.commit("user/setToken", data.jwtToken);
|
||||
this.commit("user/setDeptId", data.deptList);
|
||||
|
@ -14,7 +14,6 @@ function redirectAuth() {
|
||||
|
||||
let token = location.hash.slice(20) || null;
|
||||
if (token != null) {
|
||||
debugger
|
||||
token = token.replace(/\ +/g, "");
|
||||
setItem("SSOTOKEN", token)
|
||||
handleLogin({ token: token});
|
||||
@ -27,7 +26,7 @@ const handleLogin = (e) => {
|
||||
store.dispatch("user/oatuhLogin", e).then((res) => {
|
||||
// 登录后操作
|
||||
if (res.deptList.length === 1) {
|
||||
window.location.hash = "/";
|
||||
// window.location.hash = "/";
|
||||
} else {
|
||||
deptList.value = [...res.deptList];
|
||||
loginDialog.value = true;
|
||||
|
Reference in New Issue
Block a user