diff --git a/public/map/bottom.png b/public/map/bottom.png new file mode 100644 index 00000000..4d3a7ba9 Binary files /dev/null and b/public/map/bottom.png differ diff --git a/public/map/change-view-btn.png b/public/map/change-view-btn.png index 4229ccb6..ec6c35cd 100644 Binary files a/public/map/change-view-btn.png and b/public/map/change-view-btn.png differ diff --git a/public/map/home-btn.png b/public/map/home-btn.png index 424551d1..c5d5a6c9 100644 Binary files a/public/map/home-btn.png and b/public/map/home-btn.png differ diff --git a/public/map/layer-center-left.png b/public/map/layer-center-left.png new file mode 100644 index 00000000..3a092cd1 Binary files /dev/null and b/public/map/layer-center-left.png differ diff --git a/public/map/layer-center-right.png b/public/map/layer-center-right.png new file mode 100644 index 00000000..3f9d69a5 Binary files /dev/null and b/public/map/layer-center-right.png differ diff --git a/public/map/top.png b/public/map/top.png new file mode 100644 index 00000000..280d8e49 Binary files /dev/null and b/public/map/top.png differ diff --git a/public/map/矢量智能对象 拷贝 6.png b/public/map/矢量智能对象 拷贝 6.png new file mode 100644 index 00000000..45626a0e Binary files /dev/null and b/public/map/矢量智能对象 拷贝 6.png differ diff --git a/src/drag.ts b/src/drag.ts new file mode 100644 index 00000000..185fda3c --- /dev/null +++ b/src/drag.ts @@ -0,0 +1,54 @@ +// src/directives/drag.js +import {onMounted} from "vue" +export default { + onMounted(el) { + alert(123); + let isDragging = false; // 拖动标志 + let offsetX = 0, offsetY = 0; // 记录鼠标相对元素的偏移量 + + // 鼠标按下事件,初始化拖动 + const onMouseDown = (e) => { + isDragging = true; + offsetX = e.clientX - el.getBoundingClientRect().left; + offsetY = e.clientY - el.getBoundingClientRect().top; + // 禁用文本选择,避免拖动过程中出现文本选中状态 + document.body.style.userSelect = 'none'; + }; + + // 鼠标移动事件,执行拖动 + const onMouseMove = (e) => { + if (!isDragging) return; + const left = e.clientX - offsetX; + const top = e.clientY - offsetY; + el.style.position = 'absolute'; // 设置元素为绝对定位 + el.style.left = `${left}px`; + el.style.top = `${top}px`; + }; + + // 鼠标松开事件,结束拖动 + const onMouseUp = () => { + isDragging = false; + document.body.style.userSelect = ''; // 恢复文本选择 + }; + + // 绑定事件 + el.addEventListener('mousedown', onMouseDown); + document.addEventListener('mousemove', onMouseMove); + document.addEventListener('mouseup', onMouseUp); + + // 清理事件监听器 + el._dragDestroy = () => { + el.removeEventListener('mousedown', onMouseDown); + document.removeEventListener('mousemove', onMouseMove); + document.removeEventListener('mouseup', onMouseUp); + }; + }, + + // 在组件销毁时移除事件监听器 + // beforeUnmount(el) { + // if (el._dragDestroy) { + // el._dragDestroy(); + // } + // }, + }; + \ No newline at end of file diff --git a/src/views/sys/exception/Converge.vue b/src/views/sys/exception/Converge.vue index 68f98c76..928f593d 100644 --- a/src/views/sys/exception/Converge.vue +++ b/src/views/sys/exception/Converge.vue @@ -1,5 +1,5 @@