@fle-ui/plus-table 1.2.23 → 1.2.25
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/index.d.ts +17 -55
- package/es/index.js +49 -31
- package/es/json/columnKeys.js +0 -16
- package/es/json/list.d.ts +1365 -0
- package/es/json/list.js +1388 -0
- package/lib/index.d.ts +17 -55
- package/lib/index.js +48 -30
- package/lib/json/columnKeys.js +0 -16
- package/lib/json/list.d.ts +1365 -0
- package/lib/json/list.js +1394 -0
- package/package.json +2 -2
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import type {
|
|
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
|
-
|
|
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<
|
|
61
|
-
updateSetting?: (params:
|
|
62
|
-
resetSetting?: () => Promise<
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import "antd/es/checkbox/style";
|
|
|
4
4
|
import _Checkbox from "antd/es/checkbox";
|
|
5
5
|
import "antd/es/button/style";
|
|
6
6
|
import _Button from "antd/es/button";
|
|
7
|
-
var _excluded = ["
|
|
7
|
+
var _excluded = ["columns", "hasShowFull", "request", "pagination", "formRef", "actionRef", "defaultColumnsState", "options", "action", "showDefaultSetting"];
|
|
8
8
|
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); }
|
|
9
9
|
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); }
|
|
10
10
|
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; }
|
|
@@ -23,22 +23,21 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
23
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
24
|
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; }
|
|
25
25
|
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; }
|
|
26
|
-
import React, { useEffect, useRef, useState, useImperativeHandle
|
|
26
|
+
import React, { useEffect, useRef, useState, useImperativeHandle } from 'react';
|
|
27
27
|
import { ProTable } from '@ant-design/pro-components';
|
|
28
28
|
import FormRender from './FormSearch/index';
|
|
29
29
|
import { BarsOutlined } from '@ant-design/icons';
|
|
30
30
|
import { simulateClick } from './utils/common';
|
|
31
31
|
import './FormSearch/index.less';
|
|
32
|
-
|
|
32
|
+
function PlusTable(props, ref) {
|
|
33
33
|
var _otherProps$scroll;
|
|
34
|
-
var
|
|
35
|
-
columns = props.columns,
|
|
34
|
+
var columns = props.columns,
|
|
36
35
|
_props$hasShowFull = props.hasShowFull,
|
|
37
36
|
hasShowFull = _props$hasShowFull === void 0 ? true : _props$hasShowFull,
|
|
38
37
|
request = props.request,
|
|
39
38
|
pagination = props.pagination,
|
|
40
39
|
formRef = props.formRef,
|
|
41
|
-
|
|
40
|
+
propsActionRef = props.actionRef,
|
|
42
41
|
defaultColumnsState = props.defaultColumnsState,
|
|
43
42
|
_props$options = props.options,
|
|
44
43
|
options = _props$options === void 0 ? {} : _props$options,
|
|
@@ -60,6 +59,10 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
60
59
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
60
|
columnsStateMap = _useState6[0],
|
|
62
61
|
setColumnsStateMap = _useState6[1];
|
|
62
|
+
var actionRef = useRef();
|
|
63
|
+
useImperativeHandle(propsActionRef, function () {
|
|
64
|
+
return actionRef.current;
|
|
65
|
+
});
|
|
63
66
|
useImperativeHandle(ref, function () {
|
|
64
67
|
return {
|
|
65
68
|
getFieldsValue: function () {
|
|
@@ -177,7 +180,9 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
177
180
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
178
181
|
while (1) switch (_context5.prev = _context5.next) {
|
|
179
182
|
case 0:
|
|
180
|
-
return _context5.abrupt("return", (_props$resetSetting = props.resetSetting) === null || _props$resetSetting === void 0 ? void 0 : _props$resetSetting.call(props))
|
|
183
|
+
return _context5.abrupt("return", (_props$resetSetting = props.resetSetting) === null || _props$resetSetting === void 0 ? void 0 : _props$resetSetting.call(props).then(function (res) {
|
|
184
|
+
res.success && init();
|
|
185
|
+
}));
|
|
181
186
|
case 1:
|
|
182
187
|
case "end":
|
|
183
188
|
return _context5.stop();
|
|
@@ -256,7 +261,7 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
256
261
|
onChange: handleOnChangeColumn //列状态的值发生改变之后触发
|
|
257
262
|
};
|
|
258
263
|
var propsRequest = /*#__PURE__*/function () {
|
|
259
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
|
|
264
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params, sort, filter) {
|
|
260
265
|
var _searchRef$current5, _drawFormRef$current4;
|
|
261
266
|
var res1, res2, res;
|
|
262
267
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -270,24 +275,34 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
270
275
|
return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
|
|
271
276
|
case 5:
|
|
272
277
|
res2 = _context8.sent;
|
|
273
|
-
|
|
278
|
+
if (!request) {
|
|
279
|
+
_context8.next = 12;
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
_context8.next = 9;
|
|
274
283
|
return request(_objectSpread(_objectSpread(_objectSpread({}, params), dealFetchParams(_objectSpread(_objectSpread(_objectSpread({}, res1), res2), params))), {}, {
|
|
275
284
|
showFull: showFull
|
|
276
|
-
}));
|
|
277
|
-
case
|
|
278
|
-
|
|
285
|
+
}), sort, filter);
|
|
286
|
+
case 9:
|
|
287
|
+
_context8.t0 = _context8.sent;
|
|
288
|
+
_context8.next = 13;
|
|
289
|
+
break;
|
|
290
|
+
case 12:
|
|
291
|
+
_context8.t0 = {};
|
|
292
|
+
case 13:
|
|
293
|
+
res = _context8.t0;
|
|
279
294
|
return _context8.abrupt("return", res);
|
|
280
|
-
case
|
|
295
|
+
case 15:
|
|
281
296
|
case "end":
|
|
282
297
|
return _context8.stop();
|
|
283
298
|
}
|
|
284
299
|
}, _callee8);
|
|
285
300
|
}));
|
|
286
|
-
return function propsRequest(_x5) {
|
|
301
|
+
return function propsRequest(_x5, _x6, _x7) {
|
|
287
302
|
return _ref5.apply(this, arguments);
|
|
288
303
|
};
|
|
289
304
|
}();
|
|
290
|
-
var optionsSetting = _typeof(options.setting) === 'object' ? options.setting : {};
|
|
305
|
+
var optionsSetting = _typeof(options) === 'object' && _typeof(options.setting) === 'object' ? options.setting : {};
|
|
291
306
|
var __options = (action === null || action === void 0 ? void 0 : action.includes('columnSetting')) && showDefaultSetting !== true ? _objectSpread(_objectSpread({}, options), {}, {
|
|
292
307
|
setting: _objectSpread(_objectSpread({}, optionsSetting), {}, {
|
|
293
308
|
checkedReset: false,
|
|
@@ -314,7 +329,9 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
314
329
|
}
|
|
315
330
|
}, otherProps, {
|
|
316
331
|
// 公共配置 大家都有的
|
|
317
|
-
pagination:
|
|
332
|
+
pagination: _objectSpread({
|
|
333
|
+
size: 'default'
|
|
334
|
+
}, pagination),
|
|
318
335
|
actionRef: actionRef,
|
|
319
336
|
formRef: searchRef
|
|
320
337
|
// 根据用户自定义的配置 如果配置了高级筛选就有这个配置
|
|
@@ -347,16 +364,18 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
347
364
|
key: "2",
|
|
348
365
|
type: "default",
|
|
349
366
|
onClick: function onClick() {
|
|
350
|
-
var _drawFormRef$current5;
|
|
367
|
+
var _drawFormRef$current5, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
|
|
351
368
|
drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
|
|
352
|
-
actionRef.current.reset();
|
|
353
|
-
actionRef.current.reload();
|
|
369
|
+
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);
|
|
370
|
+
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);
|
|
354
371
|
},
|
|
355
372
|
size: "middle"
|
|
356
|
-
}, "\u91CD\u7F6E"),
|
|
357
|
-
return item.search !== false;
|
|
358
|
-
}).length > 3 ? /*#__PURE__*/React.createElement("a", {
|
|
373
|
+
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement("a", {
|
|
359
374
|
key: "3",
|
|
375
|
+
style: {
|
|
376
|
+
wordBreak: 'break-word',
|
|
377
|
+
whiteSpace: 'nowrap'
|
|
378
|
+
},
|
|
360
379
|
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
361
380
|
var _drawFormRef$current6, _searchRef$current6;
|
|
362
381
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
@@ -373,7 +392,7 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
373
392
|
}
|
|
374
393
|
}, _callee9);
|
|
375
394
|
}))
|
|
376
|
-
}, /*#__PURE__*/React.createElement(BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009")
|
|
395
|
+
}, /*#__PURE__*/React.createElement(BarsOutlined, null), "\u9AD8\u7EA7\u7B5B\u9009")];
|
|
377
396
|
}
|
|
378
397
|
} : props.search
|
|
379
398
|
// 根据用户自定义的配置 如果配置了列设置就有这个配置完全受控
|
|
@@ -404,8 +423,7 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
404
423
|
search: false
|
|
405
424
|
});
|
|
406
425
|
}) : columns,
|
|
407
|
-
toolBarRender: function toolBarRender(searchConfig) {
|
|
408
|
-
var _otherProps$toolBarRe;
|
|
426
|
+
toolBarRender: function toolBarRender(searchConfig, rows) {
|
|
409
427
|
return [(action === null || action === void 0 ? void 0 : action.includes('viewInvisibleData')) ? /*#__PURE__*/React.createElement(_Checkbox, {
|
|
410
428
|
onChange: function onChange(e) {
|
|
411
429
|
setShowFull(e.target.checked);
|
|
@@ -413,7 +431,7 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
413
431
|
searchConfig === null || searchConfig === void 0 ? void 0 : searchConfig.reload();
|
|
414
432
|
}, 100);
|
|
415
433
|
}
|
|
416
|
-
}, "\u663E\u793A\u6240\u6709\u6570\u636E") : null,
|
|
434
|
+
}, "\u663E\u793A\u6240\u6709\u6570\u636E") : null, typeof otherProps.toolBarRender === 'function' && otherProps.toolBarRender(searchConfig, rows)];
|
|
417
435
|
},
|
|
418
436
|
options: __options
|
|
419
437
|
})), /*#__PURE__*/React.createElement(_Drawer, {
|
|
@@ -472,10 +490,10 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
472
490
|
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(_Button, {
|
|
473
491
|
type: "default",
|
|
474
492
|
onClick: function onClick() {
|
|
475
|
-
var _drawFormRef$current10;
|
|
493
|
+
var _drawFormRef$current10, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
|
|
476
494
|
drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
|
|
477
|
-
actionRef.current.reset();
|
|
478
|
-
actionRef.current.reload();
|
|
495
|
+
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);
|
|
496
|
+
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);
|
|
479
497
|
},
|
|
480
498
|
size: "middle"
|
|
481
499
|
}, "\u91CD\u7F6E"))];
|
|
@@ -488,5 +506,5 @@ var PlusTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
488
506
|
manualRequest: true,
|
|
489
507
|
action: actionRef
|
|
490
508
|
})));
|
|
491
|
-
}
|
|
492
|
-
export default PlusTable;
|
|
509
|
+
}
|
|
510
|
+
export default /*#__PURE__*/React.forwardRef(PlusTable);
|
package/es/json/columnKeys.js
CHANGED
|
@@ -3,14 +3,6 @@ export default {
|
|
|
3
3
|
code: '2000',
|
|
4
4
|
message: null,
|
|
5
5
|
data: [{
|
|
6
|
-
id: 12966348,
|
|
7
|
-
title: '商品编码',
|
|
8
|
-
field: 'goodsNumber',
|
|
9
|
-
sort: 0,
|
|
10
|
-
hideInTable: 0,
|
|
11
|
-
fixed: 1,
|
|
12
|
-
disabled: 1
|
|
13
|
-
}, {
|
|
14
6
|
id: 12966347,
|
|
15
7
|
title: '商品名称',
|
|
16
8
|
field: 'mainImage,name',
|
|
@@ -186,13 +178,5 @@ export default {
|
|
|
186
178
|
hideInTable: 1,
|
|
187
179
|
fixed: 0,
|
|
188
180
|
disabled: 0
|
|
189
|
-
}, {
|
|
190
|
-
id: 12966341,
|
|
191
|
-
title: '操作',
|
|
192
|
-
field: 'option',
|
|
193
|
-
sort: 23,
|
|
194
|
-
hideInTable: 0,
|
|
195
|
-
fixed: 2,
|
|
196
|
-
disabled: 1
|
|
197
181
|
}]
|
|
198
182
|
};
|