@teamix/pro 1.2.31 → 1.2.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.
Files changed (89) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +16186 -16728
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog-form.js +58 -9
  6. package/es/common.scss +22 -0
  7. package/es/form/Filter/index.d.ts +5 -9
  8. package/es/form/Filter/index.js +489 -152
  9. package/es/form/Filter/index.scss +33 -11
  10. package/es/form/Filter/index2.d.ts +9 -5
  11. package/es/form/Filter/index2.js +154 -370
  12. package/es/form/Filter/index2.scss +11 -33
  13. package/es/form/Filter/useSpecialProps.d.ts +1 -1
  14. package/es/form/Filter/useSpecialProps.js +9 -9
  15. package/es/form/ProForm/index.js +4 -4
  16. package/es/form/ProForm/index.scss +5 -0
  17. package/es/form/SchemaForm/index.js +5 -5
  18. package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
  19. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  20. package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
  21. package/es/form/SchemaForm/initializeRequest.js +41 -5
  22. package/es/form/SchemaForm/reactions.d.ts +3 -3
  23. package/es/form/SchemaForm/reactions.js +39 -19
  24. package/es/form/index.d.ts +3 -3
  25. package/es/form/index.js +3 -3
  26. package/es/form/typing.d.ts +7 -1
  27. package/es/index.d.ts +1 -1
  28. package/es/index.js +1 -1
  29. package/es/info/components/InfoValueItem/index.js +38 -12
  30. package/es/info/components/InfoValueItem/index.scss +1 -0
  31. package/es/info/components/ProInfoItem/index.js +6 -3
  32. package/es/info/components/ProInfoItem/index.scss +9 -0
  33. package/es/info/components/baseInfo/index.js +2 -1
  34. package/es/info/components/headerInfo/index.js +2 -1
  35. package/es/info/components/tableInfo/index.js +2 -1
  36. package/es/info/index.scss +2 -0
  37. package/es/info/typing.d.ts +3 -0
  38. package/es/page-header/index.js +3 -3
  39. package/es/table/components/Layout/index.js +29 -23
  40. package/es/table/components/Layout/index.scss +7 -0
  41. package/es/table/components/ToolBar/Fullscreen.js +39 -15
  42. package/es/table/components/ToolBar/index.scss +1 -0
  43. package/es/table/index.js +63 -40
  44. package/es/table/typing.d.ts +3 -0
  45. package/es/table/utils/columnRender.js +1 -1
  46. package/lib/actions/dialog-form.js +57 -10
  47. package/lib/common.scss +22 -0
  48. package/lib/form/Filter/index.d.ts +5 -9
  49. package/lib/form/Filter/index.js +504 -154
  50. package/lib/form/Filter/index.scss +33 -11
  51. package/lib/form/Filter/index2.d.ts +9 -5
  52. package/lib/form/Filter/index2.js +154 -383
  53. package/lib/form/Filter/index2.scss +11 -33
  54. package/lib/form/Filter/useSpecialProps.d.ts +1 -1
  55. package/lib/form/Filter/useSpecialProps.js +8 -8
  56. package/lib/form/ProForm/index.js +4 -4
  57. package/lib/form/ProForm/index.scss +5 -0
  58. package/lib/form/SchemaForm/index.js +5 -5
  59. package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
  60. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  61. package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
  62. package/lib/form/SchemaForm/initializeRequest.js +41 -5
  63. package/lib/form/SchemaForm/reactions.d.ts +3 -3
  64. package/lib/form/SchemaForm/reactions.js +39 -19
  65. package/lib/form/index.d.ts +3 -3
  66. package/lib/form/index.js +8 -8
  67. package/lib/form/typing.d.ts +7 -1
  68. package/lib/index.d.ts +1 -1
  69. package/lib/index.js +1 -1
  70. package/lib/info/components/InfoValueItem/index.js +38 -12
  71. package/lib/info/components/InfoValueItem/index.scss +1 -0
  72. package/lib/info/components/ProInfoItem/index.js +6 -3
  73. package/lib/info/components/ProInfoItem/index.scss +9 -0
  74. package/lib/info/components/baseInfo/index.js +2 -1
  75. package/lib/info/components/headerInfo/index.js +2 -1
  76. package/lib/info/components/tableInfo/index.js +2 -1
  77. package/lib/info/index.scss +2 -0
  78. package/lib/info/typing.d.ts +3 -0
  79. package/lib/page-header/index.js +2 -2
  80. package/lib/table/components/Layout/index.js +29 -23
  81. package/lib/table/components/Layout/index.scss +7 -0
  82. package/lib/table/components/ToolBar/Fullscreen.js +37 -14
  83. package/lib/table/components/ToolBar/index.scss +1 -0
  84. package/lib/table/index.js +63 -40
  85. package/lib/table/typing.d.ts +3 -0
  86. package/lib/table/utils/columnRender.js +1 -1
  87. package/package.json +1 -1
  88. package/dist/212.js +0 -155705
  89. package/dist/fonts/codicon.ttf +0 -0
@@ -17,6 +17,15 @@ $item-padding-bottom: 8px;
17
17
  .teamix-pro-field-info-form-item {
18
18
  width: 100%;
19
19
  padding-bottom: $item-padding-bottom;
20
+
21
+ &-header-row {
22
+ display: flex;
23
+ align-items: center;
24
+ }
25
+ &-base-row {
26
+ display: flex;
27
+ align-items: center;
28
+ }
20
29
  }
21
30
 
22
31
  .teamix-pro-field-info-form-item-label {
@@ -92,7 +92,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
92
92
  infoItem: item,
93
93
  record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
94
94
  actionRef: actionRef,
95
- context: context
95
+ context: context,
96
+ props: item.props
96
97
  }),
97
98
  baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
98
99
  tooltip: item.tooltip,
@@ -68,7 +68,8 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
68
68
  dataSource: item.dataSource,
69
69
  infoItem: item,
70
70
  record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
71
- actionRef: actionRef
71
+ actionRef: actionRef,
72
+ props: item.props
72
73
  }),
73
74
  headerInfoLayout: layout !== null && layout !== void 0 ? layout : defaultLayout,
74
75
  tooltip: item.tooltip,
@@ -85,7 +85,8 @@ var ProTableInfo = function ProTableInfo(props) {
85
85
  dataSource: item.dataSource,
86
86
  infoItem: item,
87
87
  record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
88
- actionRef: actionRef
88
+ actionRef: actionRef,
89
+ props: item.props
89
90
  });
90
91
  };
91
92
 
@@ -1,4 +1,6 @@
1
+ @import '../common.scss';
1
2
  .teamix-pro-info {
3
+ @include hybridcloud-scrollbar;
2
4
  color: var(--color-brand1-6);
3
5
 
4
6
  .teamix-pro-info-content-row {
@@ -94,6 +94,8 @@ export interface ProInfoColumnsProps {
94
94
  actions?: ProActionButtonProps[];
95
95
  /** 追加在列后 */
96
96
  extra?: React.ReactNode;
97
+ /** 其他 ProField 配置 */
98
+ props?: any;
97
99
  }
98
100
  export declare type ProInfoActionType = {
99
101
  /** 刷新Info */
@@ -168,6 +170,7 @@ export declare type InfoValueItemProps = {
168
170
  render?: ProInfoCellRender;
169
171
  dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
170
172
  context?: object;
173
+ props?: any;
171
174
  } & Omit<ProFieldProps, 'render' | 'dataSource'>;
172
175
  export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
173
176
  /** ProInfoGroupContextProps */
@@ -88,8 +88,8 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
88
88
  var isColorPresetColor = (0, _utils.isPresetColor)(color);
89
89
  var isBgColorPresetColor = (0, _utils.isPresetColor)(backgroundColor);
90
90
  var className = (0, _classnames2.default)((_classnames = {}, _defineProperty(_classnames, "".concat((0, _utils.getColorClassName)(color)), isColorPresetColor), _defineProperty(_classnames, "".concat((0, _utils.getBackgroundColorClassName)(backgroundColor)), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
91
- var styleColor = isColorPresetColor ? undefined : color;
92
- var styleBgColor = isBgColorPresetColor ? undefined : backgroundColor;
91
+ var styleColor = isColorPresetColor ? (0, _utils.getColor)(color) : color;
92
+ var styleBgColor = isBgColorPresetColor ? (0, _utils.getColor)(color) : backgroundColor;
93
93
  var style = {
94
94
  color: styleColor,
95
95
  backgroundColor: styleBgColor
@@ -76,6 +76,19 @@ var Layout = function Layout(props) {
76
76
  context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
77
77
  })));
78
78
  } else return mainAction;
79
+ }; // 渲染 addonAfter
80
+
81
+
82
+ var renderAddonAfter = function renderAddonAfter() {
83
+ return /*#__PURE__*/_react.default.createElement("div", {
84
+ className: cls('addon-after-wrapper')
85
+ }, extra && !header && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
86
+ actionRef: actionRef,
87
+ quickAction: extra,
88
+ rowSelection: rowSelection
89
+ }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
90
+ actionRef: actionRef
91
+ }, otherProps)));
79
92
  }; // 渲染新版 QueryFilter
80
93
 
81
94
 
@@ -103,13 +116,7 @@ var Layout = function Layout(props) {
103
116
  },
104
117
  panelContent: dataFilter.content,
105
118
  addonBefore: renderMainAction(),
106
- addonAfter: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, extra && !header && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
107
- actionRef: actionRef,
108
- quickAction: extra,
109
- rowSelection: rowSelection
110
- }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
111
- actionRef: actionRef
112
- }, otherProps)))
119
+ addonAfter: renderAddonAfter()
113
120
  }, dataFilter));
114
121
  } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
115
122
  return /*#__PURE__*/_react.default.createElement(_form.QueryFilter, _objectSpread({
@@ -128,27 +135,18 @@ var Layout = function Layout(props) {
128
135
  (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
129
136
  },
130
137
  addonBefore: renderMainAction(),
131
- addonAfter: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, extra && !header && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
132
- actionRef: actionRef,
133
- quickAction: extra,
134
- rowSelection: rowSelection
135
- }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
136
- actionRef: actionRef
137
- }, otherProps)))
138
+ addonAfter: renderAddonAfter()
138
139
  }, dataFilter));
139
140
  }
140
141
  } else if (mainAction) {
141
142
  // 没传 dataFilter 但是传了 mainAction
142
143
  return /*#__PURE__*/_react.default.createElement(_form.QueryFilterLayout, {
143
- className: "mb8",
144
144
  addonBefore: renderMainAction(),
145
- addonAfter: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, extra && !header && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
146
- actionRef: actionRef,
147
- quickAction: extra,
148
- rowSelection: rowSelection
149
- }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
150
- actionRef: actionRef
151
- }, otherProps)))
145
+ addonAfter: renderAddonAfter()
146
+ });
147
+ } else {
148
+ return /*#__PURE__*/_react.default.createElement(_form.QueryFilterLayout, {
149
+ addonAfter: renderAddonAfter()
152
150
  });
153
151
  }
154
152
  }; // 区域组合渲染
@@ -168,11 +166,19 @@ var Layout = function Layout(props) {
168
166
  rowSelection: rowSelection
169
167
  }))), renderQueryFilter());
170
168
  } else if (header && !mainAction) {
169
+ var _dataFilter$schema3, _dataFilter$schema4;
170
+
171
171
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
172
172
  className: cls('wrapper')
173
173
  }, /*#__PURE__*/_react.default.createElement("div", {
174
174
  className: cls('left')
175
- }, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header)), renderQueryFilter())));
175
+ }, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header)), (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema3 = dataFilter.schema) === null || _dataFilter$schema3 === void 0 ? void 0 : _dataFilter$schema3.length) && renderQueryFilter()), /*#__PURE__*/_react.default.createElement("div", {
176
+ className: cls('right')
177
+ }, extra && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
178
+ actionRef: actionRef,
179
+ quickAction: extra,
180
+ rowSelection: rowSelection
181
+ }), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter())));
176
182
  } else if (!header && mainAction) {
177
183
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderQueryFilter());
178
184
  } else if (!header && !mainAction) {
@@ -37,4 +37,11 @@ $prefix: 'teamix-pro-table-layout';
37
37
  padding: 16px;
38
38
  background: var(--panel-filter-bg, var(--color-fill1-2));
39
39
  }
40
+ &-main-action {
41
+ margin-bottom: 8px;
42
+ }
43
+ &-addon-after-wrapper {
44
+ display: flex;
45
+ align-items: center;
46
+ }
40
47
  }
@@ -25,35 +25,58 @@ var FullScreen = function FullScreen(props) {
25
25
  actionRef = props.actionRef;
26
26
  var _actionRef$current = actionRef.current,
27
27
  normalDataFilterForm = _actionRef$current.normalDataFilterForm,
28
- fullscreenDataFilterForm = _actionRef$current.fullscreenDataFilterForm;
28
+ fullscreenDataFilterForm = _actionRef$current.fullscreenDataFilterForm,
29
+ filterEnableRef = _actionRef$current.filterEnableRef;
29
30
 
30
- function closeByESC(e) {
31
+ var closeByESC = function closeByESC(e) {
31
32
  if (visible && e.code === 'Escape') {
32
- var _actionRef$current2, _actionRef$current2$s, _actionRef$current3, _actionRef$current3$f;
33
+ var _actionRef$current2, _actionRef$current2$f;
33
34
 
34
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setFullScreenState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, false);
35
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$f = _actionRef$current3.fullScreen) === null || _actionRef$current3$f === void 0 ? void 0 : _actionRef$current3$f.call(_actionRef$current3);
35
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.fullScreen) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2);
36
36
  }
37
- } // 监听esc按钮
37
+ }; // 监听esc按钮
38
38
 
39
39
 
40
40
  (0, _react.useEffect)(function () {
41
- var _actionRef$current4, _actionRef$current4$s;
42
-
43
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFullScreenState) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, visible);
44
41
  window.addEventListener('keydown', closeByESC);
45
42
  return function () {
46
43
  window.removeEventListener('keydown', closeByESC);
47
44
  };
48
- }, [visible]);
45
+ }, [visible, actionRef]);
49
46
 
50
47
  var afterClose = function afterClose() {
51
- normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm.values);
48
+ // 判断全屏前后筛选表单值是否有改变
49
+ var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm.values));
50
+ var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm.values));
51
+
52
+ if (n === f) {
53
+ // 关闭全屏后,表单值未变化,开启普通表单onFilter
54
+ filterEnableRef.current.normal = true;
55
+ } else {
56
+ // 关闭全屏后,表单值有变化,修改表单值
57
+ normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm.values);
58
+ } // 关闭全屏后,关闭全屏表单onFilter
59
+
60
+
61
+ filterEnableRef.current.fullscreen = false;
52
62
  }; // 全屏开启之后
53
63
 
54
64
 
55
65
  var afterOpen = function afterOpen() {
56
- fullscreenDataFilterForm.setValues(normalDataFilterForm.values);
66
+ // 判断全屏前后筛选表单值是否有改变
67
+ var n = JSON.stringify((0, _utils.getValidValues)(normalDataFilterForm.values));
68
+ var f = JSON.stringify((0, _utils.getValidValues)(fullscreenDataFilterForm.values));
69
+
70
+ if (n === f) {
71
+ // 全屏后,表单值未变化,开启全屏表单onFilter
72
+ filterEnableRef.current.fullscreen = true;
73
+ } else {
74
+ // 全屏后,表单值变化,修改表单值
75
+ fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm.values);
76
+ } // 全屏后,关闭普通表单onFilter
77
+
78
+
79
+ filterEnableRef.current.normal = false; // 消息提示
57
80
 
58
81
  _components.Message.show({
59
82
  type: 'notice',
@@ -84,9 +107,9 @@ var FullScreen = function FullScreen(props) {
84
107
  zIndex: 999
85
108
  },
86
109
  onRequestClose: function onRequestClose() {
87
- var _actionRef$current5, _actionRef$current5$f;
110
+ var _actionRef$current3, _actionRef$current3$f;
88
111
 
89
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$f = _actionRef$current5.fullScreen) === null || _actionRef$current5$f === void 0 ? void 0 : _actionRef$current5$f.call(_actionRef$current5);
112
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$f = _actionRef$current3.fullScreen) === null || _actionRef$current3$f === void 0 ? void 0 : _actionRef$current3$f.call(_actionRef$current3);
90
113
  }
91
114
  }, /*#__PURE__*/_react.default.createElement("div", {
92
115
  className: "teamix-pro-table-full-screen"
@@ -1,6 +1,7 @@
1
1
  .teamix-pro-table-toolbar {
2
2
  width: 100%;
3
3
  text-align: right;
4
+ margin-bottom: 8px;
4
5
  }
5
6
  .teamix-pro-table-toolbar-custom {
6
7
  display: inline-block;
@@ -165,7 +165,7 @@ var globalFormatSort = function globalFormatSort(sort) {
165
165
  };
166
166
 
167
167
  var ProTable = function ProTable(props) {
168
- var _rowSelection$selecte, _dataFilterForm4;
168
+ var _rowSelection$selecte;
169
169
 
170
170
  var header = props.header,
171
171
  className = props.className,
@@ -331,16 +331,21 @@ 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;
340
345
  var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
341
346
 
342
- var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
343
- var dataFilterForm = dataFilterFormRef.current; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
347
+ var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
348
+ // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
344
349
 
345
350
  var _useState29 = (0, _react.useState)(false),
346
351
  _useState30 = _slicedToArray(_useState29, 2),
@@ -507,21 +512,24 @@ var ProTable = function ProTable(props) {
507
512
 
508
513
  (0, _utils2.useActionType)(actionRef, {
509
514
  fullScreen: function fullScreen() {
515
+ var _actionRef$current2, _actionRef$current2$s;
516
+
510
517
  var state = !fullscreenState; // 全屏时需要重新计算header高度
511
518
 
512
519
  getHeaderHeight().then(function (height) {
513
520
  setHeaderHeight(height);
514
521
  });
515
522
  setFullscreenState(state);
523
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'fullScreenState', state);
516
524
  return state;
517
525
  },
518
526
  setColumn: function setColumn(newColumns) {
519
- var _actionRef$current2, _actionRef$current2$s;
527
+ var _actionRef$current3, _actionRef$current3$s;
520
528
 
521
529
  var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
522
530
  var columns = processColumns(newColumns, propsColumns);
523
531
  setFilteredColumns(columns);
524
- (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'filterColumns', columns);
532
+ (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setState) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, 'filterColumns', columns);
525
533
 
526
534
  if (update) {
527
535
  (0, _utils2.emit)('refreshFilterState', newColumns);
@@ -546,12 +554,12 @@ var ProTable = function ProTable(props) {
546
554
  _request(params);
547
555
  },
548
556
  reset: function reset() {
549
- var _actionRef$current3, _actionRef$current3$s, _dataFilterForm;
557
+ var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
550
558
 
551
559
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
552
560
 
553
- (_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, {});
554
- (_dataFilterForm = dataFilterForm) === null || _dataFilterForm === void 0 ? void 0 : _dataFilterForm.reset();
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, {});
562
+ (_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
555
563
  setCurrentPage(1);
556
564
 
557
565
  _request(_defineProperty({}, targetPageKey, 1));
@@ -573,9 +581,11 @@ var ProTable = function ProTable(props) {
573
581
  pageSize: pageSize
574
582
  },
575
583
  data: data,
576
- dataFilterForm: dataFilterForm,
584
+ dataFilterForm: dataFilterFormRef.current,
585
+ dataFilterFormRef: dataFilterFormRef,
577
586
  normalDataFilterForm: normalDataFilterForm,
578
587
  fullscreenDataFilterForm: fullscreenDataFilterForm,
588
+ filterEnableRef: filterEnableRef,
579
589
  resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
580
590
  getHeaderHeight().then(function (height) {
581
591
  setHeaderHeight(height);
@@ -664,8 +674,8 @@ var ProTable = function ProTable(props) {
664
674
  }
665
675
  }); // 请求函数
666
676
 
667
- function _request(params, noLoading) {
668
- var _dataFilterForm2, _actionRef$current$ge, _actionRef$current4, _actionRef$current4$g, _objectSpread2;
677
+ function _request(params, noLoading, filterParams) {
678
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
669
679
 
670
680
  // 如果没有传 url 且没有 customRequest,直接返回
671
681
  if (!url && !customRequest) {
@@ -678,9 +688,9 @@ var ProTable = function ProTable(props) {
678
688
 
679
689
  var sortParams = targetFormatSort(sort); // 筛选区请求参数
680
690
 
681
- var dataFilterParams = toJS((_dataFilterForm2 = dataFilterForm) === null || _dataFilterForm2 === void 0 ? void 0 : _dataFilterForm2.values); // 列过滤请求参数
691
+ var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
682
692
 
683
- 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 : {}; // 格式化后的请求参数
693
+ 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 : {}; // 格式化后的请求参数
684
694
 
685
695
  var requestData = formatParams(_objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, targetPageKey, currentPage), _defineProperty(_objectSpread2, targetPageSizeKey, pageSize), _objectSpread2), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params));
686
696
 
@@ -729,31 +739,24 @@ var ProTable = function ProTable(props) {
729
739
  }
730
740
 
731
741
  (0, _react.useEffect)(function () {
732
- dataFilterForm = dataFilterFormRef.current; // 监听 浏览器变化 更吸底状态
742
+ var _propsDataFilter$sche, _propsDataFilter$sche2;
733
743
 
744
+ // 监听 浏览器变化 更吸底状态
734
745
  if (footerSuction) {
735
746
  getFooterSuctionState();
736
747
 
737
748
  window.onresize = function () {
738
749
  getFooterSuctionState();
739
750
  };
740
- }
751
+ } // 如果不传 dataFilter,则在这里初始化请求
741
752
 
742
- if (propsDataFilter) {
743
- var _dataFilterForm3;
744
753
 
745
- if (requestWhenMount && ((_dataFilterForm3 = dataFilterForm) === null || _dataFilterForm3 === void 0 ? void 0 : _dataFilterForm3.id)) {
746
- // 在请求发送之前 处理漏斗默认数据
747
- (0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
754
+ 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;
748
755
 
749
- _request();
750
- }
751
- } else {
752
- if (requestWhenMount) {
753
- (0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
756
+ if (requestWhenMount && !hasDataFilter) {
757
+ (0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
754
758
 
755
- _request();
756
- }
759
+ _request();
757
760
  }
758
761
 
759
762
  return function () {
@@ -767,7 +770,7 @@ var ProTable = function ProTable(props) {
767
770
 
768
771
  actionRef.current = undefined;
769
772
  };
770
- }, [(_dataFilterForm4 = dataFilterForm) === null || _dataFilterForm4 === void 0 ? void 0 : _dataFilterForm4.id]);
773
+ }, []);
771
774
 
772
775
  function onSort(dataIndex, order) {
773
776
  var nextSort = _defineProperty({}, dataIndex, order);
@@ -781,24 +784,44 @@ var ProTable = function ProTable(props) {
781
784
  var dataFilter = _objectSpread(_objectSpread({
782
785
  mode: 'inline'
783
786
  }, propsDataFilter), {}, {
787
+ onInit: function onInit(values) {
788
+ // 表单初始化请求处理
789
+ console.log('onInit');
790
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit(values));
791
+ !fullscreenState && _request({}, false, values);
792
+ return true;
793
+ },
784
794
  onFilter: function onFilter(values) {
785
- var _actionRef$current5, _actionRef$current5$c;
795
+ var _actionRef$current6, _actionRef$current6$c;
796
+
797
+ console.log('onFilter'); // 全屏状态,判断全屏表单onFilter是否禁用
798
+
799
+ if (fullscreenState && !filterEnableRef.current.fullscreen) {
800
+ filterEnableRef.current.fullscreen = true;
801
+ return;
802
+ } // 非全屏状态,判断普通表单onFiler是否禁用
803
+
804
+
805
+ if (!fullscreenState && !filterEnableRef.current.normal) {
806
+ filterEnableRef.current.normal = true;
807
+ return;
808
+ }
786
809
 
787
810
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
788
811
 
789
- (_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);
812
+ (_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);
790
813
  setCurrentPage(1);
791
814
 
792
- _request(_defineProperty({}, targetPageKey, 1));
815
+ _request(_defineProperty({}, targetPageKey, 1), false, values);
793
816
  },
794
- onReset: function onReset() {
795
- var _dataFilterForm5;
817
+ onReset: function onReset(values) {
818
+ var _dataFilterFormRef$cu3;
796
819
 
797
820
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
798
- (_dataFilterForm5 = dataFilterForm) === null || _dataFilterForm5 === void 0 ? void 0 : _dataFilterForm5.reset();
821
+ (_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
799
822
  setCurrentPage(1);
800
823
 
801
- _request(_defineProperty({}, targetPageKey, 1));
824
+ _request(_defineProperty({}, targetPageKey, 1), false, values);
802
825
  }
803
826
  });
804
827
 
@@ -882,21 +905,21 @@ var ProTable = function ProTable(props) {
882
905
 
883
906
  var renderFooter = function renderFooter() {
884
907
  function onChangePagination(currentPage) {
885
- var _actionRef$current6, _actionRef$current6$c;
908
+ var _actionRef$current7, _actionRef$current7$c;
886
909
 
887
910
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
888
911
  // 翻页暂时先清空选择
889
- (_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);
912
+ (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
890
913
  setCurrentPage(currentPage);
891
914
 
892
915
  _request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
893
916
  }
894
917
 
895
918
  function onChangePaginationSize(currentPageSize) {
896
- var _actionRef$current7, _actionRef$current7$c, _request5;
919
+ var _actionRef$current8, _actionRef$current8$c, _request5;
897
920
 
898
921
  // 翻页暂时先清空选择
899
- (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
922
+ (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
900
923
  setPageSize(currentPageSize);
901
924
  setCurrentPage(1);
902
925
 
@@ -190,8 +190,11 @@ export declare type ProTableActionType = {
190
190
  resetPage?: () => void;
191
191
  /** 获取数据过滤区表单实例 */
192
192
  dataFilterForm?: FormType;
193
+ /** 用于在 mount 的时候获取到表单 ref */
194
+ dataFilterFormRef?: React.MutableRefObject<FormType>;
193
195
  normalDataFilterForm?: FormType;
194
196
  fullscreenDataFilterForm?: FormType;
197
+ filterEnableRef?: any;
195
198
  /** 表格当前的数据 */
196
199
  data?: any[];
197
200
  } & ProTableActionTypeMutations;
@@ -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],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.31",
3
+ "version": "1.2.35",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",