Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报表参数的时间控件设置默认值时查询框无法回显 #3464

Closed
PPnostalgia opened this issue Feb 14, 2025 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@PPnostalgia
Copy link

版本号:1.9.3
问题描述:

在使用Api数据集的情况下,以报表参数作为查询条件,报表参数中查询控件为日期类型的参数,在设置了默认值 “=dateStr()“,查询日期格式为yyyy-MM-dd HH:mm:ss的情况下,点击预览,该参数的查询框未回显日期,但是点击查询时,在请求参数里该参数是赋值的。尝试过使用js增强配置对该参数进行赋值(如下所示),但依然无法回显
`function init(){
const now = new Date();

const firstDayOfThisMonth = new Date(now.getFullYear(), now.getMonth(), 1);

const lastDayOfLastMonth = new Date(firstDayOfThisMonth);
lastDayOfLastMonth.setDate(0); 
lastDayOfLastMonth.setHours(18, 0, 0, 0); // 设置为18:00:00.000

const lastDayOfThisMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0);
lastDayOfThisMonth.setHours(18, 0, 0, 0); // 设置为18:00:00.000

const formatDate = (date) => {
     return date.toISOString().replace('T', ' ').substring(0, 19);
};
this.queryInfo['startDate'] = formatDate(lastDayOfLastMonth) ;
this.queryInfo['endDate'] = formatDate(lastDayOfThisMonth);

}`

错误日志&截图:

Image

Image

重现步骤:

友情提示(为了提高issue处理效率):

  • 积木报表是一款免费报表产品,功能免费源码不开放;
  • 未按格式要求发帖,会被直接删掉;
  • 请针对问题提供[报表设计配置或SQL脚本]或在官网制作报表示例并提供ID;
  • 针对不好重现的问题,请录制操作视频或详细的重现步骤;
@PPnostalgia PPnostalgia added the bug Something isn't working label Feb 14, 2025
@jeecgos
Copy link
Collaborator

jeecgos commented Feb 14, 2025

assign ws

@jeecgos
Copy link
Collaborator

jeecgos commented Feb 18, 2025

日期格式下 不需要你选中下拉单选,下拉单选是给字符类型用的。参数中日期仅支持不选择查询控件;字段中支持不选择查询控件或者选择范围查询组件
下个版本选择错误将按照文本框进行显示

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants