From c8d7fdd0f6b194772bc7467f9b7821b01061715c Mon Sep 17 00:00:00 2001
From: mll <1874467086>
Date: Wed, 25 Feb 2026 15:46:17 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=BB=98=E8=AE=A4=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../LowDesign/src/LowReport/index.vue | 29 +++++++-
src/styles/index.scss | 4 +-
src/utils/formatTime.ts | 2 +-
.../general/components/useRenderVxeColumn.tsx | 69 +++++++++++++++++++
.../reportDesign/components/TableInfo.vue | 5 ++
.../lowdesign/reportDesign/designData.ts | 2 +
6 files changed, 108 insertions(+), 3 deletions(-)
diff --git a/src/components/LowDesign/src/LowReport/index.vue b/src/components/LowDesign/src/LowReport/index.vue
index 3a9d269..a27a470 100644
--- a/src/components/LowDesign/src/LowReport/index.vue
+++ b/src/components/LowDesign/src/LowReport/index.vue
@@ -169,6 +169,23 @@ const summaryMethod1=({columns,data})=>{
})
return result;
}
+function getCurrentDate() {
+ const now = new Date();
+ // 补零函数:小于10则前面加0
+ const padZero = (num) => num.toString().padStart(2, '0');
+
+ const year = now.getFullYear();
+ const month = padZero(now.getMonth() + 1);
+ const day = padZero(now.getDate());
+
+ // 返回格式化后的字符串或对象,按需选择
+ return {
+ year,
+ month,
+ day,
+ fullDate: `${year}-${month}-${day}` // 拼接成 2026-02-24 格式
+ };
+}
const initTable = async () => {
isInit.value = false
loading.value = true
@@ -248,7 +265,17 @@ const initTable = async () => {
_hasChildConfig: childFieldConfigs.has(item.fieldCode),
_childConfigs: childFieldConfigs.get(item.fieldCode) || []
}
-
+ if(!!item.searchDefaultValue){
+ if(['年','年度','年份'].includes(item.fieldName)&&item.searchDefaultValue=='本年'){
+ tableSearch.value[config.prop]=getCurrentDate().year
+ }else if( ['月','月度','月份'].includes(item.fieldName)&&item.searchDefaultValue=='本月'){
+ tableSearch.value[config.prop]=new Date().getMonth() + 1
+ }else if(item.fieldType=='Date'&&item.searchDefaultValue=='当日'){
+ tableSearch.value[config.prop]=getCurrentDate().fullDate
+ }else{
+ tableSearch.value[config.prop]=item.searchDefaultValue
+ }
+ }
if(!!item.isAmount){
index==0?amountFieds.value.fistField=config.prop:''
amountFieds.value[item.isAmount]=config
diff --git a/src/styles/index.scss b/src/styles/index.scss
index cf00a7e..4145022 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -95,7 +95,9 @@
display: flex;
justify-content: flex-start;
}
-
+.width-50{
+ width: 50% !important;
+}
/* nprogress 适配 element-plus 的主题色 */
#nprogress {
& .bar {
diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts
index 51461ae..af074dd 100644
--- a/src/utils/formatTime.ts
+++ b/src/utils/formatTime.ts
@@ -2,7 +2,7 @@ import dayjs from 'dayjs'
import type { TableColumnCtx } from 'element-plus'
/**
- * 日期快捷选项适用于 el-date-picker
+ * 日期快捷选项适用于 -picker
*/
export const defaultShortcuts = [
{
diff --git a/src/views/lowdesign/general/components/useRenderVxeColumn.tsx b/src/views/lowdesign/general/components/useRenderVxeColumn.tsx
index 29c7502..395fc7c 100644
--- a/src/views/lowdesign/general/components/useRenderVxeColumn.tsx
+++ b/src/views/lowdesign/general/components/useRenderVxeColumn.tsx
@@ -74,6 +74,75 @@ export const useRenderVxeColumn = (useType = 'table') => {
return