@vtx/components 2.5.15 → 2.5.16
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 +61 -50
- 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/getUrlParam.js +1 -8
- 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/useInterval.js +0 -3
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +23 -39
- 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 +0 -22
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +10 -27
- 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 +45 -84
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +27 -53
- 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 +4 -13
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +24 -49
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +4 -16
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +90 -148
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +8 -39
- 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 +22 -52
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/YearPicker.js +13 -36
- package/lib/vtx-date-picker/YearPicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +27 -69
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +3 -10
- 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-editor/index.js +10 -29
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +0 -2
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +0 -2
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-export/index.js +31 -64
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +0 -6
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +0 -6
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export/style/index.less +6 -6
- package/lib/vtx-form-layout/Card.js +11 -33
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +1 -7
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +13 -38
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +3 -9
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +1 -8
- 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/index.js +9 -24
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +0 -8
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +0 -8
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-image/Image.js +65 -100
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +30 -59
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +17 -47
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +4 -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 +46 -79
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +10 -28
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +0 -2
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +0 -2
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-input/TextArea.js +11 -28
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +21 -46
- 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/useLength.js +7 -20
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +2 -8
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +51 -81
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +0 -2
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +0 -2
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +5 -10
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +15 -26
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +3 -12
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +24 -54
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +11 -22
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +25 -54
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +1 -10
- 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-rps-frame/index.js +37 -52
- 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 +30 -66
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js +0 -1
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js +0 -1
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-search/VtxCol.js +7 -26
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +7 -14
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +55 -98
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +0 -5
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +0 -5
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +46 -76
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +0 -3
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +0 -3
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +31 -74
- 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-signature/index.js +18 -33
- 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-split-pane/Pane.js +11 -22
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +20 -40
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +54 -107
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +1 -6
- 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-statistics-column/Back.js +2 -9
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +14 -30
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +14 -30
- 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 +1 -18
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js.map +1 -1
- package/lib/vtx-time-picker/index.js +5 -19
- 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-upload/FilePreview.js +15 -33
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +78 -147
- 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-ztree/index.js +71 -122
- 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-select/index.js +60 -121
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +0 -4
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +0 -4
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/package.json +121 -121
- package/CHANGELOG.md +0 -842
|
@@ -4,45 +4,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function ownKeys(
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
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
17
|
function TableWrap(props) {
|
|
23
|
-
var _classnames;
|
|
24
|
-
|
|
25
18
|
var relative = props.relative,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var tableClass = (0, _classnames2["default"])((
|
|
19
|
+
height = props.height,
|
|
20
|
+
style = props.style,
|
|
21
|
+
className = props.className;
|
|
22
|
+
var tableClass = (0, _classnames2["default"])(_defineProperty(_defineProperty({}, 'vtx-table-wrapper-absolute', !relative), 'vtx-table-wrapper-relative', relative), className);
|
|
30
23
|
var newStyle = style;
|
|
31
|
-
|
|
32
24
|
if (relative && 'height' in props) {
|
|
33
25
|
newStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
34
26
|
height: height
|
|
35
27
|
});
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
30
|
className: tableClass,
|
|
40
31
|
style: newStyle
|
|
41
32
|
}, props.children);
|
|
42
33
|
}
|
|
43
|
-
|
|
44
|
-
var _default = TableWrap;
|
|
45
|
-
exports["default"] = _default;
|
|
34
|
+
var _default = exports["default"] = TableWrap;
|
|
46
35
|
TableWrap.propTypes = {
|
|
47
36
|
style: _propTypes["default"].object,
|
|
48
37
|
className: _propTypes["default"].string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableWrap.js","names":["TableWrap","props","relative","height","style","className","tableClass","classnames","newStyle","children","propTypes","PropTypes","object","string","bool","number","node"],"sources":["vtx-page-layout/TableWrap.jsx"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\n\r\nfunction TableWrap(props) {\r\n const { relative, height, style, className } = props;\r\n\r\n let tableClass = classnames(\r\n {\r\n ['vtx-table-wrapper-absolute']: !relative,\r\n ['vtx-table-wrapper-relative']: relative,\r\n },\r\n className,\r\n );\r\n\r\n let newStyle = style;\r\n if (relative && 'height' in props) {\r\n newStyle = {\r\n ...style,\r\n height: height,\r\n };\r\n }\r\n\r\n return (\r\n <div className={tableClass} style={newStyle}>\r\n {props.children}\r\n </div>\r\n );\r\n}\r\n\r\nexport default TableWrap;\r\n\r\nTableWrap.propTypes = {\r\n style: PropTypes.object,\r\n className: PropTypes.string,\r\n relative: PropTypes.bool,\r\n height: PropTypes.number,\r\n children: PropTypes.node,\r\n};\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableWrap.js","names":["_react","_interopRequireDefault","require","_propTypes","_classnames2","obj","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","toPrimitive","call","TypeError","String","Number","TableWrap","props","relative","height","style","className","tableClass","classnames","newStyle","createElement","children","_default","exports","propTypes","PropTypes","object","string","bool","number","node"],"sources":["vtx-page-layout/TableWrap.jsx"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\n\r\nfunction TableWrap(props) {\r\n const { relative, height, style, className } = props;\r\n\r\n let tableClass = classnames(\r\n {\r\n ['vtx-table-wrapper-absolute']: !relative,\r\n ['vtx-table-wrapper-relative']: relative,\r\n },\r\n className,\r\n );\r\n\r\n let newStyle = style;\r\n if (relative && 'height' in props) {\r\n newStyle = {\r\n ...style,\r\n height: height,\r\n };\r\n }\r\n\r\n return (\r\n <div className={tableClass} style={newStyle}>\r\n {props.children}\r\n </div>\r\n );\r\n}\r\n\r\nexport default TableWrap;\r\n\r\nTableWrap.propTypes = {\r\n style: PropTypes.object,\r\n className: PropTypes.string,\r\n relative: PropTypes.bool,\r\n height: PropTypes.number,\r\n children: PropTypes.node,\r\n};\r\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1BG,KAAK;IAAEC,SAAS,GAAKJ,KAAK,CAAnBI,SAAS;EAE1C,IAAIC,UAAU,GAAG,IAAAC,uBAAU,EAAAvB,eAAA,CAAAA,eAAA,KAElB,4BAA4B,EAAG,CAACkB,QAAQ,GACxC,4BAA4B,EAAGA,QAAQ,GAE5CG,SACJ,CAAC;EAED,IAAIG,QAAQ,GAAGJ,KAAK;EACpB,IAAIF,QAAQ,IAAI,QAAQ,IAAID,KAAK,EAAE;IAC/BO,QAAQ,GAAA5B,aAAA,CAAAA,aAAA,KACDwB,KAAK;MACRD,MAAM,EAAEA;IAAM,EACjB;EACL;EAEA,oBACIhD,MAAA,YAAAsD,aAAA;IAAKJ,SAAS,EAAEC,UAAW;IAACF,KAAK,EAAEI;EAAS,GACvCP,KAAK,CAACS,QACN,CAAC;AAEd;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcZ,SAAS;AAExBA,SAAS,CAACa,SAAS,GAAG;EAClBT,KAAK,EAAEU,qBAAS,CAACC,MAAM;EACvBV,SAAS,EAAES,qBAAS,CAACE,MAAM;EAC3Bd,QAAQ,EAAEY,qBAAS,CAACG,IAAI;EACxBd,MAAM,EAAEW,qBAAS,CAACI,MAAM;EACxBR,QAAQ,EAAEI,qBAAS,CAACK;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,84 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
9
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
11
|
+
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); }
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
24
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
|
-
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
28
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
-
|
|
30
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
-
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
-
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
36
19
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
38
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
42
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
23
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
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); } /**
|
|
28
|
+
* 高阶组件
|
|
29
|
+
*/
|
|
46
30
|
function getDisplayName(WrappedComponend) {
|
|
47
31
|
return WrappedComponend.displayName || WrappedComponend.name || 'Component';
|
|
48
32
|
}
|
|
49
|
-
|
|
50
33
|
function Container() {
|
|
51
34
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
52
35
|
var componentClass = params.componentClass;
|
|
53
36
|
return function HOCFactory(WrappedComponend) {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
return _class = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
_inherits(HOC, _React$Component);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(HOC);
|
|
60
|
-
|
|
37
|
+
var _HOC;
|
|
38
|
+
return _HOC = /*#__PURE__*/function (_React$Component) {
|
|
61
39
|
function HOC() {
|
|
62
40
|
_classCallCheck(this, HOC);
|
|
63
|
-
|
|
64
|
-
return _super.apply(this, arguments);
|
|
41
|
+
return _callSuper(this, HOC, arguments);
|
|
65
42
|
}
|
|
66
|
-
|
|
67
|
-
_createClass(HOC, [{
|
|
43
|
+
_inherits(HOC, _React$Component);
|
|
44
|
+
return _createClass(HOC, [{
|
|
68
45
|
key: "render",
|
|
69
46
|
value: function render() {
|
|
70
47
|
var _this$props = this.props,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
48
|
+
style = _this$props.style,
|
|
49
|
+
className = _this$props.className,
|
|
50
|
+
top = _this$props.top,
|
|
51
|
+
space = _this$props.space;
|
|
75
52
|
var wrapClass = (0, _classnames2["default"])(_defineProperty({}, componentClass, true), className);
|
|
76
|
-
|
|
77
53
|
var newStyle = _objectSpread({
|
|
78
54
|
top: top,
|
|
79
55
|
padding: space
|
|
80
56
|
}, style);
|
|
81
|
-
|
|
82
57
|
var newProps = {
|
|
83
58
|
className: wrapClass,
|
|
84
59
|
style: newStyle
|
|
@@ -86,17 +61,13 @@ function Container() {
|
|
|
86
61
|
return /*#__PURE__*/_react["default"].createElement(WrappedComponend, _extends({}, this.props, newProps));
|
|
87
62
|
}
|
|
88
63
|
}]);
|
|
89
|
-
|
|
90
|
-
return HOC;
|
|
91
|
-
}(_react["default"].Component), _defineProperty(_class, "displayName", "HOC(".concat(getDisplayName(WrappedComponend), ")")), _defineProperty(_class, "propTypes", {
|
|
64
|
+
}(_react["default"].Component), _defineProperty(_HOC, "displayName", "HOC(".concat(getDisplayName(WrappedComponend), ")")), _defineProperty(_HOC, "propTypes", {
|
|
92
65
|
top: _propTypes["default"].number,
|
|
93
66
|
space: _propTypes["default"].number || _propTypes["default"].string,
|
|
94
67
|
style: _propTypes["default"].object,
|
|
95
68
|
className: _propTypes["default"].string
|
|
96
|
-
}),
|
|
69
|
+
}), _HOC;
|
|
97
70
|
};
|
|
98
71
|
}
|
|
99
|
-
|
|
100
|
-
var _default = Container;
|
|
101
|
-
exports["default"] = _default;
|
|
72
|
+
var _default = exports["default"] = Container;
|
|
102
73
|
//# sourceMappingURL=container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","names":["getDisplayName","WrappedComponend","displayName","name","Container","params","componentClass","HOCFactory","props","style","className","top","space","wrapClass","classnames","newStyle","padding","newProps","React","Component","PropTypes","number","string","object"],"sources":["vtx-page-layout/container.jsx"],"sourcesContent":["/**\r\n * 高阶组件\r\n */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\n\r\nfunction getDisplayName(WrappedComponend) {\r\n return WrappedComponend.displayName || WrappedComponend.name || 'Component';\r\n}\r\n\r\nfunction Container(params = {}) {\r\n let { componentClass } = params;\r\n\r\n return function HOCFactory(WrappedComponend) {\r\n return class HOC extends React.Component {\r\n static displayName = `HOC(${getDisplayName(WrappedComponend)})`;\r\n\r\n static propTypes = {\r\n top: PropTypes.number,\r\n space: PropTypes.number || PropTypes.string,\r\n style: PropTypes.object,\r\n className: PropTypes.string,\r\n };\r\n\r\n render() {\r\n const { style, className, top, space } = this.props;\r\n\r\n let wrapClass = classnames(\r\n {\r\n [componentClass]: true,\r\n },\r\n className,\r\n );\r\n\r\n const newStyle = {\r\n top,\r\n padding: space,\r\n ...style,\r\n };\r\n\r\n let newProps = {\r\n className: wrapClass,\r\n style: newStyle,\r\n };\r\n return <WrappedComponend {...this.props} {...newProps} />;\r\n }\r\n };\r\n };\r\n}\r\n\r\nexport default Container;\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.js","names":["_react","_interopRequireDefault","require","_propTypes","_classnames2","obj","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","_extends","Object","assign","bind","target","i","arguments","length","source","key","hasOwnProperty","call","apply","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classCallCheck","instance","Constructor","TypeError","_defineProperties","props","descriptor","configurable","writable","_toPropertyKey","_createClass","protoProps","staticProps","_callSuper","_getPrototypeOf","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","self","_assertThisInitialized","ReferenceError","Boolean","valueOf","setPrototypeOf","getPrototypeOf","__proto__","_inherits","subClass","superClass","create","value","_setPrototypeOf","p","_toPrimitive","toPrimitive","String","Number","getDisplayName","WrappedComponend","displayName","name","Container","params","undefined","componentClass","HOCFactory","_HOC","_React$Component","HOC","render","_this$props","style","className","top","space","wrapClass","classnames","newStyle","padding","newProps","createElement","React","Component","concat","PropTypes","number","string","object","_default","exports"],"sources":["vtx-page-layout/container.jsx"],"sourcesContent":["/**\r\n * 高阶组件\r\n */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\n\r\nfunction getDisplayName(WrappedComponend) {\r\n return WrappedComponend.displayName || WrappedComponend.name || 'Component';\r\n}\r\n\r\nfunction Container(params = {}) {\r\n let { componentClass } = params;\r\n\r\n return function HOCFactory(WrappedComponend) {\r\n return class HOC extends React.Component {\r\n static displayName = `HOC(${getDisplayName(WrappedComponend)})`;\r\n\r\n static propTypes = {\r\n top: PropTypes.number,\r\n space: PropTypes.number || PropTypes.string,\r\n style: PropTypes.object,\r\n className: PropTypes.string,\r\n };\r\n\r\n render() {\r\n const { style, className, top, space } = this.props;\r\n\r\n let wrapClass = classnames(\r\n {\r\n [componentClass]: true,\r\n },\r\n className,\r\n );\r\n\r\n const newStyle = {\r\n top,\r\n padding: space,\r\n ...style,\r\n };\r\n\r\n let newProps = {\r\n className: wrapClass,\r\n style: newStyle,\r\n };\r\n return <WrappedComponend {...this.props} {...newProps} />;\r\n }\r\n };\r\n };\r\n}\r\n\r\nexport default Container;\r\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KA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,qBAAS,CAACG,MAAM;MACvBf,SAAS,EAAEY,qBAAS,CAACE;IACzB,CAAC,GAAApB,IAAA;EAyBT,CAAC;AACL;AAAC,IAAAsB,QAAA,GAAAC,OAAA,cAEc5B,SAAS","ignoreList":[]}
|
|
@@ -4,28 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _container = _interopRequireDefault(require("./container"));
|
|
9
|
-
|
|
10
8
|
var _Basic = _interopRequireDefault(require("./Basic"));
|
|
11
|
-
|
|
12
9
|
var _Content = _interopRequireDefault(require("./Content"));
|
|
13
|
-
|
|
14
10
|
var _TableWrap = _interopRequireDefault(require("./TableWrap"));
|
|
15
|
-
|
|
16
11
|
var _TableLayout = _interopRequireDefault(require("./TableLayout"));
|
|
17
|
-
|
|
18
12
|
var _Pane = _interopRequireDefault(require("./Pane"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
14
|
var Page = (0, _container["default"])({
|
|
23
15
|
componentClass: 'vtx-page'
|
|
24
16
|
})(_Basic["default"]);
|
|
25
17
|
var ButtonWrap = (0, _container["default"])({
|
|
26
18
|
componentClass: 'vtx-button-wrap'
|
|
27
19
|
})(_Basic["default"]);
|
|
28
|
-
var _default = {
|
|
20
|
+
var _default = exports["default"] = {
|
|
29
21
|
TableLayout: _TableLayout["default"],
|
|
30
22
|
Page: Page,
|
|
31
23
|
ButtonWrap: ButtonWrap,
|
|
@@ -33,5 +25,4 @@ var _default = {
|
|
|
33
25
|
Content: (0, _container["default"])()(_Content["default"]),
|
|
34
26
|
TableWrap: (0, _container["default"])()(_TableWrap["default"])
|
|
35
27
|
};
|
|
36
|
-
exports["default"] = _default;
|
|
37
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Page","container","componentClass","Basic","ButtonWrap","TableLayout","Pane","Content","TableWrap"],"sources":["vtx-page-layout/index.jsx"],"sourcesContent":["import container from './container';\nimport Basic from './Basic';\nimport Content from './Content';\nimport TableWrap from './TableWrap';\nimport TableLayout from './TableLayout';\nimport Pane from './Pane';\n\nconst Page = container({ componentClass: 'vtx-page' })(Basic);\nconst ButtonWrap = container({ componentClass: 'vtx-button-wrap' })(Basic);\n\nexport default {\n TableLayout,\n Page,\n ButtonWrap,\n Pane,\n Content: container()(Content),\n TableWrap: container()(TableWrap),\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_container","_interopRequireDefault","require","_Basic","_Content","_TableWrap","_TableLayout","_Pane","obj","__esModule","Page","container","componentClass","Basic","ButtonWrap","_default","exports","TableLayout","Pane","Content","TableWrap"],"sources":["vtx-page-layout/index.jsx"],"sourcesContent":["import container from './container';\r\nimport Basic from './Basic';\r\nimport Content from './Content';\r\nimport TableWrap from './TableWrap';\r\nimport TableLayout from './TableLayout';\r\nimport Pane from './Pane';\r\n\r\nconst Page = container({ componentClass: 'vtx-page' })(Basic);\r\nconst ButtonWrap = container({ componentClass: 'vtx-button-wrap' })(Basic);\r\n\r\nexport default {\r\n TableLayout,\r\n Page,\r\n ButtonWrap,\r\n Pane,\r\n Content: container()(Content),\r\n TableWrap: container()(TableWrap),\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAE1B,IAAME,IAAI,GAAG,IAAAC,qBAAS,EAAC;EAAEC,cAAc,EAAE;AAAW,CAAC,CAAC,CAACC,iBAAK,CAAC;AAC7D,IAAMC,UAAU,GAAG,IAAAH,qBAAS,EAAC;EAAEC,cAAc,EAAE;AAAkB,CAAC,CAAC,CAACC,iBAAK,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAE5D;EACXC,WAAW,EAAXA,uBAAW;EACXP,IAAI,EAAJA,IAAI;EACJI,UAAU,EAAVA,UAAU;EACVI,IAAI,EAAJA,gBAAI;EACJC,OAAO,EAAE,IAAAR,qBAAS,EAAC,CAAC,CAACQ,mBAAO,CAAC;EAC7BC,SAAS,EAAE,IAAAT,qBAAS,EAAC,CAAC,CAACS,qBAAS;AACpC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-page-layout/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"css.js","names":["require"],"sources":["vtx-page-layout/style/index.js"],"sourcesContent":["import './index.less';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-page-layout/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["vtx-page-layout/style/index.js"],"sourcesContent":["import './index.less';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
13
|
-
|
|
14
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
10
|
var _getUrlParam = _interopRequireDefault(require("@vtx/utils/lib/getUrlParam"));
|
|
17
|
-
|
|
18
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
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); }
|
|
13
|
+
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 && {}.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; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); } /* eslint-disable camelcase */ /*
|
|
20
|
+
* @Author: chenxinyu
|
|
21
|
+
* @Date: 2021-03-24 21:47:52
|
|
22
|
+
* @LastEditors: your name
|
|
23
|
+
* @LastEditTime: 2022-01-12 18:49:30
|
|
24
|
+
* @Description: 报表容器
|
|
25
|
+
* @FilePath: \react-components\components\vtx-rps-frame\index.jsx
|
|
26
|
+
*/
|
|
30
27
|
var initReportParamUrl = '/cloud/management/rest/np/param/getByParamTypeCode';
|
|
31
28
|
var initReportInfoUrl = '/cloud/rps/api/np/v101/report/getReportInfoByCode.smvc';
|
|
32
29
|
var initReportServerUrl = '/ReportServer';
|
|
33
|
-
|
|
34
30
|
function VtxRpsFrame(props) {
|
|
35
|
-
var iframeName = (0, _react.useRef)(Math.random() + new Date().getTime());
|
|
31
|
+
var iframeName = (0, _react.useRef)(Math.random() + new Date().getTime());
|
|
36
32
|
|
|
33
|
+
// flag改变,重新渲染报表
|
|
37
34
|
(0, _react.useEffect)(function () {
|
|
38
35
|
getReportInfoByCode();
|
|
39
36
|
}, [props.flag]);
|
|
40
|
-
|
|
41
37
|
var getReportInfoByCode = function getReportInfoByCode() {
|
|
42
38
|
var report_param = props.report_param,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var paramCode = paramTypeCode || 'param_report_constant';
|
|
55
|
-
|
|
39
|
+
data_param = props.data_param,
|
|
40
|
+
paramTypeCode = props.paramTypeCode,
|
|
41
|
+
tenantId = props.tenantId,
|
|
42
|
+
_props$isParamEncode = props.isParamEncode,
|
|
43
|
+
isParamEncode = _props$isParamEncode === void 0 ? false : _props$isParamEncode,
|
|
44
|
+
_props$reportParamUrl = props.reportParamUrl,
|
|
45
|
+
reportParamUrl = _props$reportParamUrl === void 0 ? initReportParamUrl : _props$reportParamUrl,
|
|
46
|
+
_props$reportInfoUrl = props.reportInfoUrl,
|
|
47
|
+
reportInfoUrl = _props$reportInfoUrl === void 0 ? initReportInfoUrl : _props$reportInfoUrl,
|
|
48
|
+
_props$reportServerUr = props.reportServerUrl,
|
|
49
|
+
reportServerUrl = _props$reportServerUr === void 0 ? initReportServerUrl : _props$reportServerUr;
|
|
50
|
+
var paramCode = paramTypeCode || 'param_report_constant';
|
|
51
|
+
// report_code 可配置,如果地址栏有report_code,则优先,否则根据props的report_code
|
|
56
52
|
var report_code = (0, _getUrlParam["default"])().report_code ? (0, _getUrlParam["default"])().report_code : props.report_code;
|
|
57
|
-
var access_token = (0, _getUrlParam["default"])()['token'] || (0, _getUrlParam["default"])()['access_token'];
|
|
53
|
+
var access_token = (0, _getUrlParam["default"])()['token'] || (0, _getUrlParam["default"])()['access_token'];
|
|
58
54
|
|
|
55
|
+
// 获取公共参数
|
|
59
56
|
function commonParam() {
|
|
60
57
|
return (0, _axios["default"])({
|
|
61
58
|
method: 'get',
|
|
@@ -65,16 +62,15 @@ function VtxRpsFrame(props) {
|
|
|
65
62
|
Authorization: "Bearer ".concat(access_token)
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
|
-
}
|
|
69
|
-
|
|
65
|
+
}
|
|
70
66
|
|
|
67
|
+
// 获取报表code
|
|
71
68
|
var param = {
|
|
72
69
|
report_code: report_code,
|
|
73
70
|
timestamp: new Date().valueOf(),
|
|
74
71
|
reqMethod: 0
|
|
75
72
|
};
|
|
76
73
|
var formData = isParamEncode ? encodeURI(JSON.stringify(param)) : JSON.stringify(param);
|
|
77
|
-
|
|
78
74
|
function getReportInfoByCode() {
|
|
79
75
|
return (0, _axios["default"])({
|
|
80
76
|
method: 'get',
|
|
@@ -85,7 +81,6 @@ function VtxRpsFrame(props) {
|
|
|
85
81
|
}
|
|
86
82
|
});
|
|
87
83
|
}
|
|
88
|
-
|
|
89
84
|
_axios["default"].all([commonParam(), getReportInfoByCode()]).then(_axios["default"].spread(function (commonParamResult, reportInfoByCodeResult) {
|
|
90
85
|
if (!commonParamResult.data.result && !reportInfoByCodeResult.data.result) {
|
|
91
86
|
// 报表公共参数
|
|
@@ -95,22 +90,20 @@ function VtxRpsFrame(props) {
|
|
|
95
90
|
obj[d.parmCode] = d.parmName;
|
|
96
91
|
});
|
|
97
92
|
var reportInfoByCodeData = reportInfoByCodeResult.data.data;
|
|
98
|
-
|
|
99
93
|
var _param = _objectSpread(_objectSpread(_objectSpread({
|
|
100
94
|
data_url: reportInfoByCodeData.data_url,
|
|
101
95
|
data_param: JSON.stringify(data_param)
|
|
102
96
|
}, report_param), obj), {}, {
|
|
103
97
|
reqMethod: 0
|
|
104
98
|
});
|
|
105
|
-
|
|
106
99
|
createForm("".concat(window.rpsPrefix || '').concat(reportServerUrl, "?report_code=").concat(report_code, "&reportlet=").concat(reportInfoByCodeData.reportlet, "&fr_locale=zh_CN×tamp=").concat(new Date().valueOf()), _param, "".concat(iframeName.current));
|
|
107
100
|
}
|
|
108
|
-
}))
|
|
101
|
+
}))
|
|
102
|
+
// eslint-disable-next-line no-console
|
|
109
103
|
["catch"](function (err) {
|
|
110
104
|
return console.log(err);
|
|
111
105
|
});
|
|
112
106
|
};
|
|
113
|
-
|
|
114
107
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
108
|
className: "vtx-rps-frame"
|
|
116
109
|
}, /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
@@ -120,7 +113,6 @@ function VtxRpsFrame(props) {
|
|
|
120
113
|
name: "".concat(iframeName.current)
|
|
121
114
|
}));
|
|
122
115
|
}
|
|
123
|
-
|
|
124
116
|
VtxRpsFrame.propTypes = {
|
|
125
117
|
flag: _propTypes["default"].number,
|
|
126
118
|
report_code: _propTypes["default"].string,
|
|
@@ -133,9 +125,7 @@ VtxRpsFrame.propTypes = {
|
|
|
133
125
|
reportServerUrl: _propTypes["default"].string,
|
|
134
126
|
isParamEncode: _propTypes["default"].bool
|
|
135
127
|
};
|
|
136
|
-
var _default = VtxRpsFrame;
|
|
137
|
-
exports["default"] = _default;
|
|
138
|
-
|
|
128
|
+
var _default = exports["default"] = VtxRpsFrame;
|
|
139
129
|
var createForm = function createForm(reqURL, param, iframeName) {
|
|
140
130
|
// 定义一个form表单
|
|
141
131
|
var formDom = document.createElement('form');
|
|
@@ -144,7 +134,6 @@ var createForm = function createForm(reqURL, param, iframeName) {
|
|
|
144
134
|
formDom.action = reqURL;
|
|
145
135
|
formDom.style = 'display:none';
|
|
146
136
|
var inputArray = [];
|
|
147
|
-
|
|
148
137
|
for (var k in param) {
|
|
149
138
|
if (Object.prototype.hasOwnProperty.call(param, k)) {
|
|
150
139
|
var input1 = document.createElement('input');
|
|
@@ -154,15 +143,11 @@ var createForm = function createForm(reqURL, param, iframeName) {
|
|
|
154
143
|
inputArray.push(input1);
|
|
155
144
|
}
|
|
156
145
|
}
|
|
157
|
-
|
|
158
146
|
document.body.appendChild(formDom); // 将表单放置在web中
|
|
159
|
-
|
|
160
147
|
for (var i = 0, len = inputArray.length; i < len; i++) {
|
|
161
148
|
formDom.append(inputArray[i]);
|
|
162
149
|
}
|
|
163
|
-
|
|
164
150
|
formDom.submit(); // 表单提交
|
|
165
|
-
|
|
166
151
|
formDom.remove();
|
|
167
152
|
};
|
|
168
153
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["initReportParamUrl","initReportInfoUrl","initReportServerUrl","VtxRpsFrame","props","iframeName","useRef","Math","random","Date","getTime","useEffect","getReportInfoByCode","flag","report_param","data_param","paramTypeCode","tenantId","isParamEncode","reportParamUrl","reportInfoUrl","reportServerUrl","paramCode","report_code","getUrlParam","access_token","commonParam","axios","method","url","headers","Authorization","param","timestamp","valueOf","reqMethod","formData","encodeURI","JSON","stringify","all","then","spread","commonParamResult","reportInfoByCodeResult","data","result","commonParamData","obj","forEach","d","parmCode","parmName","reportInfoByCodeData","data_url","createForm","window","rpsPrefix","reportlet","current","err","console","log","propTypes","PropTypes","number","string","object","oneOfType","array","bool","reqURL","formDom","document","createElement","target","action","style","inputArray","k","Object","prototype","hasOwnProperty","call","input1","type","name","value","push","body","appendChild","i","len","length","append","submit","remove"],"sources":["vtx-rps-frame/index.jsx"],"sourcesContent":["/* eslint-disable camelcase */\r\n/*\r\n * @Author: chenxinyu\r\n * @Date: 2021-03-24 21:47:52\r\n * @LastEditors: your name\r\n * @LastEditTime: 2022-01-12 18:49:30\r\n * @Description: 报表容器\r\n * @FilePath: \\react-components\\components\\vtx-rps-frame\\index.jsx\r\n */\r\nimport React, { useEffect, useRef } from 'react';\r\nimport axios from 'axios';\r\nimport PropTypes from 'prop-types';\r\nimport getUrlParam from '@vtx/utils/lib/getUrlParam';\r\n\r\n\r\nconst initReportParamUrl = '/cloud/management/rest/np/param/getByParamTypeCode';\r\nconst initReportInfoUrl = '/cloud/rps/api/np/v101/report/getReportInfoByCode.smvc';\r\nconst initReportServerUrl = '/ReportServer';\r\nfunction VtxRpsFrame(props) {\r\n const iframeName = useRef(Math.random() + new Date().getTime());\r\n\r\n // flag改变,重新渲染报表\r\n useEffect(() => {\r\n getReportInfoByCode();\r\n }, [props.flag]);\r\n\r\n const getReportInfoByCode = () => {\r\n const {\r\n // report_code,\r\n report_param,\r\n data_param,\r\n paramTypeCode,\r\n tenantId,\r\n isParamEncode = false,\r\n reportParamUrl = initReportParamUrl,\r\n reportInfoUrl = initReportInfoUrl,\r\n reportServerUrl = initReportServerUrl,\r\n } = props;\r\n\r\n const paramCode = paramTypeCode || 'param_report_constant';\r\n // report_code 可配置,如果地址栏有report_code,则优先,否则根据props的report_code\r\n const report_code = getUrlParam().report_code\r\n ? getUrlParam().report_code\r\n : props.report_code;\r\n\r\n const access_token = getUrlParam()['token'] || getUrlParam()['access_token'];\r\n\r\n // 获取公共参数\r\n function commonParam() {\r\n return axios({\r\n method: 'get',\r\n url: `${reportParamUrl}?parameters={\"paramTypeCode\": \"${paramCode}\",\"tenantId\":\"${tenantId}\"}`,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded',\r\n Authorization: `Bearer ${access_token}`,\r\n },\r\n });\r\n }\r\n\r\n // 获取报表code\r\n const param = {\r\n report_code,\r\n timestamp: new Date().valueOf(),\r\n reqMethod: 0,\r\n };\r\n const formData = isParamEncode ? encodeURI(JSON.stringify(param)) : JSON.stringify(param);\r\n function getReportInfoByCode() {\r\n return axios({\r\n method: 'get',\r\n url: `${reportInfoUrl}?parameters=${formData}`,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded',\r\n Authorization: `Bearer ${access_token}`,\r\n },\r\n });\r\n }\r\n\r\n axios\r\n .all([commonParam(), getReportInfoByCode()])\r\n .then(\r\n axios.spread(function (commonParamResult, reportInfoByCodeResult) {\r\n if (!commonParamResult.data.result && !reportInfoByCodeResult.data.result) {\r\n // 报表公共参数\r\n const commonParamData = commonParamResult.data.data;\r\n const obj = {};\r\n commonParamData.forEach(d => {\r\n obj[d.parmCode] = d.parmName;\r\n });\r\n const reportInfoByCodeData = reportInfoByCodeResult.data.data;\r\n const param = {\r\n data_url: reportInfoByCodeData.data_url,\r\n data_param: JSON.stringify(data_param),\r\n ...report_param,\r\n ...obj,\r\n reqMethod: 0,\r\n };\r\n createForm(\r\n `${window.rpsPrefix || ''}${reportServerUrl}?report_code=${report_code}&reportlet=${reportInfoByCodeData.reportlet\r\n }&fr_locale=zh_CN×tamp=${new Date().valueOf()}`,\r\n param,\r\n `${iframeName.current}`,\r\n );\r\n }\r\n }),\r\n )\r\n // eslint-disable-next-line no-console\r\n .catch(err => console.log(err));\r\n };\r\n\r\n return (\r\n <div className=\"vtx-rps-frame\">\r\n <iframe\r\n className=\"vtx-rps-frame-wrapper\"\r\n width=\"100%\"\r\n height=\"100%\"\r\n name={`${iframeName.current}`}\r\n ></iframe>\r\n </div>\r\n );\r\n}\r\n\r\nVtxRpsFrame.propTypes = {\r\n flag: PropTypes.number,\r\n report_code: PropTypes.string,\r\n report_param: PropTypes.object,\r\n data_param: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\r\n paramTypeCode: PropTypes.string,\r\n tenantId: PropTypes.string,\r\n reportParamUrl: PropTypes.string,\r\n reportInfoUrl: PropTypes.string,\r\n reportServerUrl: PropTypes.string,\r\n isParamEncode: PropTypes.bool,\r\n};\r\nexport default VtxRpsFrame;\r\n\r\nconst createForm = function (reqURL, param, iframeName) {\r\n // 定义一个form表单\r\n const formDom = document.createElement('form');\r\n formDom.method = 'post';\r\n formDom.target = iframeName;\r\n formDom.action = reqURL;\r\n formDom.style = 'display:none';\r\n const inputArray = [];\r\n for (const k in param) {\r\n if (Object.prototype.hasOwnProperty.call(param, k)) {\r\n const input1 = document.createElement('input');\r\n input1.type = 'hidden';\r\n input1.name = k;\r\n input1.value = param[k];\r\n inputArray.push(input1);\r\n }\r\n }\r\n document.body.appendChild(formDom); // 将表单放置在web中\r\n for (let i = 0, len = inputArray.length; i < len; i++) {\r\n formDom.append(inputArray[i]);\r\n }\r\n formDom.submit(); // 表单提交\r\n formDom.remove();\r\n};\r\n"],"mappings":";;;;;;;;;AASA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAGA,IAAMA,kBAAkB,GAAG,oDAA3B;AACA,IAAMC,iBAAiB,GAAG,wDAA1B;AACA,IAAMC,mBAAmB,GAAG,eAA5B;;AACA,SAASC,WAAT,CAAqBC,KAArB,EAA4B;EACxB,IAAMC,UAAU,GAAG,IAAAC,aAAA,EAAOC,IAAI,CAACC,MAAL,KAAgB,IAAIC,IAAJ,GAAWC,OAAX,EAAvB,CAAnB,CADwB,CAGxB;;EACA,IAAAC,gBAAA,EAAU,YAAM;IACZC,mBAAmB;EACtB,CAFD,EAEG,CAACR,KAAK,CAACS,IAAP,CAFH;;EAIA,IAAMD,mBAAmB,GAAG,+BAAM;IAC9B,IAEIE,YAFJ,GAUIV,KAVJ,CAEIU,YAFJ;IAAA,IAGIC,UAHJ,GAUIX,KAVJ,CAGIW,UAHJ;IAAA,IAIIC,aAJJ,GAUIZ,KAVJ,CAIIY,aAJJ;IAAA,IAKIC,QALJ,GAUIb,KAVJ,CAKIa,QALJ;IAAA,2BAUIb,KAVJ,CAMIc,aANJ;IAAA,IAMIA,aANJ,qCAMoB,KANpB;IAAA,4BAUId,KAVJ,CAOIe,cAPJ;IAAA,IAOIA,cAPJ,sCAOqBnB,kBAPrB;IAAA,2BAUII,KAVJ,CAQIgB,aARJ;IAAA,IAQIA,aARJ,qCAQoBnB,iBARpB;IAAA,4BAUIG,KAVJ,CASIiB,eATJ;IAAA,IASIA,eATJ,sCASsBnB,mBATtB;IAYA,IAAMoB,SAAS,GAAGN,aAAa,IAAI,uBAAnC,CAb8B,CAc9B;;IACA,IAAMO,WAAW,GAAG,IAAAC,uBAAA,IAAcD,WAAd,GACd,IAA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,UAAU,CAACe,MAAjC,EAAyCF,CAAC,GAAGC,GAA7C,EAAkDD,CAAC,EAAnD,EAAuD;IACnDnB,OAAO,CAACsB,MAAR,CAAehB,UAAU,CAACa,CAAD,CAAzB;EACH;;EACDnB,OAAO,CAACuB,MAAR,GArBoD,CAqBlC;;EAClBvB,OAAO,CAACwB,MAAR;AACH,CAvBD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_axios","_interopRequireDefault","_propTypes","_getUrlParam","obj","__esModule","_getRequireWildcardCache","e","WeakMap","r","t","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","o","Symbol","iterator","constructor","prototype","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","toPrimitive","TypeError","String","Number","initReportParamUrl","initReportInfoUrl","initReportServerUrl","VtxRpsFrame","props","iframeName","useRef","Math","random","Date","getTime","useEffect","getReportInfoByCode","flag","report_param","data_param","paramTypeCode","tenantId","_props$isParamEncode","isParamEncode","_props$reportParamUrl","reportParamUrl","_props$reportInfoUrl","reportInfoUrl","_props$reportServerUr","reportServerUrl","paramCode","report_code","getUrlParam","access_token","commonParam","axios","method","url","concat","headers","Authorization","param","timestamp","valueOf","reqMethod","formData","encodeURI","JSON","stringify","all","then","spread","commonParamResult","reportInfoByCodeResult","data","result","commonParamData","d","parmCode","parmName","reportInfoByCodeData","data_url","createForm","window","rpsPrefix","reportlet","current","err","console","log","createElement","className","width","height","name","propTypes","PropTypes","number","string","object","oneOfType","array","bool","_default","exports","reqURL","formDom","document","target","action","style","inputArray","k","input1","type","body","appendChild","len","append","submit","remove"],"sources":["vtx-rps-frame/index.jsx"],"sourcesContent":["/* eslint-disable camelcase */\r\n/*\r\n * @Author: chenxinyu\r\n * @Date: 2021-03-24 21:47:52\r\n * @LastEditors: your name\r\n * @LastEditTime: 2022-01-12 18:49:30\r\n * @Description: 报表容器\r\n * @FilePath: \\react-components\\components\\vtx-rps-frame\\index.jsx\r\n */\r\nimport React, { useEffect, useRef } from 'react';\r\nimport axios from 'axios';\r\nimport PropTypes from 'prop-types';\r\nimport getUrlParam from '@vtx/utils/lib/getUrlParam';\r\n\r\n\r\nconst initReportParamUrl = '/cloud/management/rest/np/param/getByParamTypeCode';\r\nconst initReportInfoUrl = '/cloud/rps/api/np/v101/report/getReportInfoByCode.smvc';\r\nconst initReportServerUrl = '/ReportServer';\r\nfunction VtxRpsFrame(props) {\r\n const iframeName = useRef(Math.random() + new Date().getTime());\r\n\r\n // flag改变,重新渲染报表\r\n useEffect(() => {\r\n getReportInfoByCode();\r\n }, [props.flag]);\r\n\r\n const getReportInfoByCode = () => {\r\n const {\r\n // report_code,\r\n report_param,\r\n data_param,\r\n paramTypeCode,\r\n tenantId,\r\n isParamEncode = false,\r\n reportParamUrl = initReportParamUrl,\r\n reportInfoUrl = initReportInfoUrl,\r\n reportServerUrl = initReportServerUrl,\r\n } = props;\r\n\r\n const paramCode = paramTypeCode || 'param_report_constant';\r\n // report_code 可配置,如果地址栏有report_code,则优先,否则根据props的report_code\r\n const report_code = getUrlParam().report_code\r\n ? getUrlParam().report_code\r\n : props.report_code;\r\n\r\n const access_token = getUrlParam()['token'] || getUrlParam()['access_token'];\r\n\r\n // 获取公共参数\r\n function commonParam() {\r\n return axios({\r\n method: 'get',\r\n url: `${reportParamUrl}?parameters={\"paramTypeCode\": \"${paramCode}\",\"tenantId\":\"${tenantId}\"}`,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded',\r\n Authorization: `Bearer ${access_token}`,\r\n },\r\n });\r\n }\r\n\r\n // 获取报表code\r\n const param = {\r\n report_code,\r\n timestamp: new Date().valueOf(),\r\n reqMethod: 0,\r\n };\r\n const formData = isParamEncode ? encodeURI(JSON.stringify(param)) : JSON.stringify(param);\r\n function getReportInfoByCode() {\r\n return axios({\r\n method: 'get',\r\n url: `${reportInfoUrl}?parameters=${formData}`,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded',\r\n Authorization: `Bearer ${access_token}`,\r\n },\r\n });\r\n }\r\n\r\n axios\r\n .all([commonParam(), getReportInfoByCode()])\r\n .then(\r\n axios.spread(function (commonParamResult, reportInfoByCodeResult) {\r\n if (!commonParamResult.data.result && !reportInfoByCodeResult.data.result) {\r\n // 报表公共参数\r\n const commonParamData = commonParamResult.data.data;\r\n const obj = {};\r\n commonParamData.forEach(d => {\r\n obj[d.parmCode] = d.parmName;\r\n });\r\n const reportInfoByCodeData = reportInfoByCodeResult.data.data;\r\n const param = {\r\n data_url: reportInfoByCodeData.data_url,\r\n data_param: JSON.stringify(data_param),\r\n ...report_param,\r\n ...obj,\r\n reqMethod: 0,\r\n };\r\n createForm(\r\n `${window.rpsPrefix || ''}${reportServerUrl}?report_code=${report_code}&reportlet=${reportInfoByCodeData.reportlet\r\n }&fr_locale=zh_CN×tamp=${new Date().valueOf()}`,\r\n param,\r\n `${iframeName.current}`,\r\n );\r\n }\r\n }),\r\n )\r\n // eslint-disable-next-line no-console\r\n .catch(err => console.log(err));\r\n };\r\n\r\n return (\r\n <div className=\"vtx-rps-frame\">\r\n <iframe\r\n className=\"vtx-rps-frame-wrapper\"\r\n width=\"100%\"\r\n height=\"100%\"\r\n name={`${iframeName.current}`}\r\n ></iframe>\r\n </div>\r\n );\r\n}\r\n\r\nVtxRpsFrame.propTypes = {\r\n flag: PropTypes.number,\r\n report_code: PropTypes.string,\r\n report_param: PropTypes.object,\r\n data_param: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\r\n paramTypeCode: PropTypes.string,\r\n tenantId: PropTypes.string,\r\n reportParamUrl: PropTypes.string,\r\n reportInfoUrl: PropTypes.string,\r\n reportServerUrl: PropTypes.string,\r\n isParamEncode: PropTypes.bool,\r\n};\r\nexport default VtxRpsFrame;\r\n\r\nconst createForm = function (reqURL, param, iframeName) {\r\n // 定义一个form表单\r\n const formDom = document.createElement('form');\r\n formDom.method = 'post';\r\n formDom.target = iframeName;\r\n formDom.action = reqURL;\r\n formDom.style = 'display:none';\r\n const inputArray = [];\r\n for (const k in param) {\r\n if (Object.prototype.hasOwnProperty.call(param, k)) {\r\n const input1 = document.createElement('input');\r\n input1.type = 'hidden';\r\n input1.name = k;\r\n input1.value = param[k];\r\n inputArray.push(input1);\r\n }\r\n }\r\n document.body.appendChild(formDom); // 将表单放置在web中\r\n for (let i = 0, len = inputArray.length; i < len; i++) {\r\n formDom.append(inputArray[i]);\r\n }\r\n formDom.submit(); // 表单提交\r\n formDom.remove();\r\n};\r\n"],"mappings":";;;;;;AASA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AAAqD,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAF,UAAA,SAAAE,CAAA,eAAAA,CAAA,gBAAAI,OAAA,CAAAJ,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAE,GAAA,CAAAL,CAAA,UAAAG,CAAA,CAAAG,GAAA,CAAAN,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAA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CAACY,SAAS,CAACR,cAAc,CAACC,IAAI,CAACqE,KAAK,EAAEmD,CAAC,CAAC,EAAE;MAChD,IAAMC,MAAM,GAAGN,QAAQ,CAACjB,aAAa,CAAC,OAAO,CAAC;MAC9CuB,MAAM,CAACC,IAAI,GAAG,QAAQ;MACtBD,MAAM,CAACnB,IAAI,GAAGkB,CAAC;MACfC,MAAM,CAAClG,KAAK,GAAG8C,KAAK,CAACmD,CAAC,CAAC;MACvBD,UAAU,CAAC1G,IAAI,CAAC4G,MAAM,CAAC;IAC3B;EACJ;EACAN,QAAQ,CAACQ,IAAI,CAACC,WAAW,CAACV,OAAO,CAAC,CAAC,CAAC;EACpC,KAAK,IAAIjH,CAAC,GAAG,CAAC,EAAE4H,GAAG,GAAGN,UAAU,CAACtG,MAAM,EAAEhB,CAAC,GAAG4H,GAAG,EAAE5H,CAAC,EAAE,EAAE;IACnDiH,OAAO,CAACY,MAAM,CAACP,UAAU,CAACtH,CAAC,CAAC,CAAC;EACjC;EACAiH,OAAO,CAACa,MAAM,CAAC,CAAC,CAAC,CAAC;EAClBb,OAAO,CAACc,MAAM,CAAC,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-rps-frame/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"css.js","names":["require"],"sources":["vtx-rps-frame/style/index.js"],"sourcesContent":["import './index.less';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-rps-frame/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["vtx-rps-frame/style/index.js"],"sourcesContent":["import './index.less';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|