|
|
@@ -278,6 +278,9 @@ const mapClickValue = (e:any) => {
|
|
|
}
|
|
|
|
|
|
const popupContent = `
|
|
|
+ <div class="popup-header">
|
|
|
+ <span class="popup-close-btn" id="popup-close-btn">×</span>
|
|
|
+ </div>
|
|
|
<div style="font-size:14px;line-height:1.6;padding:10px;">
|
|
|
<h4 style="margin:0 0 6px 0;color:#222;"><span>内容信息</span><span style="display: ${fet.properties.c_xmygrs>0 ? 'block' : 'none'};" class="more" id="popup-more-btn">员工信息>></span></h4>
|
|
|
${str}
|
|
|
@@ -286,9 +289,10 @@ const mapClickValue = (e:any) => {
|
|
|
|
|
|
if (popup.value) popup.value.remove();
|
|
|
popup.value = new mapboxgl.Popup({
|
|
|
- closeButton: true,
|
|
|
+ closeButton: false,
|
|
|
className: 'custom-popup',
|
|
|
- maxWidth: '500px'
|
|
|
+ maxWidth: '500px',
|
|
|
+ offset: 12
|
|
|
})
|
|
|
.setLngLat(e.lngLat)
|
|
|
.setHTML(popupContent)
|
|
|
@@ -296,12 +300,18 @@ const mapClickValue = (e:any) => {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
const moreBtn = document.getElementById('popup-more-btn');
|
|
|
+ const closeBtn = document.getElementById('popup-close-btn');
|
|
|
if (moreBtn) {
|
|
|
- moreBtn.addEventListener('click', () => {
|
|
|
- tableSearchText.value = "";
|
|
|
- guid.value = fet.properties.c_guid;
|
|
|
- handleMoreClick(guid.value,"",0);
|
|
|
- });
|
|
|
+ moreBtn.addEventListener('click', () => {
|
|
|
+ tableSearchText.value = "";
|
|
|
+ guid.value = fet.properties.c_guid;
|
|
|
+ handleMoreClick(guid.value,"",0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (closeBtn) {
|
|
|
+ closeBtn.addEventListener('click', () => {
|
|
|
+ if (popup.value) popup.value.remove();
|
|
|
+ });
|
|
|
}
|
|
|
}, 0);
|
|
|
|
|
|
@@ -567,6 +577,23 @@ defineExpose({
|
|
|
/*节点标签样式 */
|
|
|
.custom-popup {
|
|
|
z-index: 9;
|
|
|
+ .popup-header {
|
|
|
+ position: absolute;
|
|
|
+ right: 0px;
|
|
|
+ top: 0px;
|
|
|
+ padding: 0px 6px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ .popup-close-btn{
|
|
|
+ cursor:pointer;
|
|
|
+ width:24px;
|
|
|
+ height:24px;
|
|
|
+ text-align:center;
|
|
|
+ line-height:24px;
|
|
|
+ }
|
|
|
+ .popup-header:hover{
|
|
|
+ background:#e5e5e5;
|
|
|
+ }
|
|
|
}
|
|
|
.more{
|
|
|
float:right;
|
|
|
@@ -574,6 +601,6 @@ defineExpose({
|
|
|
transition: color 0.2s;
|
|
|
}
|
|
|
.more:hover {
|
|
|
- color: #00A8FF;
|
|
|
+ color: var(--el-color-primary);
|
|
|
}
|
|
|
</style>
|