@zat-design/sisyphus-react 3.13.20-beta.2 → 3.13.20-beta.4
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.
@@ -1,6 +1,5 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
2
|
var _excluded = ["children"];
|
3
|
-
import { isNull, isUndefined } from 'lodash';
|
4
3
|
/**
|
5
4
|
* 获取枚举数据
|
6
5
|
* @param storage
|
@@ -114,9 +113,10 @@ export function cacheFieldNames(fieldNames, dataSource) {
|
|
114
113
|
restFieldNames = _objectWithoutProperties(fieldNames, _excluded);
|
115
114
|
var result = {};
|
116
115
|
Object.keys(restFieldNames).forEach(key => {
|
117
|
-
|
118
|
-
|
119
|
-
|
116
|
+
if (![undefined, null].includes(dataSource[restFieldNames[key]])) {
|
117
|
+
result[key] = dataSource[restFieldNames[key]];
|
118
|
+
} else {
|
119
|
+
result[key] = dataSource[key];
|
120
120
|
}
|
121
121
|
});
|
122
122
|
// 递归去对数据进行清洗
|
@@ -94,7 +94,8 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
94
94
|
queryBean: (_pickBy = pickBy(queryBean, item => item !== undefined)) !== null && _pickBy !== void 0 ? _pickBy : {}
|
95
95
|
});
|
96
96
|
if (transformParams) {
|
97
|
-
|
97
|
+
var mergedParams = _objectSpread(_objectSpread({}, realParams), requestParams);
|
98
|
+
return transformParams(mergedParams);
|
98
99
|
}
|
99
100
|
return requestParams;
|
100
101
|
};
|
@@ -639,7 +639,7 @@ export interface ProTableRequestOptionsType<T, R> {
|
|
639
639
|
* @description 在发送请求前转换参数
|
640
640
|
* @default undefined
|
641
641
|
*/
|
642
|
-
transformParams?: (params: any
|
642
|
+
transformParams?: (params: any) => any;
|
643
643
|
/**
|
644
644
|
* 转换响应数据
|
645
645
|
* @description 处理服务器返回的数据
|
@@ -12,7 +12,6 @@ exports.isObject = isObject;
|
|
12
12
|
exports.mergeCacheData = mergeCacheData;
|
13
13
|
exports.setEnumData = setEnumData;
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
|
-
var _lodash = require("lodash");
|
16
15
|
var _excluded = ["children"];
|
17
16
|
/**
|
18
17
|
* 获取枚举数据
|
@@ -127,9 +126,10 @@ function cacheFieldNames(fieldNames, dataSource) {
|
|
127
126
|
restFieldNames = (0, _objectWithoutProperties2.default)(fieldNames, _excluded);
|
128
127
|
var result = {};
|
129
128
|
Object.keys(restFieldNames).forEach(key => {
|
130
|
-
|
131
|
-
|
132
|
-
|
129
|
+
if (![undefined, null].includes(dataSource[restFieldNames[key]])) {
|
130
|
+
result[key] = dataSource[restFieldNames[key]];
|
131
|
+
} else {
|
132
|
+
result[key] = dataSource[key];
|
133
133
|
}
|
134
134
|
});
|
135
135
|
// 递归去对数据进行清洗
|
@@ -102,7 +102,8 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
102
102
|
queryBean: (_pickBy = (0, _lodash.pickBy)(queryBean, item => item !== undefined)) !== null && _pickBy !== void 0 ? _pickBy : {}
|
103
103
|
});
|
104
104
|
if (transformParams) {
|
105
|
-
|
105
|
+
var mergedParams = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, realParams), requestParams);
|
106
|
+
return transformParams(mergedParams);
|
106
107
|
}
|
107
108
|
return requestParams;
|
108
109
|
};
|
@@ -639,7 +639,7 @@ export interface ProTableRequestOptionsType<T, R> {
|
|
639
639
|
* @description 在发送请求前转换参数
|
640
640
|
* @default undefined
|
641
641
|
*/
|
642
|
-
transformParams?: (params: any
|
642
|
+
transformParams?: (params: any) => any;
|
643
643
|
/**
|
644
644
|
* 转换响应数据
|
645
645
|
* @description 处理服务器返回的数据
|