mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 解决网站排序错误的问题 (#5092)
Refs https://github.com/1Panel-dev/1Panel/issues/5021
This commit is contained in:
parent
4dc722b83c
commit
0a7144f625
@ -54,7 +54,7 @@
|
|||||||
<ComplexTable
|
<ComplexTable
|
||||||
:pagination-config="paginationConfig"
|
:pagination-config="paginationConfig"
|
||||||
:data="data"
|
:data="data"
|
||||||
@sort-change="search"
|
@sort-change="changeSort"
|
||||||
@search="search()"
|
@search="search()"
|
||||||
:class="{ mask: nginxStatus != 'Running' }"
|
:class="{ mask: nginxStatus != 'Running' }"
|
||||||
>
|
>
|
||||||
@ -251,12 +251,22 @@ let req = reactive({
|
|||||||
const mobile = computed(() => {
|
const mobile = computed(() => {
|
||||||
return globalStore.isMobile();
|
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.page = paginationConfig.currentPage;
|
||||||
req.pageSize = paginationConfig.pageSize;
|
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;
|
loading.value = true;
|
||||||
await SearchWebsites(req)
|
await SearchWebsites(req)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user