mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 03:52:59 +08:00
fix(查询组件): 自定义排序问题
This commit is contained in:
parent
b193074bf0
commit
30d84e5dd6
@ -291,9 +291,18 @@ const setOldMapValue = arr => {
|
||||
const customSort = () => {
|
||||
if (config.value.sortList?.length && config.value.sort === 'customSort') {
|
||||
options.value = [
|
||||
...options.value.sort(
|
||||
(a, b) => config.value.sortList.indexOf(a.value) - config.value.sortList.indexOf(b.value)
|
||||
)
|
||||
...options.value
|
||||
.sort(a => {
|
||||
if (config.value.sortList.indexOf(a.value) !== -1) {
|
||||
return -1
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
if (config.value.sortList.indexOf(a.value) === -1) {
|
||||
return 0
|
||||
}
|
||||
return config.value.sortList.indexOf(a.value) - config.value.sortList.indexOf(b.value)
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -517,7 +526,7 @@ const setOptions = (num: number) => {
|
||||
handleFieldIdChange({
|
||||
queryId: field.id,
|
||||
displayId: displayId || field.id,
|
||||
sort: sort === 'customSort' ? '' : sort,
|
||||
sort: sort === 'customSort' ? 'asc' : sort,
|
||||
sortId,
|
||||
resultMode: config.value.resultMode || 0,
|
||||
searchText: searchText.value,
|
||||
|
Loading…
Reference in New Issue
Block a user