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