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

fix(仪表板): 日期过滤组件筛选提示异常
This commit is contained in:
dataeaseShu 2024-07-03 10:02:13 +08:00 committed by GitHub
commit 46d87dbfc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,16 +123,9 @@ const getValueByDefaultValueCheckOrFirstLoad = (
}
if (firstLoad && !selectValue?.length) {
return defaultValueCheck
? Array.isArray(defaultValue)
? defaultValue
: [defaultValue]
: multiple
? []
: ''
return defaultValueCheck ? defaultValue : multiple ? [] : ''
}
return selectValue ? (Array.isArray(selectValue) ? selectValue : [selectValue]) : ''
return selectValue ? selectValue : ''
}
export const useFilter = (curComponentId: string, firstLoad = false) => {
@ -310,8 +303,10 @@ export const searchQuery = (queryComponentList, filter, curComponentId, firstLoa
}
if (
!!selectValue?.length ||
displayType === '8' ||
Object.prototype.toString.call(selectValue) === '[object Date]'
['[object Number]', '[object Date]'].includes(
Object.prototype.toString.call(selectValue)
) ||
displayType === '8'
) {
const result = forMatterValue(
+displayType,