mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 01:49:19 +08:00
fix: 移除订单管理页表单中的排序字段选择器,改用表头点击排序
This commit is contained in:
@@ -42,25 +42,11 @@ let shopSearchTimer: ReturnType<typeof setTimeout> | null = null;
|
|||||||
// 订单状态选项
|
// 订单状态选项
|
||||||
const orderStatusOptions = ref<{ label: string; value: number }[]>([]);
|
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({
|
const searchForm = ref({
|
||||||
platformOrderNo: '',
|
platformOrderNo: '',
|
||||||
shopId: undefined as number | undefined,
|
shopId: undefined as number | undefined,
|
||||||
statusId: 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,
|
statusId: searchParams.statusId,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
// 添加排序参数
|
|
||||||
if (searchParams.sortField && searchParams.sortOrder) {
|
|
||||||
params.sorts = [
|
|
||||||
{
|
|
||||||
field: searchParams.sortField,
|
|
||||||
order: searchParams.sortOrder as 'asc' | 'desc',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
const data = await getOrderPageApi(params);
|
const data = await getOrderPageApi(params);
|
||||||
return {
|
return {
|
||||||
items: data.records,
|
items: data.records,
|
||||||
@@ -297,28 +274,6 @@ const formOptions = computed(() => ({
|
|||||||
fieldName: 'statusId',
|
fieldName: 'statusId',
|
||||||
label: '订单状态',
|
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,
|
showDefaultActions: true,
|
||||||
collapsed: true,
|
collapsed: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user