zhufu 2024-11-24 14:36:35 +08:00
commit bb068def12
1 changed files with 56 additions and 1 deletions

View File

@ -48,7 +48,8 @@
</div>
<a-modal
style="width: 100vw; top: 0px; left: 0px; margin: 0px; padding: 0px"
class="dragModal"
width="100%"
wrap-class-name="full-modal"
v-model:open="showInfoOpen"
title="详情"
@ -137,35 +138,49 @@
if (res) {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
}
});
} else if (subject.value == '非法采矿') {
showMainInfoId.value = id;
showInfoOpen.value = true;
//
addListener();
} else if (subject.value == '耕地非粮化') {
GetCaseInfoById({ id: id }).then((res) => {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
});
} else if (subject.value == '重点问题') {
getCaseInfoByIdtotal({ id: id }).then((res) => {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
});
} else if (subject.value == '巡察审计') {
getInspectionAuditCaseInfoById({ id: id }).then((res) => {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
});
} else if (subject.value == '生态保护红线监管') {
getRedLineCaseInfoById({ id: id }).then((res) => {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
});
} else if (subject.value == '生态修复') {
getRepairCaseInfoById({ id: id }).then((res) => {
showInfoData.value = res;
showInfoOpen.value = true;
//
addListener();
});
}
};
@ -318,6 +333,46 @@
MapboxComponent.value.handlerChangeTifLayer(layer);
}
// -
let isDragging = false;
let initialMouseX;
let initialMouseY;
let initialModalX;
let initialModalY;
//
function addListener() {
setTimeout(() => {
const dragModalDocument: any = document.querySelector('.dragModal');
if (dragModalDocument) {
//
dragModalDocument.addEventListener('mousedown', function(event) {
isDragging = true;
initialMouseX = event.clientX;
initialMouseY = event.clientY;
initialModalX = dragModalDocument.offsetLeft;
initialModalY = dragModalDocument.offsetTop;
dragModalDocument.style.cursor = 'grabbing';
});
//
dragModalDocument.addEventListener('mousemove', function(event) {
if (isDragging) {
const deltaX = event.clientX - initialMouseX;
const deltaY = event.clientY - initialMouseY;
dragModalDocument.style.left = initialModalX + deltaX + 'px';
dragModalDocument.style.top = initialModalY + deltaY + 'px';
}
});
//
dragModalDocument.addEventListener('mouseup', function(event) {
isDragging = false;
dragModalDocument.style.cursor = 'default';
});
}
}, 1000);
}
onMounted(() => {
getLayerSettings();
});