@vtx/components 3.1.140 → 3.1.141
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/README.md +19 -19
- package/lib/_util/filterSpecialCharacters.js +55 -66
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +4 -1
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getToken.js +16 -8
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +9 -2
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +1 -0
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +1 -0
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useColSize.js +13 -3
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js +3 -0
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +42 -26
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js +2 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +30 -1
- package/lib/index.js.map +1 -1
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/vtx-color-picker/index.js +33 -14
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +2 -0
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +2 -0
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-color-picker/style/index.less +12 -12
- package/lib/vtx-combogrid/Combogrid.js +96 -55
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +66 -41
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +7 -0
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +7 -0
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/Alert.js +15 -6
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/CheckboxList.js +71 -35
- package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +104 -58
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +18 -6
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +214 -138
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +46 -15
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +10 -0
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +10 -0
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +58 -28
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +77 -35
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +8 -2
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +1 -0
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +1 -0
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-editor/index.js +32 -13
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +1 -0
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +1 -0
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +8 -8
- package/lib/vtx-ellipsis-text/index.js +29 -16
- package/lib/vtx-ellipsis-text/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/css.js +1 -0
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.js +1 -0
- package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.less +13 -13
- package/lib/vtx-export/index.js +73 -38
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +5 -0
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +5 -0
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export/style/index.less +6 -6
- package/lib/vtx-export-async/History.js +117 -75
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +121 -80
- package/lib/vtx-export-async/index.js.map +1 -1
- package/lib/vtx-export-async/style/css.js.map +1 -1
- package/lib/vtx-export-async/style/index.js.map +1 -1
- package/lib/vtx-export-async/util.js +21 -9
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +39 -17
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +12 -6
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +38 -16
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +10 -4
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +9 -2
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +4 -1
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +43 -43
- package/lib/vtx-form-layout/index.js +25 -10
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +7 -0
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +7 -0
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +220 -220
- package/lib/vtx-image/Image.js +117 -77
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +63 -34
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +54 -24
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +11 -4
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +1 -0
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +1 -0
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-import/index.js +143 -91
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +33 -15
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +3 -0
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +3 -0
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-import/style/index.less +8 -8
- package/lib/vtx-import2/CheckResult.js +9 -2
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +38 -16
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +7 -2
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +15 -8
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +7 -2
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +176 -91
- package/lib/vtx-import2/index.js.map +1 -1
- package/lib/vtx-import2/style/css.js +3 -0
- package/lib/vtx-import2/style/css.js.map +1 -1
- package/lib/vtx-import2/style/index.js +3 -0
- package/lib/vtx-import2/style/index.js.map +1 -1
- package/lib/vtx-import2/style/index.less +102 -102
- package/lib/vtx-input/TextArea.js +31 -14
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +49 -24
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +1 -0
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +1 -0
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +24 -24
- package/lib/vtx-input/useLength.js +23 -10
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +9 -3
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +85 -52
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +1 -0
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +1 -0
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +11 -6
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +27 -16
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +13 -4
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +64 -34
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +23 -12
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +61 -32
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +11 -2
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/css.js.map +1 -1
- package/lib/vtx-page-layout/style/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +138 -138
- package/lib/vtx-rps-frame/index.js +58 -38
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-rps-frame/style/css.js.map +1 -1
- package/lib/vtx-rps-frame/style/index.js.map +1 -1
- package/lib/vtx-rps-frame/style/index.less +8 -8
- package/lib/vtx-scrollable-row/index.js +68 -34
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +113 -113
- package/lib/vtx-search/VtxCol.js +27 -8
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +15 -8
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +112 -67
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +4 -0
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +4 -0
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +98 -63
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +2 -0
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +2 -0
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +99 -47
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +8 -0
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +8 -0
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +68 -68
- package/lib/vtx-signature/index.js +34 -19
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +2 -0
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +2 -0
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +33 -33
- package/lib/vtx-split-pane/Pane.js +23 -12
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +41 -21
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +111 -55
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +7 -2
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +3 -0
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +3 -0
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +76 -76
- package/lib/vtx-statistics-column/Back.js +11 -4
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +32 -16
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +31 -15
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +4 -1
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +19 -2
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js +1 -0
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +1 -0
- package/lib/vtx-statistics-column/style/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +59 -59
- package/lib/vtx-time-picker/index.js +22 -8
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-time-picker/style/css.js.map +1 -1
- package/lib/vtx-time-picker/style/index.js.map +1 -1
- package/lib/vtx-tree/index.js +153 -83
- package/lib/vtx-tree/index.js.map +1 -1
- package/lib/vtx-tree/style/css.js +2 -0
- package/lib/vtx-tree/style/css.js.map +1 -1
- package/lib/vtx-tree/style/index.js +2 -0
- package/lib/vtx-tree/style/index.js.map +1 -1
- package/lib/vtx-tree/utils.js +31 -10
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +81 -37
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +4 -0
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +4 -0
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +35 -17
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +167 -90
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +6 -0
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +6 -0
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +61 -61
- package/lib/vtx-wang-editor/index.js +126 -84
- package/lib/vtx-wang-editor/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/css.js +1 -0
- package/lib/vtx-wang-editor/style/css.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.js +1 -0
- package/lib/vtx-wang-editor/style/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +141 -80
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +160 -80
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +1 -0
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +1 -0
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +45 -45
- package/lib/vtx-ztree-select/index.js +159 -91
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +3 -0
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +3 -0
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +109 -109
- package/package.json +1 -1
|
@@ -1,136 +1,183 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = VtxDatagrid;
|
|
8
9
|
exports.indexColumnKey = void 0;
|
|
10
|
+
|
|
9
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
10
13
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
14
|
+
|
|
11
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
|
|
12
17
|
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
18
|
+
|
|
13
19
|
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
20
|
+
|
|
14
21
|
var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
|
|
22
|
+
|
|
15
23
|
var _menu = _interopRequireDefault(require("antd/lib/menu"));
|
|
24
|
+
|
|
16
25
|
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
26
|
+
|
|
17
27
|
var _RedoOutlined = _interopRequireDefault(require("@ant-design/icons/RedoOutlined"));
|
|
28
|
+
|
|
18
29
|
var _ColumnHeightOutlined = _interopRequireDefault(require("@ant-design/icons/ColumnHeightOutlined"));
|
|
30
|
+
|
|
19
31
|
var _SettingOutlined = _interopRequireDefault(require("@ant-design/icons/SettingOutlined"));
|
|
32
|
+
|
|
20
33
|
var _Alert = _interopRequireDefault(require("./Alert"));
|
|
34
|
+
|
|
21
35
|
var _ColumnSetting = _interopRequireDefault(require("./ColumnSetting"));
|
|
36
|
+
|
|
22
37
|
var _ResizeableTitle = _interopRequireDefault(require("./ResizeableTitle"));
|
|
38
|
+
|
|
23
39
|
var _renderColumnButtons = _interopRequireDefault(require("./renderColumnButtons"));
|
|
40
|
+
|
|
24
41
|
var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
|
|
42
|
+
|
|
25
43
|
var _isFunction = _interopRequireDefault(require("../_util/isFunction"));
|
|
44
|
+
|
|
26
45
|
var _axios = _interopRequireDefault(require("axios"));
|
|
46
|
+
|
|
27
47
|
var _ahooks = require("ahooks");
|
|
48
|
+
|
|
28
49
|
var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
|
|
50
|
+
|
|
29
51
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
52
|
+
|
|
30
53
|
var _excluded = ["prefixCls", "toolbar", "toolbarClassName", "toolbarTilte", "buttonGroup", "refreshIconVisible", "hideColumnSetting", "hideColumnHeight", "visibleColumnKeys", "defaultVisibleColumnKeys", "onVisibleColumnsChange", "onRefresh", "indexColumn", "indexFixed", "bordered", "indexTitle", "startIndex", "autoFit", "headFootHeight", "columnResizable", "components", "className", "style", "emptyText", "onRowSelectionClear", "disabledColumnKeys", "onColumnsSave", "uniqueKey", "prefixUrl", "customEnumText", "hideSelectionClear", "indexWidth"];
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
54
|
+
|
|
55
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
56
|
+
|
|
57
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
58
|
+
|
|
59
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
60
|
+
|
|
61
|
+
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); }
|
|
62
|
+
|
|
63
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
64
|
+
|
|
36
65
|
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."); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function
|
|
66
|
+
|
|
67
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
68
|
+
|
|
69
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
70
|
+
|
|
71
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
72
|
+
|
|
73
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
74
|
+
|
|
75
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
76
|
+
|
|
77
|
+
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; }
|
|
78
|
+
|
|
79
|
+
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; }
|
|
80
|
+
|
|
81
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
82
|
+
|
|
47
83
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
48
|
-
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
function
|
|
84
|
+
|
|
85
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
86
|
+
|
|
87
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
88
|
+
|
|
89
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
90
|
+
|
|
91
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
92
|
+
|
|
52
93
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
53
|
-
var indexColumnKey =
|
|
94
|
+
var indexColumnKey = '_serialNum';
|
|
95
|
+
exports.indexColumnKey = indexColumnKey;
|
|
96
|
+
|
|
54
97
|
function VtxDatagrid(props) {
|
|
55
|
-
var _rest$dataSource, _rest$rowSelection, _rest$columns2, _rest$rowSelection2, _dataSource2, _rest$rowSelection3, _dataSource3;
|
|
98
|
+
var _rest$dataSource, _rest$rowSelection, _rest$columns2, _rest$rowSelection2, _dataSource2, _classnames, _rest$rowSelection3, _dataSource3;
|
|
99
|
+
|
|
56
100
|
var _useSet = (0, _useSet3["default"])({
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
101
|
+
// 显示列
|
|
102
|
+
visibleColumns: [],
|
|
103
|
+
// 列设置选中的列
|
|
104
|
+
checkedColumnKeys: [],
|
|
105
|
+
// 列设置选项
|
|
106
|
+
columnSettingOptions: [],
|
|
107
|
+
// 表格id
|
|
108
|
+
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
109
|
+
scrollY: 0,
|
|
110
|
+
size: 'middle',
|
|
111
|
+
projectKey: '',
|
|
112
|
+
firstChangeVisibleColumnKeys: true
|
|
113
|
+
}),
|
|
114
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
|
115
|
+
state = _useSet2[0],
|
|
116
|
+
setState = _useSet2[1];
|
|
117
|
+
|
|
73
118
|
var visibleColumns = state.visibleColumns,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var datagridRef = (0, _react.useRef)(null);
|
|
80
|
-
|
|
81
|
-
var alertHeight = (0, _react.useRef)(0);
|
|
82
|
-
|
|
83
|
-
var toolbarHeight = (0, _react.useRef)(0);
|
|
84
|
-
|
|
119
|
+
checkedColumnKeys = state.checkedColumnKeys,
|
|
120
|
+
columnSettingOptions = state.columnSettingOptions,
|
|
121
|
+
datagridId = state.datagridId,
|
|
122
|
+
scrollY = state.scrollY,
|
|
123
|
+
size = state.size;
|
|
124
|
+
var datagridRef = (0, _react.useRef)(null); // 列设置提示高度
|
|
125
|
+
|
|
126
|
+
var alertHeight = (0, _react.useRef)(0); // 工具栏高度
|
|
127
|
+
|
|
128
|
+
var toolbarHeight = (0, _react.useRef)(0); // 列接口显示字段
|
|
129
|
+
|
|
85
130
|
var settingRef = (0, _react.useRef)();
|
|
131
|
+
|
|
86
132
|
var _props$prefixCls = props.prefixCls,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
|
|
134
|
+
_props$toolbar = props.toolbar,
|
|
135
|
+
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
136
|
+
toolbarClassName = props.toolbarClassName,
|
|
137
|
+
_props$toolbarTilte = props.toolbarTilte,
|
|
138
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
139
|
+
buttonGroup = props.buttonGroup,
|
|
140
|
+
_props$refreshIconVis = props.refreshIconVisible,
|
|
141
|
+
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
142
|
+
hideColumnSetting = props.hideColumnSetting,
|
|
143
|
+
hideColumnHeight = props.hideColumnHeight,
|
|
144
|
+
visibleColumnKeys = props.visibleColumnKeys,
|
|
145
|
+
defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
|
|
146
|
+
onVisibleColumnsChange = props.onVisibleColumnsChange,
|
|
147
|
+
onRefresh = props.onRefresh,
|
|
148
|
+
_props$indexColumn = props.indexColumn,
|
|
149
|
+
indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
|
|
150
|
+
_props$indexFixed = props.indexFixed,
|
|
151
|
+
indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
|
|
152
|
+
_props$bordered = props.bordered,
|
|
153
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
154
|
+
_props$indexTitle = props.indexTitle,
|
|
155
|
+
indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
|
|
156
|
+
_props$startIndex = props.startIndex,
|
|
157
|
+
startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
|
|
158
|
+
_props$autoFit = props.autoFit,
|
|
159
|
+
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
160
|
+
_props$headFootHeight = props.headFootHeight,
|
|
161
|
+
headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
|
|
162
|
+
columnResizable = props.columnResizable,
|
|
163
|
+
components = props.components,
|
|
164
|
+
className = props.className,
|
|
165
|
+
style = props.style,
|
|
166
|
+
_props$emptyText = props.emptyText,
|
|
167
|
+
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
168
|
+
onRowSelectionClear = props.onRowSelectionClear,
|
|
169
|
+
disabledColumnKeys = props.disabledColumnKeys,
|
|
170
|
+
onColumnsSave = props.onColumnsSave,
|
|
171
|
+
uniqueKey = props.uniqueKey,
|
|
172
|
+
prefixUrl = props.prefixUrl,
|
|
173
|
+
_props$customEnumText = props.customEnumText,
|
|
174
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
175
|
+
_props$hideSelectionC = props.hideSelectionClear,
|
|
176
|
+
hideSelectionClear = _props$hideSelectionC === void 0 ? false : _props$hideSelectionC,
|
|
177
|
+
_props$indexWidth = props.indexWidth,
|
|
178
|
+
indexWidth = _props$indexWidth === void 0 ? 70 : _props$indexWidth,
|
|
179
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
180
|
+
|
|
134
181
|
var TextEnum = _objectSpread({
|
|
135
182
|
refreshText: '刷新',
|
|
136
183
|
densityDefaultText: '默认',
|
|
@@ -149,11 +196,12 @@ function VtxDatagrid(props) {
|
|
|
149
196
|
messageWarningOneText: '至少勾选一列保存',
|
|
150
197
|
paginationTotalText: '共',
|
|
151
198
|
paginationItemText: '条'
|
|
152
|
-
}, customEnumText);
|
|
199
|
+
}, customEnumText); // 规则,菜单根目录_页面路由
|
|
200
|
+
|
|
153
201
|
|
|
154
|
-
// 规则,菜单根目录_页面路由
|
|
155
202
|
function getUniqueKey() {
|
|
156
203
|
var route = location.href.match(/#\/(\S*)\?/);
|
|
204
|
+
|
|
157
205
|
if (route) {
|
|
158
206
|
(0, _axios["default"])({
|
|
159
207
|
method: 'GET',
|
|
@@ -161,6 +209,7 @@ function VtxDatagrid(props) {
|
|
|
161
209
|
headers: _objectSpread({}, (0, _getSignature["default"])({}))
|
|
162
210
|
}).then(function (res) {
|
|
163
211
|
var _res$data;
|
|
212
|
+
|
|
164
213
|
if ((res === null || res === void 0 ? void 0 : res.status) == 200 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.key) {
|
|
165
214
|
setState({
|
|
166
215
|
projectKey: "".concat(res.data.key, "_").concat(route ? route[1] : 'test')
|
|
@@ -168,41 +217,46 @@ function VtxDatagrid(props) {
|
|
|
168
217
|
}
|
|
169
218
|
});
|
|
170
219
|
}
|
|
171
|
-
}
|
|
220
|
+
} // 高度计算
|
|
221
|
+
|
|
172
222
|
|
|
173
|
-
// 高度计算
|
|
174
223
|
var _useThrottleFn = (0, _ahooks.useThrottleFn)(function () {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
224
|
+
var _datagridRef$current;
|
|
225
|
+
|
|
226
|
+
if (!datagridRef.current) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
231
|
+
var divs = datagridRef.current.getElementsByTagName('div');
|
|
232
|
+
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
233
|
+
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
|
|
234
|
+
})[0];
|
|
235
|
+
bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
|
|
236
|
+
setState({
|
|
237
|
+
scrollY: bodyHeight
|
|
238
|
+
});
|
|
239
|
+
}, {
|
|
240
|
+
wait: 350
|
|
241
|
+
}),
|
|
242
|
+
calculateHeight = _useThrottleFn.run;
|
|
243
|
+
|
|
192
244
|
(0, _react.useEffect)(function () {
|
|
193
245
|
// 当没有传入唯一值而且没有自定义列保存的时候且根据规则自动生成唯一值
|
|
194
246
|
if (!uniqueKey && !onColumnsSave && toolbar && !hideColumnSetting) {
|
|
195
247
|
getUniqueKey();
|
|
196
248
|
}
|
|
249
|
+
|
|
197
250
|
var resizeObserver = new ResizeObserver(function () {
|
|
198
251
|
calculateHeight();
|
|
199
|
-
});
|
|
200
|
-
|
|
252
|
+
}); // componentDidMount
|
|
253
|
+
|
|
201
254
|
if (autoFit && datagridRef.current) {
|
|
202
255
|
resizeObserver.observe(datagridRef.current, {
|
|
203
256
|
box: 'border-box'
|
|
204
257
|
});
|
|
205
258
|
}
|
|
259
|
+
|
|
206
260
|
return function () {
|
|
207
261
|
// componentWillUnmount
|
|
208
262
|
if (autoFit) {
|
|
@@ -217,14 +271,15 @@ function VtxDatagrid(props) {
|
|
|
217
271
|
}, [(_rest$dataSource = rest.dataSource) === null || _rest$dataSource === void 0 ? void 0 : _rest$dataSource.length, (((_rest$rowSelection = rest.rowSelection) === null || _rest$rowSelection === void 0 ? void 0 : _rest$rowSelection.selectedRowKeys) || []).join(',')]);
|
|
218
272
|
(0, _react.useEffect)(function () {
|
|
219
273
|
var _rest$columns;
|
|
274
|
+
|
|
220
275
|
var keys = [];
|
|
221
276
|
var options = ((_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.map(function (col) {
|
|
222
277
|
keys.push(col.dataIndex || col.key);
|
|
223
278
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
224
279
|
key: col.dataIndex || col.key
|
|
225
280
|
});
|
|
226
|
-
})) || [];
|
|
227
|
-
|
|
281
|
+
})) || []; // 序号添加操作列
|
|
282
|
+
|
|
228
283
|
if (indexColumn) {
|
|
229
284
|
options = [{
|
|
230
285
|
title: indexTitle,
|
|
@@ -234,10 +289,11 @@ function VtxDatagrid(props) {
|
|
|
234
289
|
fixed: indexFixed
|
|
235
290
|
}].concat(_toConsumableArray(options));
|
|
236
291
|
}
|
|
292
|
+
|
|
237
293
|
setState({
|
|
238
294
|
columnSettingOptions: options
|
|
239
295
|
});
|
|
240
|
-
}, [Array.isArray(rest === null || rest === void 0 ? void 0 : rest.columns) ? JSON.stringify(rest === null || rest === void 0
|
|
296
|
+
}, [Array.isArray(rest === null || rest === void 0 ? void 0 : rest.columns) ? JSON.stringify(rest === null || rest === void 0 ? void 0 : (_rest$columns2 = rest.columns) === null || _rest$columns2 === void 0 ? void 0 : _rest$columns2.map(function (v) {
|
|
241
297
|
return {
|
|
242
298
|
key: v.dataIndex || v.key
|
|
243
299
|
};
|
|
@@ -259,28 +315,31 @@ function VtxDatagrid(props) {
|
|
|
259
315
|
*/
|
|
260
316
|
if (state.firstChangeVisibleColumnKeys && visibleColumnKeys && (visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) > 0 && !(0, _isEqual["default"])(checkedColumnKeys, visibleColumnKeys)) {
|
|
261
317
|
var _settingRef$current;
|
|
318
|
+
|
|
262
319
|
setState({
|
|
263
320
|
firstChangeVisibleColumnKeys: false
|
|
264
321
|
});
|
|
265
322
|
var newVisibleColumnKeys = state.firstChangeVisibleColumnKeys ? [indexColumn ? [indexColumnKey] : []].concat(_toConsumableArray(visibleColumnKeys)) : visibleColumnKeys;
|
|
266
|
-
(_settingRef$current = settingRef.current) === null || _settingRef$current === void 0
|
|
323
|
+
(_settingRef$current = settingRef.current) === null || _settingRef$current === void 0 ? void 0 : _settingRef$current.updateShowColumns(newVisibleColumnKeys === null || newVisibleColumnKeys === void 0 ? void 0 : newVisibleColumnKeys.join(','));
|
|
267
324
|
}
|
|
268
325
|
}, [Array.isArray(visibleColumnKeys) ? JSON.stringify(visibleColumnKeys) : visibleColumnKeys]);
|
|
326
|
+
|
|
269
327
|
var parseColumns = function parseColumns(type) {
|
|
270
328
|
// 显示工具栏的同时并显示列设置
|
|
271
329
|
if (toolbar && !hideColumnSetting) {
|
|
272
330
|
var _settingRef$current2;
|
|
273
|
-
// 说是初始化传入的 visibleColumnKeys为[] 需要展示全部
|
|
274
331
|
|
|
332
|
+
// 说是初始化传入的 visibleColumnKeys为[] 需要展示全部
|
|
275
333
|
if (defaultVisibleColumnKeys || (Array.isArray(visibleColumnKeys) ? (visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) > 0 : visibleColumnKeys) || (_settingRef$current2 = settingRef.current) !== null && _settingRef$current2 !== void 0 && _settingRef$current2.showColumns) {
|
|
276
334
|
var _settingRef$current3;
|
|
335
|
+
|
|
277
336
|
var columnKeys = type === 'reset' ? defaultVisibleColumnKeys || (columnSettingOptions === null || columnSettingOptions === void 0 ? void 0 : columnSettingOptions.map(function (item) {
|
|
278
337
|
return item.key;
|
|
279
338
|
})) : ((_settingRef$current3 = settingRef.current) === null || _settingRef$current3 === void 0 ? void 0 : _settingRef$current3.showColumns) || visibleColumnKeys || defaultVisibleColumnKeys;
|
|
280
339
|
setState({
|
|
281
340
|
checkedColumnKeys: columnKeys,
|
|
282
341
|
visibleColumns: columnSettingOptions === null || columnSettingOptions === void 0 ? void 0 : columnSettingOptions.filter(function (item) {
|
|
283
|
-
return columnKeys.includes(item.
|
|
342
|
+
return columnKeys.includes(item.key);
|
|
284
343
|
})
|
|
285
344
|
});
|
|
286
345
|
} else {
|
|
@@ -297,15 +356,16 @@ function VtxDatagrid(props) {
|
|
|
297
356
|
});
|
|
298
357
|
}
|
|
299
358
|
};
|
|
359
|
+
|
|
300
360
|
var hasAlert = (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
301
361
|
alertHeight.current = !hideSelectionClear && hasAlert ? 49 : 0;
|
|
302
|
-
toolbarHeight.current = toolbar ? 56 : 0;
|
|
362
|
+
toolbarHeight.current = toolbar ? 56 : 0; // 列设置回调
|
|
303
363
|
|
|
304
|
-
// 列设置回调
|
|
305
364
|
var handleChangeColumns = function handleChangeColumns(keys) {
|
|
306
365
|
var columnKeys = keys || (columnSettingOptions === null || columnSettingOptions === void 0 ? void 0 : columnSettingOptions.map(function (item) {
|
|
307
366
|
return item.dataIndex || item.key;
|
|
308
367
|
}));
|
|
368
|
+
|
|
309
369
|
if (!(0, _isEqual["default"])(checkedColumnKeys, columnKeys)) {
|
|
310
370
|
setState({
|
|
311
371
|
checkedColumnKeys: columnKeys,
|
|
@@ -315,10 +375,11 @@ function VtxDatagrid(props) {
|
|
|
315
375
|
});
|
|
316
376
|
onVisibleColumnsChange && onVisibleColumnsChange(columnKeys);
|
|
317
377
|
}
|
|
318
|
-
};
|
|
378
|
+
}; // 工具栏
|
|
379
|
+
|
|
319
380
|
|
|
320
|
-
// 工具栏
|
|
321
381
|
var toolbarRender;
|
|
382
|
+
|
|
322
383
|
if (toolbar) {
|
|
323
384
|
toolbarRender = /*#__PURE__*/_react["default"].createElement("div", {
|
|
324
385
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-toolbar"), toolbarClassName)
|
|
@@ -380,13 +441,14 @@ function VtxDatagrid(props) {
|
|
|
380
441
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
381
442
|
title: TextEnum.columnSettingText
|
|
382
443
|
}, /*#__PURE__*/_react["default"].createElement(_SettingOutlined["default"], null)))))));
|
|
383
|
-
}
|
|
444
|
+
} // 分页
|
|
445
|
+
|
|
384
446
|
|
|
385
|
-
// 分页
|
|
386
447
|
var getPagination = function getPagination(pagination) {
|
|
387
448
|
if (typeof pagination === 'boolean' && !pagination) {
|
|
388
449
|
return pagination;
|
|
389
450
|
}
|
|
451
|
+
|
|
390
452
|
return _objectSpread({
|
|
391
453
|
pageSizeOptions: ['10', '20', '30', '40', '50'],
|
|
392
454
|
showSizeChanger: true,
|
|
@@ -395,16 +457,20 @@ function VtxDatagrid(props) {
|
|
|
395
457
|
return "".concat(TextEnum.paginationTotalText, " ").concat(total, " ").concat(TextEnum.paginationItemText);
|
|
396
458
|
}
|
|
397
459
|
}, pagination);
|
|
398
|
-
};
|
|
399
|
-
|
|
460
|
+
}; // 处理操作按钮
|
|
461
|
+
|
|
462
|
+
|
|
400
463
|
var columns = (visibleColumns || []).map(function (column) {
|
|
401
464
|
var newColumn = _objectSpread({}, column);
|
|
465
|
+
|
|
402
466
|
if (newColumn.renderButtons) {
|
|
403
467
|
delete newColumn.renderButtons;
|
|
404
468
|
}
|
|
469
|
+
|
|
405
470
|
if (newColumn.renderButtonsVisibleNum) {
|
|
406
471
|
delete newColumn.renderButtonsVisibleNum;
|
|
407
472
|
}
|
|
473
|
+
|
|
408
474
|
return _objectSpread(_objectSpread({}, newColumn), {}, {
|
|
409
475
|
render: (0, _isFunction["default"])(column.renderButtons) ? function (text, record, index) {
|
|
410
476
|
return (0, _renderColumnButtons["default"])(column.renderButtons, column.renderButtonsVisibleNum, text, record, index, TextEnum);
|
|
@@ -412,8 +478,8 @@ function VtxDatagrid(props) {
|
|
|
412
478
|
return ['', null, undefined].includes(text) ? '-' : text;
|
|
413
479
|
}
|
|
414
480
|
});
|
|
415
|
-
});
|
|
416
|
-
|
|
481
|
+
}); // 配置了列可伸缩
|
|
482
|
+
|
|
417
483
|
if (columnResizable) {
|
|
418
484
|
columns = columns.map(function (col, index) {
|
|
419
485
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
@@ -425,12 +491,15 @@ function VtxDatagrid(props) {
|
|
|
425
491
|
}
|
|
426
492
|
});
|
|
427
493
|
});
|
|
494
|
+
|
|
428
495
|
var handleResize = function handleResize(index) {
|
|
429
496
|
return function (e, _ref2) {
|
|
430
497
|
var size = _ref2.size;
|
|
431
498
|
setState(function (_ref3) {
|
|
432
499
|
var visibleColumns = _ref3.visibleColumns;
|
|
500
|
+
|
|
433
501
|
var nextColumns = _toConsumableArray(visibleColumns);
|
|
502
|
+
|
|
434
503
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
435
504
|
width: size.width
|
|
436
505
|
});
|
|
@@ -440,11 +509,14 @@ function VtxDatagrid(props) {
|
|
|
440
509
|
});
|
|
441
510
|
};
|
|
442
511
|
};
|
|
443
|
-
}
|
|
444
|
-
|
|
512
|
+
} // 序号添加
|
|
513
|
+
|
|
514
|
+
|
|
445
515
|
var dataSource = rest.dataSource;
|
|
516
|
+
|
|
446
517
|
if (indexColumn) {
|
|
447
518
|
var _dataSource;
|
|
519
|
+
|
|
448
520
|
// columns = [
|
|
449
521
|
// {
|
|
450
522
|
// title: indexTitle,
|
|
@@ -461,15 +533,18 @@ function VtxDatagrid(props) {
|
|
|
461
533
|
});
|
|
462
534
|
});
|
|
463
535
|
}
|
|
536
|
+
|
|
464
537
|
var scroll = rest.scroll || {};
|
|
538
|
+
|
|
465
539
|
if (autoFit) {
|
|
466
540
|
scroll = _objectSpread(_objectSpread({}, scroll), {}, {
|
|
467
541
|
y: scrollY - (rest.scrollY || 0)
|
|
468
542
|
});
|
|
469
543
|
}
|
|
544
|
+
|
|
470
545
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
471
546
|
id: datagridId,
|
|
472
|
-
className: (0, _classnames2["default"])(prefixCls, className,
|
|
547
|
+
className: (0, _classnames2["default"])(prefixCls, className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-fit"), autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-noFit"), !autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-nodata"), !((_dataSource2 = dataSource) !== null && _dataSource2 !== void 0 && _dataSource2.length)), _defineProperty(_classnames, "".concat(prefixCls, "-userAgent-mac"), isMac), _classnames)),
|
|
473
548
|
style: style,
|
|
474
549
|
ref: datagridRef
|
|
475
550
|
}, toolbarRender, !hideSelectionClear && hasAlert ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -502,6 +577,7 @@ function VtxDatagrid(props) {
|
|
|
502
577
|
}) : components
|
|
503
578
|
})));
|
|
504
579
|
}
|
|
580
|
+
|
|
505
581
|
VtxDatagrid.propTypes = {
|
|
506
582
|
prefixCls: _propTypes["default"].string,
|
|
507
583
|
refreshIconVisible: _propTypes["default"].bool,
|