@vtx/components 4.0.0-beta.8 → 4.0.0-beta.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +3 -0
- package/es/utils/filterSpecialCharacters.js +47 -46
- package/es/utils/index.js +1 -2
- package/es/vtx-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +106 -137
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -3
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +124 -32
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +25 -25
- package/es/vtx-export-async/History.js +11 -3
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +207 -65
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +30 -19
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-modal/index.js +9 -4
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +7 -3
- package/es/vtx-provider/locale/en_US.js +57 -3
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-search/index.js +13 -9
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +102 -36
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +42 -34
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +98 -35
- package/es/vtx-tree-select/index.js +71 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +93 -39
- package/es/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/lib/index.js +36 -0
- package/lib/utils/filterSpecialCharacters.js +48 -46
- package/lib/utils/index.js +0 -7
- package/lib/vtx-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +113 -143
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -3
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +124 -32
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +26 -26
- package/lib/vtx-export-async/History.js +11 -3
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +205 -63
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -18
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-modal/index.js +9 -4
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +7 -3
- package/lib/vtx-provider/locale/en_US.js +57 -3
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-search/index.js +13 -9
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +104 -38
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +40 -31
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +96 -33
- package/lib/vtx-tree-select/index.js +71 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +91 -37
- package/lib/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/package.json +47 -32
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
|
@@ -14,37 +14,85 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
14
14
|
var genVtxStyle = function genVtxStyle(token) {
|
|
15
15
|
var componentCls = token.componentCls,
|
|
16
16
|
antCls = token.antCls;
|
|
17
|
-
return _defineProperty(
|
|
17
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
|
|
18
18
|
position: 'relative',
|
|
19
|
-
overflow: 'hidden'
|
|
20
|
-
|
|
19
|
+
// overflow: 'hidden',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column'
|
|
22
|
+
}, "".concat(antCls, "-table-cell-ellipsis"), {
|
|
23
|
+
whiteSpace: 'normal'
|
|
24
|
+
}), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
|
|
25
|
+
// minWidth: "calc(100% - 2px) !important"
|
|
26
|
+
}), '.ant-spin, .ant-spin-nested-loading', _defineProperty({
|
|
27
|
+
height: '100%'
|
|
28
|
+
}, '.ant-spin-container', _defineProperty({
|
|
29
|
+
height: '100%',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column'
|
|
32
|
+
}, '.ant-table', _defineProperty({
|
|
33
|
+
// height: '100%',
|
|
34
|
+
flex: 1
|
|
35
|
+
}, '.ant-table-container', _defineProperty(_defineProperty({
|
|
36
|
+
height: '100%',
|
|
37
|
+
borderInlineStart: 'none'
|
|
38
|
+
}, '.ant-table-body', {
|
|
39
|
+
scrollbarWidth: 'thin'
|
|
40
|
+
}), '.ant-table-content', _defineProperty({
|
|
41
|
+
height: '100%',
|
|
42
|
+
scrollbarWidth: 'thin'
|
|
43
|
+
}, 'table', {
|
|
44
|
+
// height: '100%',
|
|
45
|
+
minWidth: 'calc(100% - 1px) !important'
|
|
46
|
+
})))))), '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
|
|
21
47
|
'>tr>th': {
|
|
22
|
-
background: token.colorBgContainer
|
|
48
|
+
background: token.colorBgContainer,
|
|
49
|
+
'&:first-child': {
|
|
50
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
51
|
+
}
|
|
23
52
|
}
|
|
24
53
|
})), '.ant-table-cell', {
|
|
25
|
-
minWidth:
|
|
26
|
-
}), '.ant-table-
|
|
54
|
+
// minWidth: 10,
|
|
55
|
+
}), '.ant-table-tbody', {
|
|
56
|
+
'>tr>td': {
|
|
57
|
+
'&:first-child': {
|
|
58
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
27
61
|
'>tr.ant-table-placeholder': {
|
|
28
62
|
position: 'absolute',
|
|
29
|
-
top: '
|
|
63
|
+
top: 'auto',
|
|
64
|
+
bottom: 'auto',
|
|
30
65
|
right: 0,
|
|
31
66
|
left: 0,
|
|
32
67
|
backgroundColor: 'transparent',
|
|
33
68
|
borderTop: 'none',
|
|
69
|
+
// borderInlineEnd: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
|
|
70
|
+
// borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
|
|
34
71
|
'>td.ant-table-cell': {
|
|
35
|
-
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center',
|
|
72
|
+
padding: 0,
|
|
38
73
|
width: '100%',
|
|
39
74
|
height: '100%',
|
|
40
|
-
border: 'none'
|
|
75
|
+
border: 'none',
|
|
76
|
+
'>.ant-table-expanded-row-fixed': {
|
|
77
|
+
display: 'flex',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
height: '100%',
|
|
81
|
+
width: '100%',
|
|
82
|
+
'&::after': {
|
|
83
|
+
border: 'none'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
41
86
|
}
|
|
42
87
|
}
|
|
43
|
-
}))
|
|
88
|
+
})), '.ant-pagination', _defineProperty({
|
|
89
|
+
margin: 'var(--ant-margin) 0 0 0'
|
|
90
|
+
}, '.ant-pagination-item', {
|
|
44
91
|
borderRadius: token.borderRadiusSM
|
|
45
|
-
}))), "
|
|
46
|
-
height: '100%'
|
|
47
|
-
|
|
92
|
+
})))), "".concat(componentCls, "-fit"), {
|
|
93
|
+
height: '100%',
|
|
94
|
+
minHeight: 200
|
|
95
|
+
}), "".concat(componentCls, "-noFit"), {}), "".concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
|
|
48
96
|
borderColor: 'transparent'
|
|
49
97
|
}, '.ant-table-thead', {
|
|
50
98
|
'>tr>th': {
|
|
@@ -53,10 +101,14 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
53
101
|
}), '.ant-table-body', {
|
|
54
102
|
'>table >tbody>tr>td': {
|
|
55
103
|
borderInlineColor: 'transparent !important'
|
|
104
|
+
},
|
|
105
|
+
'>table >tbody>tr.ant-table-placeholder': {
|
|
106
|
+
borderInlineColor: 'transparent !important',
|
|
107
|
+
borderBottomColor: 'transparent !important'
|
|
56
108
|
}
|
|
57
|
-
}))))), "
|
|
109
|
+
}))))), "".concat(componentCls, "-striped"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({}, '.ant-table-body', {
|
|
58
110
|
'>table >tbody>tr:nth-child(odd)>td': {
|
|
59
|
-
backgroundColor: token.
|
|
111
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
60
112
|
'&.ant-table-cell-row-hover': {
|
|
61
113
|
backgroundColor: token.colorFillAlterSolid
|
|
62
114
|
}
|
|
@@ -70,11 +122,41 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
70
122
|
backgroundColor: token.controlItemBgActiveHover
|
|
71
123
|
}
|
|
72
124
|
}
|
|
73
|
-
})
|
|
125
|
+
}), '.ant-table-tbody', {
|
|
126
|
+
'>tr:nth-child(odd)>td': {
|
|
127
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
128
|
+
'&.ant-table-cell-row-hover': {
|
|
129
|
+
backgroundColor: token.colorFillAlterSolid
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
'>tr:nth-child(odd)>td.ant-table-column-sort': {
|
|
133
|
+
backgroundColor: token.colorFillAlterSolid
|
|
134
|
+
},
|
|
135
|
+
'>tr.ant-table-row-selected:nth-child(odd)>td': {
|
|
136
|
+
backgroundColor: token.controlItemBgActive,
|
|
137
|
+
'&.ant-table-cell-row-hover': {
|
|
138
|
+
backgroundColor: token.controlItemBgActiveHover
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}))))), "".concat(componentCls, "-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
|
|
74
142
|
'>tr>th': {
|
|
75
|
-
background: token.
|
|
143
|
+
background: token.colorBgLayoutTable
|
|
144
|
+
}
|
|
145
|
+
}))))), "".concat(componentCls, "-no-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper "), _defineProperty({}, '.ant-table-thead', {
|
|
146
|
+
'>tr>th': {
|
|
147
|
+
background: token.colorBgContainer
|
|
76
148
|
}
|
|
77
|
-
})))))
|
|
149
|
+
}))), "".concat(componentCls, "-no-data"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
|
|
150
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
151
|
+
}, '.ant-table-content', _defineProperty({
|
|
152
|
+
borderRight: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)',
|
|
153
|
+
borderBottom: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
154
|
+
}, 'table', {})))))))), "".concat(componentCls, "-no-data").concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
|
|
155
|
+
borderInlineStart: 'none'
|
|
156
|
+
}, '.ant-table-content', {
|
|
157
|
+
borderRight: 'none',
|
|
158
|
+
borderBottom: 'none'
|
|
159
|
+
})))))));
|
|
78
160
|
};
|
|
79
161
|
function useStyle(prefix) {
|
|
80
162
|
return (0, _vtxProvider.useStyle)(prefix, function (token) {
|
|
@@ -31,7 +31,7 @@ function VtxQtimePicker(props) {
|
|
|
31
31
|
var _format$split;
|
|
32
32
|
var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
|
|
33
33
|
getPrefixCls = _useContext.getPrefixCls;
|
|
34
|
-
var prefixCls = getPrefixCls('', 'vtx-
|
|
34
|
+
var prefixCls = getPrefixCls('', 'vtx-date-picker');
|
|
35
35
|
var _useStyle = (0, _index.useStyle)(prefixCls),
|
|
36
36
|
wrapSSR = _useStyle.wrapSSR,
|
|
37
37
|
hashId = _useStyle.hashId;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _style = require("./style");
|
|
12
|
+
var _vtxProvider = require("../vtx-provider");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
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); }
|
|
22
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
23
|
+
function VtxDescriptions(props) {
|
|
24
|
+
var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
|
|
25
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
26
|
+
var prefixCls = getPrefixCls('descriptions', props.prefixCls);
|
|
27
|
+
var _useStyle = (0, _style.useStyle)(prefixCls),
|
|
28
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
29
|
+
hashId = _useStyle.hashId;
|
|
30
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(props), props));
|
|
31
|
+
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Descriptions, _objectSpread({
|
|
32
|
+
classNames: {
|
|
33
|
+
root: (0, _classnames.default)(hashId, prefixCls)
|
|
34
|
+
}
|
|
35
|
+
}, rest)));
|
|
36
|
+
}
|
|
37
|
+
VtxDescriptions.propTypes = {};
|
|
38
|
+
var _default = exports.default = VtxDescriptions;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "VtxDescriptions", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Descriptions.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
var _Descriptions = _interopRequireDefault(require("./Descriptions"));
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
var _default = exports.default = _Descriptions.default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useStyle = useStyle;
|
|
7
|
+
var _vtxProvider = require("../../vtx-provider");
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
var genStyle = function genStyle(token) {
|
|
15
|
+
var componentCls = token.componentCls;
|
|
16
|
+
return _defineProperty({}, componentCls, {});
|
|
17
|
+
};
|
|
18
|
+
function useStyle(prefixCls) {
|
|
19
|
+
return (0, _vtxProvider.useStyle)('VtxDescriptions', function (token) {
|
|
20
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
21
|
+
componentCls: ".".concat(prefixCls)
|
|
22
|
+
});
|
|
23
|
+
return [genStyle(_token)];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -28,6 +28,11 @@ function VtxEllipsisText(props) {
|
|
|
28
28
|
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
|
|
29
29
|
className = props.className,
|
|
30
30
|
style = props.style;
|
|
31
|
+
|
|
32
|
+
// 边界检查
|
|
33
|
+
if (!text) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
31
36
|
var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
|
|
32
37
|
getPrefixCls = _useContext.getPrefixCls;
|
|
33
38
|
var prefixCls = getPrefixCls('vtx-ellipsis-text');
|
|
@@ -35,7 +40,7 @@ function VtxEllipsisText(props) {
|
|
|
35
40
|
wrapSSR = _useStyle.wrapSSR,
|
|
36
41
|
hashId = _useStyle.hashId;
|
|
37
42
|
var textStyle = {};
|
|
38
|
-
if (lineClamp
|
|
43
|
+
if (lineClamp >= 1) {
|
|
39
44
|
textStyle['WebkitLineClamp'] = lineClamp;
|
|
40
45
|
}
|
|
41
46
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, _objectSpread(_objectSpread({
|
|
@@ -44,7 +49,7 @@ function VtxEllipsisText(props) {
|
|
|
44
49
|
mouseEnterDelay: 0.3
|
|
45
50
|
}, tooltip), {}, {
|
|
46
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
47
|
-
className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp <
|
|
52
|
+
className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
|
|
48
53
|
style: _objectSpread(_objectSpread({}, style), textStyle),
|
|
49
54
|
children: text
|
|
50
55
|
})
|
|
@@ -16,7 +16,9 @@ var genVtxEllipsisTextStyle = function genVtxEllipsisTextStyle(token) {
|
|
|
16
16
|
return _defineProperty({}, componentCls, _defineProperty(_defineProperty({
|
|
17
17
|
margin: 0,
|
|
18
18
|
overflow: 'hidden',
|
|
19
|
-
textOverflow: 'ellipsis'
|
|
19
|
+
textOverflow: 'ellipsis',
|
|
20
|
+
wordBreak: "break-all",
|
|
21
|
+
wordWrap: "break-word"
|
|
20
22
|
}, "&--single", {
|
|
21
23
|
whiteSpace: 'nowrap'
|
|
22
24
|
}), "&--multi", {
|
package/lib/vtx-export/index.js
CHANGED
|
@@ -11,12 +11,14 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
11
11
|
var _querystring = _interopRequireDefault(require("querystring"));
|
|
12
12
|
var _getToken = _interopRequireDefault(require("../utils/getToken"));
|
|
13
13
|
var _icons = require("@ant-design/icons");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _downloadFile = _interopRequireDefault(require("@vtx/utils/lib/downloadFile"));
|
|
15
|
+
var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
|
|
16
|
+
var _utils = require("../utils");
|
|
16
17
|
var _index = require("./style/index");
|
|
17
18
|
var _antd = require("antd");
|
|
18
19
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
20
|
var _vtxProvider = require("../vtx-provider");
|
|
21
|
+
var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -90,7 +92,7 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
|
|
|
90
92
|
headers: _objectSpread(_objectSpread({
|
|
91
93
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
92
94
|
Authorization: token ? "Bearer ".concat(token) : ''
|
|
93
|
-
}, headers), (0,
|
|
95
|
+
}, headers), (0, _getSignature.default)((0, _utils.isObject)(postData) ? postData : {}, undefined, (0, _utils.isObject)(postData) ? undefined : postData)),
|
|
94
96
|
data: (headers === null || headers === void 0 ? void 0 : headers['Content-Type']) === 'application/json' ? postData : _querystring.default.stringify(postData)
|
|
95
97
|
};
|
|
96
98
|
return new Promise(function (resolve, reject) {
|
|
@@ -109,31 +111,26 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
|
|
|
109
111
|
spinning: true,
|
|
110
112
|
className: (0, _classnames.default)(prefixCls, hashId, 'vtx-spin')
|
|
111
113
|
}), div);
|
|
114
|
+
var status = false;
|
|
112
115
|
document.body.appendChild(div);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
(0, _downloadFile.default)(downloadURL, {
|
|
117
|
+
timeout: timeout,
|
|
118
|
+
data: postData,
|
|
119
|
+
extraHeader: headers,
|
|
120
|
+
success: function success() {
|
|
121
|
+
status = true;
|
|
122
|
+
},
|
|
123
|
+
fail: function fail() {
|
|
124
|
+
status = false;
|
|
125
|
+
_antd.message.error('导出失败');
|
|
126
|
+
},
|
|
127
|
+
finally: function _finally() {
|
|
128
|
+
document.body.removeChild(div);
|
|
129
|
+
if (afterExport && typeof afterExport === 'function') {
|
|
130
|
+
afterExport(status);
|
|
123
131
|
}
|
|
124
|
-
if ('download' in document.createElement('a')) {
|
|
125
|
-
download(res.data, filename);
|
|
126
|
-
status = true;
|
|
127
|
-
} else {
|
|
128
|
-
_antd.message.warning(intl.getMessage('fallback.browserNotSupported', '浏览器不支持'));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// 关闭loading,执行回调
|
|
132
|
-
document.body.removeChild(div);
|
|
133
|
-
if (afterExport && typeof afterExport === 'function') {
|
|
134
|
-
afterExport(status);
|
|
135
132
|
}
|
|
136
|
-
});
|
|
133
|
+
}, 'blob');
|
|
137
134
|
}
|
|
138
135
|
/* 下载并 兼容IE */
|
|
139
136
|
function download(content, filename) {
|
|
@@ -184,7 +181,10 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
|
|
|
184
181
|
trigger: ['click'],
|
|
185
182
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
|
|
186
183
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ExportOutlined, {}),
|
|
187
|
-
children: [exportText, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
184
|
+
children: [exportText, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
|
|
185
|
+
type: "downOutlined",
|
|
186
|
+
fileType: "svg"
|
|
187
|
+
})]
|
|
188
188
|
})
|
|
189
189
|
}));
|
|
190
190
|
};
|
|
@@ -46,7 +46,9 @@ function History(props) {
|
|
|
46
46
|
_props$customTablePro = props.customTableProps,
|
|
47
47
|
customTableProps = _props$customTablePro === void 0 ? {} : _props$customTablePro,
|
|
48
48
|
refreshTime = props.refreshTime,
|
|
49
|
-
downloadInNewTab = props.downloadInNewTab
|
|
49
|
+
downloadInNewTab = props.downloadInNewTab,
|
|
50
|
+
_props$headers = props.headers,
|
|
51
|
+
headers = _props$headers === void 0 ? {} : _props$headers;
|
|
50
52
|
var _Form$useForm = _antd.Form.useForm(),
|
|
51
53
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
52
54
|
form = _Form$useForm2[0];
|
|
@@ -114,6 +116,10 @@ function History(props) {
|
|
|
114
116
|
timer.current = setInterval(function () {
|
|
115
117
|
refresh();
|
|
116
118
|
}, refreshTime * 1000);
|
|
119
|
+
return function () {
|
|
120
|
+
timer.current && clearInterval(timer.current);
|
|
121
|
+
timer.current = null;
|
|
122
|
+
};
|
|
117
123
|
}, [JSON.stringify(tableProps.dataSource)]);
|
|
118
124
|
var pageSize = pagination.pageSize,
|
|
119
125
|
current = pagination.current;
|
|
@@ -159,7 +165,8 @@ function History(props) {
|
|
|
159
165
|
(0, _utils.downloadFile)(downFileUrl, {
|
|
160
166
|
data: {
|
|
161
167
|
id: record.id
|
|
162
|
-
}
|
|
168
|
+
},
|
|
169
|
+
extraHeader: headers
|
|
163
170
|
}, 'blob');
|
|
164
171
|
}
|
|
165
172
|
},
|
|
@@ -259,6 +266,7 @@ History.propTypes = {
|
|
|
259
266
|
TextEnum: _propTypes.default.object,
|
|
260
267
|
customTableProps: _propTypes.default.object,
|
|
261
268
|
refreshTime: _propTypes.default.number,
|
|
262
|
-
downloadInNewTab: _propTypes.default.bool
|
|
269
|
+
downloadInNewTab: _propTypes.default.bool,
|
|
270
|
+
headers: _propTypes.default.object
|
|
263
271
|
};
|
|
264
272
|
var _default = exports.default = History;
|
|
@@ -18,6 +18,8 @@ var _index = require("./style/index");
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
var _vtxProvider = require("../vtx-provider");
|
|
20
20
|
var _vtxModal = _interopRequireDefault(require("../vtx-modal"));
|
|
21
|
+
var _vtxInput = _interopRequireDefault(require("../vtx-input"));
|
|
22
|
+
var _filterSpecialCharacters = require("../utils/filterSpecialCharacters");
|
|
21
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -33,15 +35,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
33
35
|
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; }
|
|
34
36
|
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; } }
|
|
35
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
|
-
var
|
|
38
|
+
var Includes = ['\\\\', '\\/', ':', '*', '?', '"', '<', '>', '|'];
|
|
37
39
|
var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
38
40
|
var intl = (0, _vtxProvider.useIntl)();
|
|
39
41
|
var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
|
|
40
42
|
getPrefixCls = _useContext.getPrefixCls;
|
|
41
|
-
var prefixCls = getPrefixCls('vtx-export-async'
|
|
43
|
+
var prefixCls = getPrefixCls('', 'vtx-export-async');
|
|
42
44
|
var _useStyle = (0, _index.useStyle)(prefixCls),
|
|
43
45
|
wrapSSR = _useStyle.wrapSSR,
|
|
44
46
|
hashId = _useStyle.hashId;
|
|
47
|
+
var timerRef = (0, _react.useRef)(null);
|
|
45
48
|
var uniqueKey = props.uniqueKey,
|
|
46
49
|
_props$title = props.title,
|
|
47
50
|
title = _props$title === void 0 ? '' : _props$title,
|
|
@@ -84,9 +87,13 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
84
87
|
downloadInNewTab = _props$downloadInNewT === void 0 ? false : _props$downloadInNewT,
|
|
85
88
|
_props$enableCustomSe = props.enableCustomSelect,
|
|
86
89
|
enableCustomSelect = _props$enableCustomSe === void 0 ? false : _props$enableCustomSe,
|
|
87
|
-
beforeExport = props.beforeExport,
|
|
88
90
|
_props$headers = props.headers,
|
|
89
|
-
headers = _props$headers === void 0 ? {} : _props$headers
|
|
91
|
+
headers = _props$headers === void 0 ? {} : _props$headers,
|
|
92
|
+
beforeExport = props.beforeExport,
|
|
93
|
+
_props$historyHeaders = props.historyHeaders,
|
|
94
|
+
historyHeaders = _props$historyHeaders === void 0 ? {} : _props$historyHeaders,
|
|
95
|
+
_props$hideContent = props.hideContent,
|
|
96
|
+
hideContent = _props$hideContent === void 0 ? false : _props$hideContent;
|
|
90
97
|
var _Form$useForm = _antd.Form.useForm(),
|
|
91
98
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
92
99
|
form = _Form$useForm2[0];
|
|
@@ -168,9 +175,9 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
168
175
|
});
|
|
169
176
|
}, [state.visible]);
|
|
170
177
|
function close() {
|
|
171
|
-
if (
|
|
172
|
-
clearInterval(
|
|
173
|
-
|
|
178
|
+
if (timerRef.current) {
|
|
179
|
+
clearInterval(timerRef.current);
|
|
180
|
+
timerRef.current = null;
|
|
174
181
|
}
|
|
175
182
|
form.resetFields();
|
|
176
183
|
setState({
|
|
@@ -180,6 +187,15 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
180
187
|
timer: null
|
|
181
188
|
});
|
|
182
189
|
}
|
|
190
|
+
|
|
191
|
+
// 组件卸载时也要清理
|
|
192
|
+
(0, _react.useEffect)(function () {
|
|
193
|
+
return function () {
|
|
194
|
+
if (timerRef.current) {
|
|
195
|
+
clearInterval(timerRef.current);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}, []);
|
|
183
199
|
function showHistory() {
|
|
184
200
|
setState({
|
|
185
201
|
showHistoryModal: true
|
|
@@ -261,6 +277,8 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
261
277
|
} else {
|
|
262
278
|
_antd.message.error((res === null || res === void 0 ? void 0 : res.msg) || "".concat(intl.getMessage('export.exportText', '导出')).concat(intl.getMessage('export.failure', '失败')));
|
|
263
279
|
}
|
|
280
|
+
}).catch(function (err) {
|
|
281
|
+
_antd.message.error('导出失败:' + (err.message || '网络错误'));
|
|
264
282
|
});
|
|
265
283
|
}
|
|
266
284
|
});
|
|
@@ -290,7 +308,9 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
290
308
|
subtitle: TextEnum.modalTitleText
|
|
291
309
|
}) : TextEnum.modalTitleText,
|
|
292
310
|
open: state.visible,
|
|
293
|
-
|
|
311
|
+
mask: {
|
|
312
|
+
closable: false
|
|
313
|
+
},
|
|
294
314
|
onCancel: close,
|
|
295
315
|
footer: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
296
316
|
onClick: close,
|
|
@@ -321,8 +341,15 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
321
341
|
required: true,
|
|
322
342
|
message: TextEnum.requireFieldMsgText
|
|
323
343
|
}],
|
|
324
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
325
|
-
placeholder: TextEnum.placeholderFileName
|
|
344
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxInput.default, {
|
|
345
|
+
placeholder: TextEnum.placeholderFileName,
|
|
346
|
+
specialCharactersFilter: {
|
|
347
|
+
include: Includes,
|
|
348
|
+
exclude: _filterSpecialCharacters.SpecialCharacters.filter(function (v) {
|
|
349
|
+
return !Includes.includes(v);
|
|
350
|
+
})
|
|
351
|
+
},
|
|
352
|
+
maxLength: 255
|
|
326
353
|
})
|
|
327
354
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
328
355
|
label: TextEnum.fieldTypeText,
|
|
@@ -339,7 +366,7 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
339
366
|
}, item.key);
|
|
340
367
|
})
|
|
341
368
|
})
|
|
342
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
369
|
+
}), hideContent ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
343
370
|
label: TextEnum.fieldContentText,
|
|
344
371
|
name: "content",
|
|
345
372
|
rules: [{
|
|
@@ -374,7 +401,8 @@ var VtxExportAsync = exports.VtxExportAsync = function VtxExportAsync(props) {
|
|
|
374
401
|
TextEnum: TextEnum,
|
|
375
402
|
customTableProps: customTableProps,
|
|
376
403
|
refreshTime: refreshTime,
|
|
377
|
-
downloadInNewTab: downloadInNewTab
|
|
404
|
+
downloadInNewTab: downloadInNewTab,
|
|
405
|
+
headers: historyHeaders
|
|
378
406
|
})]
|
|
379
407
|
}));
|
|
380
408
|
};
|
|
@@ -404,6 +432,8 @@ VtxExportAsync.propTypes = {
|
|
|
404
432
|
refreshTime: _propTypes.default.number,
|
|
405
433
|
downloadInNewTab: _propTypes.default.bool,
|
|
406
434
|
enableCustomSelect: _propTypes.default.bool,
|
|
407
|
-
headers: _propTypes.default.object
|
|
435
|
+
headers: _propTypes.default.object,
|
|
436
|
+
beforeExport: _propTypes.default.object,
|
|
437
|
+
historyHeaders: _propTypes.default.object
|
|
408
438
|
};
|
|
409
439
|
var _default = exports.default = VtxExportAsync;
|
|
@@ -16,6 +16,16 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
17
|
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); }
|
|
18
18
|
var token = (0, _getToken.default)();
|
|
19
|
+
var getContentType = function getContentType(headers) {
|
|
20
|
+
var contentTypeKey = Object.keys(headers || {}).find(function (key) {
|
|
21
|
+
return key.toLowerCase() === 'content-type';
|
|
22
|
+
});
|
|
23
|
+
return contentTypeKey ? headers[contentTypeKey] : '';
|
|
24
|
+
};
|
|
25
|
+
var stringifyPostData = function stringifyPostData(params, headers) {
|
|
26
|
+
var contentType = getContentType(headers);
|
|
27
|
+
return String(contentType).includes('application/json') ? JSON.stringify(params) : _querystring.default.stringify(params);
|
|
28
|
+
};
|
|
19
29
|
var getData = exports.getData = function getData(url, params, headers) {
|
|
20
30
|
return new Promise(function (resolve, reject) {
|
|
21
31
|
_axios.default.get(url, {
|
|
@@ -36,14 +46,15 @@ var getData = exports.getData = function getData(url, params, headers) {
|
|
|
36
46
|
};
|
|
37
47
|
var postData = exports.postData = function postData(url, params, headers) {
|
|
38
48
|
return new Promise(function (resolve, reject) {
|
|
49
|
+
var nextHeaders = _objectSpread(_objectSpread({
|
|
50
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
51
|
+
Authorization: token ? "Bearer ".concat(token) : ''
|
|
52
|
+
}, (0, _getSignature.default)(params)), headers);
|
|
39
53
|
(0, _axios.default)({
|
|
40
54
|
url: url,
|
|
41
55
|
method: 'post',
|
|
42
|
-
headers:
|
|
43
|
-
|
|
44
|
-
Authorization: token ? "Bearer ".concat(token) : ''
|
|
45
|
-
}, (0, _getSignature.default)(params)), headers),
|
|
46
|
-
data: _querystring.default.stringify(params)
|
|
56
|
+
headers: nextHeaders,
|
|
57
|
+
data: stringifyPostData(params, nextHeaders)
|
|
47
58
|
}).then(function (res) {
|
|
48
59
|
if (res.status == 200) {
|
|
49
60
|
resolve(res.data);
|
|
@@ -31,17 +31,17 @@ function VtxCard(props) {
|
|
|
31
31
|
_props$expand = props.expand,
|
|
32
32
|
expand = _props$expand === void 0 ? true : _props$expand,
|
|
33
33
|
extra = props.extra,
|
|
34
|
-
onExpandChange = props.onExpandChange
|
|
34
|
+
onExpandChange = props.onExpandChange,
|
|
35
|
+
children = props.children;
|
|
35
36
|
var _useState = (0, _react.useState)(expand),
|
|
36
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
38
|
visible = _useState2[0],
|
|
38
39
|
setVisible = _useState2[1];
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
style = {
|
|
40
|
+
var iconStyle = (0, _react.useMemo)(function () {
|
|
41
|
+
return visible ? {
|
|
42
42
|
transform: 'rotate(90deg)'
|
|
43
|
-
};
|
|
44
|
-
}
|
|
43
|
+
} : {};
|
|
44
|
+
}, [visible]);
|
|
45
45
|
(0, _react.useEffect)(function () {
|
|
46
46
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
47
47
|
onExpandChange && onExpandChange(visible);
|
|
@@ -59,8 +59,8 @@ function VtxCard(props) {
|
|
|
59
59
|
},
|
|
60
60
|
children: extra
|
|
61
61
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.RightOutlined, {
|
|
62
|
-
className: "".concat(prefixCls, "-expand-icon
|
|
63
|
-
style:
|
|
62
|
+
className: "".concat(prefixCls, "-expand-icon"),
|
|
63
|
+
style: iconStyle,
|
|
64
64
|
onClick: function onClick() {
|
|
65
65
|
return setVisible(function (pre) {
|
|
66
66
|
return !pre;
|
|
@@ -69,7 +69,7 @@ function VtxCard(props) {
|
|
|
69
69
|
}),
|
|
70
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
71
|
className: (0, _classnames2.default)("".concat(prefixCls, "-content"), _defineProperty({}, "".concat(prefixCls, "-content-hide"), !visible)),
|
|
72
|
-
children:
|
|
72
|
+
children: children
|
|
73
73
|
})
|
|
74
74
|
});
|
|
75
75
|
}
|