@fle-ui/plus-table 1.2.7 → 1.2.20

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 (3) hide show
  1. package/es/index.js +111 -65
  2. package/lib/index.js +111 -65
  3. package/package.json +2 -2
package/es/index.js CHANGED
@@ -107,6 +107,50 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
107
107
  return _getFieldsValue.apply(this, arguments);
108
108
  }
109
109
  return getFieldsValue;
110
+ }(),
111
+ setFiledsValue: function () {
112
+ var _setFiledsValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
113
+ var _searchRef$current2, _drawFormRef$current2;
114
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
115
+ while (1) switch (_context2.prev = _context2.next) {
116
+ case 0:
117
+ _context2.next = 2;
118
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.setFieldsValue(params);
119
+ case 2:
120
+ _context2.next = 4;
121
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current2 = drawFormRef.current) === null || _drawFormRef$current2 === void 0 ? void 0 : _drawFormRef$current2.setFieldsValue(params);
122
+ case 4:
123
+ case "end":
124
+ return _context2.stop();
125
+ }
126
+ }, _callee2);
127
+ }));
128
+ function setFiledsValue(_x) {
129
+ return _setFiledsValue.apply(this, arguments);
130
+ }
131
+ return setFiledsValue;
132
+ }(),
133
+ setFiledValue: function () {
134
+ var _setFiledValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, value) {
135
+ var _searchRef$current3, _drawFormRef$current3;
136
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
137
+ while (1) switch (_context3.prev = _context3.next) {
138
+ case 0:
139
+ _context3.next = 2;
140
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current3 = searchRef.current) === null || _searchRef$current3 === void 0 ? void 0 : _searchRef$current3.setFieldValue(key, value);
141
+ case 2:
142
+ _context3.next = 4;
143
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current3 = drawFormRef.current) === null || _drawFormRef$current3 === void 0 ? void 0 : _drawFormRef$current3.setFieldValue(key, value);
144
+ case 4:
145
+ case "end":
146
+ return _context3.stop();
147
+ }
148
+ }, _callee3);
149
+ }));
150
+ function setFiledValue(_x2, _x3) {
151
+ return _setFiledValue.apply(this, arguments);
152
+ }
153
+ return setFiledValue;
110
154
  }()
111
155
  };
112
156
  });
@@ -115,14 +159,14 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
115
159
  setColumnsStateMap(map);
116
160
  };
117
161
  var handleSave = /*#__PURE__*/function () {
118
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
162
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
119
163
  var newObj, key;
120
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
121
- while (1) switch (_context2.prev = _context2.next) {
164
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
165
+ while (1) switch (_context4.prev = _context4.next) {
122
166
  case 0:
123
167
  newObj = {}; // 保存列设置的操作
124
168
  if (!props.updateSetting) {
125
- _context2.next = 6;
169
+ _context4.next = 6;
126
170
  break;
127
171
  }
128
172
  for (key in columnsStateMap) {
@@ -130,57 +174,57 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
130
174
  hideInTable: columnsStateMap[key].show ? 0 : 1
131
175
  });
132
176
  }
133
- _context2.next = 5;
177
+ _context4.next = 5;
134
178
  return props.updateSetting(newObj);
135
179
  case 5:
136
180
  simulateClick();
137
181
  case 6:
138
182
  case "end":
139
- return _context2.stop();
183
+ return _context4.stop();
140
184
  }
141
- }, _callee2);
185
+ }, _callee4);
142
186
  }));
143
187
  return function handleSave() {
144
188
  return _ref.apply(this, arguments);
145
189
  };
146
190
  }();
147
191
  var handleReset = /*#__PURE__*/function () {
148
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
192
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
149
193
  var _props$fetchSetting;
150
194
  var res;
151
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
152
- while (1) switch (_context3.prev = _context3.next) {
195
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
196
+ while (1) switch (_context5.prev = _context5.next) {
153
197
  case 0:
154
- _context3.next = 2;
198
+ _context5.next = 2;
155
199
  return (_props$fetchSetting = props.fetchSetting) === null || _props$fetchSetting === void 0 ? void 0 : _props$fetchSetting.call(props);
156
200
  case 2:
157
- res = _context3.sent;
201
+ res = _context5.sent;
158
202
  setColumnsStateMap(res);
159
203
  _message.success('重置成功!');
160
204
  case 5:
161
205
  case "end":
162
- return _context3.stop();
206
+ return _context5.stop();
163
207
  }
164
- }, _callee3);
208
+ }, _callee5);
165
209
  }));
166
210
  return function handleReset() {
167
211
  return _ref2.apply(this, arguments);
168
212
  };
169
213
  }();
170
214
  var init = /*#__PURE__*/function () {
171
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
215
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
172
216
  var _props$fetchSetting2, res;
173
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
174
- while (1) switch (_context4.prev = _context4.next) {
217
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
218
+ while (1) switch (_context6.prev = _context6.next) {
175
219
  case 0:
176
220
  if (!props.fetchSetting) {
177
- _context4.next = 6;
221
+ _context6.next = 6;
178
222
  break;
179
223
  }
180
- _context4.next = 3;
224
+ _context6.next = 3;
181
225
  return (_props$fetchSetting2 = props.fetchSetting) === null || _props$fetchSetting2 === void 0 ? void 0 : _props$fetchSetting2.call(props);
182
226
  case 3:
183
- res = _context4.sent;
227
+ res = _context6.sent;
184
228
  // show?: boolean;
185
229
  // fixed?: 'right' | 'left' | undefined;
186
230
  // order?: number;
@@ -192,17 +236,17 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
192
236
  setColumnsStateMap(res);
193
237
  case 6:
194
238
  case "end":
195
- return _context4.stop();
239
+ return _context6.stop();
196
240
  }
197
- }, _callee4);
241
+ }, _callee6);
198
242
  }));
199
243
  return function init() {
200
244
  return _ref3.apply(this, arguments);
201
245
  };
202
246
  }();
203
247
  var onValuesChange = function onValuesChange(changeValue, allValue) {
204
- var _searchRef$current2;
205
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.setFieldsValue(drawFormRef.current.getFieldsValue());
248
+ var _searchRef$current4;
249
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(drawFormRef.current.getFieldsValue());
206
250
  };
207
251
  var onTableChange = function onTableChange(pagination) {
208
252
  // 劫持分页改动
@@ -212,18 +256,18 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
212
256
  });
213
257
  };
214
258
  var handleSearchAll = /*#__PURE__*/function () {
215
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(searchConfig) {
216
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
217
- while (1) switch (_context5.prev = _context5.next) {
259
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(searchConfig) {
260
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
261
+ while (1) switch (_context7.prev = _context7.next) {
218
262
  case 0:
219
263
  searchConfig.form.submit();
220
264
  case 1:
221
265
  case "end":
222
- return _context5.stop();
266
+ return _context7.stop();
223
267
  }
224
- }, _callee5);
268
+ }, _callee7);
225
269
  }));
226
- return function handleSearchAll(_x) {
270
+ return function handleSearchAll(_x4) {
227
271
  return _ref4.apply(this, arguments);
228
272
  };
229
273
  }();
@@ -250,34 +294,34 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
250
294
  onChange: handleOnChangeColumn //列状态的值发生改变之后触发
251
295
  };
252
296
  var propsRequest = /*#__PURE__*/function () {
253
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
254
- var _searchRef$current3, _drawFormRef$current2;
297
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
298
+ var _searchRef$current5, _drawFormRef$current4;
255
299
  var res1, res2, res;
256
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
257
- while (1) switch (_context6.prev = _context6.next) {
300
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
301
+ while (1) switch (_context8.prev = _context8.next) {
258
302
  case 0:
259
- _context6.next = 2;
260
- return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current3 = searchRef.current) === null || _searchRef$current3 === void 0 ? void 0 : _searchRef$current3.getFieldsValue();
303
+ _context8.next = 2;
304
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current5 = searchRef.current) === null || _searchRef$current5 === void 0 ? void 0 : _searchRef$current5.getFieldsValue();
261
305
  case 2:
262
- res1 = _context6.sent;
263
- _context6.next = 5;
264
- return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current2 = drawFormRef.current) === null || _drawFormRef$current2 === void 0 ? void 0 : _drawFormRef$current2.getFieldsValue();
306
+ res1 = _context8.sent;
307
+ _context8.next = 5;
308
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
265
309
  case 5:
266
- res2 = _context6.sent;
267
- _context6.next = 8;
310
+ res2 = _context8.sent;
311
+ _context8.next = 8;
268
312
  return request(_objectSpread(_objectSpread(_objectSpread({}, params), dealFetchParams(_objectSpread(_objectSpread(_objectSpread({}, res1), res2), params))), {}, {
269
313
  showFull: showFull
270
314
  }));
271
315
  case 8:
272
- res = _context6.sent;
273
- return _context6.abrupt("return", res);
316
+ res = _context8.sent;
317
+ return _context8.abrupt("return", res);
274
318
  case 10:
275
319
  case "end":
276
- return _context6.stop();
320
+ return _context8.stop();
277
321
  }
278
- }, _callee6);
322
+ }, _callee8);
279
323
  }));
280
- return function propsRequest(_x2) {
324
+ return function propsRequest(_x5) {
281
325
  return _ref5.apply(this, arguments);
282
326
  };
283
327
  }();
@@ -322,8 +366,8 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
322
366
  key: "2",
323
367
  type: "default",
324
368
  onClick: function onClick() {
325
- var _drawFormRef$current3;
326
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current3 = drawFormRef.current) === null || _drawFormRef$current3 === void 0 ? void 0 : _drawFormRef$current3.resetFields();
369
+ var _drawFormRef$current5;
370
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
327
371
  actionRef.current.reset();
328
372
  actionRef.current.reload();
329
373
  },
@@ -332,21 +376,21 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
332
376
  return item.search !== false;
333
377
  }).length > 3 ? /*#__PURE__*/React.createElement("a", {
334
378
  key: "3",
335
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
336
- var _drawFormRef$current4, _searchRef$current4;
337
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
338
- while (1) switch (_context7.prev = _context7.next) {
379
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
380
+ var _drawFormRef$current6, _searchRef$current6;
381
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
382
+ while (1) switch (_context9.prev = _context9.next) {
339
383
  case 0:
340
- _context7.next = 2;
384
+ _context9.next = 2;
341
385
  return setSearchDrawer(!searchDrawer);
342
386
  case 2:
343
387
  // 没法实时监听数据所以这里要带过来
344
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.getFieldsValue());
388
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
345
389
  case 3:
346
390
  case "end":
347
- return _context7.stop();
391
+ return _context9.stop();
348
392
  }
349
- }, _callee7);
393
+ }, _callee9);
350
394
  }))
351
395
  }, /*#__PURE__*/React.createElement(BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009") : null];
352
396
  }
@@ -365,11 +409,11 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
365
409
  fieldProps: _objectSpread({
366
410
  onChange: function onChange(e) {
367
411
  if (e) {
368
- var _drawFormRef$current5;
369
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
370
- } else {
371
412
  var _drawFormRef$current7;
372
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.resetFields([item.dataIndex]);
413
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
414
+ } else {
415
+ var _drawFormRef$current9;
416
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current9 = drawFormRef.current) === null || _drawFormRef$current9 === void 0 ? void 0 : _drawFormRef$current9.resetFields([item.dataIndex]);
373
417
  }
374
418
  }
375
419
  }, item.fieldProps)
@@ -411,7 +455,7 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
411
455
  onClose: function onClose() {
412
456
  return setSearchDrawer(false);
413
457
  },
414
- title: "\u9AD8\u7EA7\u7B5B\u9009",
458
+ title: '高级筛选',
415
459
  width: 380,
416
460
  rootStyle: {
417
461
  position: 'fixed',
@@ -429,8 +473,8 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
429
473
  return onValuesChange(_changeValue, allValue);
430
474
  },
431
475
  onFormSearchSubmit: function onFormSearchSubmit() {
432
- var _searchRef$current5;
433
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current5 = searchRef.current) === null || _searchRef$current5 === void 0 ? void 0 : _searchRef$current5.submit();
476
+ var _searchRef$current7;
477
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current7 = searchRef.current) === null || _searchRef$current7 === void 0 ? void 0 : _searchRef$current7.submit();
434
478
  },
435
479
  dateFormatter: "string",
436
480
  formRef: drawFormRef,
@@ -445,8 +489,10 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
445
489
  style: {
446
490
  position: 'fixed',
447
491
  bottom: 0,
492
+ background: 'white',
448
493
  display: 'flex',
449
494
  width: '380px',
495
+ borderTop: '1px solid #f0f0f0',
450
496
  right: '0',
451
497
  justifyContent: 'space-around',
452
498
  padding: '16px',
@@ -461,8 +507,8 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
461
507
  }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(_Button, {
462
508
  type: "default",
463
509
  onClick: function onClick() {
464
- var _drawFormRef$current8;
465
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current8 = drawFormRef.current) === null || _drawFormRef$current8 === void 0 ? void 0 : _drawFormRef$current8.resetFields();
510
+ var _drawFormRef$current10;
511
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
466
512
  actionRef.current.reset();
467
513
  actionRef.current.reload();
468
514
  },
package/lib/index.js CHANGED
@@ -107,6 +107,50 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
107
107
  return _getFieldsValue.apply(this, arguments);
108
108
  }
109
109
  return getFieldsValue;
110
+ }(),
111
+ setFiledsValue: function () {
112
+ var _setFiledsValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
113
+ var _searchRef$current2, _drawFormRef$current2;
114
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
115
+ while (1) switch (_context2.prev = _context2.next) {
116
+ case 0:
117
+ _context2.next = 2;
118
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.setFieldsValue(params);
119
+ case 2:
120
+ _context2.next = 4;
121
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current2 = drawFormRef.current) === null || _drawFormRef$current2 === void 0 ? void 0 : _drawFormRef$current2.setFieldsValue(params);
122
+ case 4:
123
+ case "end":
124
+ return _context2.stop();
125
+ }
126
+ }, _callee2);
127
+ }));
128
+ function setFiledsValue(_x) {
129
+ return _setFiledsValue.apply(this, arguments);
130
+ }
131
+ return setFiledsValue;
132
+ }(),
133
+ setFiledValue: function () {
134
+ var _setFiledValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, value) {
135
+ var _searchRef$current3, _drawFormRef$current3;
136
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
137
+ while (1) switch (_context3.prev = _context3.next) {
138
+ case 0:
139
+ _context3.next = 2;
140
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current3 = searchRef.current) === null || _searchRef$current3 === void 0 ? void 0 : _searchRef$current3.setFieldValue(key, value);
141
+ case 2:
142
+ _context3.next = 4;
143
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current3 = drawFormRef.current) === null || _drawFormRef$current3 === void 0 ? void 0 : _drawFormRef$current3.setFieldValue(key, value);
144
+ case 4:
145
+ case "end":
146
+ return _context3.stop();
147
+ }
148
+ }, _callee3);
149
+ }));
150
+ function setFiledValue(_x2, _x3) {
151
+ return _setFiledValue.apply(this, arguments);
152
+ }
153
+ return setFiledValue;
110
154
  }()
111
155
  };
112
156
  });
@@ -115,14 +159,14 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
115
159
  setColumnsStateMap(map);
116
160
  };
117
161
  var handleSave = /*#__PURE__*/function () {
118
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
162
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
119
163
  var newObj, key;
120
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
121
- while (1) switch (_context2.prev = _context2.next) {
164
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
165
+ while (1) switch (_context4.prev = _context4.next) {
122
166
  case 0:
123
167
  newObj = {}; // 保存列设置的操作
124
168
  if (!props.updateSetting) {
125
- _context2.next = 6;
169
+ _context4.next = 6;
126
170
  break;
127
171
  }
128
172
  for (key in columnsStateMap) {
@@ -130,57 +174,57 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
130
174
  hideInTable: columnsStateMap[key].show ? 0 : 1
131
175
  });
132
176
  }
133
- _context2.next = 5;
177
+ _context4.next = 5;
134
178
  return props.updateSetting(newObj);
135
179
  case 5:
136
180
  (0, _common.simulateClick)();
137
181
  case 6:
138
182
  case "end":
139
- return _context2.stop();
183
+ return _context4.stop();
140
184
  }
141
- }, _callee2);
185
+ }, _callee4);
142
186
  }));
143
187
  return function handleSave() {
144
188
  return _ref.apply(this, arguments);
145
189
  };
146
190
  }();
147
191
  var handleReset = /*#__PURE__*/function () {
148
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
192
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
149
193
  var _props$fetchSetting;
150
194
  var res;
151
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
152
- while (1) switch (_context3.prev = _context3.next) {
195
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
196
+ while (1) switch (_context5.prev = _context5.next) {
153
197
  case 0:
154
- _context3.next = 2;
198
+ _context5.next = 2;
155
199
  return (_props$fetchSetting = props.fetchSetting) === null || _props$fetchSetting === void 0 ? void 0 : _props$fetchSetting.call(props);
156
200
  case 2:
157
- res = _context3.sent;
201
+ res = _context5.sent;
158
202
  setColumnsStateMap(res);
159
203
  _antd.message.success('重置成功!');
160
204
  case 5:
161
205
  case "end":
162
- return _context3.stop();
206
+ return _context5.stop();
163
207
  }
164
- }, _callee3);
208
+ }, _callee5);
165
209
  }));
166
210
  return function handleReset() {
167
211
  return _ref2.apply(this, arguments);
168
212
  };
169
213
  }();
170
214
  var init = /*#__PURE__*/function () {
171
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
215
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
172
216
  var _props$fetchSetting2, res;
173
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
174
- while (1) switch (_context4.prev = _context4.next) {
217
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
218
+ while (1) switch (_context6.prev = _context6.next) {
175
219
  case 0:
176
220
  if (!props.fetchSetting) {
177
- _context4.next = 6;
221
+ _context6.next = 6;
178
222
  break;
179
223
  }
180
- _context4.next = 3;
224
+ _context6.next = 3;
181
225
  return (_props$fetchSetting2 = props.fetchSetting) === null || _props$fetchSetting2 === void 0 ? void 0 : _props$fetchSetting2.call(props);
182
226
  case 3:
183
- res = _context4.sent;
227
+ res = _context6.sent;
184
228
  // show?: boolean;
185
229
  // fixed?: 'right' | 'left' | undefined;
186
230
  // order?: number;
@@ -192,17 +236,17 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
192
236
  setColumnsStateMap(res);
193
237
  case 6:
194
238
  case "end":
195
- return _context4.stop();
239
+ return _context6.stop();
196
240
  }
197
- }, _callee4);
241
+ }, _callee6);
198
242
  }));
199
243
  return function init() {
200
244
  return _ref3.apply(this, arguments);
201
245
  };
202
246
  }();
203
247
  var onValuesChange = function onValuesChange(changeValue, allValue) {
204
- var _searchRef$current2;
205
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current2 = searchRef.current) === null || _searchRef$current2 === void 0 ? void 0 : _searchRef$current2.setFieldsValue(drawFormRef.current.getFieldsValue());
248
+ var _searchRef$current4;
249
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(drawFormRef.current.getFieldsValue());
206
250
  };
207
251
  var onTableChange = function onTableChange(pagination) {
208
252
  // 劫持分页改动
@@ -212,18 +256,18 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
212
256
  });
213
257
  };
214
258
  var handleSearchAll = /*#__PURE__*/function () {
215
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(searchConfig) {
216
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
217
- while (1) switch (_context5.prev = _context5.next) {
259
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(searchConfig) {
260
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
261
+ while (1) switch (_context7.prev = _context7.next) {
218
262
  case 0:
219
263
  searchConfig.form.submit();
220
264
  case 1:
221
265
  case "end":
222
- return _context5.stop();
266
+ return _context7.stop();
223
267
  }
224
- }, _callee5);
268
+ }, _callee7);
225
269
  }));
226
- return function handleSearchAll(_x) {
270
+ return function handleSearchAll(_x4) {
227
271
  return _ref4.apply(this, arguments);
228
272
  };
229
273
  }();
@@ -250,34 +294,34 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
250
294
  onChange: handleOnChangeColumn //列状态的值发生改变之后触发
251
295
  };
252
296
  var propsRequest = /*#__PURE__*/function () {
253
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
254
- var _searchRef$current3, _drawFormRef$current2;
297
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
298
+ var _searchRef$current5, _drawFormRef$current4;
255
299
  var res1, res2, res;
256
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
257
- while (1) switch (_context6.prev = _context6.next) {
300
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
301
+ while (1) switch (_context8.prev = _context8.next) {
258
302
  case 0:
259
- _context6.next = 2;
260
- return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current3 = searchRef.current) === null || _searchRef$current3 === void 0 ? void 0 : _searchRef$current3.getFieldsValue();
303
+ _context8.next = 2;
304
+ return searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current5 = searchRef.current) === null || _searchRef$current5 === void 0 ? void 0 : _searchRef$current5.getFieldsValue();
261
305
  case 2:
262
- res1 = _context6.sent;
263
- _context6.next = 5;
264
- return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current2 = drawFormRef.current) === null || _drawFormRef$current2 === void 0 ? void 0 : _drawFormRef$current2.getFieldsValue();
306
+ res1 = _context8.sent;
307
+ _context8.next = 5;
308
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
265
309
  case 5:
266
- res2 = _context6.sent;
267
- _context6.next = 8;
310
+ res2 = _context8.sent;
311
+ _context8.next = 8;
268
312
  return request(_objectSpread(_objectSpread(_objectSpread({}, params), dealFetchParams(_objectSpread(_objectSpread(_objectSpread({}, res1), res2), params))), {}, {
269
313
  showFull: showFull
270
314
  }));
271
315
  case 8:
272
- res = _context6.sent;
273
- return _context6.abrupt("return", res);
316
+ res = _context8.sent;
317
+ return _context8.abrupt("return", res);
274
318
  case 10:
275
319
  case "end":
276
- return _context6.stop();
320
+ return _context8.stop();
277
321
  }
278
- }, _callee6);
322
+ }, _callee8);
279
323
  }));
280
- return function propsRequest(_x2) {
324
+ return function propsRequest(_x5) {
281
325
  return _ref5.apply(this, arguments);
282
326
  };
283
327
  }();
@@ -322,8 +366,8 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
322
366
  key: "2",
323
367
  type: "default",
324
368
  onClick: function onClick() {
325
- var _drawFormRef$current3;
326
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current3 = drawFormRef.current) === null || _drawFormRef$current3 === void 0 ? void 0 : _drawFormRef$current3.resetFields();
369
+ var _drawFormRef$current5;
370
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
327
371
  actionRef.current.reset();
328
372
  actionRef.current.reload();
329
373
  },
@@ -332,21 +376,21 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
332
376
  return item.search !== false;
333
377
  }).length > 3 ? /*#__PURE__*/_react.default.createElement("a", {
334
378
  key: "3",
335
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
336
- var _drawFormRef$current4, _searchRef$current4;
337
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
338
- while (1) switch (_context7.prev = _context7.next) {
379
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
380
+ var _drawFormRef$current6, _searchRef$current6;
381
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
382
+ while (1) switch (_context9.prev = _context9.next) {
339
383
  case 0:
340
- _context7.next = 2;
384
+ _context9.next = 2;
341
385
  return setSearchDrawer(!searchDrawer);
342
386
  case 2:
343
387
  // 没法实时监听数据所以这里要带过来
344
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.getFieldsValue());
388
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
345
389
  case 3:
346
390
  case "end":
347
- return _context7.stop();
391
+ return _context9.stop();
348
392
  }
349
- }, _callee7);
393
+ }, _callee9);
350
394
  }))
351
395
  }, /*#__PURE__*/_react.default.createElement(_icons.BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009") : null];
352
396
  }
@@ -365,11 +409,11 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
365
409
  fieldProps: _objectSpread({
366
410
  onChange: function onChange(e) {
367
411
  if (e) {
368
- var _drawFormRef$current5;
369
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
370
- } else {
371
412
  var _drawFormRef$current7;
372
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.resetFields([item.dataIndex]);
413
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
414
+ } else {
415
+ var _drawFormRef$current9;
416
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current9 = drawFormRef.current) === null || _drawFormRef$current9 === void 0 ? void 0 : _drawFormRef$current9.resetFields([item.dataIndex]);
373
417
  }
374
418
  }
375
419
  }, item.fieldProps)
@@ -411,7 +455,7 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
411
455
  onClose: function onClose() {
412
456
  return setSearchDrawer(false);
413
457
  },
414
- title: "\u9AD8\u7EA7\u7B5B\u9009",
458
+ title: '高级筛选',
415
459
  width: 380,
416
460
  rootStyle: {
417
461
  position: 'fixed',
@@ -429,8 +473,8 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
429
473
  return onValuesChange(_changeValue, allValue);
430
474
  },
431
475
  onFormSearchSubmit: function onFormSearchSubmit() {
432
- var _searchRef$current5;
433
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current5 = searchRef.current) === null || _searchRef$current5 === void 0 ? void 0 : _searchRef$current5.submit();
476
+ var _searchRef$current7;
477
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current7 = searchRef.current) === null || _searchRef$current7 === void 0 ? void 0 : _searchRef$current7.submit();
434
478
  },
435
479
  dateFormatter: "string",
436
480
  formRef: drawFormRef,
@@ -445,8 +489,10 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
445
489
  style: {
446
490
  position: 'fixed',
447
491
  bottom: 0,
492
+ background: 'white',
448
493
  display: 'flex',
449
494
  width: '380px',
495
+ borderTop: '1px solid #f0f0f0',
450
496
  right: '0',
451
497
  justifyContent: 'space-around',
452
498
  padding: '16px',
@@ -461,8 +507,8 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
461
507
  }, "\u67E5\u8BE2"), /*#__PURE__*/_react.default.createElement(_antd.Button, {
462
508
  type: "default",
463
509
  onClick: function onClick() {
464
- var _drawFormRef$current8;
465
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current8 = drawFormRef.current) === null || _drawFormRef$current8 === void 0 ? void 0 : _drawFormRef$current8.resetFields();
510
+ var _drawFormRef$current10;
511
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
466
512
  actionRef.current.reset();
467
513
  actionRef.current.reload();
468
514
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fle-ui/plus-table",
3
- "version": "1.2.7",
3
+ "version": "1.2.20",
4
4
  "description": "@fle-ui/plus-table",
5
5
  "keywords": [
6
6
  "fle-ui",
@@ -46,5 +46,5 @@
46
46
  "@ant-design/pro-components": "^2.7.0",
47
47
  "dayjs": "^1.11.10"
48
48
  },
49
- "gitHead": "1267d7a76f22b4feb43f759f94b8c89b64b86f2d"
49
+ "gitHead": "0a9004d81da957555c0f85234eadfd81bc535153"
50
50
  }