From 583d9fc13c2c4ef69f9871dd637b24acedc96297 Mon Sep 17 00:00:00 2001 From: menghao <1584479611@qq.com> Date: Mon, 2 Mar 2026 15:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/.env.development | 2 +- ruoyi-ui/src/main.js | 4 ++ ruoyi-ui/src/views/cesiumMap/index.vue | 55 +--------------------- ruoyi-ui/src/views/dialogs/OnlineMembersDialog.vue | 5 +- ruoyi-ui/vue.config.js | 2 +- 5 files changed, 11 insertions(+), 57 deletions(-) diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 0e7127a..b32bd7f 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -8,7 +8,7 @@ ENV = 'development' VUE_APP_BASE_API = '/dev-api' # 访问地址(绕过 /dev-api 代理,用于解决静态资源/图片访问 401 认证问题) -VUE_APP_BACKEND_URL = 'http://127.0.0.1:8080' +VUE_APP_BACKEND_URL = 'http://192.168.1.104:8080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 55930b3..82ba26c 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -78,6 +78,10 @@ Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size }) +// 全局 el-dialog 可拖动(必须在 Element 之后注册) +import dialogDrag from './plugins/dialogDrag' +Vue.use(dialogDrag) + Vue.config.productionTip = false new Vue({ diff --git a/ruoyi-ui/src/views/cesiumMap/index.vue b/ruoyi-ui/src/views/cesiumMap/index.vue index fe2a4e9..e642190 100644 --- a/ruoyi-ui/src/views/cesiumMap/index.vue +++ b/ruoyi-ui/src/views/cesiumMap/index.vue @@ -241,15 +241,14 @@ - + @@ -621,9 +620,6 @@ export default { missileDialogVisible(val) { if (!val) { this.clearMissilePreview() - if (this._missileDialogDragCleanup) { - this._missileDialogDragCleanup() - } } } }, @@ -3123,53 +3119,6 @@ export default { }) }, - /** 导弹参数弹窗打开后绑定标题栏拖动 */ - onMissileDialogOpen() { - this.$nextTick(() => { - const dialog = document.querySelector('.missile-params-dialog') - const wrapper = dialog && dialog.closest('.el-dialog__wrapper') - if (!wrapper || !dialog) return - const header = wrapper.querySelector('.el-dialog__header') - if (!header) return - header.style.cursor = 'move' - let startX, startY, startLeft, startTop - const onMouseDown = (e) => { - if (e.button !== 0) return - startX = e.clientX - startY = e.clientY - const rect = wrapper.getBoundingClientRect() - startLeft = rect.left - startTop = rect.top - wrapper.style.position = 'fixed' - wrapper.style.left = startLeft + 'px' - wrapper.style.top = startTop + 'px' - wrapper.style.margin = '0' - document.addEventListener('mousemove', onMouseMove) - document.addEventListener('mouseup', onMouseUp) - } - const onMouseMove = (e) => { - const dx = e.clientX - startX - const dy = e.clientY - startY - wrapper.style.left = (startLeft + dx) + 'px' - wrapper.style.top = (startTop + dy) + 'px' - startLeft += dx - startTop += dy - startX = e.clientX - startY = e.clientY - } - const onMouseUp = () => { - document.removeEventListener('mousemove', onMouseMove) - document.removeEventListener('mouseup', onMouseUp) - } - header.addEventListener('mousedown', onMouseDown) - this._missileDialogDragCleanup = () => { - header.removeEventListener('mousedown', onMouseDown) - header.style.cursor = '' - delete this._missileDialogDragCleanup - } - }) - }, - /** 清除导弹预览(轨迹线 + 朝向图标) */ clearMissilePreview() { if (this.viewer && this.viewer.entities) { diff --git a/ruoyi-ui/src/views/dialogs/OnlineMembersDialog.vue b/ruoyi-ui/src/views/dialogs/OnlineMembersDialog.vue index 0ddc7c8..e2426b0 100644 --- a/ruoyi-ui/src/views/dialogs/OnlineMembersDialog.vue +++ b/ruoyi-ui/src/views/dialogs/OnlineMembersDialog.vue @@ -3,7 +3,7 @@
- +

{{ $t('onlineMembersDialog.title') }}

@@ -276,7 +276,7 @@ export default { closeDialog() { this.$emit('input', false); }, - + showRollbackConfirm() { this.showRollbackDialog = true; }, @@ -418,6 +418,7 @@ export default { justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #e8e8e8; + cursor: move; } .dialog-header h3 { diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 7ab699a..b80f647 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -15,7 +15,7 @@ const CompressionPlugin = require('compression-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 -const baseUrl = 'http://127.0.0.1:8080' // 后端接口 +const baseUrl = 'http://192.168.1.104:8080' // 后端接口 const port = process.env.port || process.env.npm_config_port || 80 // 端口 // 定义 Cesium 源码路径