From aa683f892bcf5954b7db694d17549fe1b6b3a0e4 Mon Sep 17 00:00:00 2001 From: dk <1260500659@qq.com> Date: Thu, 23 Jul 2026 14:36:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=99=BB=E5=BD=95=E9=A1=B5=E3=80=81?= =?UTF-8?q?=E5=91=A8=E6=8A=A5=E3=80=81=E7=BB=A9=E6=95=88=E4=B8=8B=E7=AD=BE?= =?UTF-8?q?):=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=92=8C=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=89=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了未使用的文件夹ZIP图标类型定义 - 添加了formatWeeklyPeriodLabel函数用于周报期间标签格式化 - 改进了日期范围计算逻辑并增加了类型安全检查 - 隐藏了登录页面的版权页脚以优化界面显示 - 修复了绩效签核对话框中的文本描述问题 - 在API响应中增加了对报表开始和结束日期的规范化处理 --- src/service/api/work-report.ts | 2 ++ src/typings/components.d.ts | 2 -- src/views/_builtin/login/index.vue | 6 +++--- .../modules/performance-sign-off-dialog.vue | 2 +- .../work-report/shared/types.ts | 18 +++++++++++++++--- .../work-report/weekly/modules/fill-page.vue | 11 +++++++++++ 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/service/api/work-report.ts b/src/service/api/work-report.ts index 9a9d627..bc6ff88 100644 --- a/src/service/api/work-report.ts +++ b/src/service/api/work-report.ts @@ -287,6 +287,8 @@ function normalizeWeeklyReport(response: WeeklyReportResponse): Api.WorkReport.W allowEdit: normalizeBooleanFlag(response.allowEdit), terminal: normalizeBooleanFlag(response.terminal), isBusinessTrip: normalizeBooleanFlag(response.isBusinessTrip), + periodStartDate: normalizeDateText(response.periodStartDate) ?? '', + periodEndDate: normalizeDateText(response.periodEndDate) ?? '', totalWorkHours: normalizeReportTotalWorkHours(response.totalWorkHours, fallbackTotalWorkHours), submitTime: response.submitTime ?? null, reviewItems: response.reviewItems?.map(normalizeReviewItem) ?? [], diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 62d6202..bf60d36 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -130,13 +130,11 @@ declare module 'vue' { IconMdiFolderOpen: typeof import('~icons/mdi/folder-open')['default'] IconMdiFolderOutline: typeof import('~icons/mdi/folder-outline')['default'] IconMdiFolderPlusOutline: typeof import('~icons/mdi/folder-plus-outline')['default'] - IconMdiFolderZipOutline: typeof import('~icons/mdi/folder-zip-outline')['default'] IconMdiInboxMultipleOutline: typeof import('~icons/mdi/inbox-multiple-outline')['default'] IconMdiInformationOutline: typeof import('~icons/mdi/information-outline')['default'] IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default'] IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default'] IconMdiLinkVariant: typeof import('~icons/mdi/link-variant')['default'] - IconMdiPenCheckOutline: typeof import('~icons/mdi/pen-check-outline')['default'] IconMdiPencilOutline: typeof import('~icons/mdi/pencil-outline')['default'] IconMdiPlus: typeof import('~icons/mdi/plus')['default'] IconMdiRefresh: typeof import('~icons/mdi/refresh')['default'] diff --git a/src/views/_builtin/login/index.vue b/src/views/_builtin/login/index.vue index 78c8975..8934525 100644 --- a/src/views/_builtin/login/index.vue +++ b/src/views/_builtin/login/index.vue @@ -369,9 +369,9 @@ const turbines = [ - + + + diff --git a/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue b/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue index 7764026..016a5c8 100644 --- a/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue +++ b/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue @@ -54,7 +54,7 @@ const title = computed(() => (isImportOnly.value ? '导入绩效压缩包' : ' const confirmText = computed(() => (isImportOnly.value ? '开始导入' : '确认执行')); const teamLabelText = computed(() => { if (needsZipFile.value) { - return '压缩包中含有的下属'; + return '全部下属'; } return props.teamLabel || '当前范围'; diff --git a/src/views/personal-center/work-report/shared/types.ts b/src/views/personal-center/work-report/shared/types.ts index fc3a159..00ec9b4 100644 --- a/src/views/personal-center/work-report/shared/types.ts +++ b/src/views/personal-center/work-report/shared/types.ts @@ -117,9 +117,21 @@ export function formatWeeklyPeriodLabel( endDate?: string | null, periodLabel?: string | null ) { - const startDate = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodStartDate : rowOrStart; - const rangeEndDate = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodEndDate : endDate; - const fallbackLabel = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodLabel : periodLabel; + const isRowPayload = + typeof rowOrStart === 'object' && + rowOrStart !== null && + !Array.isArray(rowOrStart) && + ('periodStartDate' in rowOrStart || 'periodEndDate' in rowOrStart || 'periodLabel' in rowOrStart); + let startDate: string | null | undefined; + if (isRowPayload) { + startDate = rowOrStart.periodStartDate; + } else if (typeof rowOrStart === 'string') { + startDate = rowOrStart; + } else { + startDate = undefined; + } + const rangeEndDate: string | null | undefined = isRowPayload ? rowOrStart.periodEndDate : endDate; + const fallbackLabel: string | null | undefined = isRowPayload ? rowOrStart.periodLabel : periodLabel; const referenceDate = dayjs(startDate || rangeEndDate); if (referenceDate.isValid()) { diff --git a/src/views/personal-center/work-report/weekly/modules/fill-page.vue b/src/views/personal-center/work-report/weekly/modules/fill-page.vue index fb8b31a..55baa30 100644 --- a/src/views/personal-center/work-report/weekly/modules/fill-page.vue +++ b/src/views/personal-center/work-report/weekly/modules/fill-page.vue @@ -12,6 +12,7 @@ import { type WorkReportStructuredTask, formatPeriodDateRange, formatPeriodLabel, + formatWeeklyPeriodLabel, getStructuredSections, getStructuredTasks } from '../../shared/types'; @@ -866,7 +867,15 @@ const totalHours = computed(() => { return (props.model.reviewItems || []).reduce((sum, item) => sum + Number(item.workHours || 0), 0); }); + const periodText = computed(() => { + const weeklyLabel = formatWeeklyPeriodLabel( + props.model.periodStartDate || undefined, + props.model.periodEndDate || undefined, + props.model.periodLabel || props.period + ); + if (weeklyLabel && weeklyLabel !== '--') return weeklyLabel; + const rangeText = formatPeriodDateRange( props.model.periodStartDate || undefined, props.model.periodEndDate || undefined @@ -875,10 +884,12 @@ const periodText = computed(() => { return formatPeriodLabel(props.model.periodLabel || props.period) || '--'; }); + const totalTravelDays = computed(() => { const total = travelSegments.value.reduce((sum, segment) => sum + Number(segment.days || 0), 0); return Math.round(total * 10) / 10; }); + const hasCompleteTravelSegment = computed(() => travelSegments.value.some(isCompleteTravelSegment)); function calcSegmentDays(segment: TravelSegment) {