yuang-framework-ui-pc 1.1.124 → 1.1.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,10 +66,8 @@ export declare function getOrderItems(sorter?: Sorter): OrderItem[];
66
66
  /**
67
67
  * 生成请求的排序参数列表
68
68
  * @param sorter 排序方式
69
- * @param request 请求参数配置
70
- * @param globalRequest 全局请求参数配置
71
69
  */
72
- export declare function getRequestOrderParamList(sorter?: Sorter, request?: RequestOption, globalRequest?: RequestOption): OrderParamList;
70
+ export declare function getRequestOrderParamList(sorter?: Sorter): OrderParamList;
73
71
  /**
74
72
  * 生成请求的筛选参数
75
73
  * @param filter 筛选条件
@@ -68,11 +68,11 @@ function getDefaultFilter(columns) {
68
68
  function getRequestName(globalRequest, request) {
69
69
  const defaultRequest = {
70
70
  currentPageKey: "currentPage",
71
- pageSizeKey: "pageSize",
72
- orderColumnNameKey: "orderColumnName",
73
- orderDirectionKey: "orderDirection",
74
- ascValue: "asc",
75
- descValue: "desc"
71
+ pageSizeKey: "pageSize"
72
+ // orderColumnNameKey: 'columnName',
73
+ // orderDirectionKey: 'orderDirection',
74
+ // ascValue: 'asc',
75
+ // descValue: 'desc'
76
76
  };
77
77
  return Object.assign(defaultRequest, globalRequest, request);
78
78
  }
@@ -106,20 +106,16 @@ function getOrderItems(sorter) {
106
106
  }
107
107
  return orderParamList;
108
108
  }
109
- function getRequestOrderParamList(sorter, request, globalRequest) {
109
+ function getRequestOrderParamList(sorter) {
110
110
  const orderParamList = [];
111
- const { orderColumnNameKey, orderDirectionKey, ascValue, descValue } = getRequestName(globalRequest, request);
112
- if (!orderColumnNameKey || !orderDirectionKey) {
113
- return orderParamList;
114
- }
115
111
  const items = getOrderItems(sorter);
116
112
  if (items.length === 1) {
117
113
  const orderParam = {};
118
- orderParam[orderColumnNameKey] = toUnderScoreCase(items[0].field);
119
- orderParam[orderDirectionKey] = items[0].descend ? descValue : ascValue;
114
+ orderParam["columnName"] = toUnderScoreCase(items[0].field);
115
+ orderParam["direction"] = items[0].descend ? "desc" : "asc";
120
116
  orderParamList.push(orderParam);
121
117
  } else if (items.length) {
122
- orderParamList[orderColumnNameKey] = items.map((d) => [toUnderScoreCase(d.field), d.descend ? descValue : ascValue].join(" ")).join(",");
118
+ orderParamList["columnName"] = items.map((d) => [toUnderScoreCase(d.field), d.descend ? "desc" : "asc"].join(" ")).join(",");
123
119
  }
124
120
  return orderParamList;
125
121
  }
@@ -70,11 +70,11 @@ function getDefaultFilter(columns) {
70
70
  function getRequestName(globalRequest, request) {
71
71
  const defaultRequest = {
72
72
  currentPageKey: "currentPage",
73
- pageSizeKey: "pageSize",
74
- orderColumnNameKey: "orderColumnName",
75
- orderDirectionKey: "orderDirection",
76
- ascValue: "asc",
77
- descValue: "desc"
73
+ pageSizeKey: "pageSize"
74
+ // orderColumnNameKey: 'columnName',
75
+ // orderDirectionKey: 'orderDirection',
76
+ // ascValue: 'asc',
77
+ // descValue: 'desc'
78
78
  };
79
79
  return Object.assign(defaultRequest, globalRequest, request);
80
80
  }
@@ -108,20 +108,16 @@ function getOrderItems(sorter) {
108
108
  }
109
109
  return orderParamList;
110
110
  }
111
- function getRequestOrderParamList(sorter, request, globalRequest) {
111
+ function getRequestOrderParamList(sorter) {
112
112
  const orderParamList = [];
113
- const { orderColumnNameKey, orderDirectionKey, ascValue, descValue } = getRequestName(globalRequest, request);
114
- if (!orderColumnNameKey || !orderDirectionKey) {
115
- return orderParamList;
116
- }
117
113
  const items = getOrderItems(sorter);
118
114
  if (items.length === 1) {
119
115
  const orderParam = {};
120
- orderParam[orderColumnNameKey] = stringUtils.toUnderScoreCase(items[0].field);
121
- orderParam[orderDirectionKey] = items[0].descend ? descValue : ascValue;
116
+ orderParam["columnName"] = stringUtils.toUnderScoreCase(items[0].field);
117
+ orderParam["direction"] = items[0].descend ? "desc" : "asc";
122
118
  orderParamList.push(orderParam);
123
119
  } else if (items.length) {
124
- orderParamList[orderColumnNameKey] = items.map((d) => [stringUtils.toUnderScoreCase(d.field), d.descend ? descValue : ascValue].join(" ")).join(",");
120
+ orderParamList["columnName"] = items.map((d) => [stringUtils.toUnderScoreCase(d.field), d.descend ? "desc" : "asc"].join(" ")).join(",");
125
121
  }
126
122
  return orderParamList;
127
123
  }
@@ -66,10 +66,8 @@ export declare function getOrderItems(sorter?: Sorter): OrderItem[];
66
66
  /**
67
67
  * 生成请求的排序参数列表
68
68
  * @param sorter 排序方式
69
- * @param request 请求参数配置
70
- * @param globalRequest 全局请求参数配置
71
69
  */
72
- export declare function getRequestOrderParamList(sorter?: Sorter, request?: RequestOption, globalRequest?: RequestOption): OrderParamList;
70
+ export declare function getRequestOrderParamList(sorter?: Sorter): OrderParamList;
73
71
  /**
74
72
  * 生成请求的筛选参数
75
73
  * @param filter 筛选条件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuang-framework-ui-pc",
3
- "version": "1.1.124",
3
+ "version": "1.1.125",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts --mode dev",