From 632c123112fcf5e230344e615e3c1e1dadf9a7ec Mon Sep 17 00:00:00 2001 From: dk <1260500659@qq.com> Date: Mon, 22 Jun 2026 23:07:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8A=A0=E7=8F=AD=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E4=BD=9C=E6=8A=A5=E5=91=8A=E3=80=81=E6=88=91?= =?UTF-8?q?=E7=9A=84=E7=BB=A9=E6=95=88):=20=E9=87=8D=E6=9E=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E3=80=81=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E7=B3=BB=E5=88=97bug=E3=80=81=E5=AF=B9=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E7=90=86=E7=9A=84=E5=9C=B0=E6=96=B9=E8=BF=9B=E8=A1=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/custom/table-search-fields.vue | 68 +++-- src/service/api/auth.ts | 2 + src/service/api/overtime-application.ts | 30 +- src/service/api/system-manage.ts | 24 ++ src/service/api/work-report.ts | 9 +- src/typings/api/auth.d.ts | 1 + src/typings/api/overtime-application.d.ts | 6 +- src/typings/api/system-manage.d.ts | 4 + src/typings/api/work-report.d.ts | 6 +- src/typings/components.d.ts | 1 + .../personal-center/my-performance/index.vue | 259 ++++++++++++------ .../modules/performance-action-dialog.vue | 2 +- .../performance-excel-editor-drawer.vue | 215 +++++++++++++-- .../modules/performance-record-dialog.vue | 2 +- .../modules/performance-search.vue | 20 +- .../modules/performance-shared.ts | 13 + .../modules/performance-summary.vue | 16 +- .../modules/performance-template-dialog.vue | 183 +++++++++++-- .../overtime-application/index.vue | 231 ++++++++++------ .../modules/overtime-application-search.vue | 98 ++++--- .../personal-center/work-report/index.vue | 66 ++++- .../work-report/monthly/index.vue | 216 +++++++++++---- .../monthly/modules/search-panel.vue | 4 + .../work-report/project/index.vue | 94 +++++-- .../shared/components/search-panel.vue | 88 +++++- .../shared/components/team-report-summary.vue | 63 ++++- .../work-report/shared/types.ts | 6 +- .../work-report/shared/utils.ts | 37 +++ .../work-report/weekly/index.vue | 257 +++++++++++------ .../weekly/modules/search-panel.vue | 4 + 30 files changed, 1574 insertions(+), 451 deletions(-) diff --git a/src/components/custom/table-search-fields.vue b/src/components/custom/table-search-fields.vue index 5e98fdf..44b798d 100644 --- a/src/components/custom/table-search-fields.vue +++ b/src/components/custom/table-search-fields.vue @@ -22,6 +22,10 @@ export interface SearchField { dateType?: 'date' | 'month'; /** dateRange 字段的日期范围粒度 */ dateRangeType?: 'daterange' | 'monthrange'; + /** 日期面板展示格式 */ + format?: string; + /** 自定义范围分隔文案 */ + rangeSeparator?: string; /** 日期字段提交格式 */ valueFormat?: string; /** 占位列数,默认 1 */ @@ -36,6 +40,10 @@ export interface SearchField { placeholder?: string; /** select 类型的自定义选项渲染函数 */ renderOption?: (option: Option) => VNode | VNode[] | string; + /** 值写回模型前的转换函数 */ + transformValue?: (value: any) => any; + /** 从模型值解析展示值 */ + resolveValue?: (value: any) => any; } interface Props { @@ -60,6 +68,7 @@ const props = withDefaults(defineProps(), { }); interface Emits { + (e: 'update:modelValue', value: Record): void; (e: 'search'): void; (e: 'reset'): void; } @@ -122,6 +131,19 @@ function handleReset() { function handleSearch() { emit('search'); } + +function updateFieldValue(field: SearchField, value: any) { + const nextValue = field.transformValue ? field.transformValue(value) : value; + emit('update:modelValue', { + ...props.modelValue, + [field.key]: nextValue + }); +} + +function getFieldValue(field: SearchField) { + const value = props.modelValue[field.key]; + return field.resolveValue ? field.resolveValue(value) : value; +} @@ -139,19 +161,19 @@ function handleSearch() {