Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kaoshi-java
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
单欣鑫
kaoshi-java
Commits
a0aa1b11
Commit
a0aa1b11
authored
Jun 17, 2025
by
法拉51246
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c2dc08ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
MapPicker.vue
ruoyi-ui/src/views/hezhi/studyCenter/MapPicker.vue
+70
-0
index.vue
ruoyi-ui/src/views/hezhi/studyCenter/index.vue
+1
-1
No files found.
ruoyi-ui/src/views/hezhi/studyCenter/MapPicker.vue
0 → 100644
View file @
a0aa1b11
<
template
>
<el-dialog
:visible.sync=
"visible"
title=
"选择地址"
width=
"80%"
top=
"5vh"
:close-on-click-modal=
"false"
append-to-body
>
<iframe
id=
"tencentMapPicker"
:src=
"pickerUrl"
width=
"100%"
height=
"600px"
frameborder=
"0"
allow=
"geolocation"
style=
"border: 0"
></iframe>
</el-dialog>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
visible
:
false
,
// 地图弹窗显隐
pickerUrl
:
`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=P56BZ-BV2CB-FAAUP-JMWTD-6TAHT-CXFGU&referer=KAOSHI`
,
// 腾讯地图 locationPicker 地址
meta
:
[
{
httpEquiv
:
'
Permissions-Policy
'
,
content
:
'
geolocation=(self)
'
,
// 设置权限策略
},
],
};
},
methods
:
{
// 打开弹窗
open
()
{
this
.
visible
=
true
;
},
// 监听 locationPicker 的 postMessage
handleMessage
(
event
)
{
console
.
log
(
"
监听
"
)
console
.
log
(
event
.
data
)
const
loc
=
event
.
data
;
if
(
loc
&&
loc
.
module
===
'
locationPicker
'
)
{
const
lat
=
loc
.
latlng
.
lat
;
const
lng
=
loc
.
latlng
.
lng
;
const
address
=
loc
.
poiaddress
||
loc
.
poiname
||
loc
.
address
;
// 向父组件发回选中的地址和经纬度
this
.
$emit
(
'
update-location
'
,
{
lat
,
lng
,
address
});
this
.
visible
=
false
;
// 选完后自动关闭弹窗
}
},
},
mounted
()
{
// 监听 postMessage
window
.
addEventListener
(
'
message
'
,
this
.
handleMessage
);
},
beforeDestroy
()
{
// 卸载监听器
window
.
removeEventListener
(
'
message
'
,
this
.
handleMessage
);
},
};
</
script
>
ruoyi-ui/src/views/hezhi/studyCenter/index.vue
View file @
a0aa1b11
...
...
@@ -183,7 +183,7 @@
<!-- <el-table-column label="区" align="center" prop="areaId" />-->
<el-table-column
label=
"省名"
align=
"center"
prop=
"provinceName"
width=
"80px"
>
<
template
slot-scope=
"scope"
>
<
image-preview
:src=
"scope.row.provinceName"
:width=
"50"
:height=
"50"
/>
<
tooltip
:contentName=
"scope.row.provinceName"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"市名"
align=
"center"
prop=
"cityName"
width=
"80px"
>
...
...
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