From 30d84e5dd6f3a20adcd9da5ce3a15d57afd73b92 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 25 Nov 2024 11:10:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/v-query/Select.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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,