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

JSearchSelect组件异步查询不生效 #6681

Closed
testnet0 opened this issue Jul 1, 2024 · 8 comments
Closed

JSearchSelect组件异步查询不生效 #6681

testnet0 opened this issue Jul 1, 2024 · 8 comments

Comments

@testnet0
Copy link

testnet0 commented Jul 1, 2024

版本号:

V3.7.0

问题描述:

JSearchSelect的async异步加载参数现在不生效,即使配置了首次打开下拉框,发起请求获得的也是全部数据:
image

错误截图:

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@testnet0
Copy link
Author

testnet0 commented Jul 1, 2024

image 应该是当第一次打开下拉框的时候,没有拼接keyword和pageSize参数

@zhangdaiscott
Copy link
Member

什么接口,这种问题应该是后台接口问题吧

@testnet0
Copy link
Author

testnet0 commented Jul 1, 2024

什么接口,这种问题应该是后台接口问题吧

接口是:/jeecgboot/sys/dict/getDictItems
前端代码:
image

升级前还是可以的,只有在首次加载的时候会没有分页

@testnet0
Copy link
Author

testnet0 commented Jul 1, 2024

image
第一次打开下拉框的时候,没带分页参数:
image

@zhangdaiscott
Copy link
Member

你分页参数在哪配置的

@testnet0
Copy link
Author

testnet0 commented Jul 1, 2024

你分页参数在哪配置的

找到原因了
jeecgboot-vue3/src/components/Form/src/jeecg/components/JSearchSelect.vue
这里的代码有问题,没考虑字典表的情况:
options.value.length && initDictCodeData();

修改成了:
image

options.value.length && isDictTable.value ? initDictTableData() : initDictCodeData();
就不会第一次的时候加载全部数据了

@zhangdaiscott
Copy link
Member

我们看看

@liaozhiyang
Copy link

已修复,下一版本发布。

你本地可按如下进行修复:
import { isObject } from '/@/utils/is';

const handleAsyncFocus = () => {
(isObject(selectedAsyncValue.value) || selectedAsyncValue.value?.length) && isDictTable.value && props.async && initDictTableData();
attrs.onFocus?.();
};

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants