@teamix/pro 1.2.27 → 1.2.31

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 (45) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +250 -202
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/index.d.ts +2 -3
  6. package/es/actions/index.js +15 -19
  7. package/es/form/Filter/SimpleFilter.js +10 -3
  8. package/es/form/typing.d.ts +1 -1
  9. package/es/index.d.ts +1 -1
  10. package/es/index.js +1 -1
  11. package/es/info/components/baseInfo/index.js +2 -1
  12. package/es/table/components/Filter/index.js +6 -6
  13. package/es/table/components/Layout/index.js +18 -3
  14. package/es/table/index.js +92 -29
  15. package/es/table/index.scss +4 -0
  16. package/es/table/typing.d.ts +2 -2
  17. package/es/table/utils/columnRender.js +1 -1
  18. package/es/table/utils/index.d.ts +2 -1
  19. package/es/table/utils/index.js +62 -113
  20. package/lib/actions/index.d.ts +2 -3
  21. package/lib/actions/index.js +15 -19
  22. package/lib/form/Filter/SimpleFilter.js +8 -1
  23. package/lib/form/typing.d.ts +1 -1
  24. package/lib/index.d.ts +1 -1
  25. package/lib/index.js +1 -1
  26. package/lib/info/components/baseInfo/index.js +2 -1
  27. package/lib/table/components/Filter/index.js +6 -6
  28. package/lib/table/components/Layout/index.js +18 -3
  29. package/lib/table/index.js +91 -28
  30. package/lib/table/index.scss +4 -0
  31. package/lib/table/typing.d.ts +2 -2
  32. package/lib/table/utils/columnRender.js +1 -1
  33. package/lib/table/utils/index.d.ts +2 -1
  34. package/lib/table/utils/index.js +63 -112
  35. package/package.json +1 -1
  36. package/es/form/Components/SelectTable/index.d.ts +0 -24
  37. package/es/form/Components/SelectTable/index.js +0 -135
  38. package/es/form/Components/SelectTable/index.scss +0 -28
  39. package/es/form/Components/SelectTable/table.d.ts +0 -6
  40. package/es/form/Components/SelectTable/table.js +0 -64
  41. package/lib/form/Components/SelectTable/index.d.ts +0 -24
  42. package/lib/form/Components/SelectTable/index.js +0 -157
  43. package/lib/form/Components/SelectTable/index.scss +0 -28
  44. package/lib/form/Components/SelectTable/table.d.ts +0 -6
  45. package/lib/form/Components/SelectTable/table.js +0 -76
@@ -16,129 +16,76 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import cloneDeepLodash from 'lodash.clonedeep'; // 组件内全局状态 每次初始化 ActionRef 会重新深拷贝对象
20
-
21
- var state = {
22
- fullScreenState: false,
23
- filterRules: {},
24
- filterColumns: []
25
- };
26
-
27
- var _initState = cloneDeepLodash(state); // state监听事件 每次初始化 ActionRef 会重新深拷贝对象
28
-
29
-
30
- var callback = {
31
- fullScreenState: {}
32
- };
33
- var initCallback = cloneDeepLodash(callback); // 所有 ProTable 组件公用一套组件内事件转发机制
34
-
35
- var tableCallback = {}; // 组件内监听事件
36
- // 组件内对全局状态的更改
37
-
38
- var mutations = {
39
- getState: function getState() {
40
- return state;
41
- },
42
- setState: function setState(key, value) {
43
- state[key] = value;
44
- useOn(key, value);
45
-
46
- if (mutations.hasOwnProperty(key)) {
47
- mutations[key] = value;
48
- }
49
- },
50
- initState: function initState() {
51
- state = cloneDeepLodash(_initState);
52
- },
53
- filterColumns: state.filterColumns,
54
- setFullScreenState: function setFullScreenState(fullScreenState) {
55
- state.fullScreenState = fullScreenState;
56
- useOn('fullScreenState', fullScreenState);
57
- },
58
-
59
- /**
60
- * 设置筛选列规则
61
- * @param rules 规则
62
- * @param dataIndex column.dataIndex
63
- */
64
- setFilterRules: function setFilterRules(rules) {
65
- state.filterRules = rules;
66
- },
67
-
68
- /**
69
- * 获取筛选规则。为params
70
- */
71
- getFilterRules: function getFilterRules() {
72
- var result = {};
73
-
74
- if (state.filterRules) {
75
- result = Object.entries(state.filterRules).map(function (_ref) {
76
- var _ref2 = _slicedToArray(_ref, 2),
77
- k = _ref2[0],
78
- v = _ref2[1];
79
-
80
- return _defineProperty({}, k, v.params);
81
- }).reduce(function (acc, cur) {
82
- acc = _objectSpread(_objectSpread({}, acc), cur);
83
- return acc;
84
- }, {});
85
- }
19
+ import cloneDeepLodash from 'lodash.clonedeep'; // 所有 ProTable 组件公用一套组件内事件转发机制
20
+
21
+ var tableCallback = {}; // 组件内对全局状态的更改
22
+
23
+ var getMutations = function getMutations(actionRef) {
24
+ var _actionRef$current2, _actionRef$current2$g, _actionRef$current2$g2;
25
+
26
+ return {
27
+ setFullScreenState: function setFullScreenState(fullScreenState) {
28
+ var _actionRef$current, _actionRef$current$se;
29
+
30
+ (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setState) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, 'fullScreenState', fullScreenState);
31
+ },
32
+ filterColumns: (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$g = _actionRef$current2.getState) === null || _actionRef$current2$g === void 0 ? void 0 : (_actionRef$current2$g2 = _actionRef$current2$g.call(_actionRef$current2)) === null || _actionRef$current2$g2 === void 0 ? void 0 : _actionRef$current2$g2.filterColumns,
33
+
34
+ /**
35
+ * 设置筛选列规则
36
+ * @param rules 规则
37
+ * @param dataIndex column.dataIndex
38
+ */
39
+ setFilterRules: function setFilterRules(rules) {
40
+ var _actionRef$current3, _actionRef$current3$s;
41
+
42
+ (_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, 'filterRules', rules);
43
+ },
44
+
45
+ /**
46
+ * 获取筛选规则。为params
47
+ */
48
+ getFilterRules: function getFilterRules() {
49
+ var _actionRef$current4, _actionRef$current4$g;
50
+
51
+ var result = {};
52
+ var filterRules = (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$g = _actionRef$current4.getState) === null || _actionRef$current4$g === void 0 ? void 0 : _actionRef$current4$g.call(_actionRef$current4).filterRules;
53
+
54
+ if (filterRules) {
55
+ result = Object.entries(filterRules).map(function (_ref) {
56
+ var _ref2 = _slicedToArray(_ref, 2),
57
+ k = _ref2[0],
58
+ v = _ref2[1];
59
+
60
+ return _defineProperty({}, k, v.params);
61
+ }).reduce(function (acc, cur) {
62
+ acc = _objectSpread(_objectSpread({}, acc), cur);
63
+ return acc;
64
+ }, {});
65
+ }
86
66
 
87
- return result;
88
- },
89
-
90
- /**
91
- * 绑定监听函数
92
- * @param fun 监听函数
93
- * @param state 需要监听的state
94
- * @param name 监听名(作为销毁唯一id使用)
95
- */
96
- on: function on(fun, state, name) {
97
- if (!callback[state]) {
98
- callback[state] = {};
67
+ return result;
99
68
  }
100
-
101
- callback[state][name] = fun;
102
- },
103
- off: function off(name) {
104
- callback = Object.fromEntries(Object.entries(callback).map(function (_ref4) {
105
- var _ref5 = _slicedToArray(_ref4, 2),
106
- k = _ref5[0],
107
- v = _ref5[1];
108
-
109
- var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref6) {
110
- var _ref7 = _slicedToArray(_ref6, 1),
111
- k = _ref7[0];
112
-
113
- return k !== name;
114
- }));
115
- return [k, filterV];
116
- }));
117
- }
69
+ };
118
70
  }; // 调用绑定的监听函数
119
71
 
120
- var useOn = function useOn(state) {
121
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
122
- args[_key - 1] = arguments[_key];
72
+
73
+ export function actionRefUseStateOn(callback, state) {
74
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
75
+ args[_key - 2] = arguments[_key];
123
76
  }
124
77
 
125
78
  if (callback[state]) {
126
- Object.entries(callback[state]).forEach(function (_ref8) {
127
- var _ref9 = _slicedToArray(_ref8, 2),
128
- k = _ref9[0],
129
- v = _ref9[1];
79
+ Object.entries(callback[state]).forEach(function (_ref4) {
80
+ var _ref5 = _slicedToArray(_ref4, 2),
81
+ k = _ref5[0],
82
+ v = _ref5[1];
130
83
 
131
84
  if (v) {
132
85
  v === null || v === void 0 ? void 0 : v.apply(void 0, args);
133
86
  }
134
87
  });
135
88
  }
136
- }; // 初始化 actionRef
137
-
138
-
139
- export function initActionRef() {
140
- state = cloneDeepLodash(_initState);
141
- callback = cloneDeepLodash(initCallback);
142
89
  }
143
90
  /** table 组件内监听 不对外暴露 */
144
91
 
@@ -165,12 +112,14 @@ export function emit(key) {
165
112
  fun.apply(void 0, args);
166
113
  }
167
114
  }
168
- export function useActionType(ref, action) {
169
- // 合并自定义事件
170
- var userAction = _objectSpread(_objectSpread({}, action), mutations);
115
+ export function initActionRef(ref, action) {
116
+ var userAction = _objectSpread(_objectSpread({}, action), getMutations(ref));
171
117
 
172
118
  ref.current = userAction;
173
119
  }
120
+ export function useActionType(ref, action) {
121
+ ref.current = _objectSpread(_objectSpread({}, ref.current), action);
122
+ }
174
123
  export function cloneDeep(obj) {
175
124
  return cloneDeepLodash(obj);
176
125
  }
@@ -41,6 +41,7 @@ export interface ProActionCommonProps {
41
41
  export interface ProActionMenuButtonProps extends ProActionCommonProps, Omit<MenuButtonProps, 'visible'> {
42
42
  actions: ProActionProps[];
43
43
  icon?: string;
44
+ noArrow?: boolean;
44
45
  }
45
46
  export declare const ProActionMenuButton: (props: ProActionMenuButtonProps) => JSX.Element;
46
47
  export interface ProActionDividerProps extends ProActionCommonProps {
@@ -61,9 +62,7 @@ export declare type ProActionGroupProps = {
61
62
  */
62
63
  moreText?: string;
63
64
  /** 更多按钮的配置,只有在actions数量超过max时才有效 */
64
- more?: string | (ProActionButtonProps & {
65
- noArrow?: boolean;
66
- });
65
+ more?: string | Omit<ProActionMenuButtonProps, 'actions'>;
67
66
  /** 是否有分割线,只有type="text"时生效,默认有分割线 */
68
67
  divider?: boolean;
69
68
  } & React.HTMLAttributes<HTMLElement>;
@@ -56,12 +56,11 @@ require("./index.scss");
56
56
  var _excluded = ["type"],
57
57
  _excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
58
58
  _excluded3 = ["loading"],
59
- _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
59
+ _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
60
60
  _excluded5 = ["context", "text"],
61
- _excluded6 = ["noArrow", "className"],
62
- _excluded7 = ["key", "actions"],
63
- _excluded8 = ["key", "config"],
64
- _excluded9 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
61
+ _excluded6 = ["key", "actions"],
62
+ _excluded7 = ["key", "config"],
63
+ _excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
65
64
 
66
65
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
67
66
 
@@ -282,6 +281,8 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
282
281
  context = props.context,
283
282
  _props$type2 = props.type,
284
283
  type = _props$type2 === void 0 ? 'primary' : _props$type2,
284
+ className = props.className,
285
+ noArrow = props.noArrow,
285
286
  others = _objectWithoutProperties(props, _excluded4);
286
287
 
287
288
  return /*#__PURE__*/_react.default.createElement(_components.MenuButton, _objectSpread({
@@ -295,7 +296,10 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
295
296
  v2: true
296
297
  },
297
298
  type: type,
298
- label: buttonContent(label || children, icon, iconSize, context)
299
+ label: buttonContent(label || children, icon, iconSize, context),
300
+ className: (0, _classnames.default)(className, {
301
+ 'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
302
+ })
299
303
  }, others), actions.map(function (action, i) {
300
304
  return renderCommonActionButtonMenuItem(action, action.key || i, context);
301
305
  }));
@@ -358,14 +362,12 @@ function renderCommonActionButton(button, context, isTypeText) {
358
362
  }
359
363
 
360
364
  function getDefaultMoreButton(type, more) {
361
- var noArrowClassName = 'teamix-pro-actions-text-menu-btn-no-arrow';
362
365
  var defaultConfig = type === 'button' ? {
363
366
  children: (0, _utils.getMessage)('more')
364
367
  } : {
365
368
  icon: 'more-line',
366
- // iconSize: 'small',
367
369
  autoWidth: false,
368
- className: noArrowClassName
370
+ noArrow: true
369
371
  };
370
372
 
371
373
  if (!more) {
@@ -380,13 +382,7 @@ function getDefaultMoreButton(type, more) {
380
382
  return Object.assign(defaultConfig, moreConfig);
381
383
  }
382
384
 
383
- var noArrow = moreConfig.noArrow,
384
- className = moreConfig.className,
385
- others = _objectWithoutProperties(moreConfig, _excluded6);
386
-
387
- return _objectSpread({
388
- className: (0, _classnames.default)(className, _defineProperty({}, "".concat(noArrowClassName), noArrow))
389
- }, others);
385
+ return moreConfig;
390
386
  }
391
387
 
392
388
  var MAX_ACTTIONS = 4;
@@ -403,7 +399,7 @@ function getActionConfig(action, index, context) {
403
399
  if (action.actions) {
404
400
  var _key = action.key,
405
401
  actions = action.actions,
406
- _others = _objectWithoutProperties(action, _excluded7);
402
+ _others = _objectWithoutProperties(action, _excluded6);
407
403
 
408
404
  return _objectSpread({
409
405
  key: getKey(index, _key),
@@ -415,7 +411,7 @@ function getActionConfig(action, index, context) {
415
411
 
416
412
  var key = action.key,
417
413
  config = action.config,
418
- others = _objectWithoutProperties(action, _excluded8);
414
+ others = _objectWithoutProperties(action, _excluded7);
419
415
 
420
416
  return _objectSpread({
421
417
  key: getKey(index, key),
@@ -436,7 +432,7 @@ function ProActionGroup(props) {
436
432
  _props$actions = props.actions,
437
433
  actions = _props$actions === void 0 ? [] : _props$actions,
438
434
  className = props.className,
439
- containerProps = _objectWithoutProperties(props, _excluded9);
435
+ containerProps = _objectWithoutProperties(props, _excluded8);
440
436
 
441
437
  var isTypeText = type === 'text';
442
438
  var filteredActions = actions.map(function (action, index) {
@@ -35,7 +35,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
35
35
 
36
36
  // 初始化Search组件,内置部分属性
37
37
  var initializeSearch = function initializeSearch(schema) {
38
- var searchName;
38
+ var searchName = '';
39
39
  var initializedSchema = schema.map(function (item) {
40
40
  if (item.component === 'Search') {
41
41
  searchName = item.name;
@@ -104,6 +104,13 @@ var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
104
104
  onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
105
105
  }
106
106
  }, [searchName, searchValue.current]);
107
+ (0, _react.useEffect)(function () {
108
+ var _props$form$initialVa, _props$form$initialVa2;
109
+
110
+ // 处理Search组件,缓存input的默认值
111
+ var searchDefaultValue = (_props$form$initialVa = props.form.initialValues) === null || _props$form$initialVa === void 0 ? void 0 : (_props$form$initialVa2 = _props$form$initialVa[searchName]) === null || _props$form$initialVa2 === void 0 ? void 0 : _props$form$initialVa2[1];
112
+ searchValue.current = (0, _utils.isValid)(searchDefaultValue) ? searchDefaultValue : '';
113
+ }, []);
107
114
  return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread({}, otherProps), {}, {
108
115
  className: (0, _classnames.default)(prefixCls, props.className),
109
116
  schema: simpleSchema,
@@ -24,7 +24,7 @@ export interface ProFormSchemaItem {
24
24
  name?: string;
25
25
  description?: React.ReactNode;
26
26
  title?: string;
27
- component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | 'ProField' | any;
27
+ component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | any;
28
28
  props?: AnyObject | any;
29
29
  decorator?: string | null;
30
30
  decoratorProps?: AnyObject;
package/lib/index.d.ts CHANGED
@@ -24,5 +24,5 @@ export * from './skeleton';
24
24
  export * from './table';
25
25
  export * from './utils';
26
26
  export * from './step';
27
- declare const version = "1.2.27";
27
+ declare const version = "1.2.31";
28
28
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProStep, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -285,5 +285,5 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
285
285
  // 设置图标源
286
286
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
287
287
 
288
- var version = '1.2.27';
288
+ var version = '1.2.31';
289
289
  exports.version = version;
@@ -103,7 +103,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
103
103
 
104
104
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/_react.default.createElement(Row, {
105
105
  wrap: true,
106
- className: "teamix-pro-info-content-row"
106
+ className: "teamix-pro-info-content-row",
107
+ gutter: 20
107
108
  }, renderContent()));
108
109
  };
109
110
 
@@ -70,10 +70,10 @@ var Filter = function Filter(props) {
70
70
  setVisible = _useState4[1];
71
71
 
72
72
  (0, _react.useEffect)(function () {
73
- var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4;
73
+ var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4, _actionRef$current$ge5;
74
74
 
75
75
  // 从全局状态中读取上次存储的条件
76
- var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current).filterRules) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3[column.dataIndex]) === null || _actionRef$current$ge4 === void 0 ? void 0 : _actionRef$current$ge4.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
76
+ var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current)) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3.filterRules) === null || _actionRef$current$ge4 === void 0 ? void 0 : (_actionRef$current$ge5 = _actionRef$current$ge4[column.dataIndex]) === null || _actionRef$current$ge5 === void 0 ? void 0 : _actionRef$current$ge5.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
77
77
  setSelected(rules);
78
78
  }, []); // 获取过滤项
79
79
 
@@ -191,7 +191,7 @@ var Filter = function Filter(props) {
191
191
  btn: true
192
192
  }),
193
193
  onClick: function onClick() {
194
- var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
194
+ var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
195
195
 
196
196
  (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
197
197
 
@@ -206,7 +206,7 @@ var Filter = function Filter(props) {
206
206
  } // 需要带上其他所有的信息
207
207
 
208
208
 
209
- var rules = (_actionRef$current$ge5 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge5 !== void 0 ? _actionRef$current$ge5 : {}; // 再设置所有的列筛选状态
209
+ var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {}; // 再设置所有的列筛选状态
210
210
 
211
211
  (_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, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
212
212
  rules: selected,
@@ -239,10 +239,10 @@ var Filter = function Filter(props) {
239
239
  btn: true
240
240
  }),
241
241
  onClick: function onClick() {
242
- var _actionRef$current$ge6, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
242
+ var _actionRef$current$ge7, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
243
243
 
244
244
  setSelected([]);
245
- var rules = (_actionRef$current$ge6 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
245
+ var rules = (_actionRef$current$ge7 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
246
246
  (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.setFilterRules) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
247
247
  rules: [],
248
248
  params: ''
@@ -80,8 +80,10 @@ var Layout = function Layout(props) {
80
80
 
81
81
 
82
82
  var renderQueryFilter = function renderQueryFilter() {
83
- if (dataFilter) {
84
- var _dataFilter$schema;
83
+ var _dataFilter$schema;
84
+
85
+ if (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) {
86
+ var _dataFilter$schema2;
85
87
 
86
88
  if ( /*#__PURE__*/(0, _react.isValidElement)(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
87
89
  // 自定义渲染内容
@@ -109,7 +111,7 @@ var Layout = function Layout(props) {
109
111
  actionRef: actionRef
110
112
  }, otherProps)))
111
113
  }, dataFilter));
112
- } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) >= 0) {
114
+ } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
113
115
  return /*#__PURE__*/_react.default.createElement(_form.QueryFilter, _objectSpread({
114
116
  formRef: dataFilterFormRef,
115
117
  onExpand: function onExpand(expand) {
@@ -135,6 +137,19 @@ var Layout = function Layout(props) {
135
137
  }, otherProps)))
136
138
  }, dataFilter));
137
139
  }
140
+ } else if (mainAction) {
141
+ // 没传 dataFilter 但是传了 mainAction
142
+ return /*#__PURE__*/_react.default.createElement(_form.QueryFilterLayout, {
143
+ className: "mb8",
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)))
152
+ });
138
153
  }
139
154
  }; // 区域组合渲染
140
155