@teamix/pro 1.5.34 → 1.5.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.
@@ -1,4 +1,4 @@
1
- var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
1
+ var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear", "submitProps", "resetProps", "buttonGroup"];
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -29,9 +29,46 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
29
29
  breakpoints = props.breakpoints,
30
30
  gridProps = props.gridProps,
31
31
  forceClear = props.forceClear,
32
+ _props$submitProps = props.submitProps,
33
+ submitProps = _props$submitProps === void 0 ? {} : _props$submitProps,
34
+ _props$resetProps = props.resetProps,
35
+ resetProps = _props$resetProps === void 0 ? {} : _props$resetProps,
36
+ buttonGroup = props.buttonGroup,
32
37
  otherProps = _objectWithoutProperties(props, _excluded);
33
38
  var prefixCls = usePrefixCls('teamix-pro-form-query-filter-advanced');
34
39
  var gridSchema = useMemo(function () {
40
+ var resetSchema = _objectSpread(_objectSpread({
41
+ name: 'AdvancedFilterReset',
42
+ component: 'Reset'
43
+ }, resetProps), {}, {
44
+ props: _objectSpread({
45
+ onResetValidateSuccess: onReset,
46
+ forceClear: !!forceClear,
47
+ children: getMessage('reset')
48
+ }, resetProps === null || resetProps === void 0 ? void 0 : resetProps.props)
49
+ });
50
+ var submitSchema = _objectSpread(_objectSpread({
51
+ component: 'Submit'
52
+ }, submitProps), {}, {
53
+ props: _objectSpread({
54
+ style: {
55
+ marginRight: -4
56
+ },
57
+ children: getMessage('search')
58
+ }, submitProps === null || submitProps === void 0 ? void 0 : submitProps.props)
59
+ });
60
+ var buttonGroupSchema = [resetSchema, submitSchema];
61
+ if (buttonGroup) {
62
+ buttonGroupSchema = buttonGroup.map(function (item) {
63
+ if (item === 'Submit') {
64
+ return submitSchema;
65
+ }
66
+ if (item === 'Reset') {
67
+ return resetSchema;
68
+ }
69
+ return item;
70
+ });
71
+ }
35
72
  return [{
36
73
  name: 'AdvancedFilterFormGrid',
37
74
  component: 'FormGrid',
@@ -52,23 +89,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
52
89
  props: {
53
90
  align: 'right'
54
91
  },
55
- children: [{
56
- name: 'AdvancedFilterReset',
57
- component: 'Reset',
58
- props: {
59
- onResetValidateSuccess: onReset,
60
- forceClear: !!forceClear,
61
- children: getMessage('reset')
62
- }
63
- }, {
64
- component: 'Submit',
65
- props: {
66
- style: {
67
- marginRight: -4
68
- },
69
- children: getMessage('search')
70
- }
71
- }]
92
+ children: _toConsumableArray(buttonGroupSchema)
72
93
  }]
73
94
  }])
74
95
  }];
@@ -115,6 +115,12 @@ export interface FilterProps extends ProFormProps {
115
115
  activeFilterValueRef?: React.MutableRefObject<any>;
116
116
  forceClear?: boolean;
117
117
  onReset?: (payload?: any) => void;
118
+ /** 搜索按钮配置 */
119
+ submitProps?: ProFormSchemaItem;
120
+ /** 重置按钮配置 */
121
+ resetProps?: ProFormSchemaItem;
122
+ /** 操作区按钮组配置 */
123
+ buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
118
124
  }
119
125
  export interface QueryFilterLayoutProps {
120
126
  prefixCls?: string;
@@ -164,6 +170,12 @@ export interface QueryFilterProps extends ProFormProps {
164
170
  onReset?: (payload?: any) => void;
165
171
  /** 高级筛选按钮切换 */
166
172
  onExpand?: (expand: boolean) => void;
173
+ /** 搜索按钮配置 */
174
+ submitProps?: ProFormSchemaItem;
175
+ /** 重置按钮配置 */
176
+ resetProps?: ProFormSchemaItem;
177
+ /** 操作区按钮组配置 */
178
+ buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
167
179
  }
168
180
  /**
169
181
  * 兼容性导出
package/es/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.34";
33
+ declare const version = "1.5.35";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -37,7 +37,7 @@ export * from './sidebar';
37
37
  export * from './utils';
38
38
  export * from './timeline';
39
39
  export * from './image';
40
- var version = '1.5.34';
40
+ var version = '1.5.35';
41
41
  // By TeamixTest
42
42
  window.postMessage({
43
43
  source: 'teamix-test-devtools',
@@ -12,6 +12,7 @@ interface ICellProps {
12
12
  /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
13
13
  context?: any;
14
14
  dataTeamixSpm?: string;
15
+ forcedUpdate?: boolean;
15
16
  }
16
17
  declare const _default: React.MemoExoticComponent<(props: ICellProps) => JSX.Element>;
17
18
  export default _default;
@@ -75,7 +75,6 @@ var Filter = function Filter(props) {
75
75
  });
76
76
  });
77
77
  }
78
- // console.log(filters);
79
78
  return filters;
80
79
  }, [column]);
81
80
  // 点击确定回调
@@ -27,7 +27,11 @@ var Row = Grid.Row,
27
27
  var cls = usePrefixCls('teamix-pro-table-toolbar-filter-column');
28
28
  var processColumns = function processColumns(columns) {
29
29
  var _getGlobalConfig;
30
+ var filterColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
30
31
  var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
32
+ var filterColumnsKey = filterColumns.map(function (item) {
33
+ return item === null || item === void 0 ? void 0 : item.dataIndex;
34
+ });
31
35
  // hidden 为 true 时不展示
32
36
  columns = columns.filter(function (item) {
33
37
  return (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
@@ -37,11 +41,14 @@ var processColumns = function processColumns(columns) {
37
41
  return item;
38
42
  }
39
43
  return _objectSpread(_objectSpread({}, item), {}, {
40
- columnFilters: true
44
+ columnFilters: filterColumnsKey.findIndex(function (key) {
45
+ return item.dataIndex === key;
46
+ }) >= 0 ? true : false
41
47
  });
42
48
  });
43
49
  };
44
50
  var FilterColumnIcon = function FilterColumnIcon(props) {
51
+ var _actionRef$current, _actionRef$current3;
45
52
  var _props$columns = props.columns,
46
53
  columns = _props$columns === void 0 ? [] : _props$columns,
47
54
  actionRef = props.actionRef,
@@ -54,7 +61,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
54
61
  _useState4 = _slicedToArray(_useState3, 2),
55
62
  indeterminate = _useState4[0],
56
63
  setIndeterminate = _useState4[1];
57
- var _useState5 = useState(processColumns(columns)),
64
+ var _useState5 = useState(processColumns(columns, (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.filterColumns)),
58
65
  _useState6 = _slicedToArray(_useState5, 2),
59
66
  newColumns = _useState6[0],
60
67
  setNewColumns = _useState6[1];
@@ -100,8 +107,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
100
107
  };
101
108
  });
102
109
  useEffect(function () {
103
- setNewColumns(processColumns(columns));
104
- }, [columns]);
110
+ var _actionRef$current2;
111
+ setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
112
+ }, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
105
113
  // 全选
106
114
  var onChangeAllColumns = function onChangeAllColumns(check) {
107
115
  setAllVisible(check);
@@ -193,10 +201,10 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
193
201
  };
194
202
  // 通知表格渲染
195
203
  var notifyTableRender = function notifyTableRender(columns) {
196
- var _actionRef$current, _actionRef$current$se;
204
+ var _actionRef$current4, _actionRef$current4$s;
197
205
  calculateSelectAllState(columns);
198
206
  setNewColumns(columns);
199
- (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setColumn) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, columns, false);
207
+ (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setColumn) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, columns, false);
200
208
  };
201
209
  // 计算全选状态
202
210
  var calculateSelectAllState = function calculateSelectAllState(columns) {
package/es/table/index.js CHANGED
@@ -297,7 +297,9 @@ var ProTable = function ProTable(props) {
297
297
  // 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
298
298
  var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
299
299
  var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
300
- if (!fixedTableBody) {
300
+ if (isFullscreen) {
301
+ // 开启全屏的时候先往下面走
302
+ } else if (!fixedTableBody) {
301
303
  return;
302
304
  }
303
305
  var tableDom = tableRef.current;
@@ -420,9 +422,9 @@ var ProTable = function ProTable(props) {
420
422
  if (showSkeleton && result) {
421
423
  result.disabled = true;
422
424
  }
423
- return _objectSpread({
425
+ return _objectSpread(_objectSpread({
424
426
  _primaryKey: props.primaryKey
425
- }, result);
427
+ }, record), result);
426
428
  },
427
429
  titleProps: function titleProps() {
428
430
  var result = {};
@@ -959,6 +961,12 @@ var ProTable = function ProTable(props) {
959
961
  return;
960
962
  }
961
963
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
964
+ if (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) {
965
+ var filterResult = propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values);
966
+ if (filterResult === false) {
967
+ return false;
968
+ }
969
+ }
962
970
  // 搜索变化时,暂时先清空选择
963
971
  (_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);
964
972
  setCurrentPage(1);
@@ -71,7 +71,7 @@ $fullscreenPadding: 24px;
71
71
  box-shadow: var(--shadow-1-up);
72
72
  background-color: var(--table-row-bg, #ffffff);
73
73
  margin: 0;
74
- z-index: 2;
74
+ z-index: 5;
75
75
  }
76
76
 
77
77
  .next-table-body {
@@ -126,6 +126,15 @@ $fullscreenPadding: 24px;
126
126
  }
127
127
  }
128
128
 
129
+ // .teamix-pro-table-fullscreen {
130
+ // .teamix-pro-table-container {
131
+ // height: calc(100vh - 74px);
132
+ // overflow: hidden;
133
+ // overflow-y: auto;
134
+ // }
135
+ // }
136
+
137
+
129
138
  .teamix-pro-table-footer-suction {
130
139
  margin-bottom: 50px;
131
140
  .teamix-pro-table-footer {
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
9
9
  */
10
10
  export default function genProColumnToColumn(columns: ProTableColumnProps[],
11
11
  /** 是否渲染骨架屏 */
12
- showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
12
+ showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps'], forcedUpdate?: boolean): FixedColumnProps[];
13
13
  export {};
@@ -21,6 +21,9 @@ showSkeleton, actionRef) {
21
21
  dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
22
22
  var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
23
23
  var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
24
+ var
25
+ // 是否强制刷新
26
+ forcedUpdate = arguments.length > 7 ? arguments[7] : undefined;
24
27
  return columns.map(function (columnProps) {
25
28
  var filters = columnProps.filters,
26
29
  dataIndex = columnProps.dataIndex,
@@ -69,7 +72,8 @@ showSkeleton, actionRef) {
69
72
  record: record,
70
73
  actionRef: actionRef,
71
74
  context: context,
72
- dataTeamixSpm: dataTeamixSpm
75
+ dataTeamixSpm: dataTeamixSpm,
76
+ forcedUpdate: forcedUpdate
73
77
  });
74
78
  // return renderCell(
75
79
  // value,
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _utils = require("@teamix/utils");
10
10
  var _ProForm = _interopRequireDefault(require("../ProForm"));
11
11
  var _utils2 = require("../utils");
12
- var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
12
+ var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear", "submitProps", "resetProps", "buttonGroup"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  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); }
15
15
  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; }
@@ -39,9 +39,46 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
39
39
  breakpoints = props.breakpoints,
40
40
  gridProps = props.gridProps,
41
41
  forceClear = props.forceClear,
42
+ _props$submitProps = props.submitProps,
43
+ submitProps = _props$submitProps === void 0 ? {} : _props$submitProps,
44
+ _props$resetProps = props.resetProps,
45
+ resetProps = _props$resetProps === void 0 ? {} : _props$resetProps,
46
+ buttonGroup = props.buttonGroup,
42
47
  otherProps = _objectWithoutProperties(props, _excluded);
43
48
  var prefixCls = (0, _utils.usePrefixCls)('teamix-pro-form-query-filter-advanced');
44
49
  var gridSchema = (0, _react.useMemo)(function () {
50
+ var resetSchema = _objectSpread(_objectSpread({
51
+ name: 'AdvancedFilterReset',
52
+ component: 'Reset'
53
+ }, resetProps), {}, {
54
+ props: _objectSpread({
55
+ onResetValidateSuccess: onReset,
56
+ forceClear: !!forceClear,
57
+ children: (0, _utils.getMessage)('reset')
58
+ }, resetProps === null || resetProps === void 0 ? void 0 : resetProps.props)
59
+ });
60
+ var submitSchema = _objectSpread(_objectSpread({
61
+ component: 'Submit'
62
+ }, submitProps), {}, {
63
+ props: _objectSpread({
64
+ style: {
65
+ marginRight: -4
66
+ },
67
+ children: (0, _utils.getMessage)('search')
68
+ }, submitProps === null || submitProps === void 0 ? void 0 : submitProps.props)
69
+ });
70
+ var buttonGroupSchema = [resetSchema, submitSchema];
71
+ if (buttonGroup) {
72
+ buttonGroupSchema = buttonGroup.map(function (item) {
73
+ if (item === 'Submit') {
74
+ return submitSchema;
75
+ }
76
+ if (item === 'Reset') {
77
+ return resetSchema;
78
+ }
79
+ return item;
80
+ });
81
+ }
45
82
  return [{
46
83
  name: 'AdvancedFilterFormGrid',
47
84
  component: 'FormGrid',
@@ -62,23 +99,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
62
99
  props: {
63
100
  align: 'right'
64
101
  },
65
- children: [{
66
- name: 'AdvancedFilterReset',
67
- component: 'Reset',
68
- props: {
69
- onResetValidateSuccess: onReset,
70
- forceClear: !!forceClear,
71
- children: (0, _utils.getMessage)('reset')
72
- }
73
- }, {
74
- component: 'Submit',
75
- props: {
76
- style: {
77
- marginRight: -4
78
- },
79
- children: (0, _utils.getMessage)('search')
80
- }
81
- }]
102
+ children: _toConsumableArray(buttonGroupSchema)
82
103
  }]
83
104
  }])
84
105
  }];
@@ -115,6 +115,12 @@ export interface FilterProps extends ProFormProps {
115
115
  activeFilterValueRef?: React.MutableRefObject<any>;
116
116
  forceClear?: boolean;
117
117
  onReset?: (payload?: any) => void;
118
+ /** 搜索按钮配置 */
119
+ submitProps?: ProFormSchemaItem;
120
+ /** 重置按钮配置 */
121
+ resetProps?: ProFormSchemaItem;
122
+ /** 操作区按钮组配置 */
123
+ buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
118
124
  }
119
125
  export interface QueryFilterLayoutProps {
120
126
  prefixCls?: string;
@@ -164,6 +170,12 @@ export interface QueryFilterProps extends ProFormProps {
164
170
  onReset?: (payload?: any) => void;
165
171
  /** 高级筛选按钮切换 */
166
172
  onExpand?: (expand: boolean) => void;
173
+ /** 搜索按钮配置 */
174
+ submitProps?: ProFormSchemaItem;
175
+ /** 重置按钮配置 */
176
+ resetProps?: ProFormSchemaItem;
177
+ /** 操作区按钮组配置 */
178
+ buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
167
179
  }
168
180
  /**
169
181
  * 兼容性导出
package/lib/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.34";
33
+ declare const version = "1.5.35";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -299,7 +299,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
299
299
  if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
300
300
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
301
301
  }
302
- var version = '1.5.34';
302
+ var version = '1.5.35';
303
303
  // By TeamixTest
304
304
  exports.version = version;
305
305
  window.postMessage({
@@ -12,6 +12,7 @@ interface ICellProps {
12
12
  /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
13
13
  context?: any;
14
14
  dataTeamixSpm?: string;
15
+ forcedUpdate?: boolean;
15
16
  }
16
17
  declare const _default: React.MemoExoticComponent<(props: ICellProps) => JSX.Element>;
17
18
  export default _default;
@@ -84,7 +84,6 @@ var Filter = function Filter(props) {
84
84
  });
85
85
  });
86
86
  }
87
- // console.log(filters);
88
87
  return filters;
89
88
  }, [column]);
90
89
  // 点击确定回调
@@ -34,7 +34,11 @@ var Row = _components.Grid.Row,
34
34
  var cls = (0, _utils.usePrefixCls)('teamix-pro-table-toolbar-filter-column');
35
35
  var processColumns = function processColumns(columns) {
36
36
  var _getGlobalConfig;
37
+ var filterColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
37
38
  var globalFilterColumns = (_getGlobalConfig = (0, _utils.getGlobalConfig)('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
39
+ var filterColumnsKey = filterColumns.map(function (item) {
40
+ return item === null || item === void 0 ? void 0 : item.dataIndex;
41
+ });
38
42
  // hidden 为 true 时不展示
39
43
  columns = columns.filter(function (item) {
40
44
  return (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
@@ -44,11 +48,14 @@ var processColumns = function processColumns(columns) {
44
48
  return item;
45
49
  }
46
50
  return _objectSpread(_objectSpread({}, item), {}, {
47
- columnFilters: true
51
+ columnFilters: filterColumnsKey.findIndex(function (key) {
52
+ return item.dataIndex === key;
53
+ }) >= 0 ? true : false
48
54
  });
49
55
  });
50
56
  };
51
57
  var FilterColumnIcon = function FilterColumnIcon(props) {
58
+ var _actionRef$current, _actionRef$current3;
52
59
  var _props$columns = props.columns,
53
60
  columns = _props$columns === void 0 ? [] : _props$columns,
54
61
  actionRef = props.actionRef,
@@ -61,7 +68,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
61
68
  _useState4 = _slicedToArray(_useState3, 2),
62
69
  indeterminate = _useState4[0],
63
70
  setIndeterminate = _useState4[1];
64
- var _useState5 = (0, _react.useState)(processColumns(columns)),
71
+ var _useState5 = (0, _react.useState)(processColumns(columns, (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.filterColumns)),
65
72
  _useState6 = _slicedToArray(_useState5, 2),
66
73
  newColumns = _useState6[0],
67
74
  setNewColumns = _useState6[1];
@@ -107,8 +114,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
107
114
  };
108
115
  });
109
116
  (0, _react.useEffect)(function () {
110
- setNewColumns(processColumns(columns));
111
- }, [columns]);
117
+ var _actionRef$current2;
118
+ setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
119
+ }, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
112
120
  // 全选
113
121
  var onChangeAllColumns = function onChangeAllColumns(check) {
114
122
  setAllVisible(check);
@@ -200,10 +208,10 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
200
208
  };
201
209
  // 通知表格渲染
202
210
  var notifyTableRender = function notifyTableRender(columns) {
203
- var _actionRef$current, _actionRef$current$se;
211
+ var _actionRef$current4, _actionRef$current4$s;
204
212
  calculateSelectAllState(columns);
205
213
  setNewColumns(columns);
206
- (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setColumn) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, columns, false);
214
+ (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setColumn) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, columns, false);
207
215
  };
208
216
  // 计算全选状态
209
217
  var calculateSelectAllState = function calculateSelectAllState(columns) {
@@ -318,7 +318,9 @@ var ProTable = function ProTable(props) {
318
318
  // 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
319
319
  var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
320
320
  var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
321
- if (!fixedTableBody) {
321
+ if (isFullscreen) {
322
+ // 开启全屏的时候先往下面走
323
+ } else if (!fixedTableBody) {
322
324
  return;
323
325
  }
324
326
  var tableDom = tableRef.current;
@@ -441,9 +443,9 @@ var ProTable = function ProTable(props) {
441
443
  if (showSkeleton && result) {
442
444
  result.disabled = true;
443
445
  }
444
- return _objectSpread({
446
+ return _objectSpread(_objectSpread({
445
447
  _primaryKey: props.primaryKey
446
- }, result);
448
+ }, record), result);
447
449
  },
448
450
  titleProps: function titleProps() {
449
451
  var result = {};
@@ -980,6 +982,12 @@ var ProTable = function ProTable(props) {
980
982
  return;
981
983
  }
982
984
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
985
+ if (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) {
986
+ var filterResult = propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values);
987
+ if (filterResult === false) {
988
+ return false;
989
+ }
990
+ }
983
991
  // 搜索变化时,暂时先清空选择
984
992
  (_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);
985
993
  setCurrentPage(1);
@@ -71,7 +71,7 @@ $fullscreenPadding: 24px;
71
71
  box-shadow: var(--shadow-1-up);
72
72
  background-color: var(--table-row-bg, #ffffff);
73
73
  margin: 0;
74
- z-index: 2;
74
+ z-index: 5;
75
75
  }
76
76
 
77
77
  .next-table-body {
@@ -126,6 +126,15 @@ $fullscreenPadding: 24px;
126
126
  }
127
127
  }
128
128
 
129
+ // .teamix-pro-table-fullscreen {
130
+ // .teamix-pro-table-container {
131
+ // height: calc(100vh - 74px);
132
+ // overflow: hidden;
133
+ // overflow-y: auto;
134
+ // }
135
+ // }
136
+
137
+
129
138
  .teamix-pro-table-footer-suction {
130
139
  margin-bottom: 50px;
131
140
  .teamix-pro-table-footer {
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
9
9
  */
10
10
  export default function genProColumnToColumn(columns: ProTableColumnProps[],
11
11
  /** 是否渲染骨架屏 */
12
- showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
12
+ showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps'], forcedUpdate?: boolean): FixedColumnProps[];
13
13
  export {};
@@ -28,6 +28,9 @@ showSkeleton, actionRef) {
28
28
  dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
29
29
  var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
30
30
  var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
31
+ var
32
+ // 是否强制刷新
33
+ forcedUpdate = arguments.length > 7 ? arguments[7] : undefined;
31
34
  return columns.map(function (columnProps) {
32
35
  var filters = columnProps.filters,
33
36
  dataIndex = columnProps.dataIndex,
@@ -76,7 +79,8 @@ showSkeleton, actionRef) {
76
79
  record: record,
77
80
  actionRef: actionRef,
78
81
  context: context,
79
- dataTeamixSpm: dataTeamixSpm
82
+ dataTeamixSpm: dataTeamixSpm,
83
+ forcedUpdate: forcedUpdate
80
84
  });
81
85
  // return renderCell(
82
86
  // value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.5.34",
3
+ "version": "1.5.35",
4
4
  "description": "TeamixPro大包",
5
5
  "keywords": [
6
6
  "aliyun",