Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
holo-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xinkong
holo-web
Commits
edfd140a
Commit
edfd140a
authored
Jul 30, 2024
by
ninglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化带参数地址进入系统时读取中心点&层级 供首次定位展示使用
parent
61167a82
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
22 deletions
+61
-22
mapMapbox.vue
wj-manage-web/src/components/Standard/mapMapbox.vue
+10
-2
index.js
wj-manage-web/src/router/index.js
+33
-19
index.js
wj-manage-web/src/store/index.js
+3
-1
mapInit.js
wj-manage-web/src/store/modules/mapInit.js
+15
-0
No files found.
wj-manage-web/src/components/Standard/mapMapbox.vue
View file @
edfd140a
...
...
@@ -18,13 +18,21 @@ export default {
methods
:
{
initMap
(
option
)
{
// mapboxgl.accessToken = 'pk.eyJ1IjoibmluZ2x4IiwiYSI6ImNsYnlnM2s2ODBnNmIzcHBpbzY5aDh3bHAifQ.hQL4zLjBss5i4x-zuFp9tg'
let
center
=
map_config
.
MAP_CENTER
let
zoom
=
map_config
.
MAP_ZOOM
if
(
this
.
$store
.
state
.
mapInit
.
center
){
center
=
this
.
$store
.
state
.
mapInit
.
center
}
if
(
this
.
$store
.
state
.
mapInit
.
zoom
){
zoom
=
this
.
$store
.
state
.
mapInit
.
zoom
}
let
options
=
Object
.
assign
(
{},
{
container
:
this
.
mapId
,
style
:
map_config
.
MAP_STYLE
,
center
:
map_config
.
MAP_CENTER
,
zoom
:
map_config
.
MAP_ZOOM
,
center
:
center
,
zoom
:
zoom
,
maxZoom
:
map_config
.
MAX_ZOOM
,
pitch
:
map_config
.
MAP_PITCH
,
},
...
...
wj-manage-web/src/router/index.js
View file @
edfd140a
...
...
@@ -44,24 +44,40 @@ router.beforeEach((to, from, next) => {
return
;
}
const
parentId
=
map_config
.
SYS_ID
;
//针对济南特殊处理:根据url中得tokenId,进行base32加密用户名和密码,然后请求登录接口获取token
//针对济南特殊处理:根据url中得tokenId,进行base32加密用户名和密码,然后请求登录接口获取token
const
urls
=
location
.
href
;
var
tokenId
=
""
;
let
tokenId
=
""
;
if
(
urls
.
indexOf
(
"
?
"
)
!=
-
1
)
{
const
arr
=
urls
.
split
(
"
?
"
);
const
search
=
arr
[
arr
.
length
-
1
];
const
params
=
search
.
split
(
"
&
"
);
params
.
forEach
(
val
=>
{
const
temp
=
val
.
split
(
"
=
"
);
if
(
temp
[
0
]
==
"
tokenId
"
&&
temp
[
1
]
!=
null
){
tokenId
=
temp
[
1
];
}
});
// const arr = urls.split("?");
// const search = arr[arr.length - 1];
// const params = search.split("&");
// params.forEach(val => {
// const temp = val.split("=");
// if(temp[0]=="tokenId" && temp[1]!=null){
// tokenId=temp[1];
// }
// });
let
arr
=
urls
.
split
(
'
?
'
)
let
paramsArr
=
arr
[
1
].
split
(
'
&
'
)
let
resObj
=
paramsArr
.
reduce
((
a
,
b
)
=>
{
let
[
key
,
value
]
=
b
.
split
(
'
=
'
)
a
[
key
]
=
value
return
a
},
{})
tokenId
=
resObj
.
tokenId
// 读取params的 center&zoom 并存储store
if
(
resObj
.
lon
&&
resObj
.
lat
)
{
store
.
commit
(
'
setCenter
'
,
[
Number
(
resObj
.
lon
),
Number
(
resObj
.
lat
)])
}
if
(
resObj
.
zoom
)
{
store
.
commit
(
'
setZoom
'
,
Number
(
resObj
.
zoom
))
}
}
if
(
tokenId
)
{
var
base32
=
require
(
'
base32
'
);
if
(
tokenId
)
{
let
base32
=
require
(
'
base32
'
);
//alert('basetokenId:'+base32.encode("haixin;haixin123").toUpperCase());
var
tokenStr
=
base32
.
decode
(
tokenId
.
toLowerCase
());
let
tokenStr
=
base32
.
decode
(
tokenId
.
toLowerCase
());
// alert("tokenId..."+tokenStr);
SsoDao
.
login
({
data
:
{
...
...
@@ -83,7 +99,7 @@ router.beforeEach((to, from, next) => {
}
}
});
}
else
{
}
else
{
if
(
res
.
data
.
code
==
"
10401
"
)
{
this
.
$refs
.
user_authorization
.
getPage
(
res
.
data
);
}
else
{
...
...
@@ -91,7 +107,7 @@ router.beforeEach((to, from, next) => {
}
}
});
}
else
{
}
else
{
AuthDao
.
queryMenu
({
params
:
{
parentId
,
...
...
@@ -107,10 +123,8 @@ router.beforeEach((to, from, next) => {
});
}
});
router
.
afterEach
((
to
,
from
)
=>
{
router
.
afterEach
((
to
,
from
)
=>
{
store
.
commit
(
"
setPathActive
"
,
to
.
fullPath
);
})
export
default
router
;
wj-manage-web/src/store/index.js
View file @
edfd140a
...
...
@@ -4,6 +4,7 @@ import app from "./modules/app";
import
dataset
from
"
./modules/dataset
"
;
import
menudata
from
"
./modules/menudata
"
;
import
dicts
from
'
./modules/dict
'
import
mapInit
from
'
./modules/mapInit
'
;
Vue
.
use
(
Vuex
);
...
...
@@ -13,7 +14,8 @@ const store = new Vuex.Store({
app
,
dataset
,
menudata
,
dicts
dicts
,
mapInit
},
getters
:
{
menu
:
state
=>
state
.
app
.
menu
,
...
...
wj-manage-web/src/store/modules/mapInit.js
0 → 100644
View file @
edfd140a
const
mapInit
=
{
state
:
{
center
:
null
,
zoom
:
null
,
},
mutations
:
{
setCenter
(
state
,
center
)
{
state
.
center
=
center
;
},
setZoom
(
state
,
zoom
)
{
state
.
zoom
=
zoom
;
},
}
};
export
default
mapInit
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment