@jiangood/open-admin 2.5.9 → 3.0.1
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/package.json +20 -8
- package/src/framework/GlobalData.ts +85 -0
- package/src/framework/biz/OrgTree.tsx +2 -7
- package/src/framework/biz/Perm.tsx +11 -0
- package/src/framework/biz/PermActions.tsx +18 -15
- package/src/framework/biz/index.tsx +34 -19
- package/src/framework/components/ContextMenu/index.tsx +105 -78
- package/src/framework/components/DownloadModal/index.tsx +15 -17
- package/src/framework/components/ErrorBoundary/index.tsx +2 -2
- package/src/framework/components/FormModal/index.tsx +76 -0
- package/src/framework/components/Gap/index.tsx +1 -1
- package/src/framework/components/NamedIcon/index.tsx +55 -9
- package/src/framework/components/Page/index.less +0 -1
- package/src/framework/components/Page/index.tsx +34 -27
- package/src/framework/components/PageLoading/index.less +15 -0
- package/src/framework/components/PageLoading/index.tsx +32 -16
- package/src/framework/components/ProTable/index.tsx +86 -15
- package/src/framework/components/index.ts +1 -0
- package/src/framework/config/index.ts +1 -0
- package/src/framework/config/themeConfig.ts +39 -0
- package/src/framework/fields/FieldBoolean/index.tsx +11 -2
- package/src/framework/fields/FieldDate/index.tsx +22 -7
- package/src/framework/fields/FieldDateRange/index.tsx +24 -6
- package/src/framework/fields/FieldDictSelect/index.tsx +1 -0
- package/src/framework/fields/FieldEditor/index.tsx +7 -1
- package/src/framework/fields/FieldNumberRange/index.tsx +14 -5
- package/src/framework/fields/FieldPercent/index.tsx +16 -5
- package/src/framework/fields/FieldRemoteSelect/index.tsx +4 -2
- package/src/framework/fields/FieldRemoteTreeSelect/index.tsx +2 -1
- package/src/framework/fields/FieldSysOrgTree/index.tsx +6 -1
- package/src/framework/fields/FieldSysOrgTreeSelect/index.tsx +6 -1
- package/src/framework/fields/FieldTable/index.tsx +35 -6
- package/src/framework/fields/FieldTableSelect/index.tsx +18 -2
- package/src/framework/fields/FieldUploadFile/index.tsx +69 -28
- package/src/framework/fields/index.ts +0 -1
- package/src/framework/index.ts +2 -0
- package/src/framework/router/Link.tsx +26 -0
- package/src/framework/router/PageFrame.tsx +31 -0
- package/src/framework/router/history.ts +50 -0
- package/src/framework/router/index.ts +4 -0
- package/src/framework/router/matcher.ts +58 -0
- package/src/framework/utils/{ArrayUtils.js → ArrayUtils.ts} +5 -5
- package/src/framework/utils/{DateUtils.js → DateUtils.ts} +19 -19
- package/src/framework/utils/{DeviceUtils.js → DeviceUtils.ts} +8 -1
- package/src/framework/utils/{EventBus.js → EventBus.ts} +13 -6
- package/src/framework/utils/MessageApi.ts +5 -0
- package/src/framework/utils/ModalApi.ts +5 -0
- package/src/framework/utils/ObjectUtils.ts +15 -0
- package/src/framework/utils/{StorageUtils.js → StorageUtils.ts} +7 -7
- package/src/framework/utils/{StringUtils.js → StringUtils.ts} +15 -15
- package/src/framework/utils/{TreeUtils.js → TreeUtils.ts} +19 -12
- package/src/framework/utils/{UrlUtils.js → UrlUtils.ts} +10 -10
- package/src/framework/utils/index.ts +2 -1
- package/src/framework/utils/system/{DictUtils.js → DictUtils.ts} +16 -4
- package/src/framework/utils/system/{HttpUtils.js → HttpUtils.ts} +25 -21
- package/src/framework/utils/system/PageUtils.ts +49 -0
- package/src/framework/utils/system/{PermUtils.js → PermUtils.ts} +5 -6
- package/src/framework/utils/system/index.ts +0 -2
- package/src/framework/views/ViewBoolean/index.tsx +6 -3
- package/src/framework/views/ViewFileButton/index.tsx +13 -8
- package/src/framework/views/ViewImage/index.tsx +19 -14
- package/src/framework/views/ViewRange/index.tsx +10 -7
- package/src/framework/views/ViewText/index.tsx +9 -11
- package/src/layouts/admin/AdminTabs.jsx +79 -0
- package/src/layouts/admin/AdminTabs.less +63 -0
- package/src/layouts/admin/HeaderRight.jsx +27 -13
- package/src/layouts/admin/TabLayout.jsx +124 -0
- package/src/layouts/admin/index.jsx +5 -6
- package/src/layouts/admin/index.less +1 -82
- package/src/layouts/index.tsx +148 -0
- package/src/main.jsx +8 -0
- package/src/pages/account/changePassword.jsx +14 -10
- package/src/pages/article/$code.jsx +2 -2
- package/src/pages/index.jsx +6 -4
- package/src/pages/{login.jsx → public/login.jsx} +7 -10
- package/src/pages/public/test.jsx +30 -0
- package/src/pages/{forceUpdatePwd.jsx → standalone/forceUpdatePwd.jsx} +3 -24
- package/src/pages/system/article/index.jsx +51 -56
- package/src/pages/system/dict/index.jsx +60 -91
- package/src/pages/system/file/index.jsx +23 -17
- package/src/pages/system/job/index.jsx +63 -72
- package/src/pages/system/log/index.jsx +11 -8
- package/src/pages/system/org/index.jsx +60 -80
- package/src/pages/system/role/index.jsx +50 -86
- package/src/pages/system/role/rolePerm.jsx +2 -2
- package/src/pages/system/user/index.jsx +120 -73
- package/src/pages/system/user/userPerm.jsx +2 -2
- package/vite-plugin/index.js +107 -0
- package/config/common-plugin.js +0 -145
- package/config/config.js +0 -5
- package/config/utils.js +0 -73
- package/src/.umi-production/appData.json +0 -2257
- package/src/.umi-production/core/EmptyRoute.tsx +0 -9
- package/src/.umi-production/core/defineApp.ts +0 -16
- package/src/.umi-production/core/helmet.ts +0 -10
- package/src/.umi-production/core/helmetContext.ts +0 -4
- package/src/.umi-production/core/history.ts +0 -72
- package/src/.umi-production/core/historyIntelli.ts +0 -132
- package/src/.umi-production/core/plugin.ts +0 -40
- package/src/.umi-production/core/pluginConfig.ts +0 -330
- package/src/.umi-production/core/pluginConfigJoi.d.ts +0 -7
- package/src/.umi-production/core/polyfill.ts +0 -220
- package/src/.umi-production/core/route.tsx +0 -47
- package/src/.umi-production/core/routeProps.js +0 -5
- package/src/.umi-production/core/routeProps.ts +0 -6
- package/src/.umi-production/core/terminal.ts +0 -37
- package/src/.umi-production/exports.ts +0 -17
- package/src/.umi-production/testBrowser.tsx +0 -90
- package/src/.umi-production/tsconfig.json +0 -43
- package/src/.umi-production/typings.d.ts +0 -136
- package/src/.umi-production/umi.ts +0 -83
- package/src/framework/GlobalData.d.ts +0 -10
- package/src/framework/GlobalData.js +0 -42
- package/src/framework/biz/HasPerm.tsx +0 -14
- package/src/framework/fields/FieldRemoteSelectMultiple/index.tsx +0 -29
- package/src/framework/utils/ArrayUtils.d.ts +0 -6
- package/src/framework/utils/DateUtils.d.ts +0 -20
- package/src/framework/utils/DeviceUtils.d.ts +0 -3
- package/src/framework/utils/EventBus.d.ts +0 -6
- package/src/framework/utils/MessageUtils.d.ts +0 -10
- package/src/framework/utils/MessageUtils.js +0 -43
- package/src/framework/utils/ObjectUtils.d.ts +0 -14
- package/src/framework/utils/ObjectUtils.js +0 -12
- package/src/framework/utils/StorageUtils.d.ts +0 -4
- package/src/framework/utils/StringUtils.d.ts +0 -17
- package/src/framework/utils/TreeUtils.d.ts +0 -13
- package/src/framework/utils/UrlUtils.d.ts +0 -6
- package/src/framework/utils/system/DictUtils.d.ts +0 -20
- package/src/framework/utils/system/FormRegistry.d.ts +0 -8
- package/src/framework/utils/system/FormRegistry.js +0 -31
- package/src/framework/utils/system/HttpUtils.d.ts +0 -14
- package/src/framework/utils/system/PageUtils.d.ts +0 -14
- package/src/framework/utils/system/PageUtils.js +0 -59
- package/src/framework/utils/system/PermUtils.d.ts +0 -5
- package/src/framework/utils/system/ThemeUtils.d.ts +0 -6
- package/src/framework/utils/system/ThemeUtils.js +0 -52
- package/src/layouts/PageRender.tsx +0 -29
- package/src/layouts/admin/TabPageRender.jsx +0 -210
- package/src/layouts/index.jsx +0 -120
- package/src/loading.jsx +0 -19
- package/src/pages/about.jsx +0 -16
- /package/src/pages/{login.less → public/login.less} +0 -0
|
@@ -1,136 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
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/@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 {FormRegistry} 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.57',
|
|
82
|
-
};
|
|
83
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export class GlobalData {
|
|
2
|
-
static setSiteInfo(data: object): void;
|
|
3
|
-
static getSiteInfo(): object;
|
|
4
|
-
static setLoginInfo(data: object): void;
|
|
5
|
-
static getLoginInfo(): object;
|
|
6
|
-
static setDictInfo(data: object | null): void;
|
|
7
|
-
static getDictInfo(): object | null;
|
|
8
|
-
static setSiteArticles(data: object): void;
|
|
9
|
-
static getSiteArticles(): object;
|
|
10
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {StorageUtils} from './utils/StorageUtils';
|
|
2
|
-
|
|
3
|
-
const SITE_INFO_KEY = "siteInfo";
|
|
4
|
-
const LOGIN_INFO_KEY = "loginInfo";
|
|
5
|
-
const DICT_INFO_KEY = "dictInfo";
|
|
6
|
-
const SITE_ARTICLES_KEY = "siteArticles";
|
|
7
|
-
|
|
8
|
-
export class GlobalData {
|
|
9
|
-
static setSiteInfo(data) {
|
|
10
|
-
StorageUtils.set(SITE_INFO_KEY, data);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
static getSiteInfo() {
|
|
14
|
-
return StorageUtils.get(SITE_INFO_KEY) || {};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static setLoginInfo(data) {
|
|
18
|
-
StorageUtils.set(LOGIN_INFO_KEY, data);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static getLoginInfo() {
|
|
22
|
-
return StorageUtils.get(LOGIN_INFO_KEY) || {};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static setDictInfo(data) {
|
|
26
|
-
StorageUtils.set(DICT_INFO_KEY, data);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static getDictInfo() {
|
|
30
|
-
return StorageUtils.get(DICT_INFO_KEY);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static setSiteArticles(data) {
|
|
34
|
-
StorageUtils.set(SITE_ARTICLES_KEY, data);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static getSiteArticles() {
|
|
38
|
-
return StorageUtils.get(SITE_ARTICLES_KEY) || {};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { SITE_INFO_KEY, LOGIN_INFO_KEY, DICT_INFO_KEY, SITE_ARTICLES_KEY };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {ReactNode} from "react";
|
|
2
|
-
import {PermUtils} from "../utils";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 使用该组件,可以判断权限
|
|
6
|
-
*/
|
|
7
|
-
export function HasPerm(props: { code: string, children: ReactNode }) {
|
|
8
|
-
let {code} = props;
|
|
9
|
-
|
|
10
|
-
if (PermUtils.hasPermission(code)) {
|
|
11
|
-
return props.children;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
import { BaseRemoteSelect } from '../BaseRemoteSelect';
|
|
4
|
-
|
|
5
|
-
export class FieldRemoteSelectMultiple extends BaseRemoteSelect {
|
|
6
|
-
static defaultProps = {
|
|
7
|
-
placeholder: '请搜索选择',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
render() {
|
|
11
|
-
const { value, onChange, url, ...selectProps } = this.props;
|
|
12
|
-
const { data, loading } = this.state;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Select
|
|
16
|
-
showSearch={this.getShowSearch()}
|
|
17
|
-
value={value}
|
|
18
|
-
onChange={onChange}
|
|
19
|
-
options={data}
|
|
20
|
-
notFoundContent={this.getNotFoundContent()}
|
|
21
|
-
style={{ width: '100%', minWidth: 200 }}
|
|
22
|
-
allowClear
|
|
23
|
-
mode="multiple"
|
|
24
|
-
loading={loading}
|
|
25
|
-
{...selectProps}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export class DateUtils {
|
|
2
|
-
static convertTypeToFormat(type: string): string;
|
|
3
|
-
static year(date: Date): number;
|
|
4
|
-
static month(date: Date): string;
|
|
5
|
-
static date(date: Date): string;
|
|
6
|
-
static hour(date: Date): string;
|
|
7
|
-
static minute(date: Date): string;
|
|
8
|
-
static second(date: Date): string;
|
|
9
|
-
static formatDate(d: Date): string;
|
|
10
|
-
static formatTime(d: Date): string;
|
|
11
|
-
static formatDateTime(d: Date): string;
|
|
12
|
-
static formatDateCn(d: Date): string;
|
|
13
|
-
static now(): string;
|
|
14
|
-
static today(): string;
|
|
15
|
-
static thisYear(): number;
|
|
16
|
-
static thisMonth(): string;
|
|
17
|
-
static friendlyTime(pastDate: Date | string | number): string | undefined;
|
|
18
|
-
static friendlyTotalTime(time: number | string | null): string | null;
|
|
19
|
-
static beginOfMonth(): string;
|
|
20
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export class EventBus {
|
|
2
|
-
static on<T extends any[] = []>(name: string, callback: (...args: T) => void, ctx?: any): void;
|
|
3
|
-
static once<T extends any[] = []>(name: string, callback: (...args: T) => void, ctx?: any): void;
|
|
4
|
-
static emit<T extends any[] = []>(name: string, ...args: T): void;
|
|
5
|
-
static off<T extends any[] = []>(name: string, callback?: (...args: T) => void): void;
|
|
6
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type {ModalFuncProps} from 'antd/es/modal/interface';
|
|
3
|
-
|
|
4
|
-
export class MessageUtils {
|
|
5
|
-
static alert(content: any, config?: Omit<ModalFuncProps, 'content' | 'icon' | 'onOk' | 'onCancel'>): Promise<void>;
|
|
6
|
-
static confirm(content: React.ReactNode, config?: Omit<ModalFuncProps, 'content' | 'icon' | 'onOk' | 'onCancel'>): Promise<boolean>;
|
|
7
|
-
static success(content: string, duration?: number): void;
|
|
8
|
-
static error(content: string, duration?: number): void;
|
|
9
|
-
static destroy(): void;
|
|
10
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {message, Modal} from 'antd';
|
|
2
|
-
|
|
3
|
-
export class MessageUtils {
|
|
4
|
-
|
|
5
|
-
static alert(content, config) {
|
|
6
|
-
return new Promise(resolve => {
|
|
7
|
-
Modal.info({
|
|
8
|
-
title: '提示',
|
|
9
|
-
content,
|
|
10
|
-
okText: '确定',
|
|
11
|
-
onOk: () => resolve(),
|
|
12
|
-
icon: null,
|
|
13
|
-
...config,
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static confirm(content, config) {
|
|
19
|
-
return new Promise((resolve) => {
|
|
20
|
-
Modal.confirm({
|
|
21
|
-
title: '确认操作',
|
|
22
|
-
content,
|
|
23
|
-
okText: '确定',
|
|
24
|
-
cancelText: '取消',
|
|
25
|
-
onOk: () => resolve(true),
|
|
26
|
-
onCancel: () => resolve(false),
|
|
27
|
-
...config,
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static success(content, duration = 3) {
|
|
33
|
-
message.success(content, duration);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static error(content, duration = 3) {
|
|
37
|
-
message.error(content, duration);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static destroy() {
|
|
41
|
-
message.destroy();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {ObjectUtils} from './ObjectUtils';
|
|
2
|
-
|
|
3
|
-
declare module './ObjectUtils' {
|
|
4
|
-
interface ObjectUtils {
|
|
5
|
-
// Empty - no public methods to declare
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class ObjectUtils {
|
|
10
|
-
static copyPropertyIfPresent<TSource extends object, TTarget extends object>(
|
|
11
|
-
source: TSource | null | undefined,
|
|
12
|
-
target: TTarget | null | undefined
|
|
13
|
-
): void;
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export class ObjectUtils {
|
|
2
|
-
|
|
3
|
-
static copyPropertyIfPresent(source, target) {
|
|
4
|
-
if (!source || !target || typeof source !== 'object' || typeof target !== 'object') return;
|
|
5
|
-
const keys = Object.keys(target);
|
|
6
|
-
for (const key of keys) {
|
|
7
|
-
if (Object.hasOwn(source, key)) {
|
|
8
|
-
target[key] = source[key];
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class StringUtils {
|
|
2
|
-
static readonly ISO_SPLITTER: string;
|
|
3
|
-
static removePrefix(str: string | null | undefined, ch: string): string;
|
|
4
|
-
static removeSuffix(str: string | null | undefined, ch: string): string;
|
|
5
|
-
static random(length: number): string;
|
|
6
|
-
static contains(str: string | null | undefined, subStr: string): boolean;
|
|
7
|
-
static subAfter(source: string | null | undefined, str: string): string;
|
|
8
|
-
static subAfterLast(source: string | null | undefined, str: string): string;
|
|
9
|
-
static subBefore(str: string | null | undefined, sub: string): string;
|
|
10
|
-
static pad(input: string | number | null | undefined, totalLen: number, padChar?: string): string;
|
|
11
|
-
static getWidth(str: string | null | undefined): number;
|
|
12
|
-
static cutByWidth(str: string, maxWidth: number): string;
|
|
13
|
-
static ellipsis(str: string | null | undefined, len: number, suffix?: string): string;
|
|
14
|
-
static isString(value: any): value is string;
|
|
15
|
-
static split(str: any, sp: string): string[];
|
|
16
|
-
static join(arr: any, sp: string): string;
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface TreeNode<T = any> {
|
|
2
|
-
id: string | number;
|
|
3
|
-
pid: string | number | null;
|
|
4
|
-
children?: TreeNode<T>[];
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class TreeUtils {
|
|
9
|
-
static walk<T extends TreeNode>(tree: T[], callback: (node: T) => void): void;
|
|
10
|
-
static findByKey<T extends TreeNode>(key: string | number, list: T[], keyName?: keyof T | 'id'): T | undefined;
|
|
11
|
-
static flattenTree<T extends TreeNode>(treeNodeList: T[]): T[];
|
|
12
|
-
static getKeyList<T extends TreeNode>(tree: T[], value: string | number): (string | number)[];
|
|
13
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export class UrlUtils {
|
|
2
|
-
static getParams(url?: string | null): Record<string, string>;
|
|
3
|
-
static setParam(url: string, key: string, value: string | number | boolean | null | undefined): string;
|
|
4
|
-
static getWebsocketBaseUrl(): string;
|
|
5
|
-
static contextPath(path: string): string;
|
|
6
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Tag} from 'antd';
|
|
3
|
-
|
|
4
|
-
export interface DictItem {
|
|
5
|
-
code: string | number;
|
|
6
|
-
label: string;
|
|
7
|
-
color?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface DictOption {
|
|
11
|
-
value: string | number;
|
|
12
|
-
label: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export class DictUtils {
|
|
16
|
-
static dictList(code: string): DictItem[];
|
|
17
|
-
static dictOptions(typeCode: string): DictOption[];
|
|
18
|
-
static dictLabel(typeCode: string, code: string | number): string | undefined;
|
|
19
|
-
static dictTag(typeCode: string, code: string | number): React.ReactElement | string | null;
|
|
20
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export class FormRegistry {
|
|
4
|
-
static register(formKey: string, formComponent: React.ComponentType<any>): void;
|
|
5
|
-
static get(formKey: string): React.ComponentType<any> | null;
|
|
6
|
-
static has(formKey: string): boolean;
|
|
7
|
-
static getAllKeys(): string[];
|
|
8
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export class FormRegistry {
|
|
4
|
-
static forms = new Map();
|
|
5
|
-
|
|
6
|
-
static register(formKey, formComponent) {
|
|
7
|
-
if (!formKey || !formComponent) {
|
|
8
|
-
throw new Error("表单 Key 和组件不能为空!");
|
|
9
|
-
}
|
|
10
|
-
if (FormRegistry.forms.has(formKey)) {
|
|
11
|
-
console.warn(`表单 "${formKey}" 已存在,将被覆盖!`);
|
|
12
|
-
}
|
|
13
|
-
FormRegistry.forms.set(formKey, formComponent);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
static get(formKey) {
|
|
17
|
-
const formComponent = FormRegistry.forms.get(formKey);
|
|
18
|
-
if (!formComponent) {
|
|
19
|
-
console.warn(`表单 "${formKey}" 未注册!`);
|
|
20
|
-
}
|
|
21
|
-
return formComponent ?? null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static has(formKey) {
|
|
25
|
-
return FormRegistry.forms.has(formKey);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static getAllKeys() {
|
|
29
|
-
return Array.from(FormRegistry.forms.keys());
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {AxiosRequestConfig} from "axios";
|
|
2
|
-
|
|
3
|
-
declare const SERVLET_CONTEXT: string | undefined;
|
|
4
|
-
|
|
5
|
-
interface RequestOptions extends AxiosRequestConfig {
|
|
6
|
-
showError?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class HttpUtils {
|
|
10
|
-
static coreRequest<T = any>(config: RequestOptions, transformData?: boolean): Promise<T>;
|
|
11
|
-
static get<T = any>(url: string, params?: any, options?: Partial<RequestOptions>): Promise<T>;
|
|
12
|
-
static post<T = any>(url: string, data?: any, params?: any, options?: Partial<RequestOptions>): Promise<T>;
|
|
13
|
-
static postForm<T = any>(url: string, data: any, options?: Partial<RequestOptions>): Promise<T>;
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {history} from "umi";
|
|
2
|
-
|
|
3
|
-
export class PageUtils {
|
|
4
|
-
static redirectToLogin(): void;
|
|
5
|
-
static currentParams(): Record<string, string | undefined>;
|
|
6
|
-
static currentPathname(): string;
|
|
7
|
-
static currentUrl(): string;
|
|
8
|
-
static currentPathnameLastPart(): string | undefined;
|
|
9
|
-
static open(path: string, label?: string): void;
|
|
10
|
-
static openNoLayout(path: string): void;
|
|
11
|
-
static currentLabel(): string | undefined;
|
|
12
|
-
static closeCurrent(): void;
|
|
13
|
-
static closeCurrentAndOpenPage(alertMessage: string, path: string, label: string): void;
|
|
14
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {history} from "umi";
|
|
2
|
-
import {StringUtils} from "../StringUtils";
|
|
3
|
-
import {UrlUtils} from "../UrlUtils";
|
|
4
|
-
import {MessageUtils} from "../MessageUtils";
|
|
5
|
-
|
|
6
|
-
export class PageUtils {
|
|
7
|
-
static redirectToLogin() {
|
|
8
|
-
const url = PageUtils.currentUrl();
|
|
9
|
-
const encodedUrl = encodeURIComponent(url);
|
|
10
|
-
history.push(`/login?redirect=${encodedUrl}`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
static currentParams() {
|
|
14
|
-
return UrlUtils.getParams();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static currentPathname() {
|
|
18
|
-
const path = window.location.hash.substring(1);
|
|
19
|
-
return StringUtils.subBefore(path, '?');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static currentUrl() {
|
|
23
|
-
return window.location.hash.substring(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static currentPathnameLastPart() {
|
|
27
|
-
const path = this.currentPathname();
|
|
28
|
-
return StringUtils.subAfterLast(path, '/') || undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static open(path, label = '未命名') {
|
|
32
|
-
let targetPath = path;
|
|
33
|
-
if (label) {
|
|
34
|
-
targetPath = UrlUtils.setParam(targetPath, '_label', label);
|
|
35
|
-
}
|
|
36
|
-
history.push(targetPath);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static openNoLayout(path) {
|
|
40
|
-
const targetPath = UrlUtils.setParam(path, '_noLayout', true);
|
|
41
|
-
history.push(targetPath);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static currentLabel() {
|
|
45
|
-
return this.currentParams()['_label'];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static closeCurrent() {
|
|
49
|
-
const event = new CustomEvent('close-page-event', {detail: {url: PageUtils.currentUrl()}});
|
|
50
|
-
document.dispatchEvent(event);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
static closeCurrentAndOpenPage(alertMessage, path, label) {
|
|
54
|
-
MessageUtils.alert(alertMessage).then(() => {
|
|
55
|
-
this.closeCurrent();
|
|
56
|
-
this.open(path, label);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|