@cloud-app-dev/vidc 1.0.49 → 2.0.0-alpha.2
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/.umirc.ts +1 -2
- package/es/Api/index.d.ts +3 -4
- package/es/Api/index.js +7 -8
- package/es/AppContext/Sync.d.ts +6 -0
- package/es/AppContext/Sync.js +47 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/index.js +117 -0
- package/es/AppContext/interface.d.ts +29 -0
- package/es/AppContext/static.d.ts +6 -0
- package/es/AppContext/static.js +6 -0
- package/es/{AppLayout/AppTools → AppRedirect}/index.css +0 -0
- package/es/AppRedirect/index.d.ts +16 -0
- package/es/AppRedirect/index.js +38 -0
- package/es/AppRoute/Render.d.ts +23 -0
- package/es/AppRoute/Render.js +111 -0
- package/es/AppRoute/Rendered.d.ts +4 -0
- package/es/AppRoute/Rendered.js +11 -0
- package/es/{DagInitialConfig → AppRoute}/index.css +0 -0
- package/es/AppRoute/index.d.ts +14 -0
- package/es/{AppLayout/Header/NotifyAlarm.js → AppRoute/index.js} +52 -68
- package/es/AppRoute/interface.d.ts +18 -0
- package/es/AppRoute/utils.d.ts +1 -0
- package/es/AppRoute/utils.js +28 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +17 -0
- package/es/AutoExit/index.js +8 -5
- package/es/CheckGroupFixed/index.css +49 -0
- package/es/CheckGroupFixed/index.d.ts +17 -0
- package/es/CheckGroupFixed/index.js +146 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +44 -0
- package/es/Config/interface.d.ts +47 -0
- package/es/Config/utils.d.ts +16 -0
- package/es/Config/utils.js +54 -0
- package/es/ConfigContext/index.d.ts +9 -0
- package/es/ConfigContext/index.js +3 -0
- package/es/ContentBox/BetweenBox/index.css +5 -0
- package/es/ContentBox/BetweenBox/index.d.ts +12 -0
- package/es/ContentBox/BetweenBox/index.js +24 -0
- package/es/ContentBox/InfoBox/index.css +23 -0
- package/es/ContentBox/InfoBox/index.d.ts +12 -0
- package/es/ContentBox/InfoBox/index.js +26 -0
- package/es/ContentBox/TwoColumnBox/index.css +77 -0
- package/es/ContentBox/TwoColumnBox/index.d.ts +10 -0
- package/es/ContentBox/TwoColumnBox/index.js +50 -0
- package/es/ContentBox/deps/content-grid.d.ts +9 -0
- package/es/ContentBox/deps/content-grid.js +9 -0
- package/es/ContentBox/deps/grid-factory.d.ts +10 -0
- package/es/ContentBox/deps/grid-factory.js +72 -0
- package/es/ContentBox/deps/simple-grid.d.ts +9 -0
- package/es/ContentBox/deps/simple-grid.js +8 -0
- package/es/ContentBox/index.css +9 -0
- package/es/ContentBox/index.d.ts +14 -0
- package/es/ContentBox/index.js +28 -0
- package/es/DeviceIcon/icon.js +5 -5
- package/es/DeviceIcon/index.js +2 -2
- package/es/DeviceList/index.d.ts +1 -1
- package/es/DeviceList/index.js +4 -4
- package/es/DeviceSelect/index.js +2 -2
- package/es/Dict/cache.d.ts +3 -0
- package/es/Dict/cache.js +21 -0
- package/es/Dict/desc.d.ts +64 -0
- package/es/Dict/desc.js +162 -0
- package/es/Dict/device.d.ts +28 -0
- package/es/Dict/device.js +117 -0
- package/es/Dict/hook.d.ts +4 -0
- package/es/Dict/hook.js +114 -0
- package/es/Dict/index.d.ts +13 -0
- package/es/Dict/index.js +14 -0
- package/es/Dict/interface.d.ts +16 -0
- package/es/Dict/utils.d.ts +11 -0
- package/es/Dict/utils.js +51 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +145 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +54 -0
- package/es/{DagInitialRequest → Drag}/index.css +0 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/Drawer/Demo.d.ts +3 -0
- package/es/Drawer/Demo.js +52 -0
- package/es/Drawer/Footer.d.ts +4 -0
- package/es/Drawer/Footer.js +26 -0
- package/es/Drawer/index.css +39 -0
- package/es/Drawer/index.d.ts +12 -0
- package/es/Drawer/index.js +41 -0
- package/es/Drawer/interface.d.ts +191 -0
- package/es/DynamicDeviceList/CheckExt.js +3 -3
- package/es/DynamicDeviceList/index.js +2 -2
- package/es/DynamicDeviceList/utils.js +2 -2
- package/es/DynamicList/demo.d.ts +2 -0
- package/es/{DagInitialRequest/index.js → DynamicList/demo.js} +49 -55
- package/es/DynamicList/index.css +7 -0
- package/es/DynamicList/index.d.ts +31 -0
- package/es/DynamicList/index.js +132 -0
- package/es/FullScreen/index.css +16 -0
- package/es/FullScreen/index.d.ts +10 -0
- package/es/FullScreen/index.js +68 -0
- package/es/HightLevel/index.css +3 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +22 -0
- package/es/{Upload → IconFont}/index.css +0 -0
- package/es/IconFont/index.d.ts +13 -0
- package/es/IconFont/index.js +58 -0
- package/es/ImageView/index.css +6 -0
- package/es/ImageView/index.d.ts +17 -0
- package/es/ImageView/index.js +58 -0
- package/es/InitialConfig/index.d.ts +5 -7
- package/es/InitialConfig/index.js +16 -51
- package/es/InitialConfig/utils.d.ts +15 -0
- package/es/InitialConfig/utils.js +40 -305
- package/es/InitialRequest/index.d.ts +5 -11
- package/es/InitialRequest/index.js +50 -67
- package/es/InitialRequest/utils.d.ts +8 -0
- package/es/InitialRequest/utils.js +28 -567
- package/es/Input/index.css +8 -0
- package/es/Input/index.d.ts +18 -0
- package/es/{DagInitialConfig → Input}/index.js +50 -45
- package/es/LabelValue/index.css +18 -0
- package/es/LabelValue/index.d.ts +23 -0
- package/es/LabelValue/index.js +32 -0
- package/es/List/CheckExt.d.ts +10 -0
- package/es/List/CheckExt.js +28 -0
- package/es/List/index.css +62 -6
- package/es/List/index.d.ts +73 -11
- package/es/List/index.js +162 -36
- package/es/List/renderItem.d.ts +20 -0
- package/es/List/renderItem.js +68 -0
- package/es/List/utils.d.ts +5 -0
- package/es/List/utils.js +18 -0
- package/es/ListExt/index.css +9 -0
- package/es/ListExt/index.d.ts +19 -0
- package/es/ListExt/index.js +44 -0
- package/es/LoaderScript/index.d.ts +26 -0
- package/es/LoaderScript/index.js +127 -0
- package/es/LoaderScript/interface.d.ts +26 -0
- package/es/LoaderScript/utils.d.ts +12 -0
- package/es/LoaderScript/utils.js +110 -0
- package/es/Modal/index.css +43 -0
- package/es/Modal/index.d.ts +17 -0
- package/es/Modal/index.js +34 -0
- package/es/Modal/interface.d.ts +339 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +94 -0
- package/es/Picture/component/DefaultRects/index.css +247 -0
- package/es/Picture/component/DefaultRects/index.d.ts +12 -0
- package/es/Picture/component/DefaultRects/index.js +47 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.css +8 -0
- package/es/Picture/component/DrawRect/index.d.ts +14 -0
- package/es/Picture/component/DrawRect/index.js +41 -0
- package/es/Picture/component/MoveContent/index.css +0 -0
- package/es/Picture/component/MoveContent/index.d.ts +39 -0
- package/es/Picture/component/MoveContent/index.js +240 -0
- package/es/Picture/component/MoveContent/utils.d.ts +4 -0
- package/es/Picture/component/MoveContent/utils.js +19 -0
- package/es/Picture/component/RectMenu/index.css +31 -0
- package/es/Picture/component/RectMenu/index.d.ts +13 -0
- package/es/Picture/component/RectMenu/index.js +81 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +22 -0
- package/es/Picture/component/Tools/index.css +42 -0
- package/es/Picture/component/Tools/index.d.ts +13 -0
- package/es/Picture/component/Tools/index.js +83 -0
- package/es/Picture/component/WheelScale/index.d.ts +6 -0
- package/es/Picture/component/WheelScale/index.js +29 -0
- package/es/Picture/dragBound.d.ts +5 -0
- package/es/Picture/dragBound.js +77 -0
- package/es/Picture/index.css +12 -0
- package/es/Picture/index.d.ts +16 -0
- package/es/Picture/index.js +344 -0
- package/es/Picture/interface.d.ts +67 -0
- package/es/Picture/loadCaptureRectImage.d.ts +8 -0
- package/es/Picture/loadCaptureRectImage.js +119 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +136 -0
- package/es/Picture/utils.d.ts +22 -0
- package/es/Picture/utils.js +90 -0
- package/es/Progress/index.css +20 -0
- package/es/Progress/index.d.ts +11 -0
- package/es/{AppLayout/Header/ThemeTools.js → Progress/index.js} +46 -47
- package/es/RefDrawer/index.js +4 -5
- package/es/RefModal/index.js +4 -5
- package/es/ScrollList/index.css +73 -0
- package/es/ScrollList/index.d.ts +24 -0
- package/es/ScrollList/index.js +261 -0
- package/es/ScrollList/utils.js +84 -0
- package/es/Service/http.d.ts +4 -0
- package/es/Service/http.js +135 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +14 -0
- package/es/Service/interface.d.ts +28 -0
- package/es/Service/logger.d.ts +3 -0
- package/es/Service/logger.js +13 -0
- package/es/Service/middleware.d.ts +5 -0
- package/es/Service/middleware.js +15 -0
- package/es/Service/utils.d.ts +3 -0
- package/es/Service/utils.js +11 -0
- package/es/TableLayout/index.css +4 -0
- package/es/TableLayout/index.d.ts +10 -0
- package/es/TableLayout/index.js +64 -0
- package/es/ThemeAntd/index.css +501 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +6 -0
- package/es/ThemeAntd/style/button.css +46 -0
- package/es/ThemeAntd/style/checkbox.css +64 -0
- package/es/ThemeAntd/style/form.css +10 -0
- package/es/ThemeAntd/style/input.css +58 -0
- package/es/ThemeAntd/style/pagination.css +44 -0
- package/es/ThemeAntd/style/picker.css +86 -0
- package/es/ThemeAntd/style/popover.css +3 -0
- package/es/ThemeAntd/style/radio.css +71 -0
- package/es/ThemeAntd/style/scrollbar.css +19 -0
- package/es/ThemeAntd/style/select.css +57 -0
- package/es/ThemeAntd/style/table.css +36 -0
- package/es/ThemeAntd/style/tree.css +4 -0
- package/es/{OrgUserTree → Tree}/demo.d.ts +0 -0
- package/es/Tree/demo.js +69 -0
- package/es/Tree/index.css +64 -0
- package/es/Tree/index.d.ts +24 -0
- package/es/Tree/index.js +83 -0
- package/es/TreeMode/index.d.ts +1 -1
- package/es/TreeMode/index.js +6 -6
- package/es/TreeTitle/index.js +2 -2
- package/es/UserSelect/index.d.ts +3 -3
- package/es/UserSelect/index.js +13 -15
- package/es/VList/index.css +4 -0
- package/es/VList/index.d.ts +16 -0
- package/es/VList/index.js +56 -0
- package/es/VList/utils.d.ts +10 -0
- package/es/VList/utils.js +17 -0
- package/es/WorkerFlow/Demo.js +1 -0
- package/es/WorkerFlow/Form/Condition.js +6 -6
- package/es/WorkerFlow/Form/EmptyUserSet.js +2 -2
- package/es/WorkerFlow/Form/FormAuth.js +2 -2
- package/es/WorkerFlow/Form/GroupList.d.ts +2 -1
- package/es/WorkerFlow/Form/GroupList.js +3 -2
- package/es/WorkerFlow/Form/GroupSelect.js +2 -2
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +9 -7
- package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -3
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -2
- package/es/WorkerFlow/Form/UserSelect.js +2 -2
- package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -4
- package/es/WorkerFlow/Form/UserSet.js +2 -2
- package/es/WorkerFlow/Nodes/Add.js +2 -3
- package/es/WorkerFlow/Nodes/AddOption.js +2 -2
- package/es/WorkerFlow/Nodes/Approver.js +2 -2
- package/es/WorkerFlow/Nodes/Condition.js +2 -2
- package/es/WorkerFlow/Nodes/Handle.js +2 -2
- package/es/WorkerFlow/Nodes/Notifier.js +2 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +17 -13
- package/es/WorkerFlow/index.js +37 -9
- package/es/core.d.ts +27 -0
- package/es/index.d.ts +34 -8
- package/es/index.js +34 -8
- package/es/useChangeEffect/index.d.ts +3 -0
- package/es/useChangeEffect/index.js +32 -0
- package/es/useDrawer/index.d.ts +14 -0
- package/es/useDrawer/index.js +90 -0
- package/es/useHistory/index.css +0 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +14 -0
- package/es/useHttp/index.d.ts +8 -0
- package/es/useHttp/index.js +78 -0
- package/es/useModal/index.d.ts +14 -0
- package/es/useModal/index.js +92 -0
- package/es/utils.d.ts +2 -0
- package/es/utils.js +32 -0
- package/package.json +12 -6
- package/es/AppLayout/AppHeader/index.css +0 -4
- package/es/AppLayout/AppHeader/index.d.ts +0 -18
- package/es/AppLayout/AppHeader/index.js +0 -41
- package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +0 -1
- package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.js +0 -10
- package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +0 -9
- package/es/AppLayout/AppHorizontalMenu/SubGroup.js +0 -57
- package/es/AppLayout/AppHorizontalMenu/index.css +0 -152
- package/es/AppLayout/AppHorizontalMenu/index.d.ts +0 -13
- package/es/AppLayout/AppHorizontalMenu/index.js +0 -230
- package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +0 -9
- package/es/AppLayout/AppInlineMenu/SubGroup.js +0 -34
- package/es/AppLayout/AppInlineMenu/index.css +0 -110
- package/es/AppLayout/AppInlineMenu/index.d.ts +0 -12
- package/es/AppLayout/AppInlineMenu/index.js +0 -194
- package/es/AppLayout/AppLogo/index.css +0 -74
- package/es/AppLayout/AppLogo/index.d.ts +0 -13
- package/es/AppLayout/AppLogo/index.js +0 -100
- package/es/AppLayout/AppTools/index.d.ts +0 -8
- package/es/AppLayout/AppTools/index.js +0 -10
- package/es/AppLayout/FunctionPreview/index.css +0 -128
- package/es/AppLayout/FunctionPreview/index.d.ts +0 -22
- package/es/AppLayout/FunctionPreview/index.js +0 -218
- package/es/AppLayout/Header/ListenceRoute.d.ts +0 -5
- package/es/AppLayout/Header/ListenceRoute.js +0 -28
- package/es/AppLayout/Header/ModifyPassword/index.d.ts +0 -6
- package/es/AppLayout/Header/ModifyPassword/index.js +0 -201
- package/es/AppLayout/Header/ModifyUserAvatar/index.css +0 -25
- package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +0 -10
- package/es/AppLayout/Header/ModifyUserAvatar/index.js +0 -97
- package/es/AppLayout/Header/Tools.d.ts +0 -11
- package/es/AppLayout/Header/Tools.js +0 -86
- package/es/AppLayout/Header/ToolsItem.d.ts +0 -1
- package/es/AppLayout/Header/ToolsItem.js +0 -12
- package/es/AppLayout/Header/UserAction.d.ts +0 -10
- package/es/AppLayout/Header/UserAction.js +0 -224
- package/es/AppLayout/Header/index.css +0 -136
- package/es/AppLayout/Header/index.d.ts +0 -9
- package/es/AppLayout/Header/index.js +0 -36
- package/es/AppLayout/index.css +0 -21
- package/es/AppLayout/index.d.ts +0 -12
- package/es/AppLayout/index.js +0 -38
- package/es/AppLayout/service/index.js +0 -174
- package/es/AppLayout/service/prefix.js +0 -4
- package/es/AppLayout/service/url.js +0 -35
- package/es/AppLayout/utils/menu.js +0 -24
- package/es/AppLayout/utils.d.ts +0 -4
- package/es/AppLayout/utils.js +0 -112
- package/es/DagInitialConfig/index.d.ts +0 -10
- package/es/DagInitialConfig/utils.js +0 -185
- package/es/DagInitialRequest/index.d.ts +0 -10
- package/es/DagInitialRequest/utils.js +0 -573
- package/es/FormContent/index.css +0 -27
- package/es/FormContent/index.d.ts +0 -19
- package/es/FormContent/index.js +0 -58
- package/es/OrgTree/index.css +0 -39
- package/es/OrgTree/index.d.ts +0 -16
- package/es/OrgTree/index.js +0 -176
- package/es/OrgUserTree/demo.js +0 -20
- package/es/OrgUserTree/index.css +0 -31
- package/es/OrgUserTree/index.d.ts +0 -28
- package/es/OrgUserTree/index.js +0 -131
- package/es/PlaceTree/demo.d.ts +0 -2
- package/es/PlaceTree/demo.js +0 -20
- package/es/PlaceTree/index.css +0 -40
- package/es/PlaceTree/index.d.ts +0 -26
- package/es/PlaceTree/index.js +0 -174
- package/es/Upload/AntUpload/index.css +0 -22
- package/es/Upload/AntUpload/index.d.ts +0 -19
- package/es/Upload/AntUpload/index.js +0 -226
- package/es/Upload/UploadChildren/index.css +0 -28
- package/es/Upload/UploadChildren/index.js +0 -26
- package/es/Upload/index.d.ts +0 -9
- package/es/Upload/index.js +0 -7
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import "antd/lib/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/lib/tooltip";
|
|
3
|
+
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
|
+
|
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
|
|
10
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
11
|
+
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
23
|
+
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
+
|
|
26
|
+
import React, { useState, useEffect, useMemo, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
27
|
+
import AutoSizer from 'react-virtualized/dist/es/AutoSizer';
|
|
28
|
+
import InfiniteLoader from 'react-virtualized/dist/es/InfiniteLoader';
|
|
29
|
+
import List from 'react-virtualized/dist/es/List';
|
|
30
|
+
import IconFont from '../IconFont';
|
|
31
|
+
import { debounce, cloneDeep } from 'lodash';
|
|
32
|
+
import { computedCuurentGrid, arraySliceForX, simpleGrid } from './utils';
|
|
33
|
+
import "./index.css";
|
|
34
|
+
var ScrollList = /*#__PURE__*/forwardRef(function InfiniteScrollLayout(props, ref) {
|
|
35
|
+
var data = props.data,
|
|
36
|
+
itemGrid = props.itemGrid,
|
|
37
|
+
itemHeight = props.itemHeight,
|
|
38
|
+
threshold = props.threshold,
|
|
39
|
+
isNoData = props.isNoData,
|
|
40
|
+
_props$className = props.className,
|
|
41
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
42
|
+
hasLoadPrev = props.hasLoadPrev,
|
|
43
|
+
loadPrev = props.loadPrev,
|
|
44
|
+
prethreshold = props.prethreshold,
|
|
45
|
+
noDataUrl = props.noDataUrl;
|
|
46
|
+
var infiniteRef = useRef(null);
|
|
47
|
+
var loadingRef = useRef(false);
|
|
48
|
+
var scrollRef = useRef(false);
|
|
49
|
+
|
|
50
|
+
var _useState = useState(false),
|
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
+
showBackTop = _useState2[0],
|
|
53
|
+
setShowBackUp = _useState2[1];
|
|
54
|
+
|
|
55
|
+
var _useState3 = useState(computedCuurentGrid()),
|
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
+
currentGrid = _useState4[0],
|
|
58
|
+
setContentGrid = _useState4[1];
|
|
59
|
+
|
|
60
|
+
var debounced = null;
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
var bindResizeEvent = function bindResizeEvent() {
|
|
63
|
+
setContentGrid(computedCuurentGrid());
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
window.addEventListener('resize', bindResizeEvent, false);
|
|
67
|
+
return function () {
|
|
68
|
+
debounced && debounced.cancel();
|
|
69
|
+
window.removeEventListener('resize', bindResizeEvent, false);
|
|
70
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
}, []);
|
|
72
|
+
var rowCount = useMemo(function () {
|
|
73
|
+
return Math.floor(24 / itemGrid[currentGrid]);
|
|
74
|
+
}, [itemGrid, currentGrid]);
|
|
75
|
+
var renderData = useMemo(function () {
|
|
76
|
+
return arraySliceForX(data, rowCount);
|
|
77
|
+
}, [data, rowCount]);
|
|
78
|
+
|
|
79
|
+
function forceUpdateGrid() {
|
|
80
|
+
infiniteRef.current && infiniteRef.current._registeredChild.forceUpdateGrid();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function scrollToPosition() {
|
|
84
|
+
var _infiniteRef$current$;
|
|
85
|
+
|
|
86
|
+
infiniteRef.current && (_infiniteRef$current$ = infiniteRef.current._registeredChild).scrollToPosition.apply(_infiniteRef$current$, arguments);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function scrollToRow() {
|
|
90
|
+
var _infiniteRef$current$2;
|
|
91
|
+
|
|
92
|
+
infiniteRef.current && (_infiniteRef$current$2 = infiniteRef.current._registeredChild).scrollToRow.apply(_infiniteRef$current$2, arguments);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
useImperativeHandle(ref, function () {
|
|
96
|
+
return {
|
|
97
|
+
forceUpdateGrid: forceUpdateGrid,
|
|
98
|
+
scrollToRow: scrollToRow,
|
|
99
|
+
scrollToPosition: scrollToPosition
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
var loadMore = /*#__PURE__*/function () {
|
|
104
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
105
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
106
|
+
while (1) {
|
|
107
|
+
switch (_context.prev = _context.next) {
|
|
108
|
+
case 0:
|
|
109
|
+
if (!(props.hasLoadMore && props.loadMore && !loadingRef.current)) {
|
|
110
|
+
_context.next = 5;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
loadingRef.current = true;
|
|
115
|
+
_context.next = 4;
|
|
116
|
+
return props.loadMore();
|
|
117
|
+
|
|
118
|
+
case 4:
|
|
119
|
+
loadingRef.current = false;
|
|
120
|
+
|
|
121
|
+
case 5:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, _callee);
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
return function loadMore() {
|
|
130
|
+
return _ref.apply(this, arguments);
|
|
131
|
+
};
|
|
132
|
+
}();
|
|
133
|
+
|
|
134
|
+
function onListScroll(options) {
|
|
135
|
+
if (hasLoadPrev && !loadingRef.current && loadPrev && options.scrollTop === 0 && scrollRef.current) {
|
|
136
|
+
loadingRef.current = true;
|
|
137
|
+
loadPrev().then(function (dataLength) {
|
|
138
|
+
if (dataLength) {
|
|
139
|
+
var row = Math.ceil(dataLength / rowCount);
|
|
140
|
+
|
|
141
|
+
if (row > 0) {
|
|
142
|
+
scrollToPosition(row * itemHeight);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
loadingRef.current = false;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!scrollRef.current && options.scrollTop >= prethreshold) {
|
|
151
|
+
scrollRef.current = true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
debounced && debounced.cancel();
|
|
155
|
+
debounced = debounce(function () {
|
|
156
|
+
var flag = options.scrollTop > 200;
|
|
157
|
+
|
|
158
|
+
if (showBackTop !== flag) {
|
|
159
|
+
setShowBackUp(flag);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
props.onScroll && props.onScroll(options);
|
|
163
|
+
}, 500);
|
|
164
|
+
debounced();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function rowRender(_ref2) {
|
|
168
|
+
var key = _ref2.key,
|
|
169
|
+
index = _ref2.index,
|
|
170
|
+
style = _ref2.style;
|
|
171
|
+
var gutter = props.gutter,
|
|
172
|
+
paddingRow = props.paddingRow,
|
|
173
|
+
rowClass = props.rowClass,
|
|
174
|
+
hasLoadMore = props.hasLoadMore,
|
|
175
|
+
itemClass = props.itemClass;
|
|
176
|
+
var rowData = renderData[index] || [];
|
|
177
|
+
var len = rowCount - rowData.length;
|
|
178
|
+
|
|
179
|
+
if (rowData.length < rowCount) {
|
|
180
|
+
for (var i = 0; i < len; i++) {
|
|
181
|
+
rowData.push(null);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
key: key,
|
|
187
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
188
|
+
padding: "0 ".concat(paddingRow)
|
|
189
|
+
}),
|
|
190
|
+
className: "row-group-part ".concat(rowClass)
|
|
191
|
+
}, rowData.map(function (v, i) {
|
|
192
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
key: "".concat(key, "-").concat(i),
|
|
194
|
+
className: "row-item-part ".concat(v === null && hasLoadMore ? 'row-item-placeholder' : '', " ").concat(v !== null ? itemClass : ''),
|
|
195
|
+
style: {
|
|
196
|
+
width: "".concat(100 / 24 * itemGrid[currentGrid], "%"),
|
|
197
|
+
height: itemHeight,
|
|
198
|
+
marginRight: gutter,
|
|
199
|
+
paddingBottom: gutter
|
|
200
|
+
}
|
|
201
|
+
}, v && props.renderItem(v, i));
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function _isRowLoaded(_ref3) {
|
|
206
|
+
var index = _ref3.index;
|
|
207
|
+
return !!renderData[index];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: "lm-c-infinite-scroll-layout ".concat(isNoData ? 'infinite-scroll-empty' : '', " ").concat(className),
|
|
212
|
+
style: isNoData ? {
|
|
213
|
+
backgroundImage: "url(".concat(noDataUrl, ")")
|
|
214
|
+
} : undefined
|
|
215
|
+
}, /*#__PURE__*/React.createElement(InfiniteLoader, {
|
|
216
|
+
isRowLoaded: _isRowLoaded,
|
|
217
|
+
loadMoreRows: loadMore,
|
|
218
|
+
rowCount: renderData.length + 1,
|
|
219
|
+
ref: infiniteRef,
|
|
220
|
+
threshold: threshold
|
|
221
|
+
}, function (_ref4) {
|
|
222
|
+
var onRowsRendered = _ref4.onRowsRendered,
|
|
223
|
+
registerChild = _ref4.registerChild;
|
|
224
|
+
return /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref5) {
|
|
225
|
+
var width = _ref5.width,
|
|
226
|
+
height = _ref5.height;
|
|
227
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
228
|
+
width: width,
|
|
229
|
+
onRowsRendered: onRowsRendered,
|
|
230
|
+
ref: registerChild,
|
|
231
|
+
height: height,
|
|
232
|
+
rowCount: renderData.length,
|
|
233
|
+
rowHeight: itemHeight,
|
|
234
|
+
rowRenderer: rowRender,
|
|
235
|
+
onScroll: onListScroll
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}), props.hasBackTop && showBackTop && /*#__PURE__*/React.createElement(_Tooltip, {
|
|
239
|
+
title: "\u8FD4\u56DE\u9876\u90E8",
|
|
240
|
+
placement: "top"
|
|
241
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
className: "scoll-back-top",
|
|
243
|
+
onClick: function onClick() {
|
|
244
|
+
return scrollToPosition(0);
|
|
245
|
+
}
|
|
246
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
247
|
+
type: "icon-S_Arrow_MoveUp"
|
|
248
|
+
}))));
|
|
249
|
+
});
|
|
250
|
+
ScrollList.defaultProps = {
|
|
251
|
+
itemHeight: 200,
|
|
252
|
+
gutter: 20,
|
|
253
|
+
itemGrid: cloneDeep(simpleGrid),
|
|
254
|
+
hasLoadMore: true,
|
|
255
|
+
hasLoadPrev: true,
|
|
256
|
+
threshold: 5,
|
|
257
|
+
prethreshold: 200,
|
|
258
|
+
hasBackTop: false,
|
|
259
|
+
data: []
|
|
260
|
+
};
|
|
261
|
+
export default ScrollList;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export function computedCuurentGrid() {
|
|
2
|
+
var width = document.body.clientWidth;
|
|
3
|
+
|
|
4
|
+
if (width >= 1600) {
|
|
5
|
+
return 'xxl';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (width >= 1200 && width < 1600) {
|
|
9
|
+
return 'xl';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (width >= 992 && width < 1200) {
|
|
13
|
+
return 'lg';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (width >= 768 && width < 992) {
|
|
17
|
+
return 'md';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (width >= 576 && width < 768) {
|
|
21
|
+
return 'sm';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (width < 576) {
|
|
25
|
+
return 'xs';
|
|
26
|
+
}
|
|
27
|
+
} // 切割数组 1维变2维
|
|
28
|
+
|
|
29
|
+
export function arraySliceForX(arr) {
|
|
30
|
+
var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
31
|
+
var newArr = [];
|
|
32
|
+
|
|
33
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
34
|
+
if (newArr.length === 0) {
|
|
35
|
+
newArr.push([]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (newArr[newArr.length - 1].length > x - 1) {
|
|
39
|
+
newArr.push([]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
newArr[newArr.length - 1].push(arr[i]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return newArr;
|
|
46
|
+
} // 切割数组 1维变2维,分组聚合展示
|
|
47
|
+
|
|
48
|
+
export function arraySliceForXG(arr) {
|
|
49
|
+
var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
50
|
+
var isGroupTitle = arguments.length > 2 ? arguments[2] : undefined;
|
|
51
|
+
var newArr = [];
|
|
52
|
+
|
|
53
|
+
for (var i = 0, l = arr.length; i < l; i++) {
|
|
54
|
+
if (newArr.length === 0) {
|
|
55
|
+
newArr.push([]);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (isGroupTitle(arr[i])) {
|
|
59
|
+
if (newArr[newArr.length - 1].length === 0) {
|
|
60
|
+
newArr[newArr.length - 1].push(arr[i]);
|
|
61
|
+
} else {
|
|
62
|
+
newArr.push([arr[i]]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
newArr.push([]);
|
|
66
|
+
} else {
|
|
67
|
+
if (newArr[newArr.length - 1].length > x - 1) {
|
|
68
|
+
newArr.push([]);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
newArr[newArr.length - 1].push(arr[i]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return newArr;
|
|
76
|
+
}
|
|
77
|
+
export var simpleGrid = {
|
|
78
|
+
xxl: 4,
|
|
79
|
+
xl: 6,
|
|
80
|
+
lg: 6,
|
|
81
|
+
md: 7,
|
|
82
|
+
sm: 24,
|
|
83
|
+
xs: 24
|
|
84
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RsponseType, XHRResponse } from './interface';
|
|
2
|
+
export declare function $http(options: RsponseType): import("fetch-like-axios").AxiosPromise<any>;
|
|
3
|
+
export declare const $httpMultiPartInstance: import("fetch-like-axios").AxiosInstance;
|
|
4
|
+
export declare const $httpXMLInstance: ({ url, method, data, headers, cancelHttp, isAsync, requestId }: XHRResponse) => Promise<unknown>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import fetchAxios from 'fetch-like-axios';
|
|
3
|
+
import * as Middleware from './middleware';
|
|
4
|
+
var CancelToken = fetchAxios.CancelToken;
|
|
5
|
+
var config = {
|
|
6
|
+
baseURL: '/',
|
|
7
|
+
timeout: 60 * 1000,
|
|
8
|
+
xhrMode: 'fetch',
|
|
9
|
+
headers: {
|
|
10
|
+
Accept: 'application/json; charset=utf-8',
|
|
11
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var httpInstance = fetchAxios.create(config);
|
|
15
|
+
/**
|
|
16
|
+
* 请求之前拦截动作
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
httpInstance.interceptors.request.use(function (response) {
|
|
20
|
+
return response;
|
|
21
|
+
}, function (error) {
|
|
22
|
+
return console.error(error);
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* 请求之后拦截动作
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
httpInstance.interceptors.response.use(function (response) {
|
|
29
|
+
if (Middleware.responseMiddleware.length === 0) {
|
|
30
|
+
return response.data;
|
|
31
|
+
} else {
|
|
32
|
+
Middleware.responseMiddleware.forEach(function (fn) {
|
|
33
|
+
return response = fn(response);
|
|
34
|
+
});
|
|
35
|
+
return response;
|
|
36
|
+
}
|
|
37
|
+
}, function httpUtilErrorRequest(error) {
|
|
38
|
+
if (Middleware.responseErrorMiddleware.length !== 0) {
|
|
39
|
+
Middleware.responseErrorMiddleware.forEach(function (fn) {
|
|
40
|
+
return error = fn(error);
|
|
41
|
+
});
|
|
42
|
+
return Promise.reject(error);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!error.response) {
|
|
46
|
+
console.error(error);
|
|
47
|
+
return Promise.reject(error);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return Promise.reject(error.response);
|
|
51
|
+
});
|
|
52
|
+
export function $http(options) {
|
|
53
|
+
var cancel;
|
|
54
|
+
var cancelToken = new CancelToken(function (c) {
|
|
55
|
+
cancel = c;
|
|
56
|
+
|
|
57
|
+
if (options.cancelHttp) {
|
|
58
|
+
options.cancelHttp(cancel);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var cancelHttp = options.cancelHttp,
|
|
63
|
+
newOptions = __rest(options, ["cancelHttp"]);
|
|
64
|
+
|
|
65
|
+
return httpInstance(Object.assign(Object.assign({}, newOptions), {
|
|
66
|
+
cancelToken: cancelToken
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
export var $httpMultiPartInstance = fetchAxios.create({
|
|
70
|
+
xhrMode: 'fetch',
|
|
71
|
+
timeout: 10 * 60 * 1000,
|
|
72
|
+
headers: {
|
|
73
|
+
'Content-Type': 'multipart/form-data'
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
$httpMultiPartInstance.interceptors.response.use(function (response) {
|
|
77
|
+
return response.data;
|
|
78
|
+
}, function (error) {
|
|
79
|
+
return Promise.reject(error);
|
|
80
|
+
});
|
|
81
|
+
export var $httpXMLInstance = function xhrRequest(_ref) {
|
|
82
|
+
var url = _ref.url,
|
|
83
|
+
_ref$method = _ref.method,
|
|
84
|
+
method = _ref$method === void 0 ? 'GET' : _ref$method,
|
|
85
|
+
data = _ref.data,
|
|
86
|
+
headers = _ref.headers,
|
|
87
|
+
cancelHttp = _ref.cancelHttp,
|
|
88
|
+
_ref$isAsync = _ref.isAsync,
|
|
89
|
+
isAsync = _ref$isAsync === void 0 ? false : _ref$isAsync,
|
|
90
|
+
requestId = _ref.requestId;
|
|
91
|
+
|
|
92
|
+
if (!requestId) {
|
|
93
|
+
console.warn('缺少requestId');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
var xhr = new XMLHttpRequest();
|
|
98
|
+
|
|
99
|
+
var cancel = function cancel() {
|
|
100
|
+
return xhr.abort();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
if (cancelHttp) {
|
|
104
|
+
cancelHttp(cancel);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
xhr.open(method, url, !isAsync);
|
|
108
|
+
|
|
109
|
+
if (headers) {
|
|
110
|
+
Object.keys(headers).forEach(function (key) {
|
|
111
|
+
xhr.setRequestHeader(key, headers[key]);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
xhr.onreadystatechange = function () {
|
|
116
|
+
if (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 304)) {
|
|
117
|
+
var _data;
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
_data = JSON.parse(xhr.response);
|
|
121
|
+
} catch (e) {
|
|
122
|
+
_data = xhr.response;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
resolve(_data);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (xhr.readyState === 4 && !(xhr.status === 200 || xhr.status === 304)) {
|
|
129
|
+
reject(xhr);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
xhr.send(data ? JSON.stringify(data) : null);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { $http, $httpMultiPartInstance, $httpXMLInstance } from './http';
|
|
2
|
+
import { registerResponseMiddleware, registerResponseErrorMiddleware } from './middleware';
|
|
3
|
+
import produce from 'immer';
|
|
4
|
+
import * as logger from './logger';
|
|
5
|
+
var ServiceInterface = {
|
|
6
|
+
$http: $http,
|
|
7
|
+
$httpXMLInstance: $httpXMLInstance,
|
|
8
|
+
$httpMultiPartInstance: $httpMultiPartInstance,
|
|
9
|
+
registerResponseMiddleware: registerResponseMiddleware,
|
|
10
|
+
registerResponseErrorMiddleware: registerResponseErrorMiddleware,
|
|
11
|
+
logger: logger
|
|
12
|
+
};
|
|
13
|
+
var proxy = produce(ServiceInterface, function () {});
|
|
14
|
+
export default proxy;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'fetch-like-axios';
|
|
2
|
+
|
|
3
|
+
export type loggerType = {
|
|
4
|
+
save(options: { description: string; module: string | number; function: string | number }, token?: string): Promise<any>;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type RsponseType = AxiosRequestConfig & { requestId?: string; cancelHttp?: (cancel: Function) => void; loggerIndex?: number };
|
|
8
|
+
|
|
9
|
+
export type XHRResponse = {
|
|
10
|
+
url: string;
|
|
11
|
+
method: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
headers?: any;
|
|
14
|
+
cancelHttp?: any;
|
|
15
|
+
isAsync?: boolean;
|
|
16
|
+
requestId?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type MiddleWareType = (config: any) => any;
|
|
20
|
+
|
|
21
|
+
export type IServiceInterface = {
|
|
22
|
+
$http(options: RsponseType): Promise<any>;
|
|
23
|
+
$httpXMLInstance(options: XHRResponse): Promise<any>;
|
|
24
|
+
$httpMultiPartInstance(options: AxiosRequestConfig): Promise<any>;
|
|
25
|
+
registerResponseMiddleware(fn: MiddleWareType): void;
|
|
26
|
+
registerResponseErrorMiddleware(fn: MiddleWareType): void;
|
|
27
|
+
logger: loggerType;
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
2
|
+
import { $http } from './http';
|
|
3
|
+
export function save(data, token) {
|
|
4
|
+
return $http({
|
|
5
|
+
method: 'post',
|
|
6
|
+
url: "/api/log/v1/addLog",
|
|
7
|
+
data: data,
|
|
8
|
+
requestId: 'addLog',
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: token || _cache.getCache('token', 'session')
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MiddleWareType } from './interface';
|
|
2
|
+
export declare const responseMiddleware: Array<any>;
|
|
3
|
+
export declare const responseErrorMiddleware: Array<any>;
|
|
4
|
+
export declare function registerResponseMiddleware(fn: MiddleWareType): void;
|
|
5
|
+
export declare function registerResponseErrorMiddleware(fn: MiddleWareType): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var _global = window;
|
|
2
|
+
export var responseMiddleware = _global.responseMiddleware || [];
|
|
3
|
+
export var responseErrorMiddleware = _global.responseMiddleware || [];
|
|
4
|
+
export function registerResponseMiddleware(fn) {
|
|
5
|
+
if (!responseMiddleware.includes(fn)) {
|
|
6
|
+
responseMiddleware.push(fn);
|
|
7
|
+
_global.responseMiddleware = responseMiddleware;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function registerResponseErrorMiddleware(fn) {
|
|
11
|
+
if (!responseErrorMiddleware.includes(fn)) {
|
|
12
|
+
responseErrorMiddleware.push(fn);
|
|
13
|
+
_global.responseErrorMiddleware = responseErrorMiddleware;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ITableLayoutProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
children: React.ReactElement;
|
|
6
|
+
cutNum?: number;
|
|
7
|
+
x?: string | number;
|
|
8
|
+
}
|
|
9
|
+
declare function TableLayout({ className, children, cutNum, x }: ITableLayoutProps): JSX.Element;
|
|
10
|
+
export default TableLayout;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _resizeObserver from "@cloud-app-dev/utils/es/resizeObserver";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
16
|
+
import "./index.css";
|
|
17
|
+
|
|
18
|
+
function TableLayout(_ref) {
|
|
19
|
+
var _ref$className = _ref.className,
|
|
20
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
_ref$cutNum = _ref.cutNum,
|
|
23
|
+
cutNum = _ref$cutNum === void 0 ? 0 : _ref$cutNum,
|
|
24
|
+
_ref$x = _ref.x,
|
|
25
|
+
x = _ref$x === void 0 ? 1200 : _ref$x;
|
|
26
|
+
|
|
27
|
+
var _useState = useState(500),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
height = _useState2[0],
|
|
30
|
+
setHeight = _useState2[1];
|
|
31
|
+
|
|
32
|
+
var domRef = useRef(null);
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var set = function set() {
|
|
35
|
+
var _a;
|
|
36
|
+
|
|
37
|
+
var rect = (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
38
|
+
|
|
39
|
+
if (rect) {
|
|
40
|
+
setHeight(rect.height - cutNum);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
set();
|
|
45
|
+
var dom = domRef.current;
|
|
46
|
+
|
|
47
|
+
_resizeObserver.createResizeObserver(dom, set);
|
|
48
|
+
|
|
49
|
+
return function () {
|
|
50
|
+
_resizeObserver.unResizeObserver(dom, set);
|
|
51
|
+
};
|
|
52
|
+
}, [cutNum]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
ref: domRef,
|
|
55
|
+
className: "table-layout ".concat(className)
|
|
56
|
+
}, /*#__PURE__*/React.cloneElement(children, {
|
|
57
|
+
scroll: {
|
|
58
|
+
x: x,
|
|
59
|
+
y: height
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default TableLayout;
|