@teamix/pro 1.2.33 → 1.2.34
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/pro.css +1 -1
- package/dist/pro.js +16214 -15977
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/form/Filter/index.js +94 -38
- package/es/form/ProForm/index.js +4 -4
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +41 -5
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +13 -6
- package/es/form/typing.d.ts +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/table/components/ToolBar/Fullscreen.js +32 -4
- package/es/table/index.js +43 -28
- package/es/table/typing.d.ts +1 -0
- package/es/table/utils/columnRender.js +1 -1
- package/lib/form/Filter/index.js +93 -37
- package/lib/form/ProForm/index.js +4 -4
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +41 -5
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +13 -6
- package/lib/form/typing.d.ts +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/ToolBar/Fullscreen.js +30 -3
- package/lib/table/index.js +43 -28
- package/lib/table/typing.d.ts +1 -0
- package/lib/table/utils/columnRender.js +1 -1
- package/package.json +1 -1
package/lib/table/index.js
CHANGED
@@ -165,7 +165,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
165
165
|
};
|
166
166
|
|
167
167
|
var ProTable = function ProTable(props) {
|
168
|
-
var _rowSelection$selecte
|
168
|
+
var _rowSelection$selecte;
|
169
169
|
|
170
170
|
var header = props.header,
|
171
171
|
className = props.className,
|
@@ -331,9 +331,14 @@ var ProTable = function ProTable(props) {
|
|
331
331
|
var _useState27 = (0, _react.useState)(false),
|
332
332
|
_useState28 = _slicedToArray(_useState27, 2),
|
333
333
|
fullscreenState = _useState28[0],
|
334
|
-
setFullscreenState = _useState28[1]; //
|
334
|
+
setFullscreenState = _useState28[1]; // 切换全屏搜索开关
|
335
335
|
|
336
336
|
|
337
|
+
var filterEnableRef = (0, _react.useRef)({
|
338
|
+
fullscreen: false,
|
339
|
+
normal: true
|
340
|
+
}); // 非全屏状态下的
|
341
|
+
|
337
342
|
var normalDataFilterFormRef = (0, _react.useRef)();
|
338
343
|
var fullscreenDataFilterFormRef = (0, _react.useRef)();
|
339
344
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
@@ -549,12 +554,12 @@ var ProTable = function ProTable(props) {
|
|
549
554
|
_request(params);
|
550
555
|
},
|
551
556
|
reset: function reset() {
|
552
|
-
var _actionRef$current4, _actionRef$current4$s
|
557
|
+
var _actionRef$current4, _actionRef$current4$s;
|
553
558
|
|
554
559
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
555
560
|
|
556
561
|
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, {});
|
557
|
-
|
562
|
+
dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
|
558
563
|
setCurrentPage(1);
|
559
564
|
|
560
565
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -579,6 +584,7 @@ var ProTable = function ProTable(props) {
|
|
579
584
|
dataFilterForm: dataFilterForm,
|
580
585
|
normalDataFilterForm: normalDataFilterForm,
|
581
586
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
587
|
+
filterEnableRef: filterEnableRef,
|
582
588
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
|
583
589
|
getHeaderHeight().then(function (height) {
|
584
590
|
setHeaderHeight(height);
|
@@ -667,8 +673,8 @@ var ProTable = function ProTable(props) {
|
|
667
673
|
}
|
668
674
|
}); // 请求函数
|
669
675
|
|
670
|
-
function _request(params, noLoading) {
|
671
|
-
var
|
676
|
+
function _request(params, noLoading, filterParams) {
|
677
|
+
var _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
672
678
|
|
673
679
|
// 如果没有传 url 且没有 customRequest,直接返回
|
674
680
|
if (!url && !customRequest) {
|
@@ -681,7 +687,7 @@ var ProTable = function ProTable(props) {
|
|
681
687
|
|
682
688
|
var sortParams = targetFormatSort(sort); // 筛选区请求参数
|
683
689
|
|
684
|
-
var dataFilterParams =
|
690
|
+
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values; // 列过滤请求参数
|
685
691
|
|
686
692
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
687
693
|
|
@@ -732,31 +738,24 @@ var ProTable = function ProTable(props) {
|
|
732
738
|
}
|
733
739
|
|
734
740
|
(0, _react.useEffect)(function () {
|
735
|
-
|
741
|
+
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
736
742
|
|
743
|
+
// 监听 浏览器变化 更吸底状态
|
737
744
|
if (footerSuction) {
|
738
745
|
getFooterSuctionState();
|
739
746
|
|
740
747
|
window.onresize = function () {
|
741
748
|
getFooterSuctionState();
|
742
749
|
};
|
743
|
-
}
|
750
|
+
} // 如果不传 dataFilter,则在这里初始化请求
|
744
751
|
|
745
|
-
if (propsDataFilter) {
|
746
|
-
var _dataFilterForm3;
|
747
752
|
|
748
|
-
|
749
|
-
// 在请求发送之前 处理漏斗默认数据
|
750
|
-
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
753
|
+
var hasDataFilter = (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche = propsDataFilter.schema) === null || _propsDataFilter$sche === void 0 ? void 0 : _propsDataFilter$sche.length) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche2 = propsDataFilter.schema) === null || _propsDataFilter$sche2 === void 0 ? void 0 : _propsDataFilter$sche2.length) > 0;
|
751
754
|
|
752
|
-
|
753
|
-
|
754
|
-
} else {
|
755
|
-
if (requestWhenMount) {
|
756
|
-
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
755
|
+
if (requestWhenMount && !hasDataFilter) {
|
756
|
+
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
757
757
|
|
758
|
-
|
759
|
-
}
|
758
|
+
_request();
|
760
759
|
}
|
761
760
|
|
762
761
|
return function () {
|
@@ -770,7 +769,7 @@ var ProTable = function ProTable(props) {
|
|
770
769
|
|
771
770
|
actionRef.current = undefined;
|
772
771
|
};
|
773
|
-
}, [
|
772
|
+
}, []);
|
774
773
|
|
775
774
|
function onSort(dataIndex, order) {
|
776
775
|
var nextSort = _defineProperty({}, dataIndex, order);
|
@@ -784,24 +783,40 @@ var ProTable = function ProTable(props) {
|
|
784
783
|
var dataFilter = _objectSpread(_objectSpread({
|
785
784
|
mode: 'inline'
|
786
785
|
}, propsDataFilter), {}, {
|
786
|
+
onInit: function onInit(values) {
|
787
|
+
// 表单初始化请求处理
|
788
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit(values));
|
789
|
+
!fullscreenState && _request({}, false, values);
|
790
|
+
return true;
|
791
|
+
},
|
787
792
|
onFilter: function onFilter(values) {
|
788
793
|
var _actionRef$current6, _actionRef$current6$c;
|
789
794
|
|
795
|
+
// 全屏状态,判断全屏表单onFilter是否禁用
|
796
|
+
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
797
|
+
filterEnableRef.current.fullscreen = true;
|
798
|
+
return;
|
799
|
+
} // 非全屏状态,判断普通表单onFiler是否禁用
|
800
|
+
|
801
|
+
|
802
|
+
if (!fullscreenState && !filterEnableRef.current.normal) {
|
803
|
+
filterEnableRef.current.normal = true;
|
804
|
+
return;
|
805
|
+
}
|
806
|
+
|
790
807
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
|
791
808
|
|
792
809
|
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
|
793
810
|
setCurrentPage(1);
|
794
811
|
|
795
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
812
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
796
813
|
},
|
797
|
-
onReset: function onReset() {
|
798
|
-
var _dataFilterForm5;
|
799
|
-
|
814
|
+
onReset: function onReset(values) {
|
800
815
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
801
|
-
|
816
|
+
dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
|
802
817
|
setCurrentPage(1);
|
803
818
|
|
804
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
819
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
805
820
|
}
|
806
821
|
});
|
807
822
|
|
package/lib/table/typing.d.ts
CHANGED
@@ -239,7 +239,7 @@ var processRenderFunction = function processRenderFunction() {
|
|
239
239
|
var index = arguments.length > 2 ? arguments[2] : undefined;
|
240
240
|
var record = arguments.length > 3 ? arguments[3] : undefined;
|
241
241
|
// 当 ProField render 类型为 function 时。需要表格预先处理以塞入 record
|
242
|
-
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick'];
|
242
|
+
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
243
243
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
244
244
|
var _ref4 = _slicedToArray(_ref3, 2),
|
245
245
|
k = _ref4[0],
|