@vtx/components 4.0.0-beta.9 → 4.0.0-beta.90
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/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +6 -6
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -140
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/index.js +2 -1
- package/es/vtx-datagrid/ToolBar/style.js +6 -3
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +134 -37
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +108 -18
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- 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 +2 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -38
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +18 -8
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/style/index.js +6 -4
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +143 -42
- 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 +29 -19
- package/es/vtx-import2/style/index.js +59 -8
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -2
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +33 -31
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_GB.js +1 -1
- package/es/vtx-provider/locale/en_US.js +58 -4
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +30 -12
- package/es/vtx-search/style/index.js +6 -3
- package/es/vtx-select/index.js +123 -40
- package/es/vtx-select/style/index.js +11 -56
- 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 +27 -9
- package/es/vtx-tree-select/index.js +81 -110
- 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 +41 -32
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +6 -6
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +112 -142
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +7 -6
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/index.js +2 -1
- package/lib/vtx-datagrid/ToolBar/style.js +6 -3
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +134 -37
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +108 -18
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- 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 +2 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -39
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +18 -8
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/style/index.js +6 -4
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +141 -43
- 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 -19
- package/lib/vtx-import2/style/index.js +59 -8
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -2
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +33 -31
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_GB.js +1 -1
- package/lib/vtx-provider/locale/en_US.js +58 -4
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +32 -12
- package/lib/vtx-search/style/index.js +6 -3
- package/lib/vtx-select/index.js +125 -42
- package/lib/vtx-select/style/index.js +11 -56
- 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 +27 -9
- package/lib/vtx-tree-select/index.js +81 -112
- 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 +39 -30
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +239 -238
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
@prefix-cls: vtx-qdate;
|
|
2
|
-
|
|
3
|
-
.@{prefix-cls} {
|
|
4
|
-
&-wrap {
|
|
5
|
-
position: relative;
|
|
6
|
-
|
|
7
|
-
.ant-calendar-picker-input {
|
|
8
|
-
color: transparent;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&-input-wrap {
|
|
13
|
-
position: absolute;
|
|
14
|
-
top: 50%;
|
|
15
|
-
left: 12px;
|
|
16
|
-
margin-top: -16px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&-extra-footer {
|
|
20
|
-
text-align: center;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&-text-year:hover,
|
|
24
|
-
&-text-date:hover,
|
|
25
|
-
&-text-month:hover,
|
|
26
|
-
&-text-time:hover {
|
|
27
|
-
text-decoration: underline;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&-text-time::before {
|
|
32
|
-
content: ' ';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&-text-month:not(:first-child)::before,
|
|
36
|
-
&-text-date:not(:first-child)::before {
|
|
37
|
-
content: '-';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
@prefix-cls: vtx-qdate;
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls} {
|
|
4
|
+
&-wrap {
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
.ant-calendar-picker-input {
|
|
8
|
+
color: transparent;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-input-wrap {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 50%;
|
|
15
|
+
left: 12px;
|
|
16
|
+
margin-top: -16px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-extra-footer {
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-text-year:hover,
|
|
24
|
+
&-text-date:hover,
|
|
25
|
+
&-text-month:hover,
|
|
26
|
+
&-text-time:hover {
|
|
27
|
+
text-decoration: underline;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&-text-time::before {
|
|
32
|
+
content: ' ';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-text-month:not(:first-child)::before,
|
|
36
|
+
&-text-date:not(:first-child)::before {
|
|
37
|
+
content: '-';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import React, { useContext } from 'react';
|
|
10
|
+
import { Descriptions } from 'antd';
|
|
11
|
+
import { useStyle } from "./style";
|
|
12
|
+
import { VtxProvider } from "../vtx-provider";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
function VtxDescriptions(props) {
|
|
15
|
+
var _useContext = useContext(VtxProvider),
|
|
16
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
17
|
+
var prefixCls = getPrefixCls('descriptions', props.prefixCls);
|
|
18
|
+
var _useStyle = useStyle(prefixCls),
|
|
19
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
20
|
+
hashId = _useStyle.hashId;
|
|
21
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(props), props));
|
|
22
|
+
return wrapSSR( /*#__PURE__*/_jsx(Descriptions, _objectSpread({
|
|
23
|
+
classNames: {
|
|
24
|
+
root: classnames(hashId, prefixCls)
|
|
25
|
+
}
|
|
26
|
+
}, rest)));
|
|
27
|
+
}
|
|
28
|
+
VtxDescriptions.propTypes = {};
|
|
29
|
+
export default VtxDescriptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
|
+
var genStyle = function genStyle(token) {
|
|
9
|
+
var componentCls = token.componentCls;
|
|
10
|
+
return _defineProperty({}, componentCls, {});
|
|
11
|
+
};
|
|
12
|
+
export function useStyle(prefixCls) {
|
|
13
|
+
return useAntdStyle('VtxDescriptions', function (token) {
|
|
14
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
15
|
+
componentCls: ".".concat(prefixCls)
|
|
16
|
+
});
|
|
17
|
+
return [genStyle(_token)];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -31,7 +31,7 @@ function VtxEllipsisText(props) {
|
|
|
31
31
|
wrapSSR = _useStyle.wrapSSR,
|
|
32
32
|
hashId = _useStyle.hashId;
|
|
33
33
|
var textStyle = {};
|
|
34
|
-
if (lineClamp >=
|
|
34
|
+
if (lineClamp >= 1) {
|
|
35
35
|
textStyle['WebkitLineClamp'] = lineClamp;
|
|
36
36
|
}
|
|
37
37
|
return wrapSSR( /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
@@ -40,7 +40,7 @@ function VtxEllipsisText(props) {
|
|
|
40
40
|
mouseEnterDelay: 0.3
|
|
41
41
|
}, tooltip), {}, {
|
|
42
42
|
children: /*#__PURE__*/_jsx("p", {
|
|
43
|
-
className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp <
|
|
43
|
+
className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
|
|
44
44
|
style: _objectSpread(_objectSpread({}, style), textStyle),
|
|
45
45
|
children: text
|
|
46
46
|
})
|
|
@@ -10,7 +10,9 @@ var genVtxEllipsisTextStyle = function genVtxEllipsisTextStyle(token) {
|
|
|
10
10
|
return _defineProperty({}, componentCls, _defineProperty(_defineProperty({
|
|
11
11
|
margin: 0,
|
|
12
12
|
overflow: 'hidden',
|
|
13
|
-
textOverflow: 'ellipsis'
|
|
13
|
+
textOverflow: 'ellipsis',
|
|
14
|
+
wordBreak: "break-all",
|
|
15
|
+
wordWrap: "break-word"
|
|
14
16
|
}, "&--single", {
|
|
15
17
|
whiteSpace: 'nowrap'
|
|
16
18
|
}), "&--multi", {
|
package/es/vtx-export/index.js
CHANGED
|
@@ -16,13 +16,15 @@ import PropTypes from 'prop-types';
|
|
|
16
16
|
import axios from 'axios';
|
|
17
17
|
import qs from 'querystring';
|
|
18
18
|
import getToken from "../utils/getToken";
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
19
|
+
import { ExportOutlined } from '@ant-design/icons';
|
|
20
|
+
import downloadFile from '@vtx/utils/lib/downloadFile';
|
|
21
|
+
import getSignature from '@vtx/utils/lib/getSignature';
|
|
21
22
|
import { isObject } from "../utils";
|
|
22
23
|
import { useStyle } from "./style/index";
|
|
23
24
|
import { ConfigProvider, message, Spin, Dropdown, Menu, Button } from 'antd';
|
|
24
25
|
import classnames from 'classnames';
|
|
25
26
|
import { useIntl } from "../vtx-provider";
|
|
27
|
+
import VtxIcon from "../vtx-icon";
|
|
26
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
29
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
30
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -69,10 +71,10 @@ var VtxExport = function VtxExport(props) {
|
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
// eslint-disable-next-line valid-jsdoc
|
|
72
|
-
/**
|
|
73
|
-
* 发送http请求
|
|
74
|
-
* @param {Object} postData api参数
|
|
75
|
-
* @return reponse
|
|
74
|
+
/**
|
|
75
|
+
* 发送http请求
|
|
76
|
+
* @param {Object} postData api参数
|
|
77
|
+
* @return reponse
|
|
76
78
|
*/
|
|
77
79
|
function requestToResponse(postData) {
|
|
78
80
|
var params = {
|
|
@@ -102,36 +104,26 @@ var VtxExport = function VtxExport(props) {
|
|
|
102
104
|
spinning: true,
|
|
103
105
|
className: classnames(prefixCls, hashId, 'vtx-spin')
|
|
104
106
|
}), div);
|
|
107
|
+
var status = false;
|
|
105
108
|
document.body.appendChild(div);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
downloadFile(downloadURL, {
|
|
110
|
+
timeout: timeout,
|
|
111
|
+
data: postData,
|
|
112
|
+
extraHeader: headers,
|
|
113
|
+
success: function success() {
|
|
114
|
+
status = true;
|
|
115
|
+
},
|
|
116
|
+
fail: function fail() {
|
|
117
|
+
status = false;
|
|
118
|
+
message.error('导出失败');
|
|
119
|
+
},
|
|
120
|
+
finally: function _finally() {
|
|
121
|
+
document.body.removeChild(div);
|
|
122
|
+
if (afterExport && typeof afterExport === 'function') {
|
|
123
|
+
afterExport(status);
|
|
116
124
|
}
|
|
117
|
-
if ('download' in document.createElement('a')) {
|
|
118
|
-
download(res.data, filename);
|
|
119
|
-
status = true;
|
|
120
|
-
} else {
|
|
121
|
-
message.warning(intl.getMessage('fallback.browserNotSupported', '浏览器不支持'));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
// 关闭loading,执行回调
|
|
125
|
-
document.body.removeChild(div);
|
|
126
|
-
if (afterExport && typeof afterExport === 'function') {
|
|
127
|
-
console.log('Export status:', status);
|
|
128
|
-
afterExport(status);
|
|
129
125
|
}
|
|
130
|
-
}
|
|
131
|
-
console.error('Export failed:', err);
|
|
132
|
-
message.error('导出失败');
|
|
133
|
-
document.body.removeChild(div);
|
|
134
|
-
});
|
|
126
|
+
}, 'blob');
|
|
135
127
|
}
|
|
136
128
|
/* 下载并 兼容IE */
|
|
137
129
|
function download(content, filename) {
|
|
@@ -143,10 +135,10 @@ var VtxExport = function VtxExport(props) {
|
|
|
143
135
|
downloadByATag(window.URL.createObjectURL(blob), filename);
|
|
144
136
|
}
|
|
145
137
|
}
|
|
146
|
-
/**
|
|
147
|
-
* 通过a标签模拟下载
|
|
148
|
-
* @param {String} href
|
|
149
|
-
* @param {String} filename
|
|
138
|
+
/**
|
|
139
|
+
* 通过a标签模拟下载
|
|
140
|
+
* @param {String} href
|
|
141
|
+
* @param {String} filename
|
|
150
142
|
*/
|
|
151
143
|
function downloadByATag(href, filename) {
|
|
152
144
|
var a = document.createElement('a');
|
|
@@ -182,7 +174,10 @@ var VtxExport = function VtxExport(props) {
|
|
|
182
174
|
trigger: ['click'],
|
|
183
175
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
184
176
|
icon: /*#__PURE__*/_jsx(ExportOutlined, {}),
|
|
185
|
-
children: [exportText, " ", /*#__PURE__*/_jsx(
|
|
177
|
+
children: [exportText, " ", /*#__PURE__*/_jsx(VtxIcon, {
|
|
178
|
+
type: "downOutlined",
|
|
179
|
+
fileType: "svg"
|
|
180
|
+
})]
|
|
186
181
|
})
|
|
187
182
|
}));
|
|
188
183
|
};
|
|
@@ -13,14 +13,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
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; }
|
|
14
14
|
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; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import
|
|
17
|
-
import { VtxDatagrid, VtxInput, VtxModal, VtxEllipsisText } from "./..";
|
|
16
|
+
import { VtxDatagrid, VtxEllipsisText, VtxInput, VtxModal } from "./..";
|
|
18
17
|
import { downloadFile, request } from '@vtx/utils';
|
|
19
18
|
import { useAntdTable } from 'ahooks';
|
|
20
19
|
import { Button, Form, Modal, message } from 'antd';
|
|
21
|
-
import { getData } from "./util";
|
|
22
20
|
import PropTypes from 'prop-types';
|
|
21
|
+
import { useEffect, useRef } from 'react';
|
|
23
22
|
import getToken from "../utils/getToken";
|
|
23
|
+
import { getData } from "./util";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
function History(props) {
|
|
@@ -38,7 +38,9 @@ function History(props) {
|
|
|
38
38
|
_props$customTablePro = props.customTableProps,
|
|
39
39
|
customTableProps = _props$customTablePro === void 0 ? {} : _props$customTablePro,
|
|
40
40
|
refreshTime = props.refreshTime,
|
|
41
|
-
downloadInNewTab = props.downloadInNewTab
|
|
41
|
+
downloadInNewTab = props.downloadInNewTab,
|
|
42
|
+
_props$headers = props.headers,
|
|
43
|
+
headers = _props$headers === void 0 ? {} : _props$headers;
|
|
42
44
|
var _Form$useForm = Form.useForm(),
|
|
43
45
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
44
46
|
form = _Form$useForm2[0];
|
|
@@ -106,6 +108,10 @@ function History(props) {
|
|
|
106
108
|
timer.current = setInterval(function () {
|
|
107
109
|
refresh();
|
|
108
110
|
}, refreshTime * 1000);
|
|
111
|
+
return function () {
|
|
112
|
+
timer.current && clearInterval(timer.current);
|
|
113
|
+
timer.current = null;
|
|
114
|
+
};
|
|
109
115
|
}, [JSON.stringify(tableProps.dataSource)]);
|
|
110
116
|
var pageSize = pagination.pageSize,
|
|
111
117
|
current = pagination.current;
|
|
@@ -146,12 +152,13 @@ function History(props) {
|
|
|
146
152
|
name: TextEnum.downloadBtnText,
|
|
147
153
|
onClick: function onClick() {
|
|
148
154
|
if (downloadInNewTab) {
|
|
149
|
-
window.
|
|
155
|
+
window.location.href = "".concat(downFileUrl, "?id=").concat(record.id, "&token=").concat(getToken('token'));
|
|
150
156
|
} else {
|
|
151
157
|
downloadFile(downFileUrl, {
|
|
152
158
|
data: {
|
|
153
159
|
id: record.id
|
|
154
|
-
}
|
|
160
|
+
},
|
|
161
|
+
extraHeader: headers
|
|
155
162
|
}, 'blob');
|
|
156
163
|
}
|
|
157
164
|
},
|
|
@@ -251,6 +258,7 @@ History.propTypes = {
|
|
|
251
258
|
TextEnum: PropTypes.object,
|
|
252
259
|
customTableProps: PropTypes.object,
|
|
253
260
|
refreshTime: PropTypes.number,
|
|
254
|
-
downloadInNewTab: PropTypes.bool
|
|
261
|
+
downloadInNewTab: PropTypes.bool,
|
|
262
|
+
headers: PropTypes.object
|
|
255
263
|
};
|
|
256
264
|
export default History;
|
|
@@ -32,7 +32,7 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
32
32
|
var intl = useIntl();
|
|
33
33
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
34
34
|
getPrefixCls = _useContext.getPrefixCls;
|
|
35
|
-
var prefixCls = getPrefixCls('vtx-export-async'
|
|
35
|
+
var prefixCls = getPrefixCls('', 'vtx-export-async');
|
|
36
36
|
var _useStyle = useStyle(prefixCls),
|
|
37
37
|
wrapSSR = _useStyle.wrapSSR,
|
|
38
38
|
hashId = _useStyle.hashId;
|
|
@@ -79,9 +79,13 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
79
79
|
downloadInNewTab = _props$downloadInNewT === void 0 ? false : _props$downloadInNewT,
|
|
80
80
|
_props$enableCustomSe = props.enableCustomSelect,
|
|
81
81
|
enableCustomSelect = _props$enableCustomSe === void 0 ? false : _props$enableCustomSe,
|
|
82
|
-
beforeExport = props.beforeExport,
|
|
83
82
|
_props$headers = props.headers,
|
|
84
|
-
headers = _props$headers === void 0 ? {} : _props$headers
|
|
83
|
+
headers = _props$headers === void 0 ? {} : _props$headers,
|
|
84
|
+
beforeExport = props.beforeExport,
|
|
85
|
+
_props$historyHeaders = props.historyHeaders,
|
|
86
|
+
historyHeaders = _props$historyHeaders === void 0 ? {} : _props$historyHeaders,
|
|
87
|
+
_props$hideContent = props.hideContent,
|
|
88
|
+
hideContent = _props$hideContent === void 0 ? false : _props$hideContent;
|
|
85
89
|
var _Form$useForm = Form.useForm(),
|
|
86
90
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
87
91
|
form = _Form$useForm2[0];
|
|
@@ -296,7 +300,9 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
296
300
|
subtitle: TextEnum.modalTitleText
|
|
297
301
|
}) : TextEnum.modalTitleText,
|
|
298
302
|
open: state.visible,
|
|
299
|
-
|
|
303
|
+
mask: {
|
|
304
|
+
closable: false
|
|
305
|
+
},
|
|
300
306
|
onCancel: close,
|
|
301
307
|
footer: [/*#__PURE__*/_jsx(Button, {
|
|
302
308
|
onClick: close,
|
|
@@ -334,7 +340,8 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
334
340
|
exclude: SpecialCharacters.filter(function (v) {
|
|
335
341
|
return !Includes.includes(v);
|
|
336
342
|
})
|
|
337
|
-
}
|
|
343
|
+
},
|
|
344
|
+
maxLength: 255
|
|
338
345
|
})
|
|
339
346
|
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
340
347
|
label: TextEnum.fieldTypeText,
|
|
@@ -351,7 +358,7 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
351
358
|
}, item.key);
|
|
352
359
|
})
|
|
353
360
|
})
|
|
354
|
-
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
361
|
+
}), hideContent ? null : /*#__PURE__*/_jsx(Form.Item, {
|
|
355
362
|
label: TextEnum.fieldContentText,
|
|
356
363
|
name: "content",
|
|
357
364
|
rules: [{
|
|
@@ -386,7 +393,8 @@ var VtxExportAsync = function VtxExportAsync(props) {
|
|
|
386
393
|
TextEnum: TextEnum,
|
|
387
394
|
customTableProps: customTableProps,
|
|
388
395
|
refreshTime: refreshTime,
|
|
389
|
-
downloadInNewTab: downloadInNewTab
|
|
396
|
+
downloadInNewTab: downloadInNewTab,
|
|
397
|
+
headers: historyHeaders
|
|
390
398
|
})]
|
|
391
399
|
}));
|
|
392
400
|
};
|
|
@@ -416,7 +424,9 @@ VtxExportAsync.propTypes = {
|
|
|
416
424
|
refreshTime: PropTypes.number,
|
|
417
425
|
downloadInNewTab: PropTypes.bool,
|
|
418
426
|
enableCustomSelect: PropTypes.bool,
|
|
419
|
-
headers: PropTypes.object
|
|
427
|
+
headers: PropTypes.object,
|
|
428
|
+
beforeExport: PropTypes.object,
|
|
429
|
+
historyHeaders: PropTypes.object
|
|
420
430
|
};
|
|
421
431
|
export { VtxExportAsync };
|
|
422
432
|
export default VtxExportAsync;
|
|
@@ -9,6 +9,16 @@ import qs from 'querystring';
|
|
|
9
9
|
import getToken from "../utils/getToken";
|
|
10
10
|
import getSignature from '@vtx/utils/lib/getSignature';
|
|
11
11
|
var token = getToken();
|
|
12
|
+
var getContentType = function getContentType(headers) {
|
|
13
|
+
var contentTypeKey = Object.keys(headers || {}).find(function (key) {
|
|
14
|
+
return key.toLowerCase() === 'content-type';
|
|
15
|
+
});
|
|
16
|
+
return contentTypeKey ? headers[contentTypeKey] : '';
|
|
17
|
+
};
|
|
18
|
+
var stringifyPostData = function stringifyPostData(params, headers) {
|
|
19
|
+
var contentType = getContentType(headers);
|
|
20
|
+
return String(contentType).includes('application/json') ? JSON.stringify(params) : qs.stringify(params);
|
|
21
|
+
};
|
|
12
22
|
var getData = function getData(url, params, headers) {
|
|
13
23
|
return new Promise(function (resolve, reject) {
|
|
14
24
|
axios.get(url, {
|
|
@@ -29,14 +39,15 @@ var getData = function getData(url, params, headers) {
|
|
|
29
39
|
};
|
|
30
40
|
var postData = function postData(url, params, headers) {
|
|
31
41
|
return new Promise(function (resolve, reject) {
|
|
42
|
+
var nextHeaders = _objectSpread(_objectSpread({
|
|
43
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
44
|
+
Authorization: token ? "Bearer ".concat(token) : ''
|
|
45
|
+
}, getSignature(params)), headers);
|
|
32
46
|
axios({
|
|
33
47
|
url: url,
|
|
34
48
|
method: 'post',
|
|
35
|
-
headers:
|
|
36
|
-
|
|
37
|
-
Authorization: token ? "Bearer ".concat(token) : ''
|
|
38
|
-
}, getSignature(params)), headers),
|
|
39
|
-
data: qs.stringify(params)
|
|
49
|
+
headers: nextHeaders,
|
|
50
|
+
data: stringifyPostData(params, nextHeaders)
|
|
40
51
|
}).then(function (res) {
|
|
41
52
|
if (res.status == 200) {
|
|
42
53
|
resolve(res.data);
|
|
@@ -12,6 +12,7 @@ import PropTypes from 'prop-types';
|
|
|
12
12
|
import { ConfigProvider, Tooltip, Col, Form } from 'antd';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
14
|
import { StoreCtx } from "./context";
|
|
15
|
+
import { useIntl } from "../vtx-provider";
|
|
15
16
|
|
|
16
17
|
// 24 栅格
|
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -19,6 +20,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
20
|
var SPAN = 24;
|
|
20
21
|
export default function FormItem(props) {
|
|
21
22
|
var _rest$rules;
|
|
23
|
+
var intl = useIntl();
|
|
22
24
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
23
25
|
getPrefixCls = _useContext.getPrefixCls;
|
|
24
26
|
var prefixCls = getPrefixCls('', 'vtx-form-layout-item');
|
|
@@ -62,27 +64,25 @@ export default function FormItem(props) {
|
|
|
62
64
|
if (placeholder) {
|
|
63
65
|
return placeholder;
|
|
64
66
|
}
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (['RangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
67
|
+
if (['Input', 'InputNumber', 'VtxInput', 'TextArea', 'VtxEditor'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
68
|
+
// return '请输入' + label
|
|
69
|
+
return intl.getMessage('tableForm.inputPlaceholder', '请输入');
|
|
70
|
+
}
|
|
71
|
+
if (['Select', 'VtxColorPicker', 'VtxSelect', 'VtxCombogrid', 'VtxTreeSelect', 'VtxZtreeSelect', 'VtxSearchMapInput'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
72
|
+
// return '请选择' + label
|
|
73
|
+
return intl.getMessage('tableForm.selectPlaceholder', '请选择');
|
|
74
|
+
}
|
|
75
|
+
if (['DatePicker', 'RangePicker', 'TimePicker', 'VtxDatePicker', 'VtxRangePicker', 'VtxTimePicker', 'VtxTimeRangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
76
|
+
return undefined;
|
|
78
77
|
}
|
|
79
78
|
return null;
|
|
80
79
|
};
|
|
81
80
|
var renderItem = function renderItem(child) {
|
|
82
81
|
if ( /*#__PURE__*/isValidElement(child)) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var _child$props;
|
|
83
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
84
|
+
placeholder: initPlaceholder(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
|
|
85
|
+
}));
|
|
86
86
|
}
|
|
87
87
|
return child;
|
|
88
88
|
};
|
|
@@ -23,7 +23,7 @@ var genVtxFormLayoutStyle = function genVtxFormLayoutStyle(token) {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
'.ant-form-item-control': {
|
|
26
|
-
|
|
26
|
+
img: {
|
|
27
27
|
borderRadius: token.borderRadius
|
|
28
28
|
},
|
|
29
29
|
'.ant-select,.ant-input-number': {
|
|
@@ -129,10 +129,12 @@ var genVtxFormLayoutStyle = function genVtxFormLayoutStyle(token) {
|
|
|
129
129
|
cursor: 'pointer'
|
|
130
130
|
},
|
|
131
131
|
'.ant-card-body': {
|
|
132
|
-
padding: 0
|
|
132
|
+
padding: '0 10px'
|
|
133
133
|
},
|
|
134
134
|
'.ant-card-head': {
|
|
135
|
-
height: '44px'
|
|
135
|
+
height: '44px',
|
|
136
|
+
background: '#F5F7FA',
|
|
137
|
+
padding: '0 20px'
|
|
136
138
|
},
|
|
137
139
|
'.ant-card-head-wrapper, .ant-card-head-title': {
|
|
138
140
|
fontWeight: '600',
|
|
@@ -145,7 +147,7 @@ var genVtxFormLayoutStyle = function genVtxFormLayoutStyle(token) {
|
|
|
145
147
|
color: token.colorTextSecondary
|
|
146
148
|
},
|
|
147
149
|
'.ant-card-head-title': {
|
|
148
|
-
paddingLeft: '
|
|
150
|
+
paddingLeft: '12px !important',
|
|
149
151
|
display: 'flex',
|
|
150
152
|
alignItems: 'center'
|
|
151
153
|
},
|