From dbc5784691a032671ca77d00d7f9611ae84a8356 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Thu, 25 Sep 2025 00:06:51 +0800 Subject: [PATCH 01/21] =?UTF-8?q?refactor:=20=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=9B=B4=E6=8E=A5=E8=BF=9B=E5=8E=BB=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E9=85=8D=E7=BD=AE=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Initialization.vue | 84 +++++++++++---------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/frontend/src/views/Initialization.vue b/frontend/src/views/Initialization.vue index 851549c..20caf00 100644 --- a/frontend/src/views/Initialization.vue +++ b/frontend/src/views/Initialization.vue @@ -191,55 +191,45 @@ async function checkEnvironment() { console.log('- main.py存在:', criticalFiles.mainPyExists) console.log('- 所有关键文件存在:', allExeFilesExist) - // 新的自动模式判断逻辑:只要所有关键exe文件都存在且不是第一次启动就进入自动模式 - console.log('自动模式判断条件:') - console.log('- 不是第一次启动:', !isFirst) + // 页面模式判断逻辑: + // 1. 第一次启动 -> 直接进入手动模式 + // 2. 非第一次启动 + 文件完整 -> 自动模式 + // 3. 非第一次启动 + 文件缺失 -> 环境不完整页面 + console.log('页面模式判断条件:') + console.log('- 是否第一次启动:', isFirst) console.log('- 所有关键文件存在:', allExeFilesExist) - // 只要不是第一次启动且所有关键exe文件都存在就进入自动模式 - if (!isFirst && allExeFilesExist) { + // 第一次启动时,无论文件是否存在都直接进入手动模式 + if (isFirst) { + console.log('第一次启动,直接进入手动模式') + autoMode.value = false + showEnvironmentIncomplete.value = false + } else if (allExeFilesExist) { + // 不是第一次启动且所有关键exe文件都存在,进入自动模式 console.log('进入自动模式,开始自动启动流程') autoMode.value = true + showEnvironmentIncomplete.value = false } else { - console.log('进入手动模式') - if (isFirst) { - console.log('原因: 第一次启动') - // 第一次启动直接进入手动模式 - autoMode.value = false - showEnvironmentIncomplete.value = false - } else if (!allExeFilesExist) { - console.log('原因: 关键exe文件缺失') - console.log(' - python.exe缺失:', !criticalFiles.pythonExists) - console.log(' - git.exe缺失:', !criticalFiles.gitExists) - console.log(' - main.py缺失:', !criticalFiles.mainPyExists) - - // 检查是否应该显示环境不完整页面(仅在自动模式下) - // 如果不是第一次启动且关键文件缺失,说明之前是自动模式但现在环境有问题 - if (!isFirst) { - const missing = [] - if (!criticalFiles.pythonExists) missing.push('Python 环境') - if (!criticalFiles.gitExists) missing.push('Git 工具') - if (!criticalFiles.mainPyExists) missing.push('后端代码') - - missingComponents.value = missing - showEnvironmentIncomplete.value = true - autoMode.value = false - } else { - // 第一次启动时,即使文件缺失也直接进入手动模式 - autoMode.value = false - showEnvironmentIncomplete.value = false - } - } else { - // 其他情况直接进入手动模式 - autoMode.value = false - showEnvironmentIncomplete.value = false - } + // 不是第一次启动但关键文件缺失,显示环境不完整页面 + console.log('环境损坏,显示环境不完整页面') + console.log(' - python.exe缺失:', !criticalFiles.pythonExists) + console.log(' - git.exe缺失:', !criticalFiles.gitExists) + console.log(' - main.py缺失:', !criticalFiles.mainPyExists) - // 如果关键文件缺失,重置初始化状态 - if (!allExeFilesExist && config.init) { - console.log('检测到关键exe文件缺失,重置初始化状态') - await saveConfig({ init: false }) - } + const missing = [] + if (!criticalFiles.pythonExists) missing.push('Python 环境') + if (!criticalFiles.gitExists) missing.push('Git 工具') + if (!criticalFiles.mainPyExists) missing.push('后端代码') + + missingComponents.value = missing + showEnvironmentIncomplete.value = true + autoMode.value = false + } + + // 如果关键文件缺失,重置初始化状态 + if (!allExeFilesExist && config.init) { + console.log('检测到关键exe文件缺失,重置初始化状态') + await saveConfig({ init: false }) } } catch (error) { const errorMsg = `环境检查失败: ${error instanceof Error ? error.message : String(error)}` @@ -284,14 +274,6 @@ onMounted(async () => { console.log('测试配置系统...') const testConfig = await getConfig() console.log('当前配置:', testConfig) - - // 测试保存配置 - await saveConfig({ isFirstLaunch: false }) - console.log('测试配置保存成功') - - // 重新读取配置验证 - const updatedConfig = await getConfig() - console.log('更新后的配置:', updatedConfig) } catch (error) { console.error('配置系统测试失败:', error) } From 2101ae99083f8049e411089989e441fdf913c31a Mon Sep 17 00:00:00 2001 From: AoXuan Date: Thu, 25 Sep 2025 00:43:03 +0800 Subject: [PATCH 02/21] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E7=94=B5?= =?UTF-8?q?=E6=BA=90=E6=93=8D=E4=BD=9C=E5=80=92=E8=AE=A1=E6=97=B6=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=87=B3=E5=85=A8=E5=B1=80=E7=BB=84=E4=BB=B6=20Global?= =?UTF-8?q?PowerCountdown.vue[=E5=BE=85=E6=B5=8B=E8=AF=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 4 + .../src/components/GlobalPowerCountdown.vue | 307 ++++++++++++++++++ frontend/src/views/scheduler/index.vue | 183 +---------- .../src/views/scheduler/useSchedulerLogic.ts | 88 ++--- 4 files changed, 333 insertions(+), 249 deletions(-) create mode 100644 frontend/src/components/GlobalPowerCountdown.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9c02e1e..9d6bc4e 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,6 +8,7 @@ import AppLayout from './components/AppLayout.vue' import TitleBar from './components/TitleBar.vue' import UpdateModal from './components/UpdateModal.vue' import DevDebugPanel from './components/DevDebugPanel.vue' +import GlobalPowerCountdown from './components/GlobalPowerCountdown.vue' import zhCN from 'ant-design-vue/es/locale/zh_CN' import { logger } from '@/utils/logger' @@ -49,6 +50,9 @@ onMounted(() => { + + + diff --git a/frontend/src/components/GlobalPowerCountdown.vue b/frontend/src/components/GlobalPowerCountdown.vue new file mode 100644 index 0000000..4d0da8d --- /dev/null +++ b/frontend/src/components/GlobalPowerCountdown.vue @@ -0,0 +1,307 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/scheduler/index.vue b/frontend/src/views/scheduler/index.vue index fb2a959..67ee33a 100644 --- a/frontend/src/views/scheduler/index.vue +++ b/frontend/src/views/scheduler/index.vue @@ -112,43 +112,7 @@ - -
-
-
-
⚠️
-

{{ powerCountdownData.title || `${getPowerActionText(powerAction)}倒计时` }}

-

- {{ powerCountdownData.message || `程序将在倒计时结束后执行 ${getPowerActionText(powerAction)} 操作` }} -

-
- {{ powerCountdownData.countdown }} - -
-
- 等待后端倒计时... -
- -
- - 取消操作 - -
-
-
-
+ @@ -346,127 +310,7 @@ onUnmounted(() => { overflow: hidden; } -/* 电源操作倒计时全屏弹窗样式 */ -.power-countdown-overlay { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.8); - backdrop-filter: blur(8px); - z-index: 9999; - display: flex; - align-items: center; - justify-content: center; - animation: fadeIn 0.3s ease-out; -} - -.power-countdown-container { - background: var(--ant-color-bg-container); - border-radius: 16px; - padding: 48px; - box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2); - text-align: center; - max-width: 500px; - width: 90%; - animation: slideIn 0.3s ease-out; -} - -.countdown-content .warning-icon { - font-size: 64px; - margin-bottom: 24px; - display: block; - animation: pulse 2s infinite; -} - -.countdown-title { - font-size: 28px; - font-weight: 600; - color: var(--ant-color-text); - margin: 0 0 16px 0; -} - -.countdown-message { - font-size: 16px; - color: var(--ant-color-text-secondary); - margin: 0 0 32px 0; - line-height: 1.5; -} - -.countdown-timer { - display: flex; - align-items: baseline; - justify-content: center; - margin-bottom: 32px; -} - -.countdown-number { - font-size: 72px; - font-weight: 700; - color: var(--ant-color-primary); - line-height: 1; - margin-right: 8px; - font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace; -} - -.countdown-unit { - font-size: 24px; - color: var(--ant-color-text-secondary); - font-weight: 500; -} - -.countdown-text { - font-size: 24px; - color: var(--ant-color-text-secondary); - font-weight: 500; -} - -.countdown-progress { - margin-bottom: 32px; -} - -.countdown-actions { - display: flex; - justify-content: center; -} - -.cancel-button { - padding: 12px 32px; - height: auto; - font-size: 16px; - font-weight: 500; -} - -/* 动画效果 */ -@keyframes fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } -} - -@keyframes slideIn { - from { - opacity: 0; - transform: translateY(-20px) scale(0.95); - } - to { - opacity: 1; - transform: translateY(0) scale(1); - } -} - -@keyframes pulse { - 0%, 100% { - transform: scale(1); - } - 50% { - transform: scale(1.1); - } -} +/* 电源操作倒计时弹窗样式已移至 GlobalPowerCountdown.vue */ /* 响应式 - 移动端适配 */ @media (max-width: 768px) { @@ -499,27 +343,6 @@ onUnmounted(() => { width: 100%; } - /* 移动端倒计时弹窗适配 */ - .power-countdown-container { - padding: 32px 24px; - margin: 16px; - } - - .countdown-title { - font-size: 24px; - } - - .countdown-number { - font-size: 56px; - } - - .countdown-unit { - font-size: 20px; - } - - .countdown-content .warning-icon { - font-size: 48px; - margin-bottom: 16px; - } + /* 移动端倒计时弹窗适配已移至 GlobalPowerCountdown.vue */ } \ No newline at end of file diff --git a/frontend/src/views/scheduler/useSchedulerLogic.ts b/frontend/src/views/scheduler/useSchedulerLogic.ts index 01711f0..7b541bc 100644 --- a/frontend/src/views/scheduler/useSchedulerLogic.ts +++ b/frontend/src/views/scheduler/useSchedulerLogic.ts @@ -8,7 +8,6 @@ import schedulerHandlers from './schedulerHandlers' import type { ComboBoxItem } from '@/api/models/ComboBoxItem' import type { QueueItem, Script } from './schedulerConstants' import { - getPowerActionText, type SchedulerTab, type TaskMessage, type SchedulerStatus, @@ -94,13 +93,15 @@ export function useSchedulerLogic() { // 电源操作 - 从本地存储加载或使用默认值 const powerAction = ref(loadPowerActionFromStorage()) + // 注意:电源倒计时弹窗已移至全局组件 GlobalPowerCountdown.vue + // 这里保留引用以避免破坏现有代码,但实际功能由全局组件处理 const powerCountdownVisible = ref(false) const powerCountdownData = ref<{ title?: string message?: string countdown?: number }>({}) - // 前端自己的60秒倒计时 + // 前端自己的60秒倒计时 - 已移至全局组件 let powerCountdownTimer: ReturnType | null = null // 消息弹窗 @@ -508,10 +509,10 @@ export function useSchedulerLogic() { } const handleMessageDialog = (tab: SchedulerTab, data: any) => { - // 处理倒计时消息 + // 处理倒计时消息 - 已移至全局组件处理 if (data.type === 'Countdown') { - console.log('[Scheduler] 收到倒计时消息,启动60秒倒计时:', data) - startPowerCountdown(data) + console.log('[Scheduler] 收到倒计时消息,由全局组件处理:', data) + // 不再在调度中心处理倒计时,由 GlobalPowerCountdown 组件处理 return } @@ -654,68 +655,16 @@ export function useSchedulerLogic() { console.log('[Scheduler] 电源操作显示已更新为:', newPowerAction) } - // 启动60秒倒计时 - const startPowerCountdown = (data: any) => { - // 清除之前的计时器 - if (powerCountdownTimer) { - clearInterval(powerCountdownTimer) - powerCountdownTimer = null - } - - // 显示倒计时弹窗 - powerCountdownVisible.value = true - - // 设置倒计时数据,从60秒开始 - powerCountdownData.value = { - title: data.title || `${getPowerActionText(powerAction.value)}倒计时`, - message: data.message || `程序将在倒计时结束后执行 ${getPowerActionText(powerAction.value)} 操作`, - countdown: 60 - } - - // 启动每秒倒计时 - powerCountdownTimer = setInterval(() => { - if (powerCountdownData.value.countdown && powerCountdownData.value.countdown > 0) { - powerCountdownData.value.countdown-- - console.log('[Scheduler] 倒计时:', powerCountdownData.value.countdown) - - // 倒计时结束 - if (powerCountdownData.value.countdown <= 0) { - if (powerCountdownTimer) { - clearInterval(powerCountdownTimer) - powerCountdownTimer = null - } - powerCountdownVisible.value = false - console.log('[Scheduler] 倒计时结束,弹窗关闭') - } - } - }, 1000) - } - - // 移除自动执行电源操作,由后端完全控制 + // 启动60秒倒计时 - 已移至全局组件,这里保留空函数避免破坏现有代码 +// 移除自动执行电源操作,由后端完全控制 // const executePowerAction = async () => { // // 不再自己执行电源操作,完全由后端控制 // } const cancelPowerAction = async () => { - // 清除倒计时器 - if (powerCountdownTimer) { - clearInterval(powerCountdownTimer) - powerCountdownTimer = null - } - - // 关闭倒计时弹窗 - powerCountdownVisible.value = false - - // 调用取消电源操作的API - try { - await Service.cancelPowerTaskApiDispatchCancelPowerPost() - message.success('已取消电源操作') - } catch (error) { - console.error('取消电源操作失败:', error) - message.error('取消电源操作失败') - } - - // 注意:这里不重置 powerAction,保留用户选择 + console.log('[Scheduler] cancelPowerAction 已移至全局组件,调度中心不再处理') + // 电源操作取消功能已移至 GlobalPowerCountdown 组件 + // 这里保留空函数以避免破坏现有的调用代码 } // 移除自动检查任务完成的逻辑,完全由后端控制 @@ -788,8 +737,8 @@ export function useSchedulerLogic() { }, onCountdown: (data) => { try { - // 直接启动前端倒计时 - startPowerCountdown(data) + // 倒计时已移至全局组件处理,这里不再处理 + console.log('[Scheduler] 倒计时消息由全局组件处理:', data) } catch (e) { console.warn('[Scheduler] registerSchedulerUI onCountdown error:', e) } @@ -814,7 +763,8 @@ export function useSchedulerLogic() { const pendingCountdown = schedulerHandlers.consumePendingCountdown() if (pendingCountdown) { try { - startPowerCountdown(pendingCountdown) + // 倒计时已移至全局组件处理,这里不再处理 + console.log('[Scheduler] 待处理倒计时消息由全局组件处理:', pendingCountdown) } catch (e) { console.warn('[Scheduler] replay pending countdown error:', e) } @@ -844,9 +794,9 @@ export function useSchedulerLogic() { console.log('[Scheduler] 收到Main消息:', { type, data }) if (type === 'Message' && data && data.type === 'Countdown') { - // 收到倒计时消息,启动前端60秒倒计时 - console.log('[Scheduler] 收到倒计时消息,启动前端60秒倒计时:', data) - startPowerCountdown(data) + // 收到倒计时消息,由全局组件处理 + console.log('[Scheduler] 收到倒计时消息,由全局组件处理:', data) + // 不再在调度中心处理倒计时 } else if (type === 'Update' && data && data.PowerSign !== undefined) { // 收到电源操作更新消息,更新显示 console.log('[Scheduler] 收到电源操作更新消息:', data.PowerSign) @@ -856,7 +806,7 @@ export function useSchedulerLogic() { // 清理函数 const cleanup = () => { - // 清理倒计时器 + // 清理倒计时器 - 已移至全局组件,这里保留以避免错误 if (powerCountdownTimer) { clearInterval(powerCountdownTimer) powerCountdownTimer = null From f9f8b56d183821802a4bd369a2fd7b2d5aa57acd Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Thu, 25 Sep 2025 08:15:27 +0800 Subject: [PATCH 03/21] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/timer.py b/app/core/timer.py index c803a56..9e364c3 100644 --- a/app/core/timer.py +++ b/app/core/timer.py @@ -112,7 +112,7 @@ class _MainTimer: """静默模式通过模拟老板键来隐藏模拟器窗口""" if ( - len(Config.if_ignore_silence) > 0 + len(Config.if_ignore_silence) == 0 and Config.get("Function", "IfSilence") and Config.get("Function", "BossKey") != "" ): From 4ad346ed14a7d452085399526f779f9b79611061 Mon Sep 17 00:00:00 2001 From: Alirea <2981883527@qq.com> Date: Thu, 25 Sep 2025 17:16:05 +0800 Subject: [PATCH 04/21] =?UTF-8?q?fix(notif):=20=E4=BF=AE=E6=94=B9=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=BA=95=E9=83=A8=E9=93=BE=E6=8E=A5=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=AB=99=E4=BB=93=E5=BA=93=E4=B8=BA=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/html/MAA_result.html | 4 ++-- res/html/MAA_statistics.html | 4 ++-- res/html/general_result.html | 4 ++-- res/html/general_statistics.html | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/res/html/MAA_result.html b/res/html/MAA_result.html index 17a63e1..0bcfa8b 100644 --- a/res/html/MAA_result.html +++ b/res/html/MAA_result.html @@ -150,8 +150,8 @@ AUTO-MAS GitHub
-

文档站仓库:

- AUTO-MAS 文档站 GitHub +

文档站:

+ AUTO-MAS 文档站
diff --git a/res/html/MAA_statistics.html b/res/html/MAA_statistics.html index ce99665..c5ec5cb 100644 --- a/res/html/MAA_statistics.html +++ b/res/html/MAA_statistics.html @@ -223,8 +223,8 @@ AUTO-MAS GitHub
-

文档站仓库:

- AUTO-MAS 文档站 GitHub +

文档站:

+ AUTO-MAS 文档站
diff --git a/res/html/general_result.html b/res/html/general_result.html index b57aa9a..5fa8c2d 100644 --- a/res/html/general_result.html +++ b/res/html/general_result.html @@ -150,8 +150,8 @@ AUTO-MAS GitHub
-

文档站仓库:

- AUTO-MAS 文档站 GitHub +

文档站:

+ AUTO-MAS 文档站
diff --git a/res/html/general_statistics.html b/res/html/general_statistics.html index b47f8d7..2bf8a48 100644 --- a/res/html/general_statistics.html +++ b/res/html/general_statistics.html @@ -190,8 +190,8 @@ AUTO-MAS GitHub
-

文档站仓库:

- AUTO-MAS 文档站 GitHub +

文档站:

+ AUTO-MAS 文档站
From 320d7ab17d21a82dc4d02f12f3a7ef5e0397a644 Mon Sep 17 00:00:00 2001 From: Alirea <2981883527@qq.com> Date: Thu, 25 Sep 2025 17:24:16 +0800 Subject: [PATCH 05/21] =?UTF-8?q?feat(ui):=20=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=B0=8F=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/History.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/History.vue b/frontend/src/views/History.vue index a389cc2..c554d07 100644 --- a/frontend/src/views/History.vue +++ b/frontend/src/views/History.vue @@ -815,7 +815,6 @@ const getDateStatusColor = (users: Record) => { flex: 1; display: flex; flex-direction: column; - min-width: 0; } .no-selection { @@ -826,6 +825,7 @@ const getDateStatusColor = (users: Record) => { border: 1px solid var(--ant-color-border); border-radius: 8px; background: var(--ant-color-bg-container); + min-height: 400px; } .detail-content { From dbd1731d7f26c1ee047ea444e452d058b6bd318a Mon Sep 17 00:00:00 2001 From: Alirea <2981883527@qq.com> Date: Thu, 25 Sep 2025 18:12:36 +0800 Subject: [PATCH 06/21] =?UTF-8?q?feat(ui):=20=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=AF=A6=E7=BB=86=E6=97=A5=E5=BF=97=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E8=A2=AB=E6=92=91=E5=BC=80=E5=88=B0=E8=A7=86?= =?UTF-8?q?=E7=95=8C=E5=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/History.vue | 42 ++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/History.vue b/frontend/src/views/History.vue index c554d07..7b556c2 100644 --- a/frontend/src/views/History.vue +++ b/frontend/src/views/History.vue @@ -833,16 +833,18 @@ const getDateStatusColor = (users: Record) => { display: flex; gap: 16px; min-height: 0; + min-width: 0; /* 确保子项 flex:1 时可以收缩 */ + overflow: hidden; /* 避免被长行撑出 */ } /* 记录条目区域 */ .records-area { width: 400px; - flex-shrink: 0; + flex-shrink: 1; /* 新增: 允许一定程度收缩 */ + min-width: 260px; /* 给一个合理下限 */ display: flex; flex-direction: column; gap: 16px; - min-width: 0; } .records-section { @@ -980,7 +982,8 @@ const getDateStatusColor = (users: Record) => { /* 日志区域 */ .log-area { flex: 1; - min-width: 300px; + /* 允许在父级 flex 宽度不足时压缩,避免整体被撑出视口 */ + min-width: 0; /* 修改: 原来是 300px,导致在内容渲染后无法收缩 */ display: flex; flex-direction: column; } @@ -1004,19 +1007,19 @@ const getDateStatusColor = (users: Record) => { flex: 1; max-height: 500px; overflow-y: auto; - background: var(--ant-color-bg-layout); - border: 1px solid var(--ant-color-border); - border-radius: 6px; - padding: 12px; - font-family: 'Consolas', 'Monaco', 'Courier New', monospace; - font-size: 12px; - line-height: 1.4; + /* 新增: 防止超长无空格字符串把容器撑宽 */ + overflow-x: auto; /* 横向单独滚动,而不是撑出布局 */ + word-break: break-all; + overflow-wrap: anywhere; } .log-content pre { margin: 0; white-space: pre-wrap; - word-wrap: break-word; + word-wrap: break-word; /* 兼容性写法 */ + word-break: break-all; /* 处理超长连续字符 */ + overflow-wrap: anywhere; + max-width: 100%; } .no-log { @@ -1055,7 +1058,22 @@ const getDateStatusColor = (users: Record) => { .log-area { width: 100%; - max-height: 400px; + min-width: 0; + } +} + +/* 针对极窄窗口再降级为纵向布局,提前触发布局切换,避免出现水平滚动 */ +@media (max-width: 1000px) { + .history-layout { + flex-direction: column; + } + .records-area { + width: 100%; + min-width: 0; + } + .log-area { + width: 100%; + min-width: 0; } } From 06b3147b53c20f58aed6a803302a01fc440ee761 Mon Sep 17 00:00:00 2001 From: Alirea <2981883527@qq.com> Date: Thu, 25 Sep 2025 19:26:02 +0800 Subject: [PATCH 07/21] =?UTF-8?q?feat(ui):=20=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=AF=A6=E7=BB=86=E6=97=A5=E5=BF=97=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E8=B0=83=E6=95=B4=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/History.vue | 267 +++++++++------------------------ 1 file changed, 73 insertions(+), 194 deletions(-) diff --git a/frontend/src/views/History.vue b/frontend/src/views/History.vue index 7b556c2..c41e2fe 100644 --- a/frontend/src/views/History.vue +++ b/frontend/src/views/History.vue @@ -26,7 +26,7 @@ - + @@ -277,43 +277,54 @@ -
+
{{ currentDetail.log_content }}
@@ -341,7 +352,7 @@ import { FileOutlined, } from '@ant-design/icons-vue' import { Service } from '@/api/services/Service' -import type { HistorySearchIn, HistoryData } from '@/api' +import { HistorySearchIn, type HistoryData } from '@/api' // 调整:枚举需要值导入 import dayjs from 'dayjs' import NodataImage from '@/assets/NoData.png' @@ -358,62 +369,20 @@ const selectedRecordIndex = ref(-1) const currentDetail = ref(null) const currentJsonFile = ref('') -// 快捷时间选择预设 +// 快捷时间选择预设(改用枚举值) const timePresets = [ - { - key: 'today', - label: '今天', - startDate: () => dayjs().format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按日合并' as HistorySearchIn.mode, - }, - { - key: 'yesterday', - label: '昨天', - startDate: () => dayjs().subtract(1, 'day').format('YYYY-MM-DD'), - endDate: () => dayjs().subtract(1, 'day').format('YYYY-MM-DD'), - mode: '按日合并' as HistorySearchIn.mode, - }, - { - key: 'week', - label: '最近一周', - startDate: () => dayjs().subtract(7, 'day').format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按日合并' as HistorySearchIn.mode, - }, - { - key: 'month', - label: '最近一个月', - startDate: () => dayjs().subtract(1, 'month').format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按周合并' as HistorySearchIn.mode, - }, - { - key: 'twoMonths', - label: '最近两个月', - startDate: () => dayjs().subtract(2, 'month').format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按周合并' as HistorySearchIn.mode, - }, - { - key: 'threeMonths', - label: '最近三个月', - startDate: () => dayjs().subtract(3, 'month').format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按月合并' as HistorySearchIn.mode, - }, - { - key: 'halfYear', - label: '最近半年', - startDate: () => dayjs().subtract(6, 'month').format('YYYY-MM-DD'), - endDate: () => dayjs().format('YYYY-MM-DD'), - mode: '按月合并' as HistorySearchIn.mode, - }, + { key: 'today', label: '今天', startDate: () => dayjs().format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.DAILY }, + { key: 'yesterday', label: '昨天', startDate: () => dayjs().subtract(1, 'day').format('YYYY-MM-DD'), endDate: () => dayjs().subtract(1, 'day').format('YYYY-MM-DD'), mode: HistorySearchIn.mode.DAILY }, + { key: 'week', label: '最近一周', startDate: () => dayjs().subtract(7, 'day').format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.DAILY }, + { key: 'month', label: '最近一个月', startDate: () => dayjs().subtract(1, 'month').format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.WEEKLY }, + { key: 'twoMonths', label: '最近两个月', startDate: () => dayjs().subtract(2, 'month').format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.WEEKLY }, + { key: 'threeMonths', label: '最近三个月', startDate: () => dayjs().subtract(3, 'month').format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.MONTHLY }, + { key: 'halfYear', label: '最近半年', startDate: () => dayjs().subtract(6, 'month').format('YYYY-MM-DD'), endDate: () => dayjs().format('YYYY-MM-DD'), mode: HistorySearchIn.mode.MONTHLY }, ] -// 搜索表单 +// 搜索表单(默认按日合并) const searchForm = reactive({ - mode: '按日合并' as HistorySearchIn.mode, + mode: HistorySearchIn.mode.DAILY as HistorySearchIn.mode, startDate: dayjs().subtract(7, 'day').format('YYYY-MM-DD'), endDate: dayjs().format('YYYY-MM-DD'), }) @@ -426,37 +395,6 @@ interface HistoryDateGroup { const historyData = ref([]) -// 计算总览数据 -const totalOverview = computed(() => { - let totalRecruit = 0 - let totalDrop = 0 - - historyData.value.forEach(dateGroup => { - Object.values(dateGroup.users).forEach(userData => { - // 统计公招数据 - if (userData.recruit_statistics) { - Object.values(userData.recruit_statistics).forEach((count: any) => { - totalRecruit += count - }) - } - - // 统计掉落数据 - if (userData.drop_statistics) { - Object.values(userData.drop_statistics).forEach((stageDrops: any) => { - Object.values(stageDrops).forEach((count: any) => { - totalDrop += count - }) - }) - } - }) - }) - - return { - totalRecruit, - totalDrop, - } -}) - // 当前显示的统计数据(根据是否选中记录条目来决定显示用户总计还是单条记录的数据) const currentStatistics = computed(() => { if (selectedRecordIndex.value >= 0 && currentDetail.value) { @@ -523,7 +461,7 @@ const handleSearch = async () => { // 重置搜索条件 const handleReset = () => { - searchForm.mode = '按日合并' + searchForm.mode = HistorySearchIn.mode.DAILY searchForm.startDate = dayjs().subtract(7, 'day').format('YYYY-MM-DD') searchForm.endDate = dayjs().format('YYYY-MM-DD') historyData.value = [] @@ -546,12 +484,12 @@ const handleDateChange = () => { currentPreset.value = '' } -// ���择用户处理 +// 选择用户处理(修正乱码注释) const handleSelectUser = async (date: string, username: string, userData: HistoryData) => { selectedUser.value = `${date}-${username}` selectedUserData.value = userData - selectedRecordIndex.value = -1 // 重置记录选择 - currentDetail.value = null // 清空日志内容 + selectedRecordIndex.value = -1 + currentDetail.value = null currentJsonFile.value = '' } @@ -655,15 +593,14 @@ const handleOpenLogDirectory = async () => { } } -// 获取日期状态颜色 -const getDateStatusColor = (users: Record) => { - const hasError = Object.values(users).some( - user => - user.index?.some(item => item.status === '异常') || - (user.error_info && Object.keys(user.error_info).length > 0) - ) - return hasError ? 'error' : 'success' -} +// 日志字体大小(恢复) +const logFontSize = ref(14) +const logFontSizeOptions = [12, 13, 14, 16, 18, 20] + +// Tooltip 容器:避免挂载到 body 造成全局滚动条闪烁与布局抖动 +const tooltipContainer = (triggerNode: HTMLElement) => triggerNode?.parentElement || document.body +// 固定 button 尺寸,避免 hover/tooltip 状态导致宽度高度微调 +const buttonFixedStyle = { width: '28px', height: '28px', padding: 0 } From bbe5286601b29a3f1acb357989da84f3da6f77dc Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Thu, 25 Sep 2025 19:54:12 +0800 Subject: [PATCH 08/21] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E8=B0=83=E5=BA=A6=E7=9A=84=E9=85=8D=E7=BD=AE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=B7=B3=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/GeneralScriptEdit.vue | 59 ++++++++++++++++-------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/frontend/src/views/GeneralScriptEdit.vue b/frontend/src/views/GeneralScriptEdit.vue index d92d41b..d7faf59 100644 --- a/frontend/src/views/GeneralScriptEdit.vue +++ b/frontend/src/views/GeneralScriptEdit.vue @@ -647,7 +647,7 @@ + + diff --git a/frontend/src/views/setting/index.vue b/frontend/src/views/setting/index.vue index d08e9e5..a657478 100644 --- a/frontend/src/views/setting/index.vue +++ b/frontend/src/views/setting/index.vue @@ -34,11 +34,17 @@ const version = (import.meta as any).env?.VITE_APP_VERSION || '获取版本失 const backendUpdateInfo = ref(null) // 镜像配置状态 -const mirrorConfigStatus = ref({ +type MirrorConfigStatus = { + isUsingCloudConfig: boolean + version?: string + lastUpdated?: string + source: 'cloud' | 'fallback' +} +const mirrorConfigStatus = ref({ isUsingCloudConfig: false, - version: '', - lastUpdated: '', - source: 'fallback' as 'cloud' | 'fallback', + version: undefined, + lastUpdated: undefined, + source: 'fallback', }) const refreshingConfig = ref(false) @@ -324,9 +330,12 @@ onMounted(() => {