@jiangood/open-admin 1.0.0-beta.5
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/config/common-plugin.js +94 -0
- package/config/config.js +58 -0
- package/config/utils.js +73 -0
- package/package.json +42 -0
- package/src/.umi-production/appData.json +2365 -0
- package/src/.umi-production/core/EmptyRoute.tsx +9 -0
- package/src/.umi-production/core/defineApp.ts +16 -0
- package/src/.umi-production/core/helmet.ts +10 -0
- package/src/.umi-production/core/helmetContext.ts +4 -0
- package/src/.umi-production/core/history.ts +72 -0
- package/src/.umi-production/core/historyIntelli.ts +132 -0
- package/src/.umi-production/core/plugin.ts +40 -0
- package/src/.umi-production/core/pluginConfig.ts +324 -0
- package/src/.umi-production/core/pluginConfigJoi.d.ts +7 -0
- package/src/.umi-production/core/polyfill.ts +220 -0
- package/src/.umi-production/core/route.tsx +54 -0
- package/src/.umi-production/core/routeProps.js +5 -0
- package/src/.umi-production/core/routeProps.ts +6 -0
- package/src/.umi-production/core/terminal.ts +37 -0
- package/src/.umi-production/exports.ts +17 -0
- package/src/.umi-production/testBrowser.tsx +90 -0
- package/src/.umi-production/tsconfig.json +44 -0
- package/src/.umi-production/typings.d.ts +136 -0
- package/src/.umi-production/umi.ts +83 -0
- package/src/framework/components/DownloadFileButton/index.d.ts +11 -0
- package/src/framework/components/DownloadFileButton/index.jsx +33 -0
- package/src/framework/components/Gap/index.d.ts +23 -0
- package/src/framework/components/Gap/index.jsx +46 -0
- package/src/framework/components/LinkButton/index.d.ts +14 -0
- package/src/framework/components/LinkButton/index.jsx +10 -0
- package/src/framework/components/NamedIcon/index.d.ts +5 -0
- package/src/framework/components/NamedIcon/index.jsx +11 -0
- package/src/framework/components/OrgTree/index.d.ts +4 -0
- package/src/framework/components/OrgTree/index.jsx +58 -0
- package/src/framework/components/Page/index.d.ts +17 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading/index.d.ts +1 -0
- package/src/framework/components/PageLoading/index.jsx +25 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +123 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +42 -0
- package/src/framework/components/ProTable/index.jsx +260 -0
- package/src/framework/components/ProTable/index.less +14 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree/index.d.ts +4 -0
- package/src/framework/components/RoleTree/index.jsx +50 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +26 -0
- package/src/framework/components/ViewRange/index.d.ts +14 -0
- package/src/framework/components/ViewRange/index.jsx +20 -0
- package/src/framework/components/index.ts +13 -0
- package/src/framework/components/system/ButtonList.d.ts +8 -0
- package/src/framework/components/system/ButtonList.jsx +42 -0
- package/src/framework/components/system/HasPerm.tsx +14 -0
- package/src/framework/components/system/index.tsx +29 -0
- package/src/framework/fields/FieldBoolean/index.d.ts +9 -0
- package/src/framework/fields/FieldBoolean/index.jsx +73 -0
- package/src/framework/fields/FieldDate/index.d.ts +23 -0
- package/src/framework/fields/FieldDate/index.jsx +116 -0
- package/src/framework/fields/FieldDateRange/index.d.ts +22 -0
- package/src/framework/fields/FieldDateRange/index.jsx +103 -0
- package/src/framework/fields/FieldDictSelect/index.d.ts +12 -0
- package/src/framework/fields/FieldDictSelect/index.jsx +16 -0
- package/src/framework/fields/FieldEditor/index.d.ts +14 -0
- package/src/framework/fields/FieldEditor/index.jsx +59 -0
- package/src/framework/fields/FieldNumberRange/index.d.ts +10 -0
- package/src/framework/fields/FieldNumberRange/index.jsx +55 -0
- package/src/framework/fields/FieldPercent/index.d.ts +8 -0
- package/src/framework/fields/FieldPercent/index.jsx +30 -0
- package/src/framework/fields/FieldRemoteSelect/index.d.ts +44 -0
- package/src/framework/fields/FieldRemoteSelect/index.jsx +125 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.jsx +85 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +21 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.jsx +88 -0
- package/src/framework/fields/FieldRemoteTree/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTree/index.jsx +50 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.d.ts +18 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.jsx +59 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +19 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.jsx +57 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.jsx +62 -0
- package/src/framework/fields/FieldSysOrgTree/index.d.ts +9 -0
- package/src/framework/fields/FieldSysOrgTree/index.jsx +20 -0
- package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +9 -0
- package/src/framework/fields/FieldSysOrgTreeSelect/index.jsx +22 -0
- package/src/framework/fields/FieldTable/index.d.ts +14 -0
- package/src/framework/fields/FieldTable/index.jsx +108 -0
- package/src/framework/fields/FieldTable/styles.less +29 -0
- package/src/framework/fields/FieldTableSelect/index.d.ts +19 -0
- package/src/framework/fields/FieldTableSelect/index.jsx +60 -0
- package/src/framework/fields/FieldUploadFile/index.d.ts +31 -0
- package/src/framework/fields/FieldUploadFile/index.jsx +139 -0
- package/src/framework/fields/index.ts +22 -0
- package/src/framework/fields/types.ts +16 -0
- package/src/framework/index.ts +5 -0
- package/src/framework/pages/LoginPage.d.ts +16 -0
- package/src/framework/pages/LoginPage.jsx +135 -0
- package/src/framework/pages/LoginPage.less +53 -0
- package/src/framework/pages/LoginPageUtils.ts +36 -0
- package/src/framework/pages/index.ts +2 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/DateUtils.ts +187 -0
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +144 -0
- package/src/framework/utils/Logger.ts +40 -0
- package/src/framework/utils/MessageUtils.tsx +170 -0
- package/src/framework/utils/ObjectUtils.ts +118 -0
- package/src/framework/utils/StorageUtils.ts +50 -0
- package/src/framework/utils/StringUtils.ts +436 -0
- package/src/framework/utils/TreeUtils.ts +251 -0
- package/src/framework/utils/UrlUtils.ts +152 -0
- package/src/framework/utils/UuidUtils.ts +88 -0
- package/src/framework/utils/ValidateUtils.ts +28 -0
- package/src/framework/utils/index.ts +15 -0
- package/src/framework/utils/system/DictUtils.ts +97 -0
- package/src/framework/utils/system/FormRegistryUtils.ts +77 -0
- package/src/framework/utils/system/HttpUtils.ts +247 -0
- package/src/framework/utils/system/PageUtils.ts +163 -0
- package/src/framework/utils/system/PermUtils.ts +79 -0
- package/src/framework/utils/system/SysUtils.ts +97 -0
- package/src/framework/utils/system/ThemeUtils.ts +27 -0
- package/src/framework/utils/system/index.ts +7 -0
- package/src/framework/views/ViewApproveStatus/index.d.ts +3 -0
- package/src/framework/views/ViewApproveStatus/index.jsx +21 -0
- package/src/framework/views/ViewBoolean/index.d.ts +3 -0
- package/src/framework/views/ViewBoolean/index.jsx +4 -0
- package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +5 -0
- package/src/framework/views/ViewBooleanEnableDisable/index.jsx +15 -0
- package/src/framework/views/ViewFile/index.d.ts +10 -0
- package/src/framework/views/ViewFile/index.jsx +49 -0
- package/src/framework/views/ViewFileButton/index.d.ts +10 -0
- package/src/framework/views/ViewFileButton/index.jsx +22 -0
- package/src/framework/views/ViewImage/index.d.ts +6 -0
- package/src/framework/views/ViewImage/index.jsx +60 -0
- package/src/framework/views/ViewPassword/index.d.ts +5 -0
- package/src/framework/views/ViewPassword/index.jsx +24 -0
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +12 -0
- package/src/framework/views/ViewProcessInstanceProgress/index.jsx +97 -0
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +6 -0
- package/src/framework/views/ViewProcessInstanceProgressButton/index.jsx +24 -0
- package/src/framework/views/ViewText/index.d.ts +16 -0
- package/src/framework/views/ViewText/index.jsx +42 -0
- package/src/framework/views/index.ts +12 -0
- package/src/framework/views/types.ts +26 -0
- package/src/index.ts +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +159 -0
- package/src/layouts/admin/index.less +65 -0
- package/src/layouts/index.jsx +187 -0
- package/src/layouts/index.less +24 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +12 -0
- package/src/pages/index.jsx +10 -0
- package/src/pages/login.jsx +16 -0
- package/src/pages/system/api/ApiDoc.jsx +148 -0
- package/src/pages/system/api/index.jsx +267 -0
- package/src/pages/system/api/perm.jsx +69 -0
- package/src/pages/system/dict/Dict.jsx +67 -0
- package/src/pages/system/dict/DictItem.jsx +175 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +147 -0
- package/src/pages/system/job/index.jsx +324 -0
- package/src/pages/system/log/index.jsx +77 -0
- package/src/pages/system/org/index.jsx +260 -0
- package/src/pages/system/role/index.jsx +302 -0
- package/src/pages/system/role/perm.jsx +107 -0
- package/src/pages/system/sysManual/index.jsx +126 -0
- package/src/pages/system/user/UserPerm.jsx +94 -0
- package/src/pages/system/user/index.jsx +253 -0
- package/src/pages/test/views.jsx +95 -0
- package/src/pages/ureport/index.jsx +16 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +57 -0
- package/src/pages/userCenter/message.jsx +103 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// This file is generated by Umi automatically
|
|
2
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
3
|
+
type CSSModuleClasses = { readonly [key: string]: string }
|
|
4
|
+
declare module '*.css' {
|
|
5
|
+
const classes: CSSModuleClasses
|
|
6
|
+
export default classes
|
|
7
|
+
}
|
|
8
|
+
declare module '*.scss' {
|
|
9
|
+
const classes: CSSModuleClasses
|
|
10
|
+
export default classes
|
|
11
|
+
}
|
|
12
|
+
declare module '*.sass' {
|
|
13
|
+
const classes: CSSModuleClasses
|
|
14
|
+
export default classes
|
|
15
|
+
}
|
|
16
|
+
declare module '*.less' {
|
|
17
|
+
const classes: CSSModuleClasses
|
|
18
|
+
export default classes
|
|
19
|
+
}
|
|
20
|
+
declare module '*.styl' {
|
|
21
|
+
const classes: CSSModuleClasses
|
|
22
|
+
export default classes
|
|
23
|
+
}
|
|
24
|
+
declare module '*.stylus' {
|
|
25
|
+
const classes: CSSModuleClasses
|
|
26
|
+
export default classes
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// images
|
|
30
|
+
declare module '*.jpg' {
|
|
31
|
+
const src: string
|
|
32
|
+
export default src
|
|
33
|
+
}
|
|
34
|
+
declare module '*.jpeg' {
|
|
35
|
+
const src: string
|
|
36
|
+
export default src
|
|
37
|
+
}
|
|
38
|
+
declare module '*.png' {
|
|
39
|
+
const src: string
|
|
40
|
+
export default src
|
|
41
|
+
}
|
|
42
|
+
declare module '*.gif' {
|
|
43
|
+
const src: string
|
|
44
|
+
export default src
|
|
45
|
+
}
|
|
46
|
+
declare module '*.svg' {
|
|
47
|
+
import * as React from 'react';
|
|
48
|
+
export const ReactComponent: React.FunctionComponent<React.SVGProps<
|
|
49
|
+
SVGSVGElement
|
|
50
|
+
> & { title?: string }>;
|
|
51
|
+
|
|
52
|
+
const src: string
|
|
53
|
+
export default src
|
|
54
|
+
}
|
|
55
|
+
declare module '*.ico' {
|
|
56
|
+
const src: string
|
|
57
|
+
export default src
|
|
58
|
+
}
|
|
59
|
+
declare module '*.webp' {
|
|
60
|
+
const src: string
|
|
61
|
+
export default src
|
|
62
|
+
}
|
|
63
|
+
declare module '*.avif' {
|
|
64
|
+
const src: string
|
|
65
|
+
export default src
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// media
|
|
69
|
+
declare module '*.mp4' {
|
|
70
|
+
const src: string
|
|
71
|
+
export default src
|
|
72
|
+
}
|
|
73
|
+
declare module '*.webm' {
|
|
74
|
+
const src: string
|
|
75
|
+
export default src
|
|
76
|
+
}
|
|
77
|
+
declare module '*.ogg' {
|
|
78
|
+
const src: string
|
|
79
|
+
export default src
|
|
80
|
+
}
|
|
81
|
+
declare module '*.mp3' {
|
|
82
|
+
const src: string
|
|
83
|
+
export default src
|
|
84
|
+
}
|
|
85
|
+
declare module '*.wav' {
|
|
86
|
+
const src: string
|
|
87
|
+
export default src
|
|
88
|
+
}
|
|
89
|
+
declare module '*.flac' {
|
|
90
|
+
const src: string
|
|
91
|
+
export default src
|
|
92
|
+
}
|
|
93
|
+
declare module '*.aac' {
|
|
94
|
+
const src: string
|
|
95
|
+
export default src
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// fonts
|
|
99
|
+
declare module '*.woff' {
|
|
100
|
+
const src: string
|
|
101
|
+
export default src
|
|
102
|
+
}
|
|
103
|
+
declare module '*.woff2' {
|
|
104
|
+
const src: string
|
|
105
|
+
export default src
|
|
106
|
+
}
|
|
107
|
+
declare module '*.eot' {
|
|
108
|
+
const src: string
|
|
109
|
+
export default src
|
|
110
|
+
}
|
|
111
|
+
declare module '*.ttf' {
|
|
112
|
+
const src: string
|
|
113
|
+
export default src
|
|
114
|
+
}
|
|
115
|
+
declare module '*.otf' {
|
|
116
|
+
const src: string
|
|
117
|
+
export default src
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// other
|
|
121
|
+
declare module '*.wasm' {
|
|
122
|
+
const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Exports>
|
|
123
|
+
export default initWasm
|
|
124
|
+
}
|
|
125
|
+
declare module '*.webmanifest' {
|
|
126
|
+
const src: string
|
|
127
|
+
export default src
|
|
128
|
+
}
|
|
129
|
+
declare module '*.pdf' {
|
|
130
|
+
const src: string
|
|
131
|
+
export default src
|
|
132
|
+
}
|
|
133
|
+
declare module '*.txt' {
|
|
134
|
+
const src: string
|
|
135
|
+
export default src
|
|
136
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import './core/polyfill';
|
|
5
|
+
|
|
6
|
+
import { renderClient } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
7
|
+
import { getRoutes } from './core/route';
|
|
8
|
+
import { createPluginManager } from './core/plugin';
|
|
9
|
+
import { createHistory } from './core/history';
|
|
10
|
+
import Loading from '/home/runner/work/open-admin/open-admin/web/src/loading.jsx';
|
|
11
|
+
import { ApplyPluginsType } from 'umi';
|
|
12
|
+
import {FormRegistryUtils} from '/home/runner/work/open-admin/open-admin/web/src/framework';
|
|
13
|
+
|
|
14
|
+
const publicPath = "/";
|
|
15
|
+
const runtimePublicPath = false;
|
|
16
|
+
|
|
17
|
+
async function render() {
|
|
18
|
+
const pluginManager = createPluginManager();
|
|
19
|
+
const { routes, routeComponents } = await getRoutes(pluginManager);
|
|
20
|
+
|
|
21
|
+
// allow user to extend routes
|
|
22
|
+
await pluginManager.applyPlugins({
|
|
23
|
+
key: 'patchRoutes',
|
|
24
|
+
type: ApplyPluginsType.event,
|
|
25
|
+
args: {
|
|
26
|
+
routes,
|
|
27
|
+
routeComponents,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const contextOpts = pluginManager.applyPlugins({
|
|
32
|
+
key: 'modifyContextOpts',
|
|
33
|
+
type: ApplyPluginsType.modify,
|
|
34
|
+
initialValue: {},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const basename = contextOpts.basename || '/';
|
|
38
|
+
const historyType = contextOpts.historyType || 'hash';
|
|
39
|
+
|
|
40
|
+
const history = createHistory({
|
|
41
|
+
type: historyType,
|
|
42
|
+
basename,
|
|
43
|
+
...contextOpts.historyOpts,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return (pluginManager.applyPlugins({
|
|
47
|
+
key: 'render',
|
|
48
|
+
type: ApplyPluginsType.compose,
|
|
49
|
+
initialValue() {
|
|
50
|
+
const context = {
|
|
51
|
+
useStream: true,
|
|
52
|
+
routes,
|
|
53
|
+
routeComponents,
|
|
54
|
+
pluginManager,
|
|
55
|
+
mountElementId: 'root',
|
|
56
|
+
rootElement: contextOpts.rootElement || document.getElementById('root'),
|
|
57
|
+
loadingComponent: Loading,
|
|
58
|
+
publicPath,
|
|
59
|
+
runtimePublicPath,
|
|
60
|
+
history,
|
|
61
|
+
historyType,
|
|
62
|
+
basename,
|
|
63
|
+
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {"pureApp":false,"pureHtml":false},
|
|
64
|
+
callback: contextOpts.callback,
|
|
65
|
+
};
|
|
66
|
+
const modifiedContext = pluginManager.applyPlugins({
|
|
67
|
+
key: 'modifyClientRenderOpts',
|
|
68
|
+
type: ApplyPluginsType.modify,
|
|
69
|
+
initialValue: context,
|
|
70
|
+
});
|
|
71
|
+
return renderClient(modifiedContext);
|
|
72
|
+
},
|
|
73
|
+
}))();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
render();
|
|
78
|
+
|
|
79
|
+
if (typeof window !== 'undefined') {
|
|
80
|
+
window.g_umi = {
|
|
81
|
+
version: '4.6.25',
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Modal, Spin} from "antd";
|
|
3
|
+
import {HttpUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class DownloadFileButton extends React.Component {
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
open:false
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
onClick(){
|
|
13
|
+
const {url, params, children, ...rest} = this.props;
|
|
14
|
+
this.setState({open:true})
|
|
15
|
+
HttpUtils.downloadFile(url,params).then(rs=>{
|
|
16
|
+
|
|
17
|
+
}).finally(()=>{
|
|
18
|
+
this.setState({open:false})
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
const {url, params, children, ...rest} = this.props;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
return <> <Button {...rest}>{children}</Button>
|
|
27
|
+
|
|
28
|
+
<Modal title='提示' footer={null} onCancel={()=>{this.setState({open:false})}} maskClosable={false}>
|
|
29
|
+
<Spin /> 下载文件中,请勿关闭浏览器
|
|
30
|
+
</Modal>
|
|
31
|
+
</>
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// 推荐(16+8n)px 作为间隔,n为自然数
|
|
5
|
+
declare type GapProps = {
|
|
6
|
+
/**
|
|
7
|
+
* mini 4px
|
|
8
|
+
* middle 8px
|
|
9
|
+
* large 16px
|
|
10
|
+
*
|
|
11
|
+
* 默认 middle
|
|
12
|
+
*/
|
|
13
|
+
size?: 'small' | 'middle' | 'large';
|
|
14
|
+
|
|
15
|
+
/** 方向:水平或垂直
|
|
16
|
+
* 默认垂直:上下间隔
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
direction?: 'horizontal' | 'vertical';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class Gap extends React.Component<GapProps, any> {
|
|
23
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 上下间隔
|
|
5
|
+
*/
|
|
6
|
+
export class Gap extends React.Component {
|
|
7
|
+
|
|
8
|
+
static defaultProps = {
|
|
9
|
+
size: 'middle',
|
|
10
|
+
direction: 'vertical',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
const {n = 0, size, direction} = this.props;
|
|
15
|
+
if (n) {
|
|
16
|
+
console.warn('参数 n 已经不被支持')
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const SizeMap = {
|
|
21
|
+
x: 4,
|
|
22
|
+
small: 8,
|
|
23
|
+
middle: 16,
|
|
24
|
+
large: 24,
|
|
25
|
+
xLarge: 32,
|
|
26
|
+
xxLarge: 40,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
let sizePx = SizeMap[size];
|
|
31
|
+
const isHorizontal = direction === 'horizontal';
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// 水平间隔:有宽度,无高度
|
|
35
|
+
// 垂直间隔:有高度,无宽度
|
|
36
|
+
const width = isHorizontal ? sizePx : 0;
|
|
37
|
+
const height = isHorizontal ? 0 : sizePx;
|
|
38
|
+
|
|
39
|
+
// 水平间隔用 inline-block(避免换行),垂直间隔用 block
|
|
40
|
+
const display = isHorizontal ? 'inline-block' : 'block';
|
|
41
|
+
|
|
42
|
+
const style = {display, height, width}
|
|
43
|
+
|
|
44
|
+
return <div style={style}></div>
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
interface LinkButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* 路径
|
|
7
|
+
*/
|
|
8
|
+
path: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type?: 'primary' | 'default' | 'dashed' | 'link' | 'text' | 'ghost'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class LinkButton extends React.Component<LinkButtonProps, any> {
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button} from "antd";
|
|
3
|
+
import {PageUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
export function LinkButton(props) {
|
|
6
|
+
const {path, label, children, size = 'small', ...rest} = props;
|
|
7
|
+
return <Button size={size} {...rest} onClick={() => {
|
|
8
|
+
PageUtils.open(path, label)
|
|
9
|
+
}}>{children}</Button>
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {Alert, Skeleton, Tree} from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import * as Icons from '@ant-design/icons';
|
|
4
|
+
import {HttpUtils} from "../../utils";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class OrgTree extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
treeDataLoading: true,
|
|
11
|
+
treeData: [],
|
|
12
|
+
|
|
13
|
+
currentOrgId: null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
componentDidMount() {
|
|
18
|
+
HttpUtils.get('admin/sysOrg/deptTree').then(tree => {
|
|
19
|
+
this.setState({treeData: tree,treeDataLoading: false})
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
onSelectOrg = orgIds => {
|
|
25
|
+
let orgId = orgIds[0] || null;
|
|
26
|
+
this.props.onChange(orgId)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
let {treeData, treeDataLoading} = this.state
|
|
32
|
+
if (treeDataLoading) {
|
|
33
|
+
return <Skeleton title='加载中...'/>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (treeData.length === 0) {
|
|
37
|
+
return <Alert type={"warning"} message={'组织机构数据为空'}>
|
|
38
|
+
</Alert>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return <Tree
|
|
42
|
+
treeData={treeData}
|
|
43
|
+
defaultExpandAll
|
|
44
|
+
onSelect={this.onSelectOrg}
|
|
45
|
+
showIcon
|
|
46
|
+
blockNode
|
|
47
|
+
icon={item=>{
|
|
48
|
+
const icon = Icons[item.iconName]
|
|
49
|
+
if(icon){
|
|
50
|
+
return React.createElement(icon)
|
|
51
|
+
}
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
</Tree>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './index.less'
|
|
3
|
+
import {ThemeUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 上下间隔
|
|
7
|
+
*/
|
|
8
|
+
export class Page extends React.Component {
|
|
9
|
+
|
|
10
|
+
static defaultProps = {
|
|
11
|
+
padding: false,
|
|
12
|
+
backgroundGray:false
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
render() {
|
|
16
|
+
const style = {}
|
|
17
|
+
if(this.props.padding){
|
|
18
|
+
style.padding = 16
|
|
19
|
+
}
|
|
20
|
+
if(this.props.backgroundGray){
|
|
21
|
+
style.backgroundColor = ThemeUtils.getColor("background-color")
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
return <div className={'tmgg-page'} style={style}>
|
|
26
|
+
{this.props.children}
|
|
27
|
+
</div>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function PageLoading(props: { message?: string });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Alert, Spin} from "antd";
|
|
3
|
+
import {ThemeUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function PageLoading(props) {
|
|
7
|
+
const msg = props.message || '页面加载中...';
|
|
8
|
+
|
|
9
|
+
return <div style={{
|
|
10
|
+
height: '100vh', width: '100%',
|
|
11
|
+
display: 'flex', alignItems: 'center', justifyContent: "center",
|
|
12
|
+
color: ThemeUtils.getColor("primary-color")
|
|
13
|
+
}}>
|
|
14
|
+
<div style={{textAlign: "center", marginTop: '-10rem'}}>
|
|
15
|
+
<div>
|
|
16
|
+
<Spin size={"large"}></Spin>
|
|
17
|
+
</div>
|
|
18
|
+
<div style={{marginTop: '1rem'}}>
|
|
19
|
+
<Alert title={msg}></Alert>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, {ReactNode} from 'react';
|
|
2
|
+
import {Modal} from 'antd';
|
|
3
|
+
|
|
4
|
+
export interface ProModalProps {
|
|
5
|
+
title: string;
|
|
6
|
+
actionRef?: any; // 弃用,请使用ref
|
|
7
|
+
ref: any;
|
|
8
|
+
onShow?: any;
|
|
9
|
+
footer?: any;
|
|
10
|
+
width?: number;
|
|
11
|
+
children:ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export class ProModal extends React.Component<ProModalProps, any> {
|
|
14
|
+
|
|
15
|
+
constructor(props:ProModalProps) {
|
|
16
|
+
super(props);
|
|
17
|
+
if (props.actionRef) {
|
|
18
|
+
props.actionRef.current = this;
|
|
19
|
+
}
|
|
20
|
+
if (props.ref) {
|
|
21
|
+
props.ref.current = this;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
state = {
|
|
28
|
+
visible: false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
show = () => {
|
|
32
|
+
this.setState({
|
|
33
|
+
visible: true,
|
|
34
|
+
});
|
|
35
|
+
if (this.props.onShow) {
|
|
36
|
+
this.props.onShow();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
hide = () => {
|
|
40
|
+
this.setState({
|
|
41
|
+
visible: false,
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
open = () => {
|
|
45
|
+
this.show();
|
|
46
|
+
};
|
|
47
|
+
close = () => {
|
|
48
|
+
this.hide();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
render() {
|
|
52
|
+
return (
|
|
53
|
+
<Modal
|
|
54
|
+
maskClosable={false}
|
|
55
|
+
destroyOnHidden
|
|
56
|
+
title={this.props.title}
|
|
57
|
+
open={this.state.visible}
|
|
58
|
+
onCancel={this.hide}
|
|
59
|
+
footer={this.props.footer || null}
|
|
60
|
+
width={this.props.width || 800}
|
|
61
|
+
>
|
|
62
|
+
{this.state.visible && this.props.children}
|
|
63
|
+
</Modal>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|