@teamix/pro 1.2.24 → 1.2.29
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/dist/212.js +129 -129
- package/dist/pro.css +1 -1
- package/dist/pro.js +18112 -15660
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +2 -0
- package/es/actions/dialog.js +1 -1
- package/es/actions/index.d.ts +12 -9
- package/es/actions/index.js +56 -15
- package/es/actions/index.scss +12 -1
- package/es/form/Filter/AdvancedFilter.js +1 -1
- package/es/form/Filter/Layout.d.ts +5 -0
- package/es/form/Filter/Layout.js +82 -0
- package/es/form/Filter/SimpleFilter.js +30 -6
- package/es/form/Filter/index2.d.ts +2 -1
- package/es/form/Filter/index2.js +97 -116
- package/es/form/Filter/index2.scss +16 -45
- package/es/form/Filter/layout.scss +36 -0
- package/es/form/Filter/useSpecialProps.d.ts +6 -0
- package/es/form/Filter/useSpecialProps.js +37 -0
- package/es/form/ProForm/customComponent.d.ts +3 -0
- package/es/form/ProForm/customComponent.js +20 -0
- package/es/form/ProForm/index.scss +5 -6
- package/es/form/ProForm/useFormDisplayValues.js +14 -24
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +8 -6
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +2 -2
- package/es/form/SchemaForm/initializeRules.d.ts +1 -1
- package/es/form/SchemaForm/initializeRules.js +3 -3
- package/es/form/fieldTypeMap.js +2 -1
- package/es/form/index.d.ts +4 -2
- package/es/form/index.js +4 -2
- package/es/form/typing.d.ts +16 -1
- package/es/form/utils.d.ts +2 -2
- package/es/form/utils.js +2 -2
- package/es/index.d.ts +5 -2
- package/es/index.js +6 -3
- package/es/info/index.scss +1 -1
- package/es/nocode/pages/renderer.js +1 -1
- package/es/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
- package/es/step/ProStepItem/components/HozStepItem/index.js +235 -0
- package/es/step/ProStepItem/components/HozStepItem/index.scss +279 -0
- package/es/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
- package/es/step/ProStepItem/components/VerStepItem/index.js +295 -0
- package/es/step/ProStepItem/components/VerStepItem/index.scss +287 -0
- package/es/step/ProStepItem/index.d.ts +4 -0
- package/es/step/ProStepItem/index.js +57 -0
- package/es/step/index.d.ts +9 -0
- package/es/step/index.js +101 -0
- package/es/step/typing.d.ts +96 -0
- package/es/step/typing.js +1 -0
- package/es/table/components/Filter/index.js +2 -17
- package/es/table/components/Layout/index.js +63 -167
- package/es/table/components/Layout/index.scss +4 -3
- package/es/table/components/Pagination/index.js +1 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +4 -9
- package/es/table/components/ToolBar/Fullscreen.js +21 -11
- package/es/table/index.js +89 -103
- package/es/table/typing.d.ts +14 -3
- package/es/table/utils/columnRender.js +21 -3
- package/es/table/utils/index.d.ts +7 -0
- package/es/table/utils/index.js +36 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/actions/dialog.js +1 -1
- package/lib/actions/index.d.ts +12 -9
- package/lib/actions/index.js +56 -15
- package/lib/actions/index.scss +12 -1
- package/lib/form/Filter/AdvancedFilter.js +1 -1
- package/lib/form/Filter/Layout.d.ts +5 -0
- package/lib/form/Filter/Layout.js +102 -0
- package/lib/form/Filter/SimpleFilter.js +29 -4
- package/lib/form/Filter/index2.d.ts +2 -1
- package/lib/form/Filter/index2.js +101 -114
- package/lib/form/Filter/index2.scss +16 -45
- package/lib/form/Filter/layout.scss +36 -0
- package/lib/form/Filter/useSpecialProps.d.ts +6 -0
- package/lib/form/Filter/useSpecialProps.js +46 -0
- package/lib/form/ProForm/customComponent.d.ts +3 -0
- package/lib/form/ProForm/customComponent.js +28 -0
- package/lib/form/ProForm/index.scss +5 -6
- package/lib/form/ProForm/useFormDisplayValues.js +17 -24
- package/lib/form/SchemaForm/adapterType.js +1 -0
- package/lib/form/SchemaForm/index.js +8 -6
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +2 -2
- package/lib/form/SchemaForm/initializeRules.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRules.js +3 -3
- package/lib/form/fieldTypeMap.js +2 -1
- package/lib/form/index.d.ts +4 -2
- package/lib/form/index.js +19 -1
- package/lib/form/typing.d.ts +16 -1
- package/lib/form/utils.d.ts +2 -2
- package/lib/form/utils.js +2 -2
- package/lib/index.d.ts +5 -2
- package/lib/index.js +35 -3
- package/lib/info/index.scss +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
- package/lib/step/ProStepItem/components/HozStepItem/index.js +258 -0
- package/lib/step/ProStepItem/components/HozStepItem/index.scss +279 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.js +315 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.scss +287 -0
- package/lib/step/ProStepItem/index.d.ts +4 -0
- package/lib/step/ProStepItem/index.js +69 -0
- package/lib/step/index.d.ts +9 -0
- package/lib/step/index.js +124 -0
- package/lib/step/typing.d.ts +96 -0
- package/lib/step/typing.js +5 -0
- package/lib/table/components/Filter/index.js +2 -17
- package/lib/table/components/Layout/index.js +61 -167
- package/lib/table/components/Layout/index.scss +4 -3
- package/lib/table/components/Pagination/index.js +1 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +4 -9
- package/lib/table/components/ToolBar/Fullscreen.js +22 -11
- package/lib/table/index.js +85 -100
- package/lib/table/typing.d.ts +14 -3
- package/lib/table/utils/columnRender.js +21 -3
- package/lib/table/utils/index.d.ts +7 -0
- package/lib/table/utils/index.js +38 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/package.json +4 -4
package/lib/table/index.js
CHANGED
@@ -38,8 +38,6 @@ var _form = require("../form");
|
|
38
38
|
|
39
39
|
var _actions = require("../actions");
|
40
40
|
|
41
|
-
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
42
|
-
|
43
41
|
var _classnames = _interopRequireDefault(require("classnames"));
|
44
42
|
|
45
43
|
var _pageContainer = _interopRequireDefault(require("../page-container"));
|
@@ -57,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
|
|
57
55
|
}
|
58
56
|
});
|
59
57
|
});
|
60
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType"];
|
58
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams"];
|
61
59
|
|
62
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
63
61
|
|
@@ -98,7 +96,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
98
96
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
99
97
|
|
100
98
|
var cls = (0, _utils.baseClass)('teamix-pro-table');
|
101
|
-
var toJS = _form.formilyReactive.toJS;
|
99
|
+
var toJS = _form.formilyReactive.toJS; // 判断是否是 root 组织
|
100
|
+
|
101
|
+
var isRoot = (0, _utils.getCookie)('organizationId') === '1';
|
102
102
|
/**
|
103
103
|
* 处理原生传入的 columns 以便于 选择列 方便处理
|
104
104
|
* @param columns 原生传入的 columns
|
@@ -106,14 +106,24 @@ var toJS = _form.formilyReactive.toJS;
|
|
106
106
|
*/
|
107
107
|
|
108
108
|
var processColumns = function processColumns(columns, initialColumns) {
|
109
|
+
var _filterColumns;
|
110
|
+
|
109
111
|
var filterColumns = columns.filter(function (item) {
|
110
112
|
return item.columnFilters !== false;
|
111
|
-
});
|
113
|
+
});
|
114
|
+
|
115
|
+
if (isRoot) {
|
116
|
+
// root 组织下不显示标签管理
|
117
|
+
filterColumns = filterColumns.filter(function (item) {
|
118
|
+
return item.valueType !== 'selectGroup';
|
119
|
+
});
|
120
|
+
} // 处理只剩一列批量选择的情况下宽度错乱问题
|
121
|
+
|
112
122
|
|
113
|
-
if (filterColumns === null ||
|
114
|
-
var _initialColumns$;
|
123
|
+
if ((_filterColumns = filterColumns) === null || _filterColumns === void 0 ? void 0 : _filterColumns.length) {
|
124
|
+
var _filterColumns2, _initialColumns$;
|
115
125
|
|
116
|
-
if ((filterColumns === null ||
|
126
|
+
if (((_filterColumns2 = filterColumns) === null || _filterColumns2 === void 0 ? void 0 : _filterColumns2.length) === 1) {
|
117
127
|
var _filterColumns$, _filterColumns$2;
|
118
128
|
|
119
129
|
if ((_filterColumns$ = filterColumns[0]) === null || _filterColumns$ === void 0 ? void 0 : _filterColumns$.width) {
|
@@ -155,7 +165,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
155
165
|
};
|
156
166
|
|
157
167
|
var ProTable = function ProTable(props) {
|
158
|
-
var _rowSelection$selecte;
|
168
|
+
var _rowSelection$selecte, _dataFilterForm4;
|
159
169
|
|
160
170
|
var header = props.header,
|
161
171
|
className = props.className,
|
@@ -209,6 +219,7 @@ var ProTable = function ProTable(props) {
|
|
209
219
|
customRequest = props.customRequest,
|
210
220
|
_props$filterColumnTy = props.filterColumnType,
|
211
221
|
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
222
|
+
defaultFilterParams = props.defaultFilterParams,
|
212
223
|
otherProps = _objectWithoutProperties(props, _excluded);
|
213
224
|
|
214
225
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -252,10 +263,8 @@ var ProTable = function ProTable(props) {
|
|
252
263
|
var _useState13 = (0, _react.useState)(true),
|
253
264
|
_useState14 = _slicedToArray(_useState13, 2),
|
254
265
|
customTableLoading = _useState14[0],
|
255
|
-
setCustomTableLoading = _useState14[1];
|
256
|
-
|
266
|
+
setCustomTableLoading = _useState14[1];
|
257
267
|
|
258
|
-
var searchValueRef = (0, _react.useRef)('');
|
259
268
|
var tableRef = (0, _react.useRef)(null);
|
260
269
|
var actionRef = (0, _react.useRef)(); // 传给 table 的过滤后的 columns
|
261
270
|
|
@@ -305,20 +314,23 @@ var ProTable = function ProTable(props) {
|
|
305
314
|
var _useState23 = (0, _react.useState)(false),
|
306
315
|
_useState24 = _slicedToArray(_useState23, 2),
|
307
316
|
fullscreenState = _useState24[0],
|
308
|
-
setFullscreenState = _useState24[1]; //
|
317
|
+
setFullscreenState = _useState24[1]; // 非全屏状态下的
|
318
|
+
|
319
|
+
|
320
|
+
var normalDataFilterFormRef = (0, _react.useRef)();
|
321
|
+
var fullscreenDataFilterFormRef = (0, _react.useRef)();
|
322
|
+
var normalDataFilterForm = normalDataFilterFormRef.current;
|
323
|
+
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
|
309
324
|
|
325
|
+
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
326
|
+
var dataFilterForm = dataFilterFormRef.current; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
310
327
|
|
311
328
|
var _useState25 = (0, _react.useState)(false),
|
312
329
|
_useState26 = _slicedToArray(_useState25, 2),
|
313
330
|
footerSuctionState = _useState26[0],
|
314
|
-
setFooterSuctionState = _useState26[1];
|
315
|
-
/** 筛选区域 form */
|
331
|
+
setFooterSuctionState = _useState26[1]; // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
316
332
|
|
317
333
|
|
318
|
-
var dataFilterForm = (0, _react.useMemo)(function () {
|
319
|
-
return (0, _form.createForm)();
|
320
|
-
}, []); // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
321
|
-
|
322
334
|
var getFooterSuctionState = function getFooterSuctionState() {
|
323
335
|
var containerDom = document.querySelector('.teamix-pro-page-container-scroll-container');
|
324
336
|
|
@@ -470,26 +482,24 @@ var ProTable = function ProTable(props) {
|
|
470
482
|
return _request(params);
|
471
483
|
},
|
472
484
|
request: function request(params) {
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
}
|
478
|
-
|
479
|
-
if (params === null || params === void 0 ? void 0 : params[targetPageSizeKey]) {
|
480
|
-
setPageSize(params[targetPageSizeKey]);
|
481
|
-
}
|
485
|
+
// 如果请求中还有翻页相关信息,需要自动设置到指定页
|
486
|
+
if (params === null || params === void 0 ? void 0 : params[targetPageKey]) {
|
487
|
+
setCurrentPage(params[targetPageKey]);
|
488
|
+
}
|
482
489
|
|
483
|
-
|
490
|
+
if (params === null || params === void 0 ? void 0 : params[targetPageSizeKey]) {
|
491
|
+
setPageSize(params[targetPageSizeKey]);
|
484
492
|
}
|
493
|
+
|
494
|
+
_request(params);
|
485
495
|
},
|
486
496
|
reset: function reset() {
|
487
|
-
var _actionRef$current3, _actionRef$current3$s;
|
497
|
+
var _actionRef$current3, _actionRef$current3$s, _dataFilterForm;
|
488
498
|
|
489
499
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
490
500
|
|
491
501
|
(_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setFilterRules) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, {});
|
492
|
-
dataFilterForm.reset();
|
502
|
+
(_dataFilterForm = dataFilterForm) === null || _dataFilterForm === void 0 ? void 0 : _dataFilterForm.reset();
|
493
503
|
setCurrentPage(1);
|
494
504
|
|
495
505
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -512,6 +522,8 @@ var ProTable = function ProTable(props) {
|
|
512
522
|
},
|
513
523
|
data: data,
|
514
524
|
dataFilterForm: dataFilterForm,
|
525
|
+
normalDataFilterForm: normalDataFilterForm,
|
526
|
+
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
515
527
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
|
516
528
|
getHeaderHeight().then(function (height) {
|
517
529
|
setHeaderHeight(height);
|
@@ -601,7 +613,7 @@ var ProTable = function ProTable(props) {
|
|
601
613
|
}); // 请求函数
|
602
614
|
|
603
615
|
function _request(params, noLoading) {
|
604
|
-
var _actionRef$current$ge, _actionRef$current4, _actionRef$current4$g, _objectSpread2;
|
616
|
+
var _dataFilterForm2, _actionRef$current$ge, _actionRef$current4, _actionRef$current4$g, _objectSpread2;
|
605
617
|
|
606
618
|
// 如果没有传 url 且没有 customRequest,直接返回
|
607
619
|
if (!url && !customRequest) {
|
@@ -614,7 +626,7 @@ var ProTable = function ProTable(props) {
|
|
614
626
|
|
615
627
|
var sortParams = targetFormatSort(sort); // 筛选区请求参数
|
616
628
|
|
617
|
-
var dataFilterParams = toJS(dataFilterForm.values); // 列过滤请求参数
|
629
|
+
var dataFilterParams = toJS((_dataFilterForm2 = dataFilterForm) === null || _dataFilterForm2 === void 0 ? void 0 : _dataFilterForm2.values); // 列过滤请求参数
|
618
630
|
|
619
631
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$g = _actionRef$current4.getFilterRules) === null || _actionRef$current4$g === void 0 ? void 0 : _actionRef$current4$g.call(_actionRef$current4)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
620
632
|
|
@@ -666,7 +678,8 @@ var ProTable = function ProTable(props) {
|
|
666
678
|
|
667
679
|
(0, _react.useEffect)(function () {
|
668
680
|
// 初始化 actionRef state、callback 此时 actionRef 已初始化完成
|
669
|
-
(0, _utils2.initActionRef)();
|
681
|
+
(0, _utils2.initActionRef)();
|
682
|
+
dataFilterForm = dataFilterFormRef.current; // 监听 浏览器变化 更吸底状态
|
670
683
|
|
671
684
|
if (footerSuction) {
|
672
685
|
getFooterSuctionState();
|
@@ -676,16 +689,21 @@ var ProTable = function ProTable(props) {
|
|
676
689
|
};
|
677
690
|
}
|
678
691
|
|
679
|
-
if (
|
680
|
-
|
681
|
-
|
692
|
+
if (propsDataFilter) {
|
693
|
+
var _dataFilterForm3;
|
694
|
+
|
695
|
+
if (requestWhenMount && ((_dataFilterForm3 = dataFilterForm) === null || _dataFilterForm3 === void 0 ? void 0 : _dataFilterForm3.id)) {
|
696
|
+
// 在请求发送之前 处理漏斗默认数据
|
697
|
+
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
682
698
|
|
683
|
-
|
699
|
+
_request();
|
700
|
+
}
|
701
|
+
} else {
|
702
|
+
if (requestWhenMount) {
|
703
|
+
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
684
704
|
|
685
|
-
|
686
|
-
|
687
|
-
var initialValues = toJS(dataFilterForm.initialValues);
|
688
|
-
searchValueRef.current = initialValues[searchName][1];
|
705
|
+
_request();
|
706
|
+
}
|
689
707
|
}
|
690
708
|
|
691
709
|
return function () {
|
@@ -699,7 +717,7 @@ var ProTable = function ProTable(props) {
|
|
699
717
|
|
700
718
|
actionRef.current = undefined;
|
701
719
|
};
|
702
|
-
}, []);
|
720
|
+
}, [(_dataFilterForm4 = dataFilterForm) === null || _dataFilterForm4 === void 0 ? void 0 : _dataFilterForm4.id]);
|
703
721
|
|
704
722
|
function onSort(dataIndex, order) {
|
705
723
|
var nextSort = _defineProperty({}, dataIndex, order);
|
@@ -707,62 +725,27 @@ var ProTable = function ProTable(props) {
|
|
707
725
|
setSort(nextSort);
|
708
726
|
|
709
727
|
_request(targetFormatSort(nextSort));
|
710
|
-
} //
|
711
|
-
|
712
|
-
|
713
|
-
var getSearchName = function getSearchName() {
|
714
|
-
var _dataFilter$schema;
|
715
|
-
|
716
|
-
if ((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.schema) && ((_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) > 0) {
|
717
|
-
var searchSchema = dataFilter.schema.find(function (item) {
|
718
|
-
return item.component === 'Search';
|
719
|
-
});
|
720
|
-
|
721
|
-
if (searchSchema) {
|
722
|
-
var searchName = searchSchema.name;
|
723
|
-
return searchName;
|
724
|
-
}
|
725
|
-
}
|
726
|
-
}; // 处理 dataFilter 中的 onFilter、onReset
|
728
|
+
} // 处理 dataFilter 中的 onFilter、onReset
|
727
729
|
|
728
730
|
|
729
731
|
var dataFilter = _objectSpread(_objectSpread({
|
730
732
|
mode: 'inline'
|
731
733
|
}, propsDataFilter), {}, {
|
732
|
-
onFilter:
|
733
|
-
|
734
|
-
|
735
|
-
if (dataFilterForm.validate()) {
|
736
|
-
var _actionRef$current5, _actionRef$current5$c;
|
737
|
-
|
738
|
-
/**
|
739
|
-
* 针对 inline 模式下的 Search 组件做特殊处理
|
740
|
-
* 当切换条件且输入内容为空的时候,类似[a, ''] => [b, ''] 不触发请求
|
741
|
-
*/
|
742
|
-
if (dataFilter.mode === 'inline') {
|
743
|
-
var searchName = getSearchName();
|
734
|
+
onFilter: function onFilter(values) {
|
735
|
+
var _actionRef$current5, _actionRef$current5$c;
|
744
736
|
|
745
|
-
|
746
|
-
var searchValue = values[searchName][1];
|
737
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
|
747
738
|
|
748
|
-
|
749
|
-
|
750
|
-
}
|
751
|
-
|
752
|
-
searchValueRef.current = searchValue;
|
753
|
-
}
|
754
|
-
} // 搜索变化时,暂时先清空选择
|
755
|
-
|
756
|
-
|
757
|
-
(_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$c = _actionRef$current5.clearRowSelection) === null || _actionRef$current5$c === void 0 ? void 0 : _actionRef$current5$c.call(_actionRef$current5);
|
758
|
-
setCurrentPage(1);
|
739
|
+
(_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$c = _actionRef$current5.clearRowSelection) === null || _actionRef$current5$c === void 0 ? void 0 : _actionRef$current5$c.call(_actionRef$current5);
|
740
|
+
setCurrentPage(1);
|
759
741
|
|
760
|
-
|
761
|
-
|
762
|
-
}, filterDebounce),
|
742
|
+
_request(_defineProperty({}, targetPageKey, 1));
|
743
|
+
},
|
763
744
|
onReset: function onReset() {
|
745
|
+
var _dataFilterForm5;
|
746
|
+
|
764
747
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
765
|
-
dataFilterForm.reset();
|
748
|
+
(_dataFilterForm5 = dataFilterForm) === null || _dataFilterForm5 === void 0 ? void 0 : _dataFilterForm5.reset();
|
766
749
|
setCurrentPage(1);
|
767
750
|
|
768
751
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -777,7 +760,7 @@ var ProTable = function ProTable(props) {
|
|
777
760
|
}
|
778
761
|
};
|
779
762
|
|
780
|
-
var renderTable = function renderTable() {
|
763
|
+
var renderTable = function renderTable(isFullScreen) {
|
781
764
|
if (propsColumns) {
|
782
765
|
return /*#__PURE__*/_react.default.createElement("div", {
|
783
766
|
className: (0, _classnames.default)('teamix-pro-table-container', className)
|
@@ -789,7 +772,7 @@ var ProTable = function ProTable(props) {
|
|
789
772
|
actionRef: actionRef,
|
790
773
|
columns: propsColumns,
|
791
774
|
dataFilter: dataFilter,
|
792
|
-
|
775
|
+
dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
|
793
776
|
rowSelection: rowSelection,
|
794
777
|
filterColumnType: filterColumnType
|
795
778
|
}), /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, _objectSpread({
|
@@ -831,7 +814,7 @@ var ProTable = function ProTable(props) {
|
|
831
814
|
|
832
815
|
var targetActions = footerAction.actions.map(function (action) {
|
833
816
|
return _objectSpread(_objectSpread({}, action), {}, {
|
834
|
-
disabled: action.disabled || selectedCount === 0
|
817
|
+
disabled: (action === null || action === void 0 ? void 0 : action.disabled) || selectedCount === 0
|
835
818
|
});
|
836
819
|
});
|
837
820
|
|
@@ -934,14 +917,16 @@ var ProTable = function ProTable(props) {
|
|
934
917
|
return /*#__PURE__*/_react.default.createElement(_Fullscreen.default, {
|
935
918
|
visible: fullscreenState,
|
936
919
|
actionRef: actionRef
|
937
|
-
},
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
920
|
+
}, function (isFullScreen) {
|
921
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
922
|
+
className: cls({
|
923
|
+
'': true,
|
924
|
+
fullscreen: fullscreenState // 'footer-suction': footerSuctionState && footerSuction,
|
925
|
+
|
926
|
+
}),
|
927
|
+
ref: tableRef
|
928
|
+
}, renderTable(isFullScreen), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter());
|
929
|
+
});
|
945
930
|
};
|
946
931
|
|
947
932
|
var _default = ProTable;
|
package/lib/table/typing.d.ts
CHANGED
@@ -56,6 +56,8 @@ export declare type ProTableColumnProps = {
|
|
56
56
|
dataIndex?: string | string[];
|
57
57
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
58
58
|
format?: string;
|
59
|
+
/** ProField 其他配置项 */
|
60
|
+
props?: any;
|
59
61
|
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
60
62
|
export declare type ProColumnProps = ProTableColumnProps;
|
61
63
|
export declare type ProTableProps = {
|
@@ -105,7 +107,10 @@ export declare type ProTableProps = {
|
|
105
107
|
footerAction?: ProActionGroupProps | React.ReactNode;
|
106
108
|
/** 表格底部(右层)配置 */
|
107
109
|
footer?: React.ReactNode;
|
108
|
-
/**
|
110
|
+
/**
|
111
|
+
* @deprecated 已废弃 建议用 dataFilter 中的 filterDebounce 代替
|
112
|
+
* 筛选区自动搜索的防抖时间(毫秒)
|
113
|
+
*/
|
109
114
|
filterDebounce?: number;
|
110
115
|
/** ProTable action 的引用,便于手动触发一些方法 */
|
111
116
|
actionRef?: React.MutableRefObject<ProTableActionType | undefined>;
|
@@ -125,6 +130,10 @@ export declare type ProTableProps = {
|
|
125
130
|
data: any[];
|
126
131
|
total?: number;
|
127
132
|
}>;
|
133
|
+
/** 默认漏斗过滤条件 */
|
134
|
+
defaultFilterParams?: {
|
135
|
+
[key: string]: any[] | any;
|
136
|
+
};
|
128
137
|
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
129
138
|
export declare type rowSelectionType = {
|
130
139
|
getProps?: (record: any, index: number) => any;
|
@@ -181,6 +190,8 @@ export declare type ProTableActionType = {
|
|
181
190
|
resetPage?: () => void;
|
182
191
|
/** 获取数据过滤区表单实例 */
|
183
192
|
dataFilterForm?: FormType;
|
193
|
+
normalDataFilterForm?: FormType;
|
194
|
+
fullscreenDataFilterForm?: FormType;
|
184
195
|
/** 表格当前的数据 */
|
185
196
|
data?: any[];
|
186
197
|
} & ProTableActionTypeMutations;
|
@@ -233,8 +244,8 @@ export declare type ProTableTopAreaProps = {
|
|
233
244
|
extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
|
234
245
|
/** 数据过滤区 */
|
235
246
|
dataFilter?: ProTableDataFilterProps;
|
236
|
-
/**
|
237
|
-
|
247
|
+
/** 传给 QueryFilter 的 formRef */
|
248
|
+
dataFilterFormRef?: any;
|
238
249
|
/** 排序、筛选列展示状态 */
|
239
250
|
filterColumnType?: 'dialog' | 'dropdown' | 'auto';
|
240
251
|
};
|
@@ -145,7 +145,8 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
|
|
145
145
|
}
|
146
146
|
|
147
147
|
var newRender = null;
|
148
|
-
var newDataSource = null;
|
148
|
+
var newDataSource = null;
|
149
|
+
var props = item.props; // 如果 render 直接传函数
|
149
150
|
|
150
151
|
if (typeof render === 'function') {
|
151
152
|
newRender = function newRender() {
|
@@ -153,6 +154,23 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
|
|
153
154
|
};
|
154
155
|
} else {
|
155
156
|
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
157
|
+
|
158
|
+
if (valueType === 'selectGroup') {
|
159
|
+
newRender = _objectSpread(_objectSpread({
|
160
|
+
maxShowNumber: 1,
|
161
|
+
foldText: 'more',
|
162
|
+
editOnClick: function editOnClick() {},
|
163
|
+
edit: true
|
164
|
+
}, newRender), {}, {
|
165
|
+
ellipsis: false
|
166
|
+
});
|
167
|
+
props = _objectSpread({
|
168
|
+
valueAlias: {
|
169
|
+
value: 'TagValue',
|
170
|
+
key: 'TagKey'
|
171
|
+
}
|
172
|
+
}, props);
|
173
|
+
}
|
156
174
|
} // 渲染操作组
|
157
175
|
|
158
176
|
|
@@ -195,13 +213,13 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
|
|
195
213
|
} // 渲染 ProField
|
196
214
|
|
197
215
|
|
198
|
-
return /*#__PURE__*/_react.default.createElement(_field.default, {
|
216
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread({
|
199
217
|
type: valueType || 'text',
|
200
218
|
value: value,
|
201
219
|
render: newRender,
|
202
220
|
dataSource: newDataSource,
|
203
221
|
format: format
|
204
|
-
});
|
222
|
+
}, props));
|
205
223
|
};
|
206
224
|
/**
|
207
225
|
* 处理 render 配置项是函数的情况
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProTableActionType } from '../typing';
|
3
|
+
import { ProTableProps, ProTableColumnProps } from '..';
|
3
4
|
export declare function initActionRef(): void;
|
4
5
|
/** table 组件内监听 不对外暴露 */
|
5
6
|
export declare function on(fun: any, key: string): void;
|
@@ -9,3 +10,9 @@ export declare function off(key: string): void;
|
|
9
10
|
export declare function emit(key: string, ...args: any): void;
|
10
11
|
export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
|
11
12
|
export declare function cloneDeep<T>(obj: T): T;
|
13
|
+
/**
|
14
|
+
* 处理默认过滤参数
|
15
|
+
* @param columns
|
16
|
+
* @param ref
|
17
|
+
*/
|
18
|
+
export declare function processDefaultFilter(columns: ProTableColumnProps[], ref: React.MutableRefObject<ProTableActionType | undefined>, defaultFilterParams: ProTableProps['defaultFilterParams']): void;
|
package/lib/table/utils/index.js
CHANGED
@@ -8,6 +8,7 @@ exports.emit = emit;
|
|
8
8
|
exports.initActionRef = initActionRef;
|
9
9
|
exports.off = off;
|
10
10
|
exports.on = on;
|
11
|
+
exports.processDefaultFilter = processDefaultFilter;
|
11
12
|
exports.useActionType = useActionType;
|
12
13
|
|
13
14
|
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
|
@@ -193,4 +194,41 @@ function useActionType(ref, action) {
|
|
193
194
|
|
194
195
|
function cloneDeep(obj) {
|
195
196
|
return (0, _lodash.default)(obj);
|
197
|
+
}
|
198
|
+
/**
|
199
|
+
* 处理默认过滤参数
|
200
|
+
* @param columns
|
201
|
+
* @param ref
|
202
|
+
*/
|
203
|
+
|
204
|
+
|
205
|
+
function processDefaultFilter(columns, ref, defaultFilterParams) {
|
206
|
+
columns.forEach(function (column) {
|
207
|
+
var _column$dataIndex$toS, _column$dataIndex;
|
208
|
+
|
209
|
+
var defaultRules = defaultFilterParams === null || defaultFilterParams === void 0 ? void 0 : defaultFilterParams[(_column$dataIndex$toS = column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()) !== null && _column$dataIndex$toS !== void 0 ? _column$dataIndex$toS : ''];
|
210
|
+
|
211
|
+
if (defaultRules) {
|
212
|
+
var _ref$current$getState, _ref$current, _ref$current$getState2, _ref$current$getState3, _ref$current2, _ref$current2$setFilt;
|
213
|
+
|
214
|
+
var params = '';
|
215
|
+
var rules = [];
|
216
|
+
|
217
|
+
if (Array.isArray(defaultRules)) {
|
218
|
+
params = defaultRules.join(',');
|
219
|
+
rules = defaultRules;
|
220
|
+
} else {
|
221
|
+
params = defaultRules;
|
222
|
+
rules = [defaultRules];
|
223
|
+
} // 需要带上其他所有的信息
|
224
|
+
|
225
|
+
|
226
|
+
var otherRules = (_ref$current$getState = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getState2 = _ref$current.getState) === null || _ref$current$getState2 === void 0 ? void 0 : (_ref$current$getState3 = _ref$current$getState2.call(_ref$current)) === null || _ref$current$getState3 === void 0 ? void 0 : _ref$current$getState3.filterRules) !== null && _ref$current$getState !== void 0 ? _ref$current$getState : {}; // 再设置所有的列筛选状态
|
227
|
+
|
228
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$setFilt = _ref$current2.setFilterRules) === null || _ref$current2$setFilt === void 0 ? void 0 : _ref$current2$setFilt.call(_ref$current2, _objectSpread(_objectSpread({}, otherRules), {}, _defineProperty({}, column.dataIndex, {
|
229
|
+
rules: rules,
|
230
|
+
params: params
|
231
|
+
})));
|
232
|
+
}
|
233
|
+
});
|
196
234
|
}
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
@@ -5,10 +5,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
+
var _exportNames = {};
|
8
9
|
exports.default = void 0;
|
9
10
|
|
10
11
|
var utils = _interopRequireWildcard(require("@teamix/utils"));
|
11
12
|
|
13
|
+
Object.keys(utils).forEach(function (key) {
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
16
|
+
if (key in exports && exports[key] === utils[key]) return;
|
17
|
+
Object.defineProperty(exports, key, {
|
18
|
+
enumerable: true,
|
19
|
+
get: function get() {
|
20
|
+
return utils[key];
|
21
|
+
}
|
22
|
+
});
|
23
|
+
});
|
24
|
+
|
12
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
13
26
|
|
14
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teamix/pro",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.29",
|
4
4
|
"description": "TeamixPro大包",
|
5
5
|
"repository": "http://gitlab.alibaba-inc.com/teamix/pro",
|
6
6
|
"author": "Velociraptor(迅猛龙)",
|
@@ -22,9 +22,9 @@
|
|
22
22
|
],
|
23
23
|
"private": false,
|
24
24
|
"dependencies": {
|
25
|
-
"@formily/core": "2.0.
|
26
|
-
"@formily/react": "2.0.
|
27
|
-
"@teamix/formily": "2.0.
|
25
|
+
"@formily/core": "2.0.8",
|
26
|
+
"@formily/react": "2.0.8",
|
27
|
+
"@teamix/formily": "2.0.8",
|
28
28
|
"@teamix/hooks": "^0.1.0",
|
29
29
|
"@teamix/pop-confirm": "^1.2.4",
|
30
30
|
"@teamix/pro-field": "^1.0.0",
|