Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
418fd478
Commit
418fd478
authored
Dec 12, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化站点经纬度获取
parent
de19e969
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
+21
-15
base-manager-ui/admin/src/main.js
base-manager-ui/admin/src/main.js
+2
-2
base-manager-ui/admin/src/pages/basicset/site/components/addsite.vue
...r-ui/admin/src/pages/basicset/site/components/addsite.vue
+19
-13
No files found.
base-manager-ui/admin/src/main.js
View file @
418fd478
...
...
@@ -22,8 +22,8 @@ import "quill/dist/quill.bubble.css";
import
{
ColorPicker
}
from
"
element-ui
"
;
import
"
element-ui/lib/theme-chalk/index.css
"
;
Vue
.
use
(
ColorPicker
);
import
{
VueJsonp
}
from
"
vue-jsonp
"
;
Vue
.
use
(
VueJsonp
);
//
import { VueJsonp } from "vue-jsonp";
//
Vue.use(VueJsonp);
// 公共样式
import
"
@/assets/css/common.css
"
;
Vue
.
use
(
VueQuillEditor
);
...
...
base-manager-ui/admin/src/pages/basicset/site/components/addsite.vue
View file @
418fd478
...
...
@@ -306,6 +306,7 @@
import
{
modelList
,
siteSave
}
from
"
@/services/basicsetFun
"
;
import
YCheckbox
from
"
@/components/ycheckbox/YCheckbox.vue
"
;
import
YSwitch
from
"
@/components/yswitch/YSwitch.vue
"
;
import
axios
from
"
axios
"
;
// import options from "@/utils/city";
import
{
regionData
}
from
"
element-china-area-data
"
;
export
default
{
...
...
@@ -724,21 +725,26 @@ export default {
getAddress
(
address
)
{
this
.
$refs
.
ruleForm
.
validateField
(
"
detailAddress
"
,
(
errVal
)
=>
{
if
(
errVal
!==
"
中心详细地址不能为空
"
)
{
this
.
$jsonp
(
`https://restapi.amap.com/v3/geocode/geo?parameters`
,
{
//官方接口
output
:
"
jsonp
"
,
key
:
"
21e7ac78b448640e516f1eddc3ffd720
"
,
//key
address
:
address
,
//获取输入的位置
})
axios
.
get
(
"
https://restapi.amap.com/v3/geocode/geo?parameters
"
,
{
params
:
{
key
:
"
21e7ac78b448640e516f1eddc3ffd720
"
,
//key
address
:
address
,
//获取输入的位置
},
})
.
then
((
res
)
=>
{
let
{
location
}
=
res
.
geocodes
[
0
];
[
this
.
formInfo
.
longitude
,
this
.
formInfo
.
latitude
,
]
=
location
.
split
(
"
,
"
);
if
(
res
.
data
.
status
==
1
)
{
let
{
location
}
=
res
.
data
.
geocodes
[
0
];
[
this
.
formInfo
.
longitude
,
this
.
formInfo
.
latitude
,
]
=
location
.
split
(
"
,
"
);
}
else
{
this
.
$message
.
error
(
"
经纬度获取失败,请输入正确的地址
"
);
}
})
.
catch
(()
=>
{
this
.
$message
.
error
(
"
经纬度获取失败,请输入正确的地址
"
);
.
catch
((
err
)
=>
{
this
.
$message
.
error
(
err
);
});
}
});
...
...
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