@ccs-ui/rc-pro 2.3.6-alpha-7 → 2.3.6-alpha-8

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.
package/es/ccs.d.ts CHANGED
@@ -43,13 +43,8 @@ type TableDataType<T> = {
43
43
  result?: T[];
44
44
  };
45
45
  type TableInstance<T = any> = {
46
- /**
47
- * @deprecated
48
- * 获取form表单数据,排序等条件数据
49
- */
50
- formValues: Record<string, any>;
51
- /** 接口请求参数 */
52
- searchParam: Record<string, any>;
46
+ /** 获取当前表单数据 */
47
+ getFormValues: () => Promise<Record<string, any>>;
53
48
  /** 获取当前表单数据 */
54
49
  data: TableData<T>;
55
50
  /** 查询数据,根据条件,从第一页开始显示 */
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
16
16
  export type DialogButtonRef = {
17
17
  onSetButtons: (e: React.ReactElement) => void;
18
18
  };
19
- export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "onClose" | "request" | "onOk" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
19
+ export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "request" | "onOk" | "onClose" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
20
20
  formRef: React.RefObject<DialogFormRef<TParams>>;
21
21
  formInitialValues: FormProps['initialValues'];
22
22
  buttonRef: RefObject<DialogButtonRef>;
@@ -161,9 +161,12 @@ export default function useTableSelection(props) {
161
161
  }
162
162
  handleOnChange();
163
163
  });
164
- return _objectSpread(_objectSpread({}, selectionRef.current), {}, {
164
+ return _objectSpread(_objectSpread(_objectSpread({}, selectionRef.current), {}, {
165
165
  onChange: onChange,
166
166
  onClear: onClear,
167
167
  type: type
168
- }, rowSelectionProps);
168
+ }, rowSelectionProps), {}, {
169
+ // @ts-ignore
170
+ onClearByProTable: onClear
171
+ });
169
172
  }
@@ -1,9 +1,9 @@
1
1
  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); }
2
- 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 new 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 new 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 new 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; }
3
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
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."); }
5
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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 new 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 new 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 new 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; }
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -124,8 +124,6 @@ var InternalProTable = function InternalProTable(props) {
124
124
  var filterOrderRef = useRef(defaultColumnValues);
125
125
  // table content
126
126
  var tableContentRef = useRef(null);
127
- // 接口查询条件
128
- var searchParamRef = useRef({});
129
127
  // container
130
128
  var containerRef = useRef(null);
131
129
  // table ref
@@ -167,14 +165,49 @@ var InternalProTable = function InternalProTable(props) {
167
165
  });
168
166
  }, []);
169
167
 
168
+ // 构建查询条件:表单数据、请求额外参数、分页参数、其他参数
169
+ var getFormValues = /*#__PURE__*/function () {
170
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
171
+ var _formRef$current;
172
+ var formValues;
173
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
174
+ while (1) switch (_context.prev = _context.next) {
175
+ case 0:
176
+ _context.next = 2;
177
+ return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.validateFields();
178
+ case 2:
179
+ formValues = _context.sent;
180
+ // 格式化条件
181
+ if (formatFormItems.length) {
182
+ Object.keys(formValues).forEach(function (k) {
183
+ if (formValues[k] !== undefined) {
184
+ var s = formatFormItems.find(function (f) {
185
+ return f.name === k;
186
+ });
187
+ if (s) formValues[k] = s.onFormat && s.onFormat(formValues[k]);
188
+ }
189
+ });
190
+ }
191
+ return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, requestParam), formInitValues), formValues));
192
+ case 5:
193
+ case "end":
194
+ return _context.stop();
195
+ }
196
+ }, _callee);
197
+ }));
198
+ return function getFormValues() {
199
+ return _ref2.apply(this, arguments);
200
+ };
201
+ }();
202
+
170
203
  // 获取数据
171
204
  var onRequest = /*#__PURE__*/function () {
172
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(eventType) {
173
- var _formRef$current, _props$table;
205
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(eventType) {
206
+ var _props$table;
174
207
  var pageNo,
175
208
  pageSize,
176
209
  record,
177
- formValues,
210
+ allParams,
178
211
  fieldNames,
179
212
  _fieldNames$requestPa,
180
213
  _fieldNames$requestPa2,
@@ -195,43 +228,31 @@ var InternalProTable = function InternalProTable(props) {
195
228
  dataSource,
196
229
  total,
197
230
  newData,
198
- _args = arguments;
199
- return _regeneratorRuntime().wrap(function _callee$(_context) {
200
- while (1) switch (_context.prev = _context.next) {
231
+ _args2 = arguments;
232
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
233
+ while (1) switch (_context2.prev = _context2.next) {
201
234
  case 0:
202
- pageNo = _args.length > 1 && _args[1] !== undefined ? _args[1] : 1;
203
- pageSize = _args.length > 2 && _args[2] !== undefined ? _args[2] : (pagination ? pagination.defaultPageSize : 10) || 10;
204
- record = _args.length > 3 ? _args[3] : undefined;
235
+ pageNo = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 1;
236
+ pageSize = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : (pagination ? pagination.defaultPageSize : 10) || 10;
237
+ record = _args2.length > 3 ? _args2[3] : undefined;
205
238
  if (!(!isAuth || !httpRequest)) {
206
- _context.next = 5;
239
+ _context2.next = 5;
207
240
  break;
208
241
  }
209
- return _context.abrupt("return");
242
+ return _context2.abrupt("return");
210
243
  case 5:
211
- _context.next = 7;
212
- return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.validateFields();
244
+ _context2.next = 7;
245
+ return getFormValues();
213
246
  case 7:
214
- formValues = _context.sent;
247
+ allParams = _context2.sent;
215
248
  // 接口字段指定
216
- fieldNames = _objectSpread(_objectSpread({}, globalFieldNames), (_props$table = props.table) === null || _props$table === void 0 ? void 0 : _props$table.fieldNames); // 格式化条件
217
- if (formatFormItems.length) {
218
- Object.keys(formValues).forEach(function (k) {
219
- if (formValues[k] !== undefined) {
220
- var s = formatFormItems.find(function (f) {
221
- return f.name === k;
222
- });
223
- if (s) formValues[k] = s.onFormat && s.onFormat(formValues[k]);
224
- }
225
- });
226
- }
227
-
228
- // 请求字段
249
+ fieldNames = _objectSpread(_objectSpread({}, globalFieldNames), (_props$table = props.table) === null || _props$table === void 0 ? void 0 : _props$table.fieldNames); // 请求字段
229
250
  _fieldNames$requestPa = fieldNames.requestParam, _fieldNames$requestPa2 = _fieldNames$requestPa.filters, fsFilters = _fieldNames$requestPa2 === void 0 ? ['filters'] : _fieldNames$requestPa2, _fieldNames$requestPa3 = _fieldNames$requestPa.pageNo, fsPageNo = _fieldNames$requestPa3 === void 0 ? ['pageNo'] : _fieldNames$requestPa3, _fieldNames$requestPa4 = _fieldNames$requestPa.pageSize, fsPageSize = _fieldNames$requestPa4 === void 0 ? ['pageSize'] : _fieldNames$requestPa4, _fieldNames$requestPa5 = _fieldNames$requestPa.orderProps, fsOrderProps = _fieldNames$requestPa5 === void 0 ? ['orderProps'] : _fieldNames$requestPa5, fsQuery = _fieldNames$requestPa.query; // 构建请求参数
230
251
  params = {};
231
252
  if (fsQuery && fsQuery.length > 0) {
232
- onSetObj(params, _toConsumableArray(fsQuery), _objectSpread(_objectSpread(_objectSpread({}, requestParam), formInitValues), formValues));
253
+ onSetObj(params, _toConsumableArray(fsQuery), allParams);
233
254
  } else {
234
- params = _objectSpread(_objectSpread(_objectSpread({}, requestParam), formInitValues), formValues);
255
+ params = allParams;
235
256
  }
236
257
  if (pagination !== false) {
237
258
  // 分页
@@ -250,14 +271,12 @@ var InternalProTable = function InternalProTable(props) {
250
271
 
251
272
  // 异步树
252
273
  if (!parentFieldName) {
253
- _context.next = 20;
274
+ _context2.next = 19;
254
275
  break;
255
276
  }
256
277
  (_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.onRequestTree(params.query, record);
257
- return _context.abrupt("return");
258
- case 20:
259
- // 记录查询条件
260
- searchParamRef.current = params;
278
+ return _context2.abrupt("return");
279
+ case 19:
261
280
  onEvent === null || onEvent === void 0 || onEvent(eventType, {
262
281
  loading: true,
263
282
  params: params
@@ -269,10 +288,10 @@ var InternalProTable = function InternalProTable(props) {
269
288
  loading: true
270
289
  });
271
290
  });
272
- _context.next = 25;
291
+ _context2.next = 23;
273
292
  return httpRequest(params);
274
- case 25:
275
- requestResult = _context.sent;
293
+ case 23:
294
+ requestResult = _context2.sent;
276
295
  onEvent === null || onEvent === void 0 || onEvent(eventType, {
277
296
  loading: false,
278
297
  params: params,
@@ -281,7 +300,7 @@ var InternalProTable = function InternalProTable(props) {
281
300
 
282
301
  // 请求结果
283
302
  if (!requestResult) {
284
- _context.next = 37;
303
+ _context2.next = 35;
285
304
  break;
286
305
  }
287
306
  // 获取table数据
@@ -291,7 +310,7 @@ var InternalProTable = function InternalProTable(props) {
291
310
  }
292
311
  total = getDataFromFields(requestResult, fieldNames.total);
293
312
  if (!(total === undefined || dataSource === undefined)) {
294
- _context.next = 35;
313
+ _context2.next = 33;
295
314
  break;
296
315
  }
297
316
  newData = {
@@ -302,8 +321,8 @@ var InternalProTable = function InternalProTable(props) {
302
321
  loading: false
303
322
  };
304
323
  setData(newData);
305
- return _context.abrupt("return");
306
- case 35:
324
+ return _context2.abrupt("return");
325
+ case 33:
307
326
  // 当前页无数据,返回上一页
308
327
  if (!dataSource.length && pageNo !== 1) {
309
328
  onRequest(TableEvent.Reload, pageNo - 1);
@@ -316,21 +335,21 @@ var InternalProTable = function InternalProTable(props) {
316
335
  total: total || 0
317
336
  });
318
337
  }
319
- return _context.abrupt("return");
320
- case 37:
338
+ return _context2.abrupt("return");
339
+ case 35:
321
340
  setData(function (d) {
322
341
  return _objectSpread(_objectSpread({}, d), {}, {
323
342
  loading: false
324
343
  });
325
344
  });
326
- case 38:
345
+ case 36:
327
346
  case "end":
328
- return _context.stop();
347
+ return _context2.stop();
329
348
  }
330
- }, _callee);
349
+ }, _callee2);
331
350
  }));
332
351
  return function onRequest(_x) {
333
- return _ref2.apply(this, arguments);
352
+ return _ref3.apply(this, arguments);
334
353
  };
335
354
  }();
336
355
 
@@ -382,12 +401,17 @@ var InternalProTable = function InternalProTable(props) {
382
401
 
383
402
  // 查询按钮
384
403
  var onSearch = function onSearch() {
404
+ var _table$rowSelection, _table$rowSelection$o;
405
+ // @ts-ignore
406
+ table === null || table === void 0 || (_table$rowSelection = table.rowSelection) === null || _table$rowSelection === void 0 || (_table$rowSelection$o = _table$rowSelection.onClearByProTable) === null || _table$rowSelection$o === void 0 || _table$rowSelection$o.call(_table$rowSelection);
385
407
  onRequest(TableEvent.Search);
386
408
  };
387
409
 
388
410
  // 重置
389
411
  var onReset = function onReset() {
390
- var _formRef$current2;
412
+ var _table$rowSelection2, _table$rowSelection2$, _formRef$current2;
413
+ // @ts-ignore
414
+ table === null || table === void 0 || (_table$rowSelection2 = table.rowSelection) === null || _table$rowSelection2 === void 0 || (_table$rowSelection2$ = _table$rowSelection2.onClearByProTable) === null || _table$rowSelection2$ === void 0 || _table$rowSelection2$.call(_table$rowSelection2);
391
415
  // 重置表单
392
416
  (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.resetFields();
393
417
  // 清空columns显示filter和sort值
@@ -406,16 +430,17 @@ var InternalProTable = function InternalProTable(props) {
406
430
 
407
431
  // 刷新
408
432
  var onReload = function onReload() {
433
+ var _table$rowSelection3, _table$rowSelection3$;
434
+ // @ts-ignore
435
+ table === null || table === void 0 || (_table$rowSelection3 = table.rowSelection) === null || _table$rowSelection3 === void 0 || (_table$rowSelection3$ = _table$rowSelection3.onClearByProTable) === null || _table$rowSelection3$ === void 0 || _table$rowSelection3$.call(_table$rowSelection3);
409
436
  onRequest(TableEvent.Reload, data.current, data.pageSize);
410
437
  };
411
438
 
412
439
  // form 数据 查询,重载,重置方法
413
440
  useImperativeHandle(proRef, function () {
414
- var _formRef$current3;
415
441
  return {
416
442
  data: data,
417
- formValues: (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldsValue(),
418
- searchParam: searchParamRef.current,
443
+ getFormValues: getFormValues,
419
444
  onSearch: onSearch,
420
445
  onReload: onReload,
421
446
  onPartialReload: function onPartialReload(param) {
@@ -550,9 +575,9 @@ var InternalProTable = function InternalProTable(props) {
550
575
  }, rootStyle);
551
576
  }
552
577
  var onFullScreen = function onFullScreen(isFull) {
553
- var _ref3 = containerRef.current || {},
554
- classList = _ref3.classList,
555
- style = _ref3.style;
578
+ var _ref4 = containerRef.current || {},
579
+ classList = _ref4.classList,
580
+ style = _ref4.style;
556
581
  if (isFull) {
557
582
  classList === null || classList === void 0 || classList.add('css-table-full');
558
583
  style.backgroundColor = token.colorBgContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-alpha-7",
3
+ "version": "2.3.6-alpha-8",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {