@jiangood/open-admin 1.3.4 → 2.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/config/config.js +3 -8
- package/package.json +5 -9
- package/src/.umi-production/appData.json +325 -365
- package/src/.umi-production/core/helmet.ts +1 -1
- package/src/.umi-production/core/history.ts +1 -1
- package/src/.umi-production/core/historyIntelli.ts +1 -1
- package/src/.umi-production/core/pluginConfig.ts +1 -1
- package/src/.umi-production/core/polyfill.ts +216 -216
- package/src/.umi-production/core/route.tsx +2 -4
- package/src/.umi-production/exports.ts +3 -3
- package/src/.umi-production/testBrowser.tsx +1 -1
- package/src/.umi-production/tsconfig.json +1 -1
- package/src/.umi-production/umi.ts +2 -2
- package/src/framework/components/ErrorBoundary/index.tsx +86 -0
- package/src/framework/components/Gap/index.tsx +42 -0
- package/src/framework/components/NamedIcon/index.d.ts +6 -4
- package/src/framework/components/NamedIcon/index.jsx +9 -6
- package/src/framework/components/OrgTree/{index.jsx → index.tsx} +10 -19
- package/src/framework/components/PageLoading/{index.jsx → index.tsx} +2 -5
- package/src/framework/components/ProModal/index.tsx +1 -1
- package/src/framework/components/ProTable/components/ToolBar/{index.jsx → index.tsx} +3 -3
- package/src/framework/components/ProTable/index.less +1 -1
- package/src/framework/components/ProTable/{index.jsx → index.tsx} +9 -7
- package/src/framework/components/ProTable/utils/index.ts +62 -0
- package/src/framework/components/RoleTree/{index.jsx → index.tsx} +7 -17
- package/src/framework/components/ValueType/{index.jsx → index.tsx} +2 -1
- package/src/framework/components/ViewRange/index.tsx +15 -0
- package/src/framework/components/index.ts +2 -1
- package/src/framework/components/system/ButtonList.tsx +22 -0
- package/src/framework/components/system/index.tsx +4 -4
- package/src/framework/fields/BaseRemoteSelect/index.tsx +129 -0
- package/src/framework/fields/FieldDictSelect/{index.jsx → index.tsx} +10 -4
- package/src/framework/fields/FieldRemoteSelect/index.tsx +37 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.tsx +29 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.tsx +33 -0
- package/src/framework/fields/FieldRemoteTree/index.tsx +31 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.tsx +39 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.tsx +39 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.tsx +43 -0
- package/src/framework/fields/FieldSysOrgTree/{index.jsx → index.tsx} +2 -2
- package/src/framework/fields/FieldSysOrgTreeSelect/{index.jsx → index.tsx} +2 -2
- package/src/framework/fields/FieldTable/{index.jsx → index.tsx} +5 -5
- package/src/framework/fields/FieldUploadFile/{index.jsx → index.tsx} +1 -3
- package/src/framework/index.ts +0 -1
- package/src/framework/utils/ArrayUtils.ts +186 -0
- package/src/framework/utils/EventBusUtils.ts +0 -1
- package/src/framework/utils/MessageUtils.tsx +0 -2
- package/src/framework/utils/TreeUtils.ts +2 -2
- package/src/framework/utils/index.ts +1 -1
- package/src/framework/utils/system/FormRegistryUtils.ts +0 -1
- package/src/framework/utils/system/PermUtils.ts +2 -2
- package/src/framework/views/ViewApproveStatus/index.tsx +11 -0
- package/src/framework/views/ViewBoolean/index.tsx +6 -0
- package/src/framework/views/ViewFile/{index.jsx → index.tsx} +4 -4
- package/src/framework/views/ViewImage/{index.jsx → index.tsx} +3 -3
- package/src/framework/views/ViewPassword/{index.jsx → index.tsx} +2 -2
- package/src/framework/views/ViewProcessInstanceProgressButton/{index.jsx → index.tsx} +1 -2
- package/src/layouts/PageRender.jsx +6 -6
- package/src/layouts/admin/HeaderRight.jsx +2 -2
- package/src/layouts/admin/TabPageRender.jsx +28 -13
- package/src/layouts/admin/index.jsx +15 -14
- package/src/layouts/admin/index.less +1 -1
- package/src/layouts/index.jsx +12 -13
- package/src/layouts/index.less +2 -2
- package/src/loading.jsx +17 -16
- package/src/pages/login.jsx +132 -4
- package/src/{framework/pages/LoginPage.less → pages/login.less} +3 -3
- package/src/pages/system/dict/index.jsx +4 -3
- package/src/pages/system/file/index.jsx +6 -5
- package/src/pages/system/job/index.jsx +10 -9
- package/src/pages/system/{sysManual → manual}/index.jsx +1 -1
- package/src/pages/system/org/index.jsx +4 -5
- package/src/pages/system/role/index.jsx +5 -5
- package/src/pages/system/role/perm.jsx +6 -6
- package/src/pages/system/user/UserPerm.jsx +4 -4
- package/src/pages/system/user/index.jsx +2 -2
- package/src/pages/userCenter/ChangePassword.jsx +3 -5
- package/src/pages/userCenter/manual.jsx +1 -1
- package/src/pages/userCenter/message.jsx +1 -1
- package/src/framework/components/DownloadFileButton/index.d.ts +0 -11
- package/src/framework/components/Gap/index.d.ts +0 -23
- package/src/framework/components/Gap/index.jsx +0 -46
- package/src/framework/components/LinkButton/index.d.ts +0 -14
- package/src/framework/components/OrgTree/index.d.ts +0 -4
- package/src/framework/components/Page/index.d.ts +0 -17
- package/src/framework/components/PageLoading/index.d.ts +0 -1
- package/src/framework/components/ProTable/index.d.ts +0 -42
- package/src/framework/components/ProTable/utils/index.js +0 -43
- package/src/framework/components/RoleTree/index.d.ts +0 -4
- package/src/framework/components/ViewRange/index.d.ts +0 -14
- package/src/framework/components/ViewRange/index.jsx +0 -20
- package/src/framework/components/system/ButtonList.d.ts +0 -8
- package/src/framework/components/system/ButtonList.jsx +0 -42
- package/src/framework/fields/FieldBoolean/index.d.ts +0 -9
- package/src/framework/fields/FieldDate/index.d.ts +0 -23
- package/src/framework/fields/FieldDateRange/index.d.ts +0 -22
- package/src/framework/fields/FieldDictSelect/index.d.ts +0 -12
- package/src/framework/fields/FieldEditor/index.d.ts +0 -14
- package/src/framework/fields/FieldNumberRange/index.d.ts +0 -10
- package/src/framework/fields/FieldPercent/index.d.ts +0 -8
- package/src/framework/fields/FieldRemoteSelect/index.d.ts +0 -44
- package/src/framework/fields/FieldRemoteSelect/index.jsx +0 -66
- package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteSelectMultiple/index.jsx +0 -85
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +0 -21
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.jsx +0 -88
- package/src/framework/fields/FieldRemoteTree/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteTree/index.jsx +0 -50
- package/src/framework/fields/FieldRemoteTreeCascader/index.d.ts +0 -18
- package/src/framework/fields/FieldRemoteTreeCascader/index.jsx +0 -59
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +0 -19
- package/src/framework/fields/FieldRemoteTreeSelect/index.jsx +0 -57
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.jsx +0 -62
- package/src/framework/fields/FieldSysOrgTree/index.d.ts +0 -9
- package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +0 -9
- package/src/framework/fields/FieldTable/index.d.ts +0 -14
- package/src/framework/fields/FieldTableSelect/index.d.ts +0 -19
- package/src/framework/fields/FieldUploadFile/index.d.ts +0 -31
- package/src/framework/pages/LoginPage.d.ts +0 -16
- package/src/framework/pages/LoginPage.jsx +0 -135
- package/src/framework/pages/LoginPageUtils.ts +0 -36
- package/src/framework/pages/index.ts +0 -2
- package/src/framework/utils/ArrUtils.ts +0 -229
- package/src/framework/views/ViewApproveStatus/index.d.ts +0 -5
- package/src/framework/views/ViewApproveStatus/index.jsx +0 -15
- package/src/framework/views/ViewBoolean/index.d.ts +0 -3
- package/src/framework/views/ViewBoolean/index.jsx +0 -4
- package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +0 -5
- package/src/framework/views/ViewFile/index.d.ts +0 -10
- package/src/framework/views/ViewFileButton/index.d.ts +0 -10
- package/src/framework/views/ViewImage/index.d.ts +0 -6
- package/src/framework/views/ViewPassword/index.d.ts +0 -5
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +0 -12
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +0 -6
- package/src/framework/views/ViewText/index.d.ts +0 -16
- package/src/pages/system/api/index.jsx +0 -279
- package/src/pages/test/views.jsx +0 -95
- package/src/framework/components/DownloadFileButton/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/LinkButton/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/Page/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/ValueType/{registry.jsx → registry.tsx} +1 -1
- /package/src/framework/fields/FieldBoolean/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldDate/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldDateRange/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldEditor/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldNumberRange/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldPercent/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldTableSelect/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewBooleanEnableDisable/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewFileButton/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewProcessInstanceProgress/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewText/{index.jsx → index.tsx} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {Spin, Tree} from "antd";
|
|
3
|
-
import {HttpUtils} from "../../utils";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 多选树
|
|
7
|
-
*
|
|
8
|
-
* 区别于下拉框,是扁平展示的树
|
|
9
|
-
* 这种需要扁平展示的树,通常都是多选。
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export class FieldRemoteTree extends React.Component {
|
|
13
|
-
state = {
|
|
14
|
-
treeLoading: true,
|
|
15
|
-
treeData: [],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
componentDidMount() {
|
|
19
|
-
this.loadData();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
loadData = async () => {
|
|
23
|
-
this.setState({treeLoading: true});
|
|
24
|
-
const {url} = this.props;
|
|
25
|
-
try {
|
|
26
|
-
const treeData = await HttpUtils.get(url);
|
|
27
|
-
this.setState({treeData});
|
|
28
|
-
} catch (e) {
|
|
29
|
-
console.log(e);
|
|
30
|
-
} finally {
|
|
31
|
-
this.setState({treeLoading: false});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
if (this.state.treeLoading) {
|
|
37
|
-
return <Spin/>;
|
|
38
|
-
}
|
|
39
|
-
return <Tree
|
|
40
|
-
multiple
|
|
41
|
-
checkable
|
|
42
|
-
onCheck={e => this.props.onChange && this.props.onChange(e.checked)}
|
|
43
|
-
checkedKeys={this.props.value}
|
|
44
|
-
treeData={this.state.treeData}
|
|
45
|
-
defaultExpandAll
|
|
46
|
-
checkStrictly
|
|
47
|
-
>
|
|
48
|
-
</Tree>;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldProps } from '../types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 远程树级联选择器, 类似select,但是树级联
|
|
6
|
-
*
|
|
7
|
-
* 注意,value为非数组形式,区别于cascader组件
|
|
8
|
-
*/
|
|
9
|
-
interface FieldRemoteTreeCascaderProps extends FieldProps<string> {
|
|
10
|
-
/**
|
|
11
|
-
* 请求地址
|
|
12
|
-
* 要求返回数据格式为:tree
|
|
13
|
-
*/
|
|
14
|
-
url: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class FieldRemoteTreeCascader extends React.Component<FieldRemoteTreeCascaderProps, any> {
|
|
18
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {Cascader, message, Spin} from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {HttpUtils, TreeUtils} from "../../utils";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 远程树级联选择器, 类似select,但是树级联
|
|
7
|
-
*
|
|
8
|
-
* 注意,value为非数组形式,区别于cascader组件
|
|
9
|
-
*/
|
|
10
|
-
export class FieldRemoteTreeCascader extends React.Component {
|
|
11
|
-
state = {
|
|
12
|
-
data: [],
|
|
13
|
-
loading: false,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
componentDidMount() {
|
|
17
|
-
this.loadData();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
loadData = async () => {
|
|
21
|
-
const {url} = this.props;
|
|
22
|
-
this.setState({loading: true});
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const list = await HttpUtils.get(url);
|
|
26
|
-
this.setState({data: list});
|
|
27
|
-
} catch (e) {
|
|
28
|
-
console.log(e);
|
|
29
|
-
} finally {
|
|
30
|
-
this.setState({loading: false});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const {data} = this.state;
|
|
37
|
-
if (this.state.loading) {
|
|
38
|
-
return <Spin/>;
|
|
39
|
-
}
|
|
40
|
-
const {value, onChange, ...rest} = this.props;
|
|
41
|
-
|
|
42
|
-
let arr = [];
|
|
43
|
-
if (value != null) {
|
|
44
|
-
arr = TreeUtils.getKeyList(data, value);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Cascader
|
|
49
|
-
options={this.state.data}
|
|
50
|
-
onChange={arr => {
|
|
51
|
-
onChange && onChange(arr[arr.length - 1]);
|
|
52
|
-
}}
|
|
53
|
-
value={arr}
|
|
54
|
-
fieldNames={{label: 'title', value: 'key'}}
|
|
55
|
-
{...rest}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldProps } from '../types';
|
|
3
|
-
|
|
4
|
-
interface FieldRemoteTreeSelectProps extends FieldProps<string | number> {
|
|
5
|
-
/**
|
|
6
|
-
* 请求地址
|
|
7
|
-
*/
|
|
8
|
-
url: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 默认展开所有
|
|
12
|
-
*/
|
|
13
|
-
treeDefaultExpandAll?: boolean;
|
|
14
|
-
|
|
15
|
-
id?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class FieldRemoteTreeSelect extends React.Component<FieldRemoteTreeSelectProps, any> {
|
|
19
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {Spin, TreeSelect} from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {HttpUtils, StringUtils} from "../../utils";
|
|
4
|
-
|
|
5
|
-
export class FieldRemoteTreeSelect extends React.Component {
|
|
6
|
-
static defaultProps = {
|
|
7
|
-
treeDefaultExpandAll: true,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
state = {
|
|
11
|
-
data: [],
|
|
12
|
-
loading: false,
|
|
13
|
-
key: this.props.id,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
componentDidMount() {
|
|
17
|
-
this.loadData();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
loadData = async () => {
|
|
21
|
-
const {url} = this.props;
|
|
22
|
-
this.setState({loading: true});
|
|
23
|
-
try {
|
|
24
|
-
const rs = await HttpUtils.get(url);
|
|
25
|
-
this.setState({data: rs});
|
|
26
|
-
} finally {
|
|
27
|
-
this.setState({loading: false});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
const {value, onChange, treeDefaultExpandAll} = this.props;
|
|
33
|
-
const {data, loading} = this.state;
|
|
34
|
-
|
|
35
|
-
if (loading) {
|
|
36
|
-
return <Spin/>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<TreeSelect
|
|
41
|
-
style={{width: '100%', minWidth: 200}}
|
|
42
|
-
allowClear={true}
|
|
43
|
-
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
44
|
-
treeData={data}
|
|
45
|
-
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
46
|
-
value={value || undefined}
|
|
47
|
-
onChange={onChange}
|
|
48
|
-
filterTreeNode={(inputValue, treeNode) => {
|
|
49
|
-
const {title} = treeNode;
|
|
50
|
-
return StringUtils.contains(title, inputValue);
|
|
51
|
-
}}
|
|
52
|
-
treeLine={{showLeafIcon: true}}
|
|
53
|
-
treeDefaultExpandAll={treeDefaultExpandAll}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldProps } from '../types';
|
|
3
|
-
|
|
4
|
-
interface FieldRemoteTreeSelectMultipleProps extends FieldProps<(string | number)[]> {
|
|
5
|
-
/**
|
|
6
|
-
* 请求地址
|
|
7
|
-
*/
|
|
8
|
-
url: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 默认展开所有
|
|
12
|
-
*/
|
|
13
|
-
treeDefaultExpandAll?: boolean;
|
|
14
|
-
|
|
15
|
-
id?: string;
|
|
16
|
-
style?: React.CSSProperties;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class FieldRemoteTreeSelectMultiple extends React.Component<FieldRemoteTreeSelectMultipleProps, any> {
|
|
20
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {Spin, TreeSelect} from 'antd';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {HttpUtils, StringUtils} from "../../utils";
|
|
4
|
-
|
|
5
|
-
export class FieldRemoteTreeSelectMultiple extends React.Component {
|
|
6
|
-
static defaultProps = {
|
|
7
|
-
treeDefaultExpandAll: true,
|
|
8
|
-
style: {
|
|
9
|
-
width: '100%',
|
|
10
|
-
minWidth: 200,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
state = {
|
|
15
|
-
data: [],
|
|
16
|
-
loading: false,
|
|
17
|
-
key: this.props.id,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
componentDidMount() {
|
|
21
|
-
this.loadData();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
loadData = async () => {
|
|
25
|
-
const {url} = this.props;
|
|
26
|
-
this.setState({loading: true});
|
|
27
|
-
try {
|
|
28
|
-
const rs = await HttpUtils.get(url);
|
|
29
|
-
this.setState({data: rs});
|
|
30
|
-
} finally {
|
|
31
|
-
this.setState({loading: false});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const {value, onChange, style, treeDefaultExpandAll} = this.props;
|
|
37
|
-
const {data, loading} = this.state;
|
|
38
|
-
|
|
39
|
-
if (loading) {
|
|
40
|
-
return <Spin/>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<TreeSelect
|
|
45
|
-
style={style}
|
|
46
|
-
allowClear={true}
|
|
47
|
-
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
48
|
-
treeData={data}
|
|
49
|
-
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
50
|
-
value={value || undefined}
|
|
51
|
-
onChange={onChange}
|
|
52
|
-
multiple={true}
|
|
53
|
-
filterTreeNode={(inputValue, treeNode) => {
|
|
54
|
-
const {title} = treeNode;
|
|
55
|
-
return StringUtils.contains(title, inputValue);
|
|
56
|
-
}}
|
|
57
|
-
treeLine={{showLeafIcon: true}}
|
|
58
|
-
treeDefaultExpandAll={treeDefaultExpandAll}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {FieldRemoteTreeProps} from "./FieldRemoteTree";
|
|
3
|
-
|
|
4
|
-
export interface FieldSysOrgTreeProps extends Omit<FieldRemoteTreeProps, 'url'> {
|
|
5
|
-
type?: 'dept' | 'unit';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class FieldSysOrgTree extends React.Component<FieldSysOrgTreeProps> {
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {FieldRemoteTreeSelectProps} from "./FieldRemoteTreeSelect";
|
|
3
|
-
|
|
4
|
-
export interface FieldSysOrgTreeSelectProps extends Omit<FieldRemoteTreeSelectProps, 'url'> {
|
|
5
|
-
type?: 'dept' | 'unit';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class FieldSysOrgTreeSelect extends React.Component<FieldSysOrgTreeSelectProps> {
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {ColumnsType} from "antd/es/table";
|
|
3
|
-
import { FieldProps } from '../types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 可编辑表格
|
|
7
|
-
*/
|
|
8
|
-
interface FieldTableProps extends FieldProps<any[]> {
|
|
9
|
-
columns: ColumnsType<any>;
|
|
10
|
-
style?: React.CSSProperties;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class FieldTable extends React.Component<FieldTableProps, any> {
|
|
14
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FieldProps } from '../types';
|
|
3
|
-
import {ColumnsType} from "antd/es/table";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 下拉表格
|
|
7
|
-
*
|
|
8
|
-
* 后端参考接口:
|
|
9
|
-
*/
|
|
10
|
-
interface FieldTableSelectProps extends FieldProps<string | number> {
|
|
11
|
-
url: string;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
|
|
14
|
-
// antd table 的列表
|
|
15
|
-
columns: ColumnsType<any>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class FieldTableSelect extends React.Component<FieldTableSelectProps, any> {
|
|
19
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {CropperProps} from "react-easy-crop/Cropper";
|
|
3
|
-
import {UploadListType} from "antd/es/upload/interface";
|
|
4
|
-
import { FieldProps } from '../types';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 上传图片前裁切, 单张图片
|
|
8
|
-
*
|
|
9
|
-
* 可参考 react-easy-crop
|
|
10
|
-
*/
|
|
11
|
-
interface FieldUploadFileProps extends FieldProps<string> {
|
|
12
|
-
onFileChange?: (fileList: any[]) => void;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 是否裁切图片
|
|
16
|
-
*/
|
|
17
|
-
cropImage?: boolean;
|
|
18
|
-
cropperProps?: CropperProps;
|
|
19
|
-
|
|
20
|
-
maxCount?: number;
|
|
21
|
-
|
|
22
|
-
accept?: "image/*" | ".pdf" | ".docx" | '.xlsx' | string;
|
|
23
|
-
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
|
|
26
|
-
listType?: UploadListType;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class FieldUploadFile extends React.Component<FieldUploadFileProps, string> {
|
|
30
|
-
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, {ReactNode} from "react";
|
|
2
|
-
|
|
3
|
-
export interface LoginPageProps {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 表单渲染
|
|
7
|
-
* @param origForm 原始表单
|
|
8
|
-
*/
|
|
9
|
-
formRender?: (originalForm: ReactNode) => ReactNode
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class LoginPage extends React.Component<LoginPageProps, any> {
|
|
15
|
-
}
|
|
16
|
-
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Button, Form, Input, message, Space} from 'antd';
|
|
3
|
-
import {LockOutlined, SafetyCertificateOutlined, UserOutlined, WarningOutlined} from '@ant-design/icons';
|
|
4
|
-
import "./LoginPage.less"
|
|
5
|
-
import {MessageUtils, SysUtils} from "../utils";
|
|
6
|
-
import {JSEncrypt} from "jsencrypt";
|
|
7
|
-
import {LoginPageUtils} from "./LoginPageUtils";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export class LoginPage extends React.Component {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
state = {
|
|
14
|
-
logging: false,
|
|
15
|
-
|
|
16
|
-
siteInfo: {},
|
|
17
|
-
random: Math.random()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async componentDidMount() {
|
|
21
|
-
console.log('渲染登录页面')
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (localStorage.length === 0) {
|
|
25
|
-
MessageUtils.alert('站点数据缺失,刷新当前页面...')
|
|
26
|
-
window.location.reload()
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const siteInfo = SysUtils.getSiteInfo()
|
|
31
|
-
this.setState({siteInfo})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
submit = values => {
|
|
36
|
-
this.setState({logging: true})
|
|
37
|
-
|
|
38
|
-
const pubkey = this.state.siteInfo.rsaPublicKey;
|
|
39
|
-
if (!pubkey) {
|
|
40
|
-
message.error("未获取密钥,请刷新浏览器再试")
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
// 对密码加密
|
|
44
|
-
const crypt = new JSEncrypt();
|
|
45
|
-
crypt.setPublicKey(pubkey);
|
|
46
|
-
values.password = crypt.encrypt(values.password)
|
|
47
|
-
|
|
48
|
-
LoginPageUtils.postLogin(values).finally(()=>{
|
|
49
|
-
this.setState({logging: false})
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
render() {
|
|
55
|
-
const {siteInfo} = this.state
|
|
56
|
-
|
|
57
|
-
const pageStyle = {}
|
|
58
|
-
if (siteInfo.loginBackground) {
|
|
59
|
-
let url = 'admin/sysFile/preview/' + siteInfo.loginBackground;
|
|
60
|
-
pageStyle.backgroundImage = 'url("' + url + '")'
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<section className='login-page' style={pageStyle}>
|
|
65
|
-
<div className="login-content">
|
|
66
|
-
<h1>{siteInfo.title}</h1>
|
|
67
|
-
{this.getForm(siteInfo)}
|
|
68
|
-
|
|
69
|
-
{this.renderFormBottom()}
|
|
70
|
-
|
|
71
|
-
</div>
|
|
72
|
-
</section>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
getForm = siteInfo => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const form = <Form
|
|
81
|
-
name="normal_login"
|
|
82
|
-
className="login-form"
|
|
83
|
-
initialValues={{remember: true}}
|
|
84
|
-
onFinish={this.submit}
|
|
85
|
-
requiredMark={false}
|
|
86
|
-
colon={false}
|
|
87
|
-
>
|
|
88
|
-
|
|
89
|
-
<Form.Item name="username" rules={[{required: true, message: '请输入用户名!'}]}>
|
|
90
|
-
<Input size='large' prefix={<UserOutlined/>} placeholder="用户名" autoComplete="off"/>
|
|
91
|
-
</Form.Item>
|
|
92
|
-
<Form.Item name="password" rules={[{required: true, message: '请输入密码!'}]}>
|
|
93
|
-
<Input autoComplete="off" prefix={<LockOutlined/>} type="password" placeholder="密码"
|
|
94
|
-
size='large'
|
|
95
|
-
/>
|
|
96
|
-
</Form.Item>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{siteInfo.captcha && <Form.Item name='captchaCode' rules={[{required: true}]}>
|
|
100
|
-
<Space style={{alignItems: 'center'}}>
|
|
101
|
-
<Input size='large' placeholder='验证码' prefix={<SafetyCertificateOutlined/>}/>
|
|
102
|
-
<img height={36}
|
|
103
|
-
width={100}
|
|
104
|
-
src={"/admin/auth/captchaImage?_random=" + this.state.random}
|
|
105
|
-
onClick={() => {
|
|
106
|
-
this.setState({random: Math.random()})
|
|
107
|
-
}}></img>
|
|
108
|
-
</Space>
|
|
109
|
-
</Form.Item>}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<Form.Item style={{marginTop: 10}}>
|
|
113
|
-
<Button loading={this.state.logging} type="primary" htmlType="submit"
|
|
114
|
-
block size='large'>
|
|
115
|
-
登录
|
|
116
|
-
</Button>
|
|
117
|
-
</Form.Item>
|
|
118
|
-
</Form>;
|
|
119
|
-
|
|
120
|
-
if(this.props.formRender){
|
|
121
|
-
return this.props.formRender(form);
|
|
122
|
-
}
|
|
123
|
-
return form;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
renderFormBottom() {
|
|
127
|
-
let siteInfo = this.state.siteInfo;
|
|
128
|
-
if (siteInfo.loginBoxBottomTip) {
|
|
129
|
-
return <div style={{color: 'white', marginTop: 50, fontSize: '14px', textAlign: 'center'}}>
|
|
130
|
-
<WarningOutlined/> {siteInfo.loginBoxBottomTip}
|
|
131
|
-
</div>
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {history} from 'umi';
|
|
2
|
-
import {EventBusUtils, HttpUtils, PageUtils} from "../utils";
|
|
3
|
-
/**
|
|
4
|
-
* 将登录页面的公共方法提取出来,方便自定义登录页面时使用
|
|
5
|
-
*/
|
|
6
|
-
export class LoginPageUtils {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
static postLogin(values) {
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
console.log('开始登录')
|
|
12
|
-
HttpUtils.post('/admin/auth/login', values).then(rs => {
|
|
13
|
-
console.log('登录结果', rs)
|
|
14
|
-
EventBusUtils.emit('loginSuccess')
|
|
15
|
-
let redirect = LoginPageUtils.getRedirect();
|
|
16
|
-
history.push(redirect)
|
|
17
|
-
resolve(rs)
|
|
18
|
-
}).catch(e => {
|
|
19
|
-
console.log('登录错误', e)
|
|
20
|
-
reject(e)
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static getRedirect() {
|
|
27
|
-
let redirect = PageUtils.currentParams()['redirect'];
|
|
28
|
-
if (redirect) {
|
|
29
|
-
console.log('重定向参数', redirect)
|
|
30
|
-
redirect = decodeURIComponent(redirect)
|
|
31
|
-
}else {
|
|
32
|
-
redirect = '/'
|
|
33
|
-
}
|
|
34
|
-
return redirect;
|
|
35
|
-
}
|
|
36
|
-
}
|