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

【影响大】查询条件带默认值,清除默认值后查询后查询又带到后端 #7774

Open
yangyf520 opened this issue Feb 6, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@yangyf520
Copy link

版本号:"@jeecg/online": "3.7.0-beta",

问题描述:查询条件带默认值,清除默认值时查询后,点击分页数字查询时,清除的条件又带了回来,导致查询有误

项目代码如下:
export const searchFormSchema: FormSchemaItem[] = [
{
field: 'status',
component: 'SearchModal',
defaultValue: defaultStatus,
componentProps: {
type: CodeTableType.STATUS,
defaultValue: defaultAssetStatus,
},
},
]

组件有问题的代码如下:
useDataSource.ts文件的async function fetch(opt?: FetchParams)方法
...(useSearchForm ? await validate() : {}), 执行到validate()时把清空的默认条件又带了回来导致的问题

错误截图:
清空的查询条件又传到了后端

@yangyf520 yangyf520 added the bug Something isn't working label Feb 6, 2025
@yangyf520 yangyf520 changed the title 查询条件带默认值,清除默认值时查询后 查询条件带默认值,清除默认值后查询后查询又带到后端 Feb 6, 2025
@yangyf520
Copy link
Author

yangyf520 commented Feb 8, 2025

使用BasicTable.vue组件时,组件的查询条件设置默认参数,查询前清空默认值,查询出数据。
然后,点击第二页的按钮,这时删除的默认值又带回来了

Image

点击分页按钮,会把已经删除查询条件的默认值又带回来

@yangyf520
Copy link
Author

@zhangdaiscott
大佬,能先帮看看这个问题么,影响比较大

@yangyf520 yangyf520 changed the title 查询条件带默认值,清除默认值后查询后查询又带到后端 【影响大】查询条件带默认值,清除默认值后查询后查询又带到后端 Feb 8, 2025
@yangyf520
Copy link
Author

前端版本号:3.7.0

@zhangdaiscott
Copy link
Member

sq

@jeecgDeveloper
Copy link

测试未复现你说的问题,请尝试升级版本试试

Image

@yangyf520
Copy link
Author

yangyf520 commented Feb 27, 2025

测试未复现你说的问题,请尝试升级版本试试

你好,是在查询条件有默认值的场景才会有问题
有默认值时,删除默认值点分页按钮就把默认值带回来了

@jeecgDeveloper
Copy link

测试未复现你说的问题,请尝试升级版本试试

你好,是在查询条件有默认值的场景才会有问题 有默认值时,删除默认值点分页按钮就把默认值带回来了

上述示例中,姓名张三就是设置的默认值,删除后,点查询,点分页都不会有问题

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

3 participants