Merge pull request #11204 from dataease/pr@dev-v2_st

fix(查询组件): 文本搜索条件设置为必填项后,输入搜索内容依然提示需要设置选项值
This commit is contained in:
dataeaseShu 2024-07-29 09:55:19 +08:00 committed by GitHub
commit ebcc0113fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 9 deletions

View File

@ -233,8 +233,8 @@ const queryDataForId = id => {
if (conditionType === 0) {
requiredName = conditionValueF === '' ? next.name : ''
} else {
requiredName = [conditionValueF || '', conditionValueS || ''].filter(ele => ele !== '')
.length
requiredName =
[conditionValueF || '', conditionValueS || ''].filter(ele => ele !== '').length < 2
? next.name
: ''
}
@ -458,8 +458,8 @@ const queryData = () => {
if (conditionType === 0) {
requiredName = conditionValueF === '' ? next.name : ''
} else {
requiredName = [conditionValueF || '', conditionValueS || ''].filter(ele => ele !== '')
.length
requiredName =
[conditionValueF || '', conditionValueS || ''].filter(ele => ele !== '').length < 2
? next.name
: ''
}

View File

@ -237,7 +237,12 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
const isTree = +displayType === 9
if (timeType === 'dynamic' && [1, 7].includes(+displayType) && firstLoad) {
if (
timeType === 'dynamic' &&
[1, 7].includes(+displayType) &&
firstLoad &&
defaultValueCheck
) {
if (+displayType === 1) {
selectValue = getDynamicRange(item)
item.defaultValue = new Date(selectValue[0])