@cloud-app-dev/vidc 1.0.50 → 2.0.0-alpha.3
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/LoaderApp/index.css +3 -0
- package/es/LoaderApp/index.d.ts +31 -0
- package/es/LoaderApp/index.js +132 -0
- package/es/LoaderApp/interface.d.ts +6 -0
- package/es/LoaderApp/loader.d.ts +20 -0
- package/es/LoaderApp/loader.js +86 -0
- package/es/LoaderApp/utils.d.ts +13 -0
- package/es/LoaderApp/utils.js +126 -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/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 +5 -8
- package/es/WorkerFlow/index.js +37 -9
- package/es/core.d.ts +27 -0
- package/es/index.d.ts +35 -8
- package/es/index.js +35 -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
package/.umirc.ts
CHANGED
|
@@ -13,7 +13,6 @@ export default defineConfig({
|
|
|
13
13
|
targets: { chrome: 60 },
|
|
14
14
|
extraBabelPlugins: [
|
|
15
15
|
['import', { libraryName: 'antd', style: true }, 'antd'],
|
|
16
|
-
['import', { libraryName: '@cloud-app-dev/basic-components', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'basic-components'],
|
|
17
16
|
['import', { libraryName: '@cloud-app-dev/utils', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'utils'],
|
|
18
17
|
['import', { libraryName: 'ahooks', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'ahooks'],
|
|
19
18
|
['import', { libraryName: '@cloud-app-dev/map', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'map-components'],
|
|
@@ -25,7 +24,7 @@ export default defineConfig({
|
|
|
25
24
|
null, // null 值代表保留约定式生成的导航,只做增量配置
|
|
26
25
|
{
|
|
27
26
|
title: 'GitLab',
|
|
28
|
-
path: 'https://git.topvdn.com/
|
|
27
|
+
path: 'https://git.topvdn.com/cloudapp/vidc',
|
|
29
28
|
},
|
|
30
29
|
],
|
|
31
30
|
alias: {
|
package/es/Api/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { OrgItemType } from '
|
|
2
|
-
import {
|
|
3
|
-
import { BzTreeItemType, PostItemType } from '../core';
|
|
1
|
+
import { BzTreeItemType, PostItemType, OrgItemType } from '../core';
|
|
2
|
+
import { UserInfoType } from '../AppContext/interface';
|
|
4
3
|
declare class Api {
|
|
5
4
|
getOrgs(): Promise<OrgItemType[]>;
|
|
6
|
-
getUsers(organizationId: string, params?: any, filterUserIds?: string[]): Promise<
|
|
5
|
+
getUsers(organizationId: string, params?: any, filterUserIds?: string[]): Promise<UserInfoType[]>;
|
|
7
6
|
getPosts(orgId: string): Promise<PostItemType[]>;
|
|
8
7
|
getDeviceBzTree(): Promise<BzTreeItemType[]>;
|
|
9
8
|
getCustomDeviceGroup(): Promise<BzTreeItemType[]>;
|
package/es/Api/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _Service from "@cloud-app-dev/basic-components/es/Service";
|
|
2
|
-
|
|
3
1
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
2
|
|
|
5
3
|
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); } }
|
|
@@ -7,6 +5,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
7
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
6
|
|
|
9
7
|
import { __awaiter } from "tslib";
|
|
8
|
+
import Service from '../Service';
|
|
10
9
|
import { getHeader } from '../utils';
|
|
11
10
|
|
|
12
11
|
var Api = /*#__PURE__*/function () {
|
|
@@ -24,7 +23,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
24
23
|
switch (_context.prev = _context.next) {
|
|
25
24
|
case 0:
|
|
26
25
|
_context.next = 2;
|
|
27
|
-
return
|
|
26
|
+
return Service.$http({
|
|
28
27
|
url: '/api/user/v1/organization/queryChildOrganizationsById',
|
|
29
28
|
method: 'post',
|
|
30
29
|
requestId: 'queryChildOrganizationsById',
|
|
@@ -61,7 +60,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
61
60
|
switch (_context2.prev = _context2.next) {
|
|
62
61
|
case 0:
|
|
63
62
|
_context2.next = 2;
|
|
64
|
-
return
|
|
63
|
+
return Service.$http({
|
|
65
64
|
url: '/api/user/v1/queryUsers',
|
|
66
65
|
method: 'post',
|
|
67
66
|
requestId: 'queryUsers',
|
|
@@ -99,7 +98,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
99
98
|
switch (_context3.prev = _context3.next) {
|
|
100
99
|
case 0:
|
|
101
100
|
_context3.next = 2;
|
|
102
|
-
return
|
|
101
|
+
return Service.$http({
|
|
103
102
|
url: "/api/user/v2/post/queryPostByOrgId/".concat(orgId),
|
|
104
103
|
method: 'post',
|
|
105
104
|
requestId: 'queryPostByOrgId',
|
|
@@ -129,7 +128,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
129
128
|
switch (_context4.prev = _context4.next) {
|
|
130
129
|
case 0:
|
|
131
130
|
_context4.next = 2;
|
|
132
|
-
return
|
|
131
|
+
return Service.$http({
|
|
133
132
|
url: '/api/udm-api/DeviceBuzTree/queryList',
|
|
134
133
|
method: 'post',
|
|
135
134
|
requestId: 'getDeviceBzTree',
|
|
@@ -159,7 +158,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
159
158
|
switch (_context5.prev = _context5.next) {
|
|
160
159
|
case 0:
|
|
161
160
|
_context5.next = 2;
|
|
162
|
-
return
|
|
161
|
+
return Service.$http({
|
|
163
162
|
url: '/api/udm-api/customDeviceGroup/queryList',
|
|
164
163
|
method: 'post',
|
|
165
164
|
requestId: 'customDeviceGroup',
|
|
@@ -189,7 +188,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
189
188
|
switch (_context6.prev = _context6.next) {
|
|
190
189
|
case 0:
|
|
191
190
|
_context6.next = 2;
|
|
192
|
-
return
|
|
191
|
+
return Service.$http({
|
|
193
192
|
url: '/api/place/v1/getPlacesByHasDevice',
|
|
194
193
|
method: 'post',
|
|
195
194
|
requestId: 'getPlacesByHasDevice',
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import { _LOGIN_STATUS_EVENT_CHANGE_, _OPERATION_EVENT_CHANGE_, _USER_EVENT_CHANGE_ } from './static';
|
|
4
|
+
|
|
5
|
+
function Sync(_ref) {
|
|
6
|
+
var stateChange = _ref.stateChange;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @description 用户微应用之间的状态同步
|
|
10
|
+
*/
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
var userFn = function userFn(user) {
|
|
13
|
+
return stateChange({
|
|
14
|
+
user: user
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var operationFn = function operationFn(operation) {
|
|
19
|
+
return stateChange({
|
|
20
|
+
operation: operation
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var statusFn = function statusFn(status) {
|
|
25
|
+
return stateChange({
|
|
26
|
+
loginStatus: status
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
_SocketEmitter.on(_USER_EVENT_CHANGE_, userFn);
|
|
31
|
+
|
|
32
|
+
_SocketEmitter.on(_OPERATION_EVENT_CHANGE_, operationFn);
|
|
33
|
+
|
|
34
|
+
_SocketEmitter.on(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
|
|
35
|
+
|
|
36
|
+
return function () {
|
|
37
|
+
_SocketEmitter.off(_USER_EVENT_CHANGE_, userFn);
|
|
38
|
+
|
|
39
|
+
_SocketEmitter.off(_OPERATION_EVENT_CHANGE_, operationFn);
|
|
40
|
+
|
|
41
|
+
_SocketEmitter.off(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default Sync;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AppContextInterface } from './interface';
|
|
3
|
+
declare function Provider({ children }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
Provider: typeof Provider;
|
|
8
|
+
Context: React.Context<AppContextInterface>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
|
+
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
|
+
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
4
|
+
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
|
|
7
|
+
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."); }
|
|
8
|
+
|
|
9
|
+
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); }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
|
|
17
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
18
|
+
import Sync from './Sync';
|
|
19
|
+
import * as Static from './static';
|
|
20
|
+
var _USER_SESSION_ = Static._USER_SESSION_,
|
|
21
|
+
_OPERATION_SESSION_ = Static._OPERATION_SESSION_,
|
|
22
|
+
_LOGIN_STATUS_SESSION_ = Static._LOGIN_STATUS_SESSION_,
|
|
23
|
+
_USER_EVENT_CHANGE_ = Static._USER_EVENT_CHANGE_,
|
|
24
|
+
_OPERATION_EVENT_CHANGE_ = Static._OPERATION_EVENT_CHANGE_,
|
|
25
|
+
_LOGIN_STATUS_EVENT_CHANGE_ = Static._LOGIN_STATUS_EVENT_CHANGE_;
|
|
26
|
+
var Context = /*#__PURE__*/React.createContext(null);
|
|
27
|
+
|
|
28
|
+
function Provider(_ref) {
|
|
29
|
+
var children = _ref.children;
|
|
30
|
+
|
|
31
|
+
var _useState = useState({
|
|
32
|
+
user: _cache.getCache(_USER_SESSION_, 'session') || {},
|
|
33
|
+
operation: _cache.getCache(_OPERATION_SESSION_, 'session') || {},
|
|
34
|
+
loginStatus: _cache.getCache(_LOGIN_STATUS_SESSION_, 'session') || false
|
|
35
|
+
}),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
state = _useState2[0],
|
|
38
|
+
setState = _useState2[1];
|
|
39
|
+
|
|
40
|
+
function updateUser() {
|
|
41
|
+
var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
42
|
+
var newUser = Object.assign(Object.assign({}, state.user), user);
|
|
43
|
+
setState(function (old) {
|
|
44
|
+
return Object.assign(Object.assign({}, old), {
|
|
45
|
+
user: newUser
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
_nextTick(function () {
|
|
50
|
+
_SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
|
|
51
|
+
|
|
52
|
+
_cache.setCache(_USER_SESSION_, newUser, 'session');
|
|
53
|
+
|
|
54
|
+
console.warn('AppContext updateUser is run !', user);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function updateOperation() {
|
|
59
|
+
var operation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
60
|
+
var newOperation = Object.assign(Object.assign({}, state.operation), operation);
|
|
61
|
+
setState(function (old) {
|
|
62
|
+
return Object.assign(Object.assign({}, old), {
|
|
63
|
+
operation: newOperation
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
_nextTick(function () {
|
|
68
|
+
_SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
|
|
69
|
+
|
|
70
|
+
_cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
|
|
71
|
+
|
|
72
|
+
console.warn('AppContext updateOperation is run !', operation);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function updateLoginStatus(status) {
|
|
77
|
+
setState(function (old) {
|
|
78
|
+
return Object.assign(Object.assign({}, old), {
|
|
79
|
+
loginStatus: status
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
_nextTick(function () {
|
|
84
|
+
_SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
|
|
85
|
+
|
|
86
|
+
_cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
|
|
87
|
+
|
|
88
|
+
console.warn('AppContext updateLoginStatus is run !', status);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var stateChange = useCallback(function (options) {
|
|
93
|
+
return setState(function (old) {
|
|
94
|
+
return Object.assign(Object.assign({}, old), options);
|
|
95
|
+
});
|
|
96
|
+
}, []);
|
|
97
|
+
var providerValue = useMemo(function () {
|
|
98
|
+
return {
|
|
99
|
+
user: state.user,
|
|
100
|
+
operation: state.operation,
|
|
101
|
+
loginStatus: state.loginStatus,
|
|
102
|
+
updateUser: updateUser,
|
|
103
|
+
updateOperation: updateOperation,
|
|
104
|
+
updateLoginStatus: updateLoginStatus
|
|
105
|
+
};
|
|
106
|
+
}, [state.user, state.operation, state.loginStatus]);
|
|
107
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
108
|
+
value: providerValue
|
|
109
|
+
}, children, /*#__PURE__*/React.createElement(Sync, {
|
|
110
|
+
stateChange: stateChange
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default {
|
|
115
|
+
Provider: Provider,
|
|
116
|
+
Context: Context
|
|
117
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type UserInfoType = {
|
|
2
|
+
acceptAgreement: boolean;
|
|
3
|
+
id: string;
|
|
4
|
+
idCardNotNull: false;
|
|
5
|
+
lockTime: string;
|
|
6
|
+
loginName: string;
|
|
7
|
+
operationCenterId: string;
|
|
8
|
+
organizationId: string;
|
|
9
|
+
organizationName: string;
|
|
10
|
+
phoneNum: string;
|
|
11
|
+
realName: string;
|
|
12
|
+
roleIds: string[];
|
|
13
|
+
userAvatarUrl?: string;
|
|
14
|
+
userGrade: string;
|
|
15
|
+
userSource: string;
|
|
16
|
+
userType: string;
|
|
17
|
+
validState: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type OperationInfoType = {};
|
|
21
|
+
|
|
22
|
+
export interface AppContextInterface {
|
|
23
|
+
user: UserInfoType;
|
|
24
|
+
operation: OperationInfoType;
|
|
25
|
+
loginStatus: boolean;
|
|
26
|
+
updateUser: (user: UserInfoType) => void;
|
|
27
|
+
updateOperation: (user: OperationInfoType) => void;
|
|
28
|
+
updateLoginStatus: (status: boolean) => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const _USER_EVENT_CHANGE_ = "_USER_EVENT_CHANGE_";
|
|
2
|
+
export declare const _OPERATION_EVENT_CHANGE_ = "_OPERATION_EVENT_CHANGE_";
|
|
3
|
+
export declare const _LOGIN_STATUS_EVENT_CHANGE_ = "_LOGIN_STATUS_EVENT_CHANGE_";
|
|
4
|
+
export declare const _USER_SESSION_ = "_USER_SESSION_";
|
|
5
|
+
export declare const _OPERATION_SESSION_ = "_OPERATION_SESSION_";
|
|
6
|
+
export declare const _LOGIN_STATUS_SESSION_ = "_LOGIN_STATUS_SESSION_";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var _USER_EVENT_CHANGE_ = '_USER_EVENT_CHANGE_';
|
|
2
|
+
export var _OPERATION_EVENT_CHANGE_ = '_OPERATION_EVENT_CHANGE_';
|
|
3
|
+
export var _LOGIN_STATUS_EVENT_CHANGE_ = '_LOGIN_STATUS_EVENT_CHANGE_';
|
|
4
|
+
export var _USER_SESSION_ = '_USER_SESSION_';
|
|
5
|
+
export var _OPERATION_SESSION_ = '_OPERATION_SESSION_';
|
|
6
|
+
export var _LOGIN_STATUS_SESSION_ = '_LOGIN_STATUS_SESSION_';
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as H from 'history';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface AppRedirectProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 匹配路径
|
|
6
|
+
* @default -
|
|
7
|
+
*/
|
|
8
|
+
path?: string | string[];
|
|
9
|
+
/**
|
|
10
|
+
* @description 重定向路径
|
|
11
|
+
* @description -
|
|
12
|
+
*/
|
|
13
|
+
to: H.LocationDescriptor<any>;
|
|
14
|
+
}
|
|
15
|
+
declare function AppRedirect({ path, to }: AppRedirectProps): JSX.Element;
|
|
16
|
+
export default AppRedirect;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
|
+
import useHistory from '../useHistory';
|
|
4
|
+
import "./index.css";
|
|
5
|
+
|
|
6
|
+
var getKey = function getKey() {
|
|
7
|
+
return Math.random().toString(36).substr(2);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function AppRedirect(_ref) {
|
|
11
|
+
var path = _ref.path,
|
|
12
|
+
to = _ref.to;
|
|
13
|
+
var history = useHistory();
|
|
14
|
+
var location = useLocation();
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
if (path === location.pathname) {
|
|
17
|
+
if (typeof to !== 'string') {
|
|
18
|
+
history.replace(Object.assign(Object.assign({}, to), {
|
|
19
|
+
search: to.search ? "".concat(to.search, "&key=").concat(getKey()) : "?key=".concat(getKey()),
|
|
20
|
+
state: Object.assign({}, to.state, {
|
|
21
|
+
isReplace: true
|
|
22
|
+
})
|
|
23
|
+
}));
|
|
24
|
+
} else {
|
|
25
|
+
history.push({
|
|
26
|
+
pathname: to,
|
|
27
|
+
search: "?key".concat(getKey()),
|
|
28
|
+
state: {
|
|
29
|
+
isReplace: true
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, [path, location.pathname, to, history]);
|
|
35
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default AppRedirect;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { match, RouteProps } from 'react-router-dom';
|
|
3
|
+
import { IRenderRouteProps } from './interface';
|
|
4
|
+
import * as H from 'history';
|
|
5
|
+
/**
|
|
6
|
+
* @TODO
|
|
7
|
+
* @多种修正使用url判断异步处理这里防止回调执行的时候url变化导致一直执行
|
|
8
|
+
* @每次执行先清除上一次的
|
|
9
|
+
*/
|
|
10
|
+
export declare const RenderRoute: React.MemoExoticComponent<({ location, match, history, setRouteProps }: IRenderRouteProps) => any>;
|
|
11
|
+
interface IRenderComponentsProps {
|
|
12
|
+
state: any;
|
|
13
|
+
props: any;
|
|
14
|
+
}
|
|
15
|
+
export declare const RenderComponents: React.MemoExoticComponent<({ state, props }: IRenderComponentsProps) => any>;
|
|
16
|
+
interface IRenderRoutesProps extends RouteProps {
|
|
17
|
+
routes?: RouteProps[];
|
|
18
|
+
setRouteProps: (match: match<any>, location: H.Location, history: H.History) => void;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare function RenderRoutes({ routes, setRouteProps, children }: IRenderRoutesProps): JSX.Element;
|
|
22
|
+
export declare function RenderSingleRoute({ exact, strict, sensitive, path, setRouteProps, children }: IRenderRoutesProps): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { useEffect, useMemo } from 'react';
|
|
3
|
+
import { getRouteItem } from './utils';
|
|
4
|
+
import useHistory from '../useHistory';
|
|
5
|
+
import { Route, Switch } from 'react-router-dom';
|
|
6
|
+
/**
|
|
7
|
+
* @TODO
|
|
8
|
+
* @多种修正使用url判断异步处理这里防止回调执行的时候url变化导致一直执行
|
|
9
|
+
* @每次执行先清除上一次的
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export var RenderRoute = /*#__PURE__*/React.memo(function (_ref) {
|
|
13
|
+
var location = _ref.location,
|
|
14
|
+
match = _ref.match,
|
|
15
|
+
history = _ref.history,
|
|
16
|
+
setRouteProps = _ref.setRouteProps;
|
|
17
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
return setRouteProps(match, location, history);
|
|
20
|
+
}, [location.pathname]);
|
|
21
|
+
return null;
|
|
22
|
+
});
|
|
23
|
+
export var RenderComponents = /*#__PURE__*/React.memo(function (_ref2) {
|
|
24
|
+
var state = _ref2.state,
|
|
25
|
+
props = _ref2.props;
|
|
26
|
+
|
|
27
|
+
var _useMemo = useMemo(function () {
|
|
28
|
+
return state;
|
|
29
|
+
}, [state]),
|
|
30
|
+
match = _useMemo.match,
|
|
31
|
+
location = _useMemo.location;
|
|
32
|
+
|
|
33
|
+
var history = useHistory();
|
|
34
|
+
|
|
35
|
+
var _a = useMemo(function () {
|
|
36
|
+
return props;
|
|
37
|
+
}, [props]),
|
|
38
|
+
path = _a.path,
|
|
39
|
+
component = _a.component,
|
|
40
|
+
render = _a.render,
|
|
41
|
+
routes = _a.routes,
|
|
42
|
+
other = __rest(_a, ["path", "component", "render", "routes"]);
|
|
43
|
+
|
|
44
|
+
var _useMemo2 = useMemo(function () {
|
|
45
|
+
var Com, Ren;
|
|
46
|
+
|
|
47
|
+
if (!routes) {
|
|
48
|
+
Com = component;
|
|
49
|
+
Ren = render;
|
|
50
|
+
} else {
|
|
51
|
+
var routeItem = getRouteItem(match, routes);
|
|
52
|
+
Com = routeItem.component;
|
|
53
|
+
Ren = routeItem.render;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
Com: Com,
|
|
58
|
+
Ren: Ren
|
|
59
|
+
};
|
|
60
|
+
}, [component, match, render, routes]),
|
|
61
|
+
Com = _useMemo2.Com,
|
|
62
|
+
Ren = _useMemo2.Ren;
|
|
63
|
+
|
|
64
|
+
return Com ? /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.createElement(Com, null), Object.assign(Object.assign({}, other), {
|
|
65
|
+
match: match,
|
|
66
|
+
location: location,
|
|
67
|
+
history: history
|
|
68
|
+
})) : Ren(Object.assign(Object.assign({}, other), {
|
|
69
|
+
match: match,
|
|
70
|
+
location: location,
|
|
71
|
+
history: history
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
export function RenderRoutes(_ref3) {
|
|
75
|
+
var routes = _ref3.routes,
|
|
76
|
+
setRouteProps = _ref3.setRouteProps,
|
|
77
|
+
children = _ref3.children;
|
|
78
|
+
return /*#__PURE__*/React.createElement(Switch, null, routes.map(function (item, i) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(Route, {
|
|
80
|
+
exact: !!item.exact,
|
|
81
|
+
sensitive: !!item.sensitive,
|
|
82
|
+
strict: !!item.strict,
|
|
83
|
+
key: i,
|
|
84
|
+
path: item.path,
|
|
85
|
+
render: function render(props) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(RenderRoute, Object.assign({}, props, {
|
|
87
|
+
setRouteProps: setRouteProps
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}), children);
|
|
92
|
+
}
|
|
93
|
+
export function RenderSingleRoute(_ref4) {
|
|
94
|
+
var exact = _ref4.exact,
|
|
95
|
+
strict = _ref4.strict,
|
|
96
|
+
sensitive = _ref4.sensitive,
|
|
97
|
+
path = _ref4.path,
|
|
98
|
+
setRouteProps = _ref4.setRouteProps,
|
|
99
|
+
children = _ref4.children;
|
|
100
|
+
return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
101
|
+
exact: !!exact,
|
|
102
|
+
strict: !!strict,
|
|
103
|
+
sensitive: !!sensitive,
|
|
104
|
+
path: path,
|
|
105
|
+
render: function render(props) {
|
|
106
|
+
return /*#__PURE__*/React.createElement(RenderRoute, Object.assign({}, props, {
|
|
107
|
+
setRouteProps: setRouteProps
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
}), children);
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
function Rendered(_ref) {
|
|
4
|
+
var onRendered = _ref.onRendered;
|
|
5
|
+
useEffect(function () {
|
|
6
|
+
return onRendered();
|
|
7
|
+
}, []);
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default Rendered;
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { match } from 'react-router-dom';
|
|
3
|
+
import { IAppRouteType, IAppRouteProps } from './interface';
|
|
4
|
+
import * as H from 'history';
|
|
5
|
+
import './index.less';
|
|
6
|
+
declare class AppRoute extends React.Component<IAppRouteProps, IAppRouteType> {
|
|
7
|
+
private isRender;
|
|
8
|
+
constructor(props: IAppRouteProps);
|
|
9
|
+
shouldComponentUpdate(props: IAppRouteProps): boolean;
|
|
10
|
+
componentWillUnmount(): void;
|
|
11
|
+
setRouteProps: (newMatch: match<any>, newLocation: H.Location<any>, history: H.History<any>) => void;
|
|
12
|
+
render(): JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export default AppRoute;
|