diff --git a/core/core-frontend/src/custom-component/v-query/Select.vue b/core/core-frontend/src/custom-component/v-query/Select.vue index 2cc0c9b969..097dbf4c30 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -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,