feat:【mall 商城】交易统计、商品统计【antd】15%:product-rank-card.vue 完善
This commit is contained in:
@@ -23,19 +23,4 @@ export * from './window';
|
||||
export { default as cloneDeep } from 'lodash.clonedeep';
|
||||
export { default as get } from 'lodash.get';
|
||||
export { default as isEqual } from 'lodash.isequal';
|
||||
export { default as set } from 'lodash.set';
|
||||
|
||||
/**
|
||||
* 构建排序字段
|
||||
* @param prop 字段名称
|
||||
* @param order 顺序
|
||||
*/
|
||||
export const buildSortingField = ({
|
||||
prop,
|
||||
order,
|
||||
}: {
|
||||
order: 'ascending' | 'descending';
|
||||
prop: string;
|
||||
}) => {
|
||||
return { field: prop, order: order === 'ascending' ? 'asc' : 'desc' };
|
||||
};
|
||||
export { default as set } from 'lodash.set';
|
||||
@@ -162,4 +162,21 @@ class RequestClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建排序字段,处理 vxe 排序条件
|
||||
*
|
||||
* add by 芋艿
|
||||
*/
|
||||
export const buildSortingField = (sorts: any[]) => {
|
||||
if (!sorts || sorts.length === 0) {
|
||||
return {};
|
||||
}
|
||||
const result: Record<string, any> = {};
|
||||
sorts.forEach((sort: any, index: number) => {
|
||||
result[`sortingFields[${index}].field`] = sort.field;
|
||||
result[`sortingFields[${index}].order`] = sort.order;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
export { RequestClient };
|
||||
|
||||
Reference in New Issue
Block a user