@ccs-ui/rc-pro 2.3.6-beta-34 → 2.3.6-beta-35
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.
- package/es/ccs.d.ts +6 -1
- package/es/dialog/button.d.ts +1 -1
- package/es/pro-table/table.js +21 -17
- package/package.json +1 -1
package/es/ccs.d.ts
CHANGED
|
@@ -43,8 +43,13 @@ type TableDataType<T> = {
|
|
|
43
43
|
result?: T[];
|
|
44
44
|
};
|
|
45
45
|
type TableInstance<T = any> = {
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
* 获取form表单数据,排序等条件数据
|
|
49
|
+
*/
|
|
47
50
|
formValues: Record<string, any>;
|
|
51
|
+
/** 接口请求参数 */
|
|
52
|
+
searchParam: Record<string, any>;
|
|
48
53
|
/** 获取当前表单数据 */
|
|
49
54
|
data: TableData<T>;
|
|
50
55
|
/** 获取当前选中的数据 */
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
|
|
|
16
16
|
export type DialogButtonRef = {
|
|
17
17
|
onSetButtons: (e: React.ReactElement) => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "
|
|
19
|
+
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "onClose" | "auth" | "request" | "onOk" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
|
|
20
20
|
formRef: React.RefObject<DialogFormRef<TParams>>;
|
|
21
21
|
formInitialValues: FormProps['initialValues'];
|
|
22
22
|
buttonRef: RefObject<DialogButtonRef>;
|
package/es/pro-table/table.js
CHANGED
|
@@ -116,9 +116,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
116
116
|
}, []);
|
|
117
117
|
|
|
118
118
|
// column filter
|
|
119
|
-
var
|
|
119
|
+
var filterOrderRef = useRef(defaultColumnValues);
|
|
120
120
|
// table content
|
|
121
121
|
var tableContentRef = useRef(null);
|
|
122
|
+
// 接口查询条件
|
|
123
|
+
var searchParamRef = useRef({});
|
|
122
124
|
// container
|
|
123
125
|
var containerRef = useRef(null);
|
|
124
126
|
// table ref
|
|
@@ -184,7 +186,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
184
186
|
fsOrderProps,
|
|
185
187
|
fsQuery,
|
|
186
188
|
params,
|
|
187
|
-
|
|
189
|
+
_filterOrderRef$curre,
|
|
188
190
|
filters,
|
|
189
191
|
orderProps,
|
|
190
192
|
_treeRef$current,
|
|
@@ -238,7 +240,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
238
240
|
}
|
|
239
241
|
|
|
240
242
|
// 列过滤或排序参数
|
|
241
|
-
|
|
243
|
+
_filterOrderRef$curre = filterOrderRef.current, filters = _filterOrderRef$curre.filters, orderProps = _filterOrderRef$curre.orderProps;
|
|
242
244
|
if (Object.keys(filters).length > 0) {
|
|
243
245
|
onSetObj(params, _toConsumableArray(fsFilters), filters);
|
|
244
246
|
}
|
|
@@ -254,28 +256,30 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
254
256
|
(_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.onRequestTree(params.query, record);
|
|
255
257
|
return _context.abrupt("return");
|
|
256
258
|
case 20:
|
|
259
|
+
// 记录查询条件
|
|
260
|
+
searchParamRef.current = params;
|
|
257
261
|
// 发起请求
|
|
258
262
|
setData(function (d) {
|
|
259
263
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
260
264
|
loading: true
|
|
261
265
|
});
|
|
262
266
|
});
|
|
263
|
-
_context.next =
|
|
267
|
+
_context.next = 24;
|
|
264
268
|
return httpRequest(params);
|
|
265
|
-
case
|
|
269
|
+
case 24:
|
|
266
270
|
requestResult = _context.sent;
|
|
267
271
|
if (!requestResult) {
|
|
268
|
-
_context.next =
|
|
272
|
+
_context.next = 35;
|
|
269
273
|
break;
|
|
270
274
|
}
|
|
271
275
|
// 获取table数据
|
|
272
276
|
dataSource = getDataFromFields(requestResult, fieldNames.dataSource); // 默认添加一条数据
|
|
273
|
-
if (
|
|
277
|
+
if (table !== null && table !== void 0 && table.emptyDefaultOne && dataSource && dataSource.length === 0) {
|
|
274
278
|
dataSource.push(_defineProperty({}, rowKey || 'id', '0'));
|
|
275
279
|
}
|
|
276
280
|
total = getDataFromFields(requestResult, fieldNames.total);
|
|
277
281
|
if (!(total === undefined || dataSource === undefined)) {
|
|
278
|
-
_context.next =
|
|
282
|
+
_context.next = 32;
|
|
279
283
|
break;
|
|
280
284
|
}
|
|
281
285
|
setData({
|
|
@@ -286,7 +290,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
286
290
|
loading: false
|
|
287
291
|
});
|
|
288
292
|
return _context.abrupt("return");
|
|
289
|
-
case
|
|
293
|
+
case 32:
|
|
290
294
|
// 当前页无数据,返回上一页
|
|
291
295
|
if (!dataSource.length && pageNo !== 1) {
|
|
292
296
|
onRequest('reload', pageNo - 1);
|
|
@@ -299,15 +303,15 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
299
303
|
total: total || 0
|
|
300
304
|
});
|
|
301
305
|
}
|
|
302
|
-
_context.next =
|
|
306
|
+
_context.next = 36;
|
|
303
307
|
break;
|
|
304
|
-
case
|
|
308
|
+
case 35:
|
|
305
309
|
setData(function (d) {
|
|
306
310
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
307
311
|
loading: false
|
|
308
312
|
});
|
|
309
313
|
});
|
|
310
|
-
case
|
|
314
|
+
case 36:
|
|
311
315
|
case "end":
|
|
312
316
|
return _context.stop();
|
|
313
317
|
}
|
|
@@ -384,7 +388,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
384
388
|
}
|
|
385
389
|
});
|
|
386
390
|
// 清空filter请求值
|
|
387
|
-
|
|
391
|
+
filterOrderRef.current = defaultColumnValues;
|
|
388
392
|
onRequest('reset');
|
|
389
393
|
};
|
|
390
394
|
|
|
@@ -396,11 +400,11 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
396
400
|
|
|
397
401
|
// form 数据 查询,重载,重置方法
|
|
398
402
|
useImperativeHandle(proRef, function () {
|
|
399
|
-
var _formRef$current3;
|
|
400
403
|
return {
|
|
401
404
|
data: data,
|
|
402
405
|
selectedRows: selectedRows,
|
|
403
|
-
formValues:
|
|
406
|
+
formValues: searchParamRef.current,
|
|
407
|
+
searchParam: searchParamRef.current,
|
|
404
408
|
onSearch: function onSearch() {
|
|
405
409
|
_onSearch();
|
|
406
410
|
},
|
|
@@ -430,7 +434,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
430
434
|
c.filteredValue = filters[c.dataIndex];
|
|
431
435
|
}
|
|
432
436
|
});
|
|
433
|
-
|
|
437
|
+
filterOrderRef.current = _objectSpread(_objectSpread({}, filterOrderRef.current), {}, {
|
|
434
438
|
filters: filters
|
|
435
439
|
});
|
|
436
440
|
}
|
|
@@ -472,7 +476,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
472
476
|
});
|
|
473
477
|
}
|
|
474
478
|
}
|
|
475
|
-
|
|
479
|
+
filterOrderRef.current = _objectSpread(_objectSpread({}, filterOrderRef.current), {}, {
|
|
476
480
|
orderProps: orderProps
|
|
477
481
|
});
|
|
478
482
|
}
|