修改实时地图

This commit is contained in:
xhf 2025-03-20 09:38:30 +08:00
parent 031e3cccb5
commit e6a5f3f38c
2 changed files with 34 additions and 5 deletions

View File

@ -6,8 +6,10 @@
height: heightVal + 'px', height: heightVal + 'px',
cursor: isDrag ? 'pointer' : 'default', cursor: isDrag ? 'pointer' : 'default',
scale: isSizeRadio, scale: isSizeRadio,
transformOrigin: '0 0' transformOrigin: '0 0',
width: widthVal + 'px'
}" }"
@wheel="handleWheel"
> >
<div <div
:class="isDrag ? 'indexpage-container-active' : 'indexpage-container'" :class="isDrag ? 'indexpage-container-active' : 'indexpage-container'"
@ -731,7 +733,9 @@ const emitParent = () => {
} }
// //
const getMapData = async (item) => { const getMapData = async (item) => {
// console.log('============', JSON.parse(item.yamlJson)) console.log('===22=========', JSON.parse(item.yamlJson))
widthVal.value = JSON.parse(item.yamlJson).width
heightVal.value = JSON.parse(item.yamlJson).height
testCarList.value = [] testCarList.value = []
nowObject.value = JSON.parse(JSON.stringify(item)) nowObject.value = JSON.parse(JSON.stringify(item))
nowObject.value.showYamlJson = JSON.parse(item.yamlJson) nowObject.value.showYamlJson = JSON.parse(item.yamlJson)
@ -811,7 +815,32 @@ const getMapLineList = () => {
lineList.value = res lineList.value = res
}) })
} }
//
const handleWheel = (event) => {
// Ctrl
if (event.ctrlKey) {
//
event.preventDefault()
//
if (event.deltaY < 0) {
//
//
if (isSizeRadio.value < 4) {
isSizeRadio.value += 0.2
} else {
message.warning('不能在放大了')
}
} else {
//
if (isSizeRadio.value > 0.2) {
isSizeRadio.value -= 0.2
} else {
message.warning('不能在缩小了')
}
}
}
}
// //
const getImageSize = (url) => { const getImageSize = (url) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -935,8 +964,8 @@ onUnmounted(() => {
.affix-container { .affix-container {
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; // overflow: hidden;
background: rgba(0, 0, 0, 0.8); // background: rgba(0, 0, 0, 0.8);
} }
.indexpage-container { .indexpage-container {
width: 100%; width: 100%;

View File

@ -189,6 +189,6 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.main-content { .main-content {
background-color: #fff; // background-color: #fff;
} }
</style> </style>