From 041c2d033fec9e1f11630c3af839d2646fc76f06 Mon Sep 17 00:00:00 2001 From: sophie <16087569+sophie_liang@user.noreply.gitee.com> Date: Tue, 26 May 2026 14:40:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=9A=97=E9=BB=91?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8B=E7=9B=B8=E5=85=B3=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/style.css | 2 +- frontend/src/views/AdminView.vue | 19 +++++--- frontend/src/views/ChatView.vue | 17 ++++--- frontend/src/views/WorkspaceView.vue | 66 +++++++++++++++------------- 4 files changed, 59 insertions(+), 45 deletions(-) diff --git a/frontend/src/style.css b/frontend/src/style.css index a485355b..31814834 100644 --- a/frontend/src/style.css +++ b/frontend/src/style.css @@ -98,7 +98,7 @@ } .card { - @apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300; + @apply bg-white rounded-2xl border border-slate-100 shadow-soft hover:shadow-lg transition-all duration-300 dark:bg-slate-800 dark:border-slate-700; } /* Mobile-first layout tokens for consistent spacing and density. */ diff --git a/frontend/src/views/AdminView.vue b/frontend/src/views/AdminView.vue index 9ce8778b..7bfa2b76 100644 --- a/frontend/src/views/AdminView.vue +++ b/frontend/src/views/AdminView.vue @@ -241,6 +241,10 @@ const route = useRoute(); // 当前左侧菜单激活的模块:dashboard / agents / permissions const activeModule = ref<'dashboard' | 'agents' | 'announcements' | 'permissions' | 'requests' | 'reports' | 'approvals' | 'users' | 'departments' | 'questions' | 'wecom' | 'schedules' | 'knowledge_base'>('dashboard'); +const adminSidebarNavActive = + 'bg-brand-50 text-brand-700 shadow-sm dark:bg-brand-500/15 dark:text-brand-300 dark:shadow-none dark:ring-1 dark:ring-inset dark:ring-brand-500/25'; +const adminSidebarNavInactive = + 'text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/80 dark:hover:text-slate-200'; const expandedReports = ref(true); // agents:管理员视角下的所有 Agent 列表 @@ -3463,28 +3467,29 @@ const handlePermissionImport = async (event: Event) => { v-for="item in sidebarItems" :key="item.id" class="group px-4 py-3 text-left text-sm font-medium rounded-xl transition-all flex items-center gap-3 relative overflow-hidden whitespace-nowrap flex-shrink-0" - :class="activeModule === item.id ? 'bg-brand-50 text-brand-700' : 'text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-slate-100'" + :class="activeModule === item.id ? adminSidebarNavActive : adminSidebarNavInactive" @click="activeModule = item.id as any; activeReportTabId = null" :title="isSidebarCollapsed ? item.label : ''" > - + {{ item.label }} {{ item.badge }} -
+
diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index ad7e7a65..df9fbdcd 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -972,8 +972,11 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null const parseDateStr = (m: RegExpMatchArray | null, groupOffset: number): Date | null => { if (!m) return null; - const mo = parseInt(m[groupOffset], 10); - const da = parseInt(m[groupOffset + 1], 10); + const rawMo = m[groupOffset]; + const rawDa = m[groupOffset + 1]; + if (!rawMo || !rawDa) return null; + const mo = parseInt(rawMo, 10); + const da = parseInt(rawDa, 10); if (Number.isNaN(mo) || Number.isNaN(da) || mo < 1 || mo > 12 || da < 1 || da > 31) return null; return new Date(thisYear, mo - 1, da, 9, 0); }; @@ -996,8 +999,8 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null if (rangeM) { const s = parseDateStr(rangeM, 1); if (rangeM[3] && rangeM[3].length <= 2 && rangeM[4] && rangeM[4].length <= 2) { - const eMo = parseInt(rangeM[3], 10); - const eDa = parseInt(rangeM[4], 10); + const eMo = parseInt(rangeM[3]!, 10); + const eDa = parseInt(rangeM[4]!, 10); if (!Number.isNaN(eMo) && eMo >= 1 && eMo <= 12 && !Number.isNaN(eDa) && eDa >= 1 && eDa <= 31) { endDay = new Date(thisYear, eMo - 1, eDa, 18, 0); } else if (!Number.isNaN(eDa) && eDa >= 1 && eDa <= 31 && s) { @@ -1014,7 +1017,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null if (s) { startDay = s; const dayUnitM = normalized.match(/(\d+\.?\d*)\s*[天日]/); - if (dayUnitM) { + if (dayUnitM?.[1]) { const days = parseFloat(dayUnitM[1]); if (days > 1) endDay = new Date(s.getFullYear(), s.getMonth(), s.getDate() + Math.ceil(days) - 1, 18, 0); else endDay = new Date(s.getFullYear(), s.getMonth(), s.getDate(), 18, 0); @@ -1026,7 +1029,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null } const hourM = normalized.match(/(\d+\.?\d*)\s*小时/); - if (hourM) { + if (hourM?.[1]) { durationHours = parseFloat(hourM[1]); if (startDay && !endDay) { endDay = new Date(startDay.getTime() + durationHours * 3600000); @@ -1034,7 +1037,7 @@ const extractLeaveInfoFromIntent = (content: string): ExtractedLeaveInfo | null } const dayM = normalized.match(/(\d+\.?\d*)\s*[天日]/); - if (dayM && !hourM) { + if (dayM?.[1] && !hourM) { const days = parseFloat(dayM[1]); durationHours = days * 8; if (startDay && !endDay) { diff --git a/frontend/src/views/WorkspaceView.vue b/frontend/src/views/WorkspaceView.vue index 0fe8008e..7f9d43b4 100644 --- a/frontend/src/views/WorkspaceView.vue +++ b/frontend/src/views/WorkspaceView.vue @@ -773,6 +773,10 @@ const handleRegister = async () => { }; const activeSidebarItem = ref<'profile' | 'applications' | 'feedback' | 'updates' | 'knowledge_base' | 'schedule_runs' | 'history'>('applications'); +const workspaceSidebarNavActive = + 'bg-brand-50 text-brand-700 shadow-sm dark:bg-brand-500/15 dark:text-brand-300 dark:shadow-none dark:ring-1 dark:ring-inset dark:ring-brand-500/25'; +const workspaceSidebarNavInactive = + 'text-slate-600 hover:bg-slate-50 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/80 dark:hover:text-slate-200'; const isProfileLoading = ref(false); const isProfileSaving = ref(false); const isProfileEditing = ref(false); @@ -1553,15 +1557,15 @@ onMounted(async () => {
-
+