vap1 0.2.3 → 0.2.4
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/components/Box/Box.js +75 -42
- package/components/Box/SelectBar.js +51 -24
- package/components/Box/_register.d.ts +4 -0
- package/components/Box/_register.js +10 -8
- package/components/Box/index.js +1 -1
- package/components/Lists/SList.js +76 -48
- package/components/SearchBar/ActionButtons.js +75 -42
- package/components/SearchBar/ByField.js +80 -52
- package/components/SearchBar/ByKeyword.js +44 -17
- package/components/SearchBar/SearchField.js +8 -8
- package/components/SearchBar/SearchTags.js +4 -4
- package/components/SearchBar/_register.js +9 -8
- package/components/SearchBar/index.js +22 -11
- package/components/Tables/ApiTable.d.ts +1 -1
- package/components/Tables/ApiTable.js +19 -8
- package/components/Tables/ApiTableModal.d.ts +1 -1
- package/components/Tables/ApiTableModal.js +40 -13
- package/components/Tables/Components/ActionBar.js +53 -26
- package/components/Tables/Components/Actions.js +40 -29
- package/components/Tables/Components/Summary.js +2 -2
- package/components/Tables/Components/index.js +3 -3
- package/components/Tables/STable.js +21 -10
- package/components/Tables/TopTable.d.ts +3 -2
- package/components/Tables/TopTable.js +64 -37
- package/components/Tables/TopTableModal.js +21 -10
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +11 -9
- package/components/Tables/VTable.d.ts +2 -2
- package/components/Tables/VTable.js +137 -65
- package/components/Tables/index.d.ts +7 -2
- package/components/Tables/index.js +5 -5
- package/components/TreeSelect/BaseTreeSelect.js +81 -45
- package/components/TreeSelect/DTreeSelect.js +191 -66
- package/components/TreeSelect/FTreeSelect.js +67 -20
- package/components/TreeSelect/STreeSelect.js +22 -11
- package/components/Trees/ActionTree.js +562 -431
- package/components/Trees/BaseTree.js +85 -38
- package/components/Trees/COTree/COButton.js +48 -21
- package/components/Trees/COTree/COSelect.js +31 -20
- package/components/Trees/COTree/COTree.js +223 -107
- package/components/Trees/COTree/COTreeUtil.js +160 -115
- package/components/Trees/DTree.js +139 -68
- package/components/Trees/FTree.js +76 -29
- package/components/Trees/STree.js +59 -23
- package/components/UForm/FormWrapper.js +70 -53
- package/components/UForm/UDescriptions.js +38 -38
- package/components/UForm/UForm.js +240 -135
- package/components/UForm/UFormModal.js +99 -44
- package/components/UForm/UInfo.js +33 -22
- package/components/UForm/UInfoModal.js +31 -20
- package/components/UForm/UModal.js +40 -13
- package/components/UForm/_FormUtils.js +29 -18
- package/components/UForm/_input.js +75 -39
- package/components/UForm/_register.js +11 -9
- package/components/Upload/UploadFile.js +38 -11
- package/components/Upload/UploadImage.js +50 -23
- package/components/Upload/UploadModal.js +149 -84
- package/components/Upload/useUpload.js +35 -19
- package/components/_RegisterUtil.js +20 -8
- package/components/_adapt/Alert.js +20 -9
- package/components/_adapt/Breadcrumb.js +18 -7
- package/components/_adapt/Button.js +24 -13
- package/components/_adapt/Col.js +34 -23
- package/components/_adapt/Collapse.js +21 -10
- package/components/_adapt/ColorPicker.js +55 -28
- package/components/_adapt/ConfigProvider.js +14 -3
- package/components/_adapt/Drawer.js +18 -7
- package/components/_adapt/Dropdown.js +23 -12
- package/components/_adapt/FloatButton.js +21 -10
- package/components/_adapt/Icon.js +18 -7
- package/components/_adapt/Input.js +17 -6
- package/components/_adapt/InputNumber.js +16 -5
- package/components/_adapt/Layout.js +84 -28
- package/components/_adapt/Menu.js +28 -17
- package/components/_adapt/Modal.js +72 -25
- package/components/_adapt/Pagination.js +14 -3
- package/components/_adapt/Popconfirm.js +17 -6
- package/components/_adapt/Popover.js +17 -6
- package/components/_adapt/Progress.js +42 -11
- package/components/_adapt/Radio.js +21 -10
- package/components/_adapt/Row.js +18 -7
- package/components/_adapt/Select.js +54 -43
- package/components/_adapt/Slider.js +1 -1
- package/components/_adapt/Space.js +2 -2
- package/components/_adapt/Table.js +16 -5
- package/components/_adapt/Tabs.js +17 -6
- package/components/_adapt/Tag.js +19 -8
- package/components/_adapt/Tooltip.js +15 -4
- package/components/_adapt/TreeSelect.js +18 -7
- package/components/_adapt/notification.js +1 -1
- package/components/_adapt/todo/Image.js +2 -2
- package/components/_adapt/todo/NotEffectOnV15.js +1 -1
- package/components/_adapt/todo/Segmented.js +2 -2
- package/components/_adapt/utils.js +28 -8
- package/components/_common/AutoComplete.js +101 -34
- package/components/_common/CountUp.js +30 -14
- package/components/_common/DateRange.js +36 -20
- package/components/_common/HighLight.js +22 -6
- package/components/_common/I18N.js +27 -2
- package/components/_common/Loading.js +25 -9
- package/components/_common/MonthRange.js +26 -26
- package/components/_common/PromiseLabel.js +68 -15
- package/components/_common/Role.js +2 -2
- package/components/_common/Upagination.js +45 -34
- package/components/_setup/Const.js +2 -2
- package/components/_setup/I18N/enUS.js +2 -2
- package/components/_setup/I18N/zhCN.js +3 -3
- package/components/_setup/I18N/zhHK.js +2 -2
- package/components/_setup/ICON/IconTypes.js +2 -2
- package/components/_setup/SearchField/SearchFieldAdvance.js +22 -11
- package/components/_setup/SearchField/SearchFieldDate.js +114 -77
- package/components/_setup/SearchField/SearchFieldInput.js +21 -10
- package/components/_setup/SearchField/SearchFieldSelect.js +55 -44
- package/components/_setup/SearchField/SearchFieldTree.js +63 -52
- package/components/_setup/SelectBar/SelectList.js +21 -10
- package/components/_setup/SelectBar/SelectTree.js +17 -6
- package/components/_setup/UForm/UFormAdvanceInput.js +105 -78
- package/components/_setup/UForm/UFormCOTree.js +21 -10
- package/components/_setup/UForm/UFormCrontab.js +51 -35
- package/components/_setup/UForm/UFormDate.js +158 -122
- package/components/_setup/UForm/UFormInput.js +110 -73
- package/components/_setup/UForm/UFormJSON.js +95 -57
- package/components/_setup/UForm/UFormJSONTable.js +79 -41
- package/components/_setup/UForm/UFormOrg.js +112 -48
- package/components/_setup/UForm/UFormRole.js +31 -20
- package/components/_setup/UForm/UFormSelect.js +106 -79
- package/components/_setup/UForm/UFormTree.js +52 -41
- package/components/_setup/UForm/UFormUpload.js +62 -34
- package/components/_setup/UForm/_utils.js +9 -9
- package/deps/JsonView.js +18 -7
- package/deps/SpringBoot.js +1 -1
- package/deps/SpringCloud.js +4 -4
- package/deps/_editor/advance/_Image.js +33 -20
- package/deps/_editor/base/Element.js +28 -17
- package/deps/_editor/base/Leaf.js +18 -7
- package/deps/_editor/base/Support.js +4 -4
- package/deps/_editor/i18n.js +1 -1
- package/deps/_editor/tools/Button.js +31 -19
- package/deps/_editor/tools/ToolBar.js +3 -3
- package/deps/_editor/tools/_BlockButton.js +49 -27
- package/deps/_editor/tools/_InsertButton.js +32 -28
- package/deps/_editor/tools/_MarkButton.js +15 -14
- package/deps/_editor/tools/_TxtButton.js +90 -58
- package/deps/api-audit.js +1 -1
- package/deps/echarts.js +58 -17
- package/deps/editor.js +52 -26
- package/deps/registerEditor.js +18 -7
- package/hooks/_list.js +1 -1
- package/hooks/useAjax.js +43 -19
- package/hooks/useAjaxAction.js +57 -20
- package/hooks/useAjaxQuery.js +121 -51
- package/hooks/useApi.js +35 -8
- package/hooks/useApiBase.js +291 -184
- package/hooks/useApiGlobal.js +40 -13
- package/hooks/useApp.js +4 -4
- package/hooks/useArray.js +114 -52
- package/hooks/useDefault.js +19 -3
- package/hooks/useDoLoad.js +25 -9
- package/hooks/useEffectFunction.js +4 -3
- package/hooks/useEffectOnce.js +5 -5
- package/hooks/useError.js +21 -5
- package/hooks/useFirstMountState.js +3 -3
- package/hooks/useGenkey.js +7 -7
- package/hooks/useGetSet.js +9 -9
- package/hooks/useGlobal.js +58 -29
- package/hooks/useHover.js +25 -9
- package/hooks/useMemoPromise.js +62 -22
- package/hooks/useModals.js +71 -36
- package/hooks/useMountedState.js +6 -6
- package/hooks/useOpenState.js +26 -10
- package/hooks/usePromise.js +15 -13
- package/hooks/useQueue.js +35 -8
- package/hooks/useSetState.js +25 -8
- package/hooks/useStateList.js +30 -18
- package/hooks/useSyncExternalStore.js +31 -15
- package/hooks/useToggle.js +6 -3
- package/hooks/useUnmountPromise.js +11 -11
- package/hooks/useUpdate.js +20 -4
- package/hooks/useUpdateEffect.js +5 -5
- package/login/Base65.js +15 -14
- package/login/Password.js +91 -38
- package/login/SM4.js +50 -49
- package/login/cems/index.js +2 -2
- package/login/jit/index.js +16 -71
- package/login/jit/pnxclient.js +6 -4
- package/login/vap/index.js +1 -1
- package/login/xrtx/index.js +2 -2
- package/package.json +1 -1
- package/screen/Comment.js +16 -5
- package/screen/Page.js +14 -14
- package/screen/render.js +2 -2
- package/uform/FormEditor.js +43 -26
- package/uform/FormViewer.js +30 -19
- package/uform/hooks/useEditor.js +83 -47
- package/uform/hooks/useForm.js +2 -2
- package/uform/index.js +10 -10
- package/uform/inputs/_advance.js +12 -12
- package/uform/inputs/_date.js +63 -52
- package/uform/inputs/_input.js +49 -38
- package/uform/inputs/_select.js +53 -42
- package/uform/inputs/_specific.js +33 -22
- package/uform/inputs/index.js +5 -5
- package/uform/inputs/register.js +14 -14
- package/uform/panel/Editor/GroupEditor.js +31 -31
- package/uform/panel/Editor/ListEditor.js +22 -22
- package/uform/panel/Editor/_FieldItems.js +16 -16
- package/uform/panel/Editor/_GroupCollapse.js +9 -9
- package/uform/panel/Editor/_GroupDefault.js +9 -9
- package/uform/panel/Editor/_GroupStep.js +18 -18
- package/uform/panel/Editor/_GroupTab.js +16 -16
- package/uform/panel/Editor/index.js +17 -17
- package/uform/panel/Items/index.js +22 -11
- package/uform/panel/Propreties/CanvasProperties.js +14 -14
- package/uform/panel/Propreties/Component/FieldPlugin.js +5 -5
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +22 -47
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +20 -43
- package/uform/panel/Propreties/Component/Links.js +40 -29
- package/uform/panel/Propreties/Component/OptionTable.js +97 -52
- package/uform/panel/Propreties/Component/RegexpModal.js +11 -11
- package/uform/panel/Propreties/Component/Validate.js +35 -24
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +13 -24
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +15 -38
- package/uform/panel/Propreties/FieldOptions.js +78 -44
- package/uform/panel/Propreties/FieldProperties.js +47 -20
- package/uform/panel/Propreties/GroupProperties.js +9 -9
- package/uform/panel/Propreties/_ItemAdvance.js +37 -26
- package/uform/panel/Propreties/_ItemBase.js +30 -19
- package/uform/panel/Propreties/_ItemLink.js +20 -9
- package/uform/panel/Propreties/_ItemValidate.js +33 -22
- package/uform/plugins/index.js +7 -7
- package/uform/utils/Convert.js +137 -94
- package/uform/utils/SchemaConvert.js +43 -68
- package/uform/utils/arr.js +103 -75
- package/utils/Ajax.d.ts +1 -11
- package/utils/Ajax.js +154 -68
- package/utils/ArrayUtil.js +14 -12
- package/utils/CacheUtil.js +19 -13
- package/utils/Const.js +13 -13
- package/utils/CustomApp.js +15 -10
- package/utils/EventUtil.js +78 -14
- package/utils/Format.js +59 -38
- package/utils/Global.js +8 -8
- package/utils/Logger.js +56 -11
- package/utils/PageUtil.d.ts +12 -6
- package/utils/PageUtil.js +105 -35
- package/utils/Renders/ApiGetRender.js +187 -100
- package/utils/Renders/ApiPostRender.js +123 -69
- package/utils/Renders/DateRender.js +9 -9
- package/utils/Renders/DictRender.js +82 -55
- package/utils/Renders/FileRender.js +34 -12
- package/utils/Renders/ListRender.js +21 -21
- package/utils/Renders/NumberRender.js +14 -13
- package/utils/Renders/StatusRender.js +20 -20
- package/utils/Renders/StringRender.js +17 -17
- package/utils/Renders/_define.d.ts +2 -2
- package/utils/Renders/_define.js +7 -7
- package/utils/StringUtil.js +98 -67
- package/utils/TreeUtil.js +71 -20
- package/utils/VAP.js +14 -14
- package/utils/XHR.js +27 -11
- package/utils/_AjaxUtil.d.ts +10 -0
- package/utils/_AjaxUtil.js +35 -12
- package/utils/_Support.js +26 -26
- package/utils/i18n.js +78 -44
- package/utils/index.d.ts +9 -1
- package/utils/index.js +34 -5
- package/utils/screenful.js +82 -29
- package/widget/index.js +4 -4
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,24 +33,40 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
33
|
__setModuleDefault(result, mod);
|
|
23
34
|
return result;
|
|
24
35
|
};
|
|
36
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
37
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
|
+
if (!m) return o;
|
|
39
|
+
var i = m.call(o), r, ar = [], e;
|
|
40
|
+
try {
|
|
41
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
42
|
+
}
|
|
43
|
+
catch (error) { e = { error: error }; }
|
|
44
|
+
finally {
|
|
45
|
+
try {
|
|
46
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
47
|
+
}
|
|
48
|
+
finally { if (e) throw e.error; }
|
|
49
|
+
}
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
25
52
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
53
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
54
|
};
|
|
28
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
56
|
exports.TopTable = void 0;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
58
|
+
var react_1 = __importStar(require("react"));
|
|
59
|
+
var Table_1 = require("../_adapt/Table");
|
|
60
|
+
var utils_1 = require("../../utils");
|
|
61
|
+
var Util_1 = require("./Util");
|
|
62
|
+
var VTable_1 = require("./VTable");
|
|
63
|
+
var TopTable = function (props) {
|
|
37
64
|
var _a;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
var _b = __read((0, react_1.useState)([]), 2), columns = _b[0], setColumns = _b[1];
|
|
66
|
+
var tableRef = (0, react_1.useRef)(null);
|
|
67
|
+
var isQuerying = false;
|
|
68
|
+
var rowKey = 'id';
|
|
69
|
+
var list = [];
|
|
43
70
|
if (props.list) {
|
|
44
71
|
list = props.list.slice(0);
|
|
45
72
|
}
|
|
@@ -60,22 +87,22 @@ const TopTable = props => {
|
|
|
60
87
|
}
|
|
61
88
|
if (props.rowKey)
|
|
62
89
|
rowKey = props.rowKey;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(0, react_1.useEffect)(()
|
|
66
|
-
|
|
90
|
+
var _c = __read((0, react_1.useState)(undefined), 2), scroll = _c[0], setScroll = _c[1];
|
|
91
|
+
var _d = __read((0, react_1.useState)(null), 2), selected = _d[0], setSelected = _d[1];
|
|
92
|
+
(0, react_1.useEffect)(function () {
|
|
93
|
+
var cols = [];
|
|
67
94
|
if (props.showIndex !== false) {
|
|
68
95
|
cols.push((0, Util_1.getIdxColumn)({ current: 0 }, props.showIndex, true));
|
|
69
96
|
}
|
|
70
|
-
props.columns.map(col
|
|
97
|
+
props.columns.map(function (col) {
|
|
71
98
|
if (col.roleCode) {
|
|
72
99
|
if (!utils_1.PageUtil.hasRole(col.roleCode)) {
|
|
73
100
|
return;
|
|
74
101
|
}
|
|
75
102
|
}
|
|
76
103
|
if (col.ik) {
|
|
77
|
-
|
|
78
|
-
cols.push(
|
|
104
|
+
var title = utils_1.i18n.txt(col.ik);
|
|
105
|
+
cols.push(__assign(__assign({}, col), { title: title == '' ? col.title : title }));
|
|
79
106
|
}
|
|
80
107
|
else {
|
|
81
108
|
cols.push(col);
|
|
@@ -83,7 +110,7 @@ const TopTable = props => {
|
|
|
83
110
|
});
|
|
84
111
|
setColumns(cols);
|
|
85
112
|
}, [props.columns]);
|
|
86
|
-
|
|
113
|
+
var onRowSelect = (0, react_1.useCallback)(function (data) {
|
|
87
114
|
if (selected == null || data[rowKey] != selected[rowKey]) {
|
|
88
115
|
setSelected(data);
|
|
89
116
|
props.onRowSelect(data);
|
|
@@ -94,15 +121,15 @@ const TopTable = props => {
|
|
|
94
121
|
setSelected(null);
|
|
95
122
|
props.onRowSelect(null);
|
|
96
123
|
}, [selected]);
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
var resizePid = (0, react_1.useRef)(null);
|
|
125
|
+
var resize = function () {
|
|
99
126
|
if (props.scroll === null)
|
|
100
127
|
return;
|
|
101
128
|
clearTimeout(resizePid.current);
|
|
102
|
-
resizePid.current = setTimeout(()
|
|
103
|
-
|
|
129
|
+
resizePid.current = setTimeout(function () {
|
|
130
|
+
var thead = (0, VTable_1.getHeightByTagName)(tableRef.current, 'thead') || 40;
|
|
104
131
|
tableRef.current.style.display = 'none';
|
|
105
|
-
|
|
132
|
+
var height = tableRef.current.parentElement.getBoundingClientRect().height;
|
|
106
133
|
if (height == 0) {
|
|
107
134
|
setScroll(undefined);
|
|
108
135
|
}
|
|
@@ -112,34 +139,34 @@ const TopTable = props => {
|
|
|
112
139
|
tableRef.current.style.display = 'block';
|
|
113
140
|
}, 50);
|
|
114
141
|
};
|
|
115
|
-
(0, react_1.useEffect)(()
|
|
142
|
+
(0, react_1.useEffect)(function () {
|
|
116
143
|
resize();
|
|
117
144
|
window.addEventListener('resize', resize, false);
|
|
118
|
-
return ()
|
|
145
|
+
return function () { return window.removeEventListener('resize', resize); };
|
|
119
146
|
}, []);
|
|
120
|
-
(0, react_1.useEffect)(()
|
|
147
|
+
(0, react_1.useEffect)(function () {
|
|
121
148
|
if (lodash_1.default.isArray(list) && list.length && props.mustSelect && props.onRowSelect) {
|
|
122
149
|
setSelected(list[0]);
|
|
123
150
|
props.onRowSelect(list[0]);
|
|
124
151
|
}
|
|
125
152
|
}, [props.list, (_a = props.model) === null || _a === void 0 ? void 0 : _a.list]);
|
|
126
|
-
|
|
153
|
+
var tableProps = {
|
|
127
154
|
tableLayout: 'fixed',
|
|
128
|
-
rowKey,
|
|
155
|
+
rowKey: rowKey,
|
|
129
156
|
size: utils_1.GLOBAL.CONFIG.TABLE.SIZE,
|
|
130
157
|
showSorterTooltip: false,
|
|
131
158
|
pagination: false,
|
|
132
159
|
};
|
|
133
160
|
if (lodash_1.default.isFunction(props.onRowSelect)) {
|
|
134
|
-
tableProps.onRow = row
|
|
135
|
-
onClick: (event)
|
|
136
|
-
utils_1.PageUtil.stopEvent(event, ()
|
|
161
|
+
tableProps.onRow = function (row) { return ({
|
|
162
|
+
onClick: function (event) {
|
|
163
|
+
utils_1.PageUtil.stopEvent(event, function () { return onRowSelect(row); });
|
|
137
164
|
}
|
|
138
|
-
});
|
|
165
|
+
}); };
|
|
139
166
|
}
|
|
140
167
|
return react_1.default.createElement("div", { ref: tableRef, className: 'c-table-top-container' },
|
|
141
|
-
react_1.default.createElement(Table_1.Table,
|
|
142
|
-
|
|
168
|
+
react_1.default.createElement(Table_1.Table, __assign({}, tableProps, props, { rowClassName: function (record, i) {
|
|
169
|
+
var clazz = [];
|
|
143
170
|
if (i <= 3)
|
|
144
171
|
clazz.push('c-table-top-' + i);
|
|
145
172
|
if (lodash_1.default.isFunction(props.onRowSelect)) {
|
|
@@ -147,7 +174,7 @@ const TopTable = props => {
|
|
|
147
174
|
clazz.push('ant-table-row-selected');
|
|
148
175
|
}
|
|
149
176
|
else {
|
|
150
|
-
clazz.push('c-table-
|
|
177
|
+
clazz.push('c-table-cursor');
|
|
151
178
|
}
|
|
152
179
|
}
|
|
153
180
|
return clazz.join(' ');
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.TopTableModal = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
20
|
+
var Modal_1 = require("../_adapt/Modal");
|
|
21
|
+
var TopTable_1 = require("./TopTable");
|
|
22
|
+
var TOP_TABLE_PROPERTIES = [
|
|
12
23
|
'mode', 'columns', 'showIndex', 'rowKey', 'autoLoad', 'model', 'list', 'ajaxQuery', 'mustSelect', 'onRowSelect'
|
|
13
24
|
];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return react_1.default.createElement(Modal_1.Modal,
|
|
18
|
-
react_1.default.createElement(TopTable_1.TopTable,
|
|
25
|
+
var TopTableModal = function (props) {
|
|
26
|
+
var modalProps = lodash_1.default.omit(props, TOP_TABLE_PROPERTIES);
|
|
27
|
+
var tableProps = lodash_1.default.pick(props, TOP_TABLE_PROPERTIES);
|
|
28
|
+
return react_1.default.createElement(Modal_1.Modal, __assign({}, modalProps),
|
|
29
|
+
react_1.default.createElement(TopTable_1.TopTable, __assign({}, tableProps)));
|
|
19
30
|
};
|
|
20
31
|
exports.TopTableModal = TopTableModal;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MutableRefObject } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getIdxColumn: (ref: MutableRefObject<number>, showIndex?: string, isRank?: boolean) =>
|
|
2
|
+
import type { ColumnProps } from 'antd/es/table/interface';
|
|
3
|
+
export declare const getIdxColumn: (ref: MutableRefObject<number>, showIndex?: string, isRank?: boolean) => ColumnProps<any>;
|
|
@@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getIdxColumn = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
var utils_1 = require("../../utils");
|
|
9
|
+
var Const_1 = require("../_setup/Const");
|
|
10
|
+
var getIdxColumn = function (ref, showIndex, isRank) {
|
|
11
|
+
if (showIndex === void 0) { showIndex = null; }
|
|
12
|
+
if (isRank === void 0) { isRank = false; }
|
|
13
|
+
var idxRender = function (x, y, i) { return ref.current + i + 1; };
|
|
14
|
+
var title;
|
|
13
15
|
if (lodash_1.default.isString(showIndex)) {
|
|
14
16
|
if (utils_1.i18n.hasKey(showIndex)) {
|
|
15
17
|
title = utils_1.i18n.txt(showIndex);
|
|
@@ -21,7 +23,7 @@ const getIdxColumn = (ref, showIndex = null, isRank = false) => {
|
|
|
21
23
|
else {
|
|
22
24
|
title = utils_1.i18n.txt(isRank ? Const_1.V.TXT_RANK : Const_1.V.TXT_IDX);
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
var width = 48;
|
|
25
27
|
if (ref.current < 1000) {
|
|
26
28
|
width = 48;
|
|
27
29
|
}
|
|
@@ -33,8 +35,8 @@ const getIdxColumn = (ref, showIndex = null, isRank = false) => {
|
|
|
33
35
|
}
|
|
34
36
|
return {
|
|
35
37
|
className: '_index',
|
|
36
|
-
title,
|
|
37
|
-
width,
|
|
38
|
+
title: title,
|
|
39
|
+
width: width,
|
|
38
40
|
render: idxRender
|
|
39
41
|
};
|
|
40
42
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BaseTableProps,
|
|
2
|
+
import type { BaseTableProps, TableCol } from './index';
|
|
3
3
|
import type { ListModel } from '../../hooks/_list';
|
|
4
4
|
import type { PlainObject, Key } from '../../basetype';
|
|
5
5
|
export type VTableRef = {
|
|
@@ -15,7 +15,7 @@ export type VTableProps = BaseTableProps & {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const VTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
|
|
17
17
|
mode?: import("../Box/Box").BoxMode;
|
|
18
|
-
columns:
|
|
18
|
+
columns: TableCol[];
|
|
19
19
|
showIndex?: string | false;
|
|
20
20
|
rowKey?: string;
|
|
21
21
|
select?: true | "DEFAULT" | "QUERY";
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,85 +33,122 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
33
|
__setModuleDefault(result, mod);
|
|
23
34
|
return result;
|
|
24
35
|
};
|
|
36
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
37
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
|
+
if (!m) return o;
|
|
39
|
+
var i = m.call(o), r, ar = [], e;
|
|
40
|
+
try {
|
|
41
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
42
|
+
}
|
|
43
|
+
catch (error) { e = { error: error }; }
|
|
44
|
+
finally {
|
|
45
|
+
try {
|
|
46
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
47
|
+
}
|
|
48
|
+
finally { if (e) throw e.error; }
|
|
49
|
+
}
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
53
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
54
|
+
if (ar || !(i in from)) {
|
|
55
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
56
|
+
ar[i] = from[i];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
60
|
+
};
|
|
25
61
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
62
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
63
|
};
|
|
28
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
65
|
exports.VTable = exports.getHeightByTagName = void 0;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
67
|
+
var react_1 = __importStar(require("react"));
|
|
68
|
+
var Table_1 = require("../_adapt/Table");
|
|
69
|
+
var antd_1 = require("antd");
|
|
70
|
+
var ActionBar_1 = require("./Components/ActionBar");
|
|
71
|
+
var utils_1 = require("../../utils");
|
|
72
|
+
var Util_1 = require("./Util");
|
|
73
|
+
var HighLight_1 = require("../_common/HighLight");
|
|
74
|
+
var hooks_1 = require("../../hooks");
|
|
75
|
+
var Box_1 = require("../Box/Box");
|
|
40
76
|
;
|
|
41
|
-
|
|
77
|
+
var getHeightByTagName = function (root, tagName) {
|
|
42
78
|
if (root == null)
|
|
43
79
|
return 0;
|
|
44
|
-
|
|
80
|
+
var els = root.getElementsByTagName(tagName);
|
|
45
81
|
if (els.length) {
|
|
46
82
|
return els[0].getBoundingClientRect().height;
|
|
47
83
|
}
|
|
48
84
|
return 0;
|
|
49
85
|
};
|
|
50
86
|
exports.getHeightByTagName = getHeightByTagName;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
87
|
+
var _VTable = (0, react_1.forwardRef)(function (props, ref) {
|
|
88
|
+
var update = (0, hooks_1.useUpdate)();
|
|
89
|
+
var _a = (0, Box_1.useBox)(), state = _a.state, root = _a.root, resize = _a.resize;
|
|
54
90
|
// const [scroll, setScroll] = useState<TableProps<PlainObject>['scroll']>(undefined);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
(0, react_1.useEffect)(()
|
|
91
|
+
var _b = props.model, rowKey = _b.rowKey, list = _b.list, isQuerying = _b.isQuerying, pageNo = _b.pageNo, pageSize = _b.pageSize, orderBy = _b.orderBy, query = _b.query, total = _b.total;
|
|
92
|
+
var start = (0, react_1.useRef)(0);
|
|
93
|
+
var tableProps = {};
|
|
94
|
+
(0, react_1.useEffect)(function () {
|
|
59
95
|
var _a;
|
|
96
|
+
var _b;
|
|
60
97
|
if (state.selected == null)
|
|
61
98
|
return;
|
|
62
|
-
if (lodash_1.default.isFunction((
|
|
63
|
-
|
|
64
|
-
query(
|
|
99
|
+
if (lodash_1.default.isFunction((_b = props.selectBar) === null || _b === void 0 ? void 0 : _b.onSelect)) {
|
|
100
|
+
var param = (_a = props.selectBar).onSelect.apply(_a, __spreadArray([], __read(state.selected), false));
|
|
101
|
+
query(__assign(__assign({}, props.default), param));
|
|
65
102
|
}
|
|
66
103
|
}, [state.selected]);
|
|
67
104
|
// 更新页数
|
|
68
|
-
(0, react_1.useLayoutEffect)(()
|
|
105
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
69
106
|
start.current = pageSize * (pageNo - 1);
|
|
70
107
|
// @ts-ignore
|
|
71
108
|
if (props.model.mode == 'static')
|
|
72
109
|
update();
|
|
73
110
|
}, [pageSize, pageNo]);
|
|
74
|
-
// 计算 clolum
|
|
75
|
-
|
|
76
|
-
|
|
111
|
+
// 计算 clolum 及 高亮keyword
|
|
112
|
+
var columns = (0, react_1.useMemo)(function () {
|
|
113
|
+
var cols = [];
|
|
77
114
|
if (props.showIndex !== false)
|
|
78
115
|
cols.push((0, Util_1.getIdxColumn)(start, props.showIndex));
|
|
79
|
-
|
|
116
|
+
var HighKeys = new Set();
|
|
80
117
|
if (!utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD && lodash_1.default.has(props, 'searchBar.keyword')) {
|
|
81
118
|
if (lodash_1.default.isObject(props.searchBar.keyword)) {
|
|
82
|
-
(props.searchBar.keyword.highlight || []).map(key
|
|
119
|
+
(props.searchBar.keyword.highlight || []).map(function (key) { return HighKeys.add(key); });
|
|
83
120
|
}
|
|
84
121
|
else {
|
|
85
|
-
props.columns.map(col
|
|
86
|
-
|
|
87
|
-
|
|
122
|
+
props.columns.map(function (col) {
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
|
|
125
|
+
if (isGroup) {
|
|
126
|
+
col.children.map((function (item) {
|
|
127
|
+
if (lodash_1.default.isString(item.dataIndex))
|
|
128
|
+
HighKeys.add(item.dataIndex);
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
var dataIndex = col.dataIndex;
|
|
133
|
+
if (lodash_1.default.isString(dataIndex))
|
|
134
|
+
HighKeys.add(dataIndex);
|
|
135
|
+
}
|
|
88
136
|
});
|
|
89
137
|
}
|
|
90
138
|
}
|
|
91
|
-
|
|
139
|
+
var convertCol = function (col) {
|
|
92
140
|
if (col.roleCode && !utils_1.PageUtil.hasRole(col.roleCode))
|
|
93
|
-
return;
|
|
94
|
-
|
|
141
|
+
return null;
|
|
142
|
+
var item = __assign({}, col);
|
|
95
143
|
if (col.ik) {
|
|
96
|
-
|
|
144
|
+
var title = utils_1.i18n.txt(col.ik);
|
|
97
145
|
item.title = title == '' ? item.title : title;
|
|
98
146
|
}
|
|
99
147
|
if (HighKeys.has(item.dataIndex) && item.render == null) {
|
|
100
|
-
item.render = (record)
|
|
148
|
+
item.render = function (record) {
|
|
101
149
|
if (!lodash_1.default.isString(record))
|
|
102
150
|
return record;
|
|
103
|
-
|
|
151
|
+
var keyword = '';
|
|
104
152
|
if (record && keyword) {
|
|
105
153
|
return react_1.default.createElement(HighLight_1.HighLight, { text: record, keyword: keyword });
|
|
106
154
|
}
|
|
@@ -110,7 +158,7 @@ const _VTable = (0, react_1.forwardRef)((props, ref) => {
|
|
|
110
158
|
if (!lodash_1.default.has(item, 'ellipsis'))
|
|
111
159
|
item.ellipsis = true;
|
|
112
160
|
if (!lodash_1.default.has(item, 'width') && lodash_1.default.isString(item.title)) {
|
|
113
|
-
|
|
161
|
+
var clz = item.title.length + (item.sorter ? 2 : 0);
|
|
114
162
|
if (col.className) {
|
|
115
163
|
item.className = 'c-table-col-' + clz + ' ' + col.className;
|
|
116
164
|
}
|
|
@@ -118,14 +166,35 @@ const _VTable = (0, react_1.forwardRef)((props, ref) => {
|
|
|
118
166
|
item.className = 'c-table-col-' + clz;
|
|
119
167
|
}
|
|
120
168
|
}
|
|
121
|
-
|
|
169
|
+
return item;
|
|
170
|
+
};
|
|
171
|
+
props.columns.map(function (col) {
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
|
|
174
|
+
if (isGroup) {
|
|
175
|
+
var column_1 = __assign(__assign({}, lodash_1.default.pick(col, ['width', 'align'])), { children: [], title: col.title, className: 'c-table-header-group' });
|
|
176
|
+
if (col.className)
|
|
177
|
+
column_1.className = "c-table-header-group ".concat(col.className);
|
|
178
|
+
col.children.map((function (item) {
|
|
179
|
+
var subCol = convertCol(item);
|
|
180
|
+
if (subCol != null)
|
|
181
|
+
column_1.children.push(subCol);
|
|
182
|
+
}));
|
|
183
|
+
if (column_1.children.length > 0)
|
|
184
|
+
cols.push(column_1);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
var column = convertCol(col);
|
|
188
|
+
if (column != null)
|
|
189
|
+
cols.push(column);
|
|
190
|
+
}
|
|
122
191
|
});
|
|
123
192
|
return cols;
|
|
124
193
|
}, [props.columns]);
|
|
125
|
-
(0, react_1.useLayoutEffect)(()
|
|
194
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
126
195
|
resize();
|
|
127
196
|
}, [columns]);
|
|
128
|
-
(0, react_1.useEffect)(()
|
|
197
|
+
(0, react_1.useEffect)(function () {
|
|
129
198
|
if (props.autoLoad === false)
|
|
130
199
|
return;
|
|
131
200
|
// @ts-ignore
|
|
@@ -150,48 +219,51 @@ const _VTable = (0, react_1.forwardRef)((props, ref) => {
|
|
|
150
219
|
// // }, 2);
|
|
151
220
|
// }, [state?.height]);
|
|
152
221
|
// @ts-ignore
|
|
153
|
-
|
|
154
|
-
(0, react_1.useEffect)(()
|
|
222
|
+
var effectKey = props.model.effect;
|
|
223
|
+
(0, react_1.useEffect)(function () {
|
|
155
224
|
if (effectKey == null)
|
|
156
225
|
return;
|
|
157
|
-
|
|
226
|
+
var effectRow = effectKey;
|
|
158
227
|
if (lodash_1.default.isString(effectKey) && lodash_1.default.startsWith(effectKey, '_'))
|
|
159
228
|
effectRow = effectRow.substring(1);
|
|
160
|
-
|
|
161
|
-
|
|
229
|
+
var trs = root.current.getElementsByClassName('ant-table-row');
|
|
230
|
+
var size = trs.length;
|
|
162
231
|
if (size <= 0)
|
|
163
232
|
return;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
233
|
+
var _loop_1 = function (i) {
|
|
234
|
+
var tr = trs.item(i);
|
|
235
|
+
var key = tr.getAttribute('data-row-key');
|
|
167
236
|
if (key == effectRow) {
|
|
168
237
|
if (tr.classList.contains('c-table-high')) {
|
|
169
238
|
tr.classList.remove('c-table-high');
|
|
170
239
|
}
|
|
171
|
-
setTimeout(()
|
|
240
|
+
setTimeout(function () { return tr.classList.add('c-table-high'); }, 2);
|
|
172
241
|
}
|
|
242
|
+
};
|
|
243
|
+
for (var i = 0; i < size; i++) {
|
|
244
|
+
_loop_1(i);
|
|
173
245
|
}
|
|
174
246
|
}, [effectKey]);
|
|
175
247
|
if (props.select) {
|
|
176
248
|
tableProps.rowSelection = {
|
|
177
249
|
selectedRowKeys: ref.current.selected[0],
|
|
178
|
-
onChange: (selectedRowKeys, selectedObjects)
|
|
250
|
+
onChange: function (selectedRowKeys, selectedObjects) {
|
|
179
251
|
ref.current.selected = [selectedRowKeys, selectedObjects];
|
|
180
252
|
ref.current.onSelected();
|
|
181
253
|
update();
|
|
182
254
|
},
|
|
183
|
-
getCheckboxProps: record
|
|
255
|
+
getCheckboxProps: function (record) {
|
|
184
256
|
if (!lodash_1.default.has(record, rowKey))
|
|
185
257
|
return { disabled: true };
|
|
186
258
|
return { disabled: false };
|
|
187
259
|
},
|
|
188
260
|
};
|
|
189
261
|
}
|
|
190
|
-
return react_1.default.createElement(Table_1.Table,
|
|
262
|
+
return react_1.default.createElement(Table_1.Table, __assign({ rowKey: props.rowKey || rowKey,
|
|
191
263
|
// scroll={scroll}
|
|
192
264
|
// tableLayout="fixed"
|
|
193
265
|
// showSorterTooltip={false}
|
|
194
|
-
size: utils_1.GLOBAL.CONFIG.TABLE.SIZE, locale: { emptyText: react_1.default.createElement(antd_1.Empty, { style: { marginTop: 24 } }) } }, props, tableProps, { className: utils_1.StringUtil.className(['c-table'], props.className), pagination: false, columns: columns, dataSource: list, loading: isQuerying, onChange: (x, y, field)
|
|
266
|
+
size: utils_1.GLOBAL.CONFIG.TABLE.SIZE, locale: { emptyText: react_1.default.createElement(antd_1.Empty, { style: { marginTop: 24 } }) } }, props, tableProps, { className: utils_1.StringUtil.className(['c-table'], props.className), pagination: false, columns: columns, dataSource: list, loading: isQuerying, onChange: function (x, y, field) {
|
|
195
267
|
if (field.column) {
|
|
196
268
|
orderBy(field.field, field.order == 'ascend' ? 'asc' : 'desc');
|
|
197
269
|
}
|
|
@@ -200,25 +272,25 @@ const _VTable = (0, react_1.forwardRef)((props, ref) => {
|
|
|
200
272
|
}
|
|
201
273
|
} }));
|
|
202
274
|
});
|
|
203
|
-
exports.VTable = (0, react_1.forwardRef)((props, ref)
|
|
204
|
-
|
|
275
|
+
exports.VTable = (0, react_1.forwardRef)(function (props, ref) {
|
|
276
|
+
var _a = props.model, isQuerying = _a.isQuerying, pageNo = _a.pageNo, pageSize = _a.pageSize, total = _a.total, totalAcc = _a.totalAcc, param = _a.param, pageTo = _a.pageTo, query = _a.query, cost = _a.cost;
|
|
205
277
|
// 通过 ref 方式交互,后续扩展方法实现定制联页选择
|
|
206
|
-
|
|
278
|
+
var selectedRef = (0, react_1.useRef)({ selected: [[], []], onSelected: function () { }, });
|
|
207
279
|
// 对外提供getSelected方法获取当前选择的数据
|
|
208
|
-
(0, react_1.useImperativeHandle)(ref, ()
|
|
280
|
+
(0, react_1.useImperativeHandle)(ref, function () {
|
|
209
281
|
return {
|
|
210
|
-
getSelected() {
|
|
282
|
+
getSelected: function () {
|
|
211
283
|
return selectedRef.current.selected;
|
|
212
284
|
},
|
|
213
|
-
getParams: ()
|
|
285
|
+
getParams: function () {
|
|
214
286
|
return props.model.param;
|
|
215
287
|
}
|
|
216
288
|
};
|
|
217
289
|
}, [param]);
|
|
218
|
-
|
|
290
|
+
var boxProps = lodash_1.default.pick(props, ['selectBar', 'style', 'className', 'default', 'mode']);
|
|
219
291
|
if (props.searchBar) {
|
|
220
|
-
boxProps.searchBar =
|
|
221
|
-
|
|
292
|
+
boxProps.searchBar = __assign(__assign({}, props.searchBar), { disabled: isQuerying, onSearch: function (data) {
|
|
293
|
+
var queryParam = lodash_1.default.extend({}, param, data);
|
|
222
294
|
query(queryParam, true);
|
|
223
295
|
selectedRef.current.selected = [[], []];
|
|
224
296
|
selectedRef.current.onSelected();
|
|
@@ -253,6 +325,6 @@ exports.VTable = (0, react_1.forwardRef)((props, ref) => {
|
|
|
253
325
|
}
|
|
254
326
|
}
|
|
255
327
|
}
|
|
256
|
-
return react_1.default.createElement(Box_1.Box,
|
|
257
|
-
react_1.default.createElement(_VTable,
|
|
328
|
+
return react_1.default.createElement(Box_1.Box, __assign({}, boxProps),
|
|
329
|
+
react_1.default.createElement(_VTable, __assign({}, lodash_1.default.omit(props, ['className', 'style']), { ref: selectedRef })));
|
|
258
330
|
});
|
|
@@ -8,7 +8,12 @@ import type { TableActionButton } from './Components/ActionBar';
|
|
|
8
8
|
import type { PlainObject, BaseItem, ApiModel } from '../../basetype';
|
|
9
9
|
import type { BoxMode } from '../Box/Box';
|
|
10
10
|
import type { SelectBarProps } from '../Box/SelectBar';
|
|
11
|
-
export type TableColumn = BaseItem & ColumnProps<
|
|
11
|
+
export type TableColumn = BaseItem & Omit<ColumnProps<any>, 'children'>;
|
|
12
|
+
export type TableColumnGroup = Pick<TableColumn, 'className' | 'width' | 'align'> & {
|
|
13
|
+
title: string;
|
|
14
|
+
children: TableColumn[];
|
|
15
|
+
};
|
|
16
|
+
export type TableCol = TableColumn | TableColumnGroup;
|
|
12
17
|
/**
|
|
13
18
|
* 说明:为保持各应用 一致性 与 简单性
|
|
14
19
|
* 所有VAP组装 Table 排除一些自定义属性
|
|
@@ -19,7 +24,7 @@ export type BaseTableProps = TableDefine & {
|
|
|
19
24
|
/**
|
|
20
25
|
* 列
|
|
21
26
|
*/
|
|
22
|
-
columns:
|
|
27
|
+
columns: TableCol[];
|
|
23
28
|
/**
|
|
24
29
|
* 序号字段
|
|
25
30
|
* 1. 不传 :显示序号 , 支持国际化
|