From e9e1e5b342fca938d1d354692ae12d1a2d9cdb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E5=B3=B0?= Date: Wed, 22 Apr 2026 12:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ops_vue_js/src/views/ScheduleView.vue | 80 +++++++++++++------ frontend/ops_vue_js/vite.config.js | 2 +- 2 files changed, 58 insertions(+), 24 deletions(-) diff --git a/frontend/ops_vue_js/src/views/ScheduleView.vue b/frontend/ops_vue_js/src/views/ScheduleView.vue index c81e376..e5a4ad0 100644 --- a/frontend/ops_vue_js/src/views/ScheduleView.vue +++ b/frontend/ops_vue_js/src/views/ScheduleView.vue @@ -266,10 +266,16 @@ const calendarOptions = ref({ eventDidMount(info) { const titleEl = info.el.querySelector('.fc-event-title') - if (titleEl && titleEl.scrollWidth > titleEl.clientWidth) { - //titleEl.setAttribute('data-truncated', 'true') - //日程过长 需要特殊处理 - //console.log("--",info) + if (titleEl) { + // 等 DOM 完全渲染后再检测宽度 + requestAnimationFrame(() => { + const overflow = titleEl.scrollWidth - titleEl.clientWidth + if (overflow > 0) { + // 将溢出量存入 CSS 变量,让动画能精确滚到末尾 + titleEl.style.setProperty('--scroll-distance', `-${overflow}px`) + titleEl.setAttribute('data-truncated', 'true') + } + }) } }, @@ -802,31 +808,59 @@ onMounted(() => { \ No newline at end of file diff --git a/frontend/ops_vue_js/vite.config.js b/frontend/ops_vue_js/vite.config.js index 1c0279c..6f190a2 100644 --- a/frontend/ops_vue_js/vite.config.js +++ b/frontend/ops_vue_js/vite.config.js @@ -20,7 +20,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: "http://127.0.0.1:8080", + target: "http://192.168.13.105", changeOrigin: true, }, },