fix: 移除订单管理页表单中的排序字段选择器,改用表头点击排序

This commit is contained in:
小蟑螂
2026-03-27 21:02:50 +08:00
parent a8feee3364
commit 8a908a178d
@@ -42,25 +42,11 @@ let shopSearchTimer: ReturnType<typeof setTimeout> | null = null;
// 订单状态选项
const orderStatusOptions = ref<{ label: string; value: number }[]>([]);
// 排序选项
const sortFieldOptions = [
{ label: '下单时间', value: 'orderTime' },
{ label: '创建时间', value: 'createTime' },
{ label: '实收金额', value: 'receivedAmount' },
{ label: '数量', value: 'quantity' },
];
const sortOrderOptions = [
{ label: '降序(从高到低)', value: 'desc' },
{ label: '升序(从低到高)', value: 'asc' },
];
// 搜索表单
const searchForm = ref({
platformOrderNo: '',
shopId: undefined as number | undefined,
statusId: undefined as number | undefined,
sortField: 'orderTime' as string | undefined,
sortOrder: 'desc' as string | undefined,
});
// 加载店铺列表(支持分页)
@@ -228,15 +214,6 @@ const gridOptions: VxeGridProps<any> = {
statusId: searchParams.statusId,
},
};
// 添加排序参数
if (searchParams.sortField && searchParams.sortOrder) {
params.sorts = [
{
field: searchParams.sortField,
order: searchParams.sortOrder as 'asc' | 'desc',
},
];
}
const data = await getOrderPageApi(params);
return {
items: data.records,
@@ -297,28 +274,6 @@ const formOptions = computed(() => ({
fieldName: 'statusId',
label: '订单状态',
},
{
component: 'Select',
componentProps: {
placeholder: '选择排序字段',
options: sortFieldOptions,
allowClear: true,
onChange: () => gridApi?.reload(),
},
fieldName: 'sortField',
label: '排序字段',
},
{
component: 'Select',
componentProps: {
placeholder: '选择排序方式',
options: sortOrderOptions,
allowClear: true,
onChange: () => gridApi?.reload(),
},
fieldName: 'sortOrder',
label: '排序方式',
},
],
showDefaultActions: true,
collapsed: true,