From 0a7144f6250704e47cd11623adab27d024a36480 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 22 May 2024 14:26:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#5092)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/1Panel-dev/1Panel/issues/5021 --- frontend/src/views/website/website/index.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/website/website/index.vue b/frontend/src/views/website/website/index.vue index 860121ab4..0f02799b9 100644 --- a/frontend/src/views/website/website/index.vue +++ b/frontend/src/views/website/website/index.vue @@ -54,7 +54,7 @@ @@ -251,12 +251,22 @@ let req = reactive({ const mobile = computed(() => { return globalStore.isMobile(); }); -const search = async (column?: any) => { + +const changeSort = ({ prop, order }) => { + if (order) { + req.orderBy = prop == 'primaryDomain' ? 'primary_domain' : prop; + req.order = order; + } else { + req.orderBy = 'created_at'; + req.order = 'null'; + } + search(); +}; + +const search = async () => { req.page = paginationConfig.currentPage; req.pageSize = paginationConfig.pageSize; - req.orderBy = column?.order ? column.prop : 'created_at'; - req.orderBy = req.orderBy === 'primaryDomain' ? 'primary_domain' : req.orderBy; - req.order = column?.order ? column.order : 'null'; + loading.value = true; await SearchWebsites(req) .then((res) => {