@fle-ui/plus-table 1.2.24 → 1.2.26

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.
@@ -13,8 +13,8 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
17
16
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
18
18
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
19
19
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
20
20
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -148,7 +148,7 @@ var FormRender = function FormRender(_ref) {
148
148
  var columnKey = (item === null || item === void 0 ? void 0 : item.key) || (item === null || item === void 0 ? void 0 : (_item$dataIndex = item.dataIndex) === null || _item$dataIndex === void 0 ? void 0 : _item$dataIndex.toString());
149
149
  return _objectSpread(_objectSpread(_objectSpread({}, item), {}, {
150
150
  width: undefined
151
- }, item.search ? item.search : {}), {}, {
151
+ }, _typeof(item.search) === "object" ? item.search : {}), {}, {
152
152
  valueType: finalValueType,
153
153
  proFieldProps: _objectSpread(_objectSpread({}, item.proFieldProps), {}, {
154
154
  proFieldKey: columnKey ? "table-field-".concat(columnKey) : undefined
package/lib/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import React, { ReactElement } from 'react';
2
- import type { ProColumns, ActionType } from '@ant-design/pro-components';
3
- import type { InputProps } from 'antd';
1
+ import React from 'react';
2
+ import type { ProTableProps, ProColumns } from '@ant-design/pro-components';
4
3
  import './FormSearch/index.less';
5
4
  interface PlusColumns extends ProColumns {
6
5
  baseSearch?: boolean;
@@ -17,49 +16,15 @@ export type settingsColumns = {
17
16
  sort?: number;
18
17
  };
19
18
  };
20
- type OptionsFunctionType = (e: React.MouseEvent<HTMLSpanElement>, action?: ActionType) => void;
21
- type OptionsType = OptionsFunctionType | boolean;
22
- type SettingOptionType = {
23
- draggable?: boolean;
24
- checkable?: boolean;
25
- showListItemOption?: boolean;
26
- checkedReset?: boolean;
27
- listsHeight?: number;
28
- extra?: React.ReactNode;
29
- children?: React.ReactNode;
30
- settingIcon?: React.ReactNode;
31
- };
32
- interface SearchProps extends InputProps {
33
- inputPrefixCls?: string;
34
- onSearch?: (value: string, event?: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLInputElement>, info?: {
35
- source?: 'clear' | 'input';
36
- }) => void;
37
- enterButton?: React.ReactNode;
38
- loading?: boolean;
39
- }
40
- type OptionSearchProps = Omit<SearchProps, 'onSearch'> & {
41
- /** 如果 onSearch 返回一个false,直接拦截请求 */
42
- onSearch?: (keyword: string) => Promise<boolean | undefined> | boolean | undefined;
43
- };
44
- export type optionsConfig = {
45
- density?: boolean;
46
- fullScreen?: OptionsType;
47
- reload?: OptionsType;
48
- setting?: boolean | SettingOptionType;
49
- search?: (OptionSearchProps & {
50
- name?: string;
51
- }) | boolean;
52
- reloadIcon?: React.ReactNode;
53
- densityIcon?: React.ReactNode;
54
- };
55
- type PlusProps = {
19
+ interface PlusTableProps<DataSource, U, ValueType> extends Omit<ProTableProps<DataSource, U, ValueType>, 'columns'> {
56
20
  action?: Array<'advancedFilter' | 'columnSetting' | 'viewInvisibleData'>;
57
21
  columns: PlusColumns[];
58
- request?: any;
59
22
  top?: number;
60
- fetchSetting?: () => Promise<settingsColumns>;
61
- updateSetting?: (params: any) => Promise<settingsColumns>;
62
- resetSetting?: () => Promise<settingsColumns>;
23
+ fetchSetting?: () => Promise<Record<string, any>>;
24
+ updateSetting?: (params: settingsColumns) => void;
25
+ resetSetting?: () => Promise<{
26
+ success: boolean;
27
+ }>;
63
28
  showDefaultSetting?: boolean;
64
29
  defaultColumnsState?: {
65
30
  [key: string]: {
@@ -67,16 +32,13 @@ type PlusProps = {
67
32
  fixed: 'left' | 'right' | undefined;
68
33
  };
69
34
  };
70
- headerTitle?: ReactElement;
71
35
  hasShowFull?: boolean;
72
- pagination?: {
73
- pageSize?: number;
74
- current?: number;
75
- };
76
- actionRef: any;
77
- formRef?: any;
78
- options?: optionsConfig;
79
- [key: string | symbol]: any;
80
- };
81
- declare const PlusTable: React.ForwardRefExoticComponent<Omit<PlusProps, "ref"> & React.RefAttributes<unknown>>;
82
- export default PlusTable;
36
+ getContainer?: string | HTMLElement | (() => HTMLElement) | false;
37
+ }
38
+ interface PlusTableRef {
39
+ getFieldsValue: () => Promise<any>;
40
+ setFiledsValue: (params: any) => Promise<void>;
41
+ setFiledValue: (key: string, value: any) => Promise<void>;
42
+ }
43
+ declare const _default: React.ForwardRefExoticComponent<PlusTableProps<Record<string, any>, Record<string, any>, unknown> & React.RefAttributes<PlusTableRef>>;
44
+ export default _default;
package/lib/index.js CHANGED
@@ -11,7 +11,7 @@ var _index = _interopRequireDefault(require("./FormSearch/index"));
11
11
  var _icons = require("@ant-design/icons");
12
12
  var _common = require("./utils/common");
13
13
  require("./FormSearch/index.less");
14
- var _excluded = ["mode", "columns", "hasShowFull", "request", "pagination", "formRef", "actionRef", "defaultColumnsState", "options", "action", "showDefaultSetting"];
14
+ var _excluded = ["columns", "hasShowFull", "request", "pagination", "formRef", "actionRef", "defaultColumnsState", "options", "action", "showDefaultSetting"];
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -32,17 +32,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
32
32
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
33
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
34
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
35
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
36
- var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
35
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
36
+ function PlusTable(props, ref) {
37
37
  var _otherProps$scroll;
38
- var mode = props.mode,
39
- columns = props.columns,
38
+ var columns = props.columns,
40
39
  _props$hasShowFull = props.hasShowFull,
41
40
  hasShowFull = _props$hasShowFull === void 0 ? true : _props$hasShowFull,
42
41
  request = props.request,
43
42
  pagination = props.pagination,
44
43
  formRef = props.formRef,
45
- actionRef = props.actionRef,
44
+ propsActionRef = props.actionRef,
46
45
  defaultColumnsState = props.defaultColumnsState,
47
46
  _props$options = props.options,
48
47
  options = _props$options === void 0 ? {} : _props$options,
@@ -64,6 +63,10 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
64
63
  _useState6 = _slicedToArray(_useState5, 2),
65
64
  columnsStateMap = _useState6[0],
66
65
  setColumnsStateMap = _useState6[1];
66
+ var actionRef = (0, _react.useRef)();
67
+ (0, _react.useImperativeHandle)(propsActionRef, function () {
68
+ return actionRef.current;
69
+ });
67
70
  (0, _react.useImperativeHandle)(ref, function () {
68
71
  return {
69
72
  getFieldsValue: function () {
@@ -182,7 +185,6 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
182
185
  while (1) switch (_context5.prev = _context5.next) {
183
186
  case 0:
184
187
  return _context5.abrupt("return", (_props$resetSetting = props.resetSetting) === null || _props$resetSetting === void 0 ? void 0 : _props$resetSetting.call(props).then(function (res) {
185
- console.log(res);
186
188
  res.success && init();
187
189
  }));
188
190
  case 1:
@@ -263,7 +265,7 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
263
265
  onChange: handleOnChangeColumn //列状态的值发生改变之后触发
264
266
  };
265
267
  var propsRequest = /*#__PURE__*/function () {
266
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
268
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params, sort, filter) {
267
269
  var _searchRef$current5, _drawFormRef$current4;
268
270
  var res1, res2, res;
269
271
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -277,24 +279,34 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
277
279
  return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
278
280
  case 5:
279
281
  res2 = _context8.sent;
280
- _context8.next = 8;
282
+ if (!request) {
283
+ _context8.next = 12;
284
+ break;
285
+ }
286
+ _context8.next = 9;
281
287
  return request(_objectSpread(_objectSpread(_objectSpread({}, params), dealFetchParams(_objectSpread(_objectSpread(_objectSpread({}, res1), res2), params))), {}, {
282
288
  showFull: showFull
283
- }));
284
- case 8:
285
- res = _context8.sent;
289
+ }), sort, filter);
290
+ case 9:
291
+ _context8.t0 = _context8.sent;
292
+ _context8.next = 13;
293
+ break;
294
+ case 12:
295
+ _context8.t0 = {};
296
+ case 13:
297
+ res = _context8.t0;
286
298
  return _context8.abrupt("return", res);
287
- case 10:
299
+ case 15:
288
300
  case "end":
289
301
  return _context8.stop();
290
302
  }
291
303
  }, _callee8);
292
304
  }));
293
- return function propsRequest(_x5) {
305
+ return function propsRequest(_x5, _x6, _x7) {
294
306
  return _ref5.apply(this, arguments);
295
307
  };
296
308
  }();
297
- var optionsSetting = _typeof(options.setting) === 'object' ? options.setting : {};
309
+ var optionsSetting = _typeof(options) === 'object' && _typeof(options.setting) === 'object' ? options.setting : {};
298
310
  var __options = (action === null || action === void 0 ? void 0 : action.includes('columnSetting')) && showDefaultSetting !== true ? _objectSpread(_objectSpread({}, options), {}, {
299
311
  setting: _objectSpread(_objectSpread({}, optionsSetting), {}, {
300
312
  checkedReset: false,
@@ -319,9 +331,11 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
319
331
  scroll: {
320
332
  x: (otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$scroll = otherProps.scroll) === null || _otherProps$scroll === void 0 ? void 0 : _otherProps$scroll.x) || 1300
321
333
  }
322
- }, otherProps, {
323
334
  // 公共配置 大家都有的
324
- pagination: pagination,
335
+ ,
336
+ pagination: _objectSpread({
337
+ size: 'default'
338
+ }, pagination),
325
339
  actionRef: actionRef,
326
340
  formRef: searchRef
327
341
  // 根据用户自定义的配置 如果配置了高级筛选就有这个配置
@@ -354,16 +368,18 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
354
368
  key: "2",
355
369
  type: "default",
356
370
  onClick: function onClick() {
357
- var _drawFormRef$current5;
371
+ var _drawFormRef$current5, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
358
372
  drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
359
- actionRef.current.reset();
360
- actionRef.current.reload();
373
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.reset) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current);
374
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.reload) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
361
375
  },
362
376
  size: "middle"
363
- }, "\u91CD\u7F6E"), columns.filter(function (item) {
364
- return item.search !== false;
365
- }).length > 3 ? /*#__PURE__*/_react.default.createElement("a", {
377
+ }, "\u91CD\u7F6E"), /*#__PURE__*/_react.default.createElement("a", {
366
378
  key: "3",
379
+ style: {
380
+ wordBreak: 'break-word',
381
+ whiteSpace: 'nowrap'
382
+ },
367
383
  onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
368
384
  var _drawFormRef$current6, _searchRef$current6;
369
385
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
@@ -380,7 +396,7 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
380
396
  }
381
397
  }, _callee9);
382
398
  }))
383
- }, /*#__PURE__*/_react.default.createElement(_icons.BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009") : null];
399
+ }, /*#__PURE__*/_react.default.createElement(_icons.BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009")];
384
400
  }
385
401
  } : props.search
386
402
  // 根据用户自定义的配置 如果配置了列设置就有这个配置完全受控
@@ -411,8 +427,7 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
411
427
  search: false
412
428
  });
413
429
  }) : columns,
414
- toolBarRender: function toolBarRender(searchConfig) {
415
- var _otherProps$toolBarRe;
430
+ toolBarRender: function toolBarRender(searchConfig, rows) {
416
431
  return [(action === null || action === void 0 ? void 0 : action.includes('viewInvisibleData')) ? /*#__PURE__*/_react.default.createElement(_antd.Checkbox, {
417
432
  onChange: function onChange(e) {
418
433
  setShowFull(e.target.checked);
@@ -420,10 +435,10 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
420
435
  searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.reload();
421
436
  }, 100);
422
437
  }
423
- }, "\u663E\u793A\u6240\u6709\u6570\u636E") : null, otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$toolBarRe = otherProps.toolBarRender) === null || _otherProps$toolBarRe === void 0 ? void 0 : _otherProps$toolBarRe.call(otherProps)];
438
+ }, "\u663E\u793A\u6240\u6709\u6570\u636E") : null, typeof otherProps.toolBarRender === 'function' && otherProps.toolBarRender(searchConfig, rows)];
424
439
  },
425
440
  options: __options
426
- })), /*#__PURE__*/_react.default.createElement(_antd.Drawer, {
441
+ }, otherProps)), /*#__PURE__*/_react.default.createElement(_antd.Drawer, {
427
442
  onClose: function onClose() {
428
443
  return setSearchDrawer(false);
429
444
  },
@@ -479,10 +494,10 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
479
494
  }, "\u67E5\u8BE2"), /*#__PURE__*/_react.default.createElement(_antd.Button, {
480
495
  type: "default",
481
496
  onClick: function onClick() {
482
- var _drawFormRef$current10;
497
+ var _drawFormRef$current10, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
483
498
  drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
484
- actionRef.current.reset();
485
- actionRef.current.reload();
499
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$r = _actionRef$current3.reset) === null || _actionRef$current3$r === void 0 ? void 0 : _actionRef$current3$r.call(_actionRef$current3);
500
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.reload) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4);
486
501
  },
487
502
  size: "middle"
488
503
  }, "\u91CD\u7F6E"))];
@@ -495,5 +510,5 @@ var PlusTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
495
510
  manualRequest: true,
496
511
  action: actionRef
497
512
  })));
498
- });
499
- var _default = exports.default = PlusTable;
513
+ }
514
+ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(PlusTable);
@@ -9,14 +9,6 @@ var _default = exports.default = {
9
9
  code: '2000',
10
10
  message: null,
11
11
  data: [{
12
- id: 12966348,
13
- title: '商品编码',
14
- field: 'goodsNumber',
15
- sort: 0,
16
- hideInTable: 0,
17
- fixed: 1,
18
- disabled: 1
19
- }, {
20
12
  id: 12966347,
21
13
  title: '商品名称',
22
14
  field: 'mainImage,name',
@@ -192,13 +184,5 @@ var _default = exports.default = {
192
184
  hideInTable: 1,
193
185
  fixed: 0,
194
186
  disabled: 0
195
- }, {
196
- id: 12966341,
197
- title: '操作',
198
- field: 'option',
199
- sort: 23,
200
- hideInTable: 0,
201
- fixed: 2,
202
- disabled: 1
203
187
  }]
204
188
  };