@jiangood/open-admin 1.0.1 → 1.1.0
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 +8 -11
- 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.jsx → DownloadFileButton/index.jsx} +1 -1
- package/src/framework/components/{LinkButton.d.ts → LinkButton/index.d.ts} +1 -1
- package/src/framework/components/{LinkButton.jsx → LinkButton/index.jsx} +1 -1
- package/src/framework/components/NamedIcon/index.d.ts +5 -0
- package/src/framework/components/{NamedIcon.tsx → NamedIcon/index.jsx} +1 -5
- package/src/framework/components/OrgTree/index.d.ts +4 -0
- package/src/framework/{field-components/system/OrgTree.tsx → components/OrgTree/index.jsx} +1 -4
- package/src/framework/components/PageLoading/index.d.ts +1 -0
- package/src/framework/components/{PageLoading.tsx → PageLoading/index.jsx} +3 -5
- package/src/framework/components/RoleTree/index.d.ts +4 -0
- package/src/framework/{field-components/system/RoleTree.tsx → components/RoleTree/index.jsx} +1 -4
- package/src/framework/components/ValueType/index.jsx +1 -1
- package/src/framework/components/ValueType/registry.jsx +2 -3
- package/src/framework/components/{view/ViewRange → ViewRange}/index.d.ts +5 -7
- package/src/framework/components/index.ts +3 -7
- package/src/framework/components/system/index.tsx +1 -1
- package/src/framework/fields/FieldBoolean/index.d.ts +9 -0
- package/src/framework/{field-components/FieldBoolean.jsx → fields/FieldBoolean/index.jsx} +6 -9
- package/src/framework/{field-components/FieldDate.d.ts → fields/FieldDate/index.d.ts} +5 -9
- package/src/framework/{field-components/FieldDate.jsx → fields/FieldDate/index.jsx} +28 -26
- package/src/framework/fields/FieldDateRange/index.d.ts +22 -0
- package/src/framework/{field-components/FieldDateRange.jsx → fields/FieldDateRange/index.jsx} +26 -27
- package/src/framework/fields/FieldDictSelect/index.d.ts +12 -0
- package/src/framework/{field-components/FieldDictSelect.jsx → fields/FieldDictSelect/index.jsx} +5 -5
- 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/{field-components/FieldNumberRange.jsx → fields/FieldNumberRange/index.jsx} +20 -24
- package/src/framework/fields/FieldPercent/index.d.ts +8 -0
- package/src/framework/{field-components/FieldPercent.jsx → fields/FieldPercent/index.jsx} +9 -6
- 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/{field-components/FieldRemoteSelectMultiple.jsx → fields/FieldRemoteSelectMultiple/index.jsx} +4 -5
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +21 -0
- package/src/framework/{field-components/FieldRemoteSelectMultipleInline.jsx → fields/FieldRemoteSelectMultipleInline/index.jsx} +8 -6
- package/src/framework/fields/FieldRemoteTree/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTree/index.jsx +50 -0
- package/src/framework/{field-components/FieldRemoteTreeCascader.d.ts → fields/FieldRemoteTreeCascader/index.d.ts} +10 -15
- package/src/framework/{field-components/FieldRemoteTreeCascader.jsx → fields/FieldRemoteTreeCascader/index.jsx} +11 -13
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +19 -0
- package/src/framework/{field-components/FieldRemoteTreeSelect.jsx → fields/FieldRemoteTreeSelect/index.jsx} +10 -20
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +20 -0
- package/src/framework/{field-components/FieldRemoteTreeSelectMultiple.jsx → fields/FieldRemoteTreeSelectMultiple/index.jsx} +11 -21
- 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/{field-components/FieldSysOrgTreeSelect.jsx → fields/FieldSysOrgTreeSelect/index.jsx} +7 -8
- package/src/framework/fields/FieldTable/index.d.ts +14 -0
- package/src/framework/{field-components/FieldTable.jsx → fields/FieldTable/index.jsx} +38 -38
- package/src/framework/fields/FieldTableSelect/index.d.ts +19 -0
- package/src/framework/{field-components/FieldTableSelect.jsx → fields/FieldTableSelect/index.jsx} +13 -12
- package/src/framework/{field-components/FieldUploadFile.d.ts → fields/FieldUploadFile/index.d.ts} +12 -15
- package/src/framework/{field-components/FieldUploadFile.jsx → fields/FieldUploadFile/index.jsx} +32 -34
- package/src/framework/{field-components → fields}/index.ts +2 -1
- package/src/framework/fields/types.ts +16 -0
- package/src/framework/index.ts +2 -2
- package/src/framework/utils/index.ts +0 -1
- package/src/framework/utils/system/DictUtils.ts +1 -1
- package/src/framework/views/ViewApproveStatus/index.d.ts +3 -0
- package/src/framework/{view-components/ViewApproveStatus.tsx → views/ViewApproveStatus/index.jsx} +3 -8
- 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/{components/view/ViewBooleanEnableDisable.tsx → views/ViewBooleanEnableDisable/index.jsx} +2 -7
- package/src/framework/{components/view/ViewFileButton.d.ts → views/ViewFile/index.d.ts} +3 -3
- 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/ViewPassword/index.d.ts +5 -0
- package/src/framework/{view-components/ViewPassword.tsx → views/ViewPassword/index.jsx} +2 -3
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +12 -0
- package/src/framework/{view-components/ViewFlowableInstanceProgress.jsx → views/ViewProcessInstanceProgress/index.jsx} +2 -2
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +6 -0
- package/src/framework/{view-components/ViewFlowableInstanceProgressButton.tsx → views/ViewProcessInstanceProgressButton/index.jsx} +4 -6
- 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/layouts/admin/index.jsx +0 -2
- package/src/layouts/index.jsx +38 -16
- package/src/pages/404.jsx +4 -4
- package/src/pages/about.jsx +0 -2
- package/src/pages/index.jsx +4 -19
- package/src/pages/login.jsx +3 -8
- package/src/pages/system/api/ApiDoc.jsx +19 -15
- package/src/pages/system/api/index.jsx +23 -24
- package/src/pages/system/api/perm.jsx +4 -4
- package/src/pages/system/dict/Dict.jsx +0 -5
- package/src/pages/system/dict/DictItem.jsx +23 -25
- package/src/pages/system/dict/index.jsx +2 -2
- package/src/pages/system/file/index.jsx +16 -29
- package/src/pages/system/job/index.jsx +44 -44
- package/src/pages/system/log/index.jsx +3 -4
- package/src/pages/system/org/index.jsx +34 -36
- package/src/pages/system/role/index.jsx +68 -74
- package/src/pages/system/role/perm.jsx +0 -1
- package/src/pages/system/sysManual/index.jsx +27 -28
- package/src/pages/system/user/UserPerm.jsx +5 -8
- package/src/pages/system/user/index.jsx +46 -51
- package/src/pages/test/views.jsx +95 -0
- package/src/pages/ureport/index.jsx +2 -2
- package/src/pages/userCenter/ChangePassword.jsx +2 -1
- package/src/pages/userCenter/index.jsx +8 -8
- package/src/pages/userCenter/manual.jsx +3 -5
- package/src/pages/userCenter/message.jsx +14 -16
- package/config/dist/common-plugin.js +0 -149
- package/config/dist/config.js +0 -45
- package/config/dist/index.js +0 -18
- package/src/app.js +0 -1
- package/src/asserts/welcome.png +0 -0
- package/src/forms/demoForm.jsx +0 -16
- package/src/framework/components/Ellipsis.jsx +0 -39
- package/src/framework/components/Ellipsis.less +0 -8
- package/src/framework/components/view/ViewEllipsis.d.ts +0 -11
- package/src/framework/components/view/ViewEllipsis.jsx +0 -30
- package/src/framework/components/view/ViewFile.d.ts +0 -10
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +0 -9
- package/src/framework/components/view/ViewText.tsx +0 -16
- package/src/framework/components/view/index.ts +0 -10
- package/src/framework/field-components/FieldBoolean.d.ts +0 -13
- package/src/framework/field-components/FieldDateRange.d.ts +0 -6
- package/src/framework/field-components/FieldDictSelect.d.ts +0 -13
- package/src/framework/field-components/FieldEditor.d.ts +0 -10
- package/src/framework/field-components/FieldEditor.jsx +0 -58
- package/src/framework/field-components/FieldNumberRange.d.ts +0 -13
- package/src/framework/field-components/FieldPercent.d.ts +0 -12
- package/src/framework/field-components/FieldRemoteSelect.d.ts +0 -13
- package/src/framework/field-components/FieldRemoteSelect.jsx +0 -87
- package/src/framework/field-components/FieldRemoteSelectMultiple.d.ts +0 -13
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.d.ts +0 -20
- package/src/framework/field-components/FieldRemoteTree.d.ts +0 -21
- package/src/framework/field-components/FieldRemoteTree.jsx +0 -45
- package/src/framework/field-components/FieldRemoteTreeSelect.d.ts +0 -17
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.d.ts +0 -17
- package/src/framework/field-components/FieldSysOrgTree.d.ts +0 -12
- package/src/framework/field-components/FieldSysOrgTree.jsx +0 -23
- package/src/framework/field-components/FieldSysOrgTreeSelect.d.ts +0 -12
- package/src/framework/field-components/FieldTable.d.ts +0 -17
- package/src/framework/field-components/FieldTableSelect.d.ts +0 -19
- package/src/framework/field-components/system/index.ts +0 -2
- package/src/framework/view-components/ViewBoolean.tsx +0 -6
- package/src/framework/view-components/ViewFlowableInstanceProgress.d.ts +0 -12
- package/src/framework/view-components/ViewProps.ts +0 -11
- package/src/framework/view-components/index.ts +0 -6
- package/src/pages/test.jsx +0 -200
- /package/src/framework/components/{DownloadFileButton.d.ts → DownloadFileButton/index.d.ts} +0 -0
- /package/src/framework/components/{view/ViewRange → ViewRange}/index.jsx +0 -0
- /package/src/framework/{field-components/FieldTable.less → fields/FieldTable/styles.less} +0 -0
- /package/src/framework/{components/view/ViewFile.jsx → views/ViewFile/index.jsx} +0 -0
- /package/src/framework/{components/view/ViewImage.jsx → views/ViewImage/index.jsx} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {TreeProps} from "antd";
|
|
3
|
+
import { FieldProps } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 多选树
|
|
7
|
+
*
|
|
8
|
+
* 区别于下拉框,是扁平展示的树
|
|
9
|
+
* 这种需要扁平展示的树,通常都是多选。
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
interface FieldRemoteTreeProps extends Omit<TreeProps, 'treeData' | 'checkedKeys' | 'onCheck' | 'multiple' | 'checkable' | 'defaultExpandAll' | 'checkStrictly'>, FieldProps<string[]> {
|
|
13
|
+
/**
|
|
14
|
+
* 请求地址
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class FieldRemoteTree extends React.Component<FieldRemoteTreeProps, string> {
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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,23 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {TreeProps} from "antd";
|
|
4
|
-
|
|
5
|
-
export interface FieldRemoteTreeCascaderProps {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* 请求地址
|
|
9
|
-
* 要求返回数据格式为:tree
|
|
10
|
-
*/
|
|
11
|
-
url: string ;
|
|
12
|
-
|
|
13
|
-
value?: string;
|
|
14
|
-
onChange?: (value: string) => void;
|
|
15
|
-
}
|
|
2
|
+
import { FieldProps } from '../types';
|
|
16
3
|
|
|
17
4
|
/**
|
|
18
5
|
* 远程树级联选择器, 类似select,但是树级联
|
|
19
6
|
*
|
|
20
7
|
* 注意,value为非数组形式,区别于cascader组件
|
|
21
8
|
*/
|
|
22
|
-
|
|
9
|
+
interface FieldRemoteTreeCascaderProps extends FieldProps<string> {
|
|
10
|
+
/**
|
|
11
|
+
* 请求地址
|
|
12
|
+
* 要求返回数据格式为:tree
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
23
16
|
|
|
17
|
+
export class FieldRemoteTreeCascader extends React.Component<FieldRemoteTreeCascaderProps, any> {
|
|
18
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {Cascader, message, Spin} from 'antd';
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import {HttpUtils, TreeUtils} from "
|
|
5
|
-
|
|
3
|
+
import {HttpUtils, TreeUtils} from "../../utils";
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 远程树级联选择器, 类似select,但是树级联
|
|
7
|
+
*
|
|
8
|
+
* 注意,value为非数组形式,区别于cascader组件
|
|
9
|
+
*/
|
|
7
10
|
export class FieldRemoteTreeCascader extends React.Component {
|
|
8
|
-
|
|
9
11
|
state = {
|
|
10
12
|
data: [],
|
|
11
|
-
value: [],
|
|
12
13
|
loading: false,
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -16,7 +17,6 @@ export class FieldRemoteTreeCascader extends React.Component {
|
|
|
16
17
|
this.loadData();
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
20
|
loadData = async () => {
|
|
21
21
|
const {url} = this.props;
|
|
22
22
|
this.setState({loading: true});
|
|
@@ -25,21 +25,19 @@ export class FieldRemoteTreeCascader extends React.Component {
|
|
|
25
25
|
const list = await HttpUtils.get(url);
|
|
26
26
|
this.setState({data: list});
|
|
27
27
|
} catch (e) {
|
|
28
|
-
console.log(e)
|
|
28
|
+
console.log(e);
|
|
29
29
|
} finally {
|
|
30
30
|
this.setState({loading: false});
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
35
|
render() {
|
|
38
36
|
const {data} = this.state;
|
|
39
37
|
if (this.state.loading) {
|
|
40
38
|
return <Spin/>;
|
|
41
39
|
}
|
|
42
|
-
|
|
40
|
+
const {value, onChange, ...rest} = this.props;
|
|
43
41
|
|
|
44
42
|
let arr = [];
|
|
45
43
|
if (value != null) {
|
|
@@ -49,8 +47,8 @@ export class FieldRemoteTreeCascader extends React.Component {
|
|
|
49
47
|
return (
|
|
50
48
|
<Cascader
|
|
51
49
|
options={this.state.data}
|
|
52
|
-
onChange={arr=>{
|
|
53
|
-
onChange(arr[arr.length - 1]);
|
|
50
|
+
onChange={arr => {
|
|
51
|
+
onChange && onChange(arr[arr.length - 1]);
|
|
54
52
|
}}
|
|
55
53
|
value={arr}
|
|
56
54
|
fieldNames={{label: 'title', value: 'key'}}
|
|
@@ -58,4 +56,4 @@ export class FieldRemoteTreeCascader extends React.Component {
|
|
|
58
56
|
/>
|
|
59
57
|
);
|
|
60
58
|
}
|
|
61
|
-
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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,17 +1,14 @@
|
|
|
1
1
|
import {Spin, TreeSelect} from 'antd';
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import {HttpUtils, StringUtils} from "
|
|
3
|
+
import {HttpUtils, StringUtils} from "../../utils";
|
|
5
4
|
|
|
6
5
|
export class FieldRemoteTreeSelect extends React.Component {
|
|
7
|
-
|
|
8
6
|
static defaultProps = {
|
|
9
7
|
treeDefaultExpandAll: true,
|
|
10
|
-
}
|
|
8
|
+
};
|
|
11
9
|
|
|
12
10
|
state = {
|
|
13
11
|
data: [],
|
|
14
|
-
value: [],
|
|
15
12
|
loading: false,
|
|
16
13
|
key: this.props.id,
|
|
17
14
|
};
|
|
@@ -20,31 +17,25 @@ export class FieldRemoteTreeSelect extends React.Component {
|
|
|
20
17
|
this.loadData();
|
|
21
18
|
}
|
|
22
19
|
|
|
23
|
-
|
|
24
20
|
loadData = async () => {
|
|
25
21
|
const {url} = this.props;
|
|
26
22
|
this.setState({loading: true});
|
|
27
23
|
try {
|
|
28
|
-
const rs = await HttpUtils.get(url)
|
|
24
|
+
const rs = await HttpUtils.get(url);
|
|
29
25
|
this.setState({data: rs});
|
|
30
26
|
} finally {
|
|
31
27
|
this.setState({loading: false});
|
|
32
28
|
}
|
|
33
29
|
};
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
31
|
render() {
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
const {value, onChange, treeDefaultExpandAll} = this.props;
|
|
33
|
+
const {data, loading} = this.state;
|
|
40
34
|
|
|
41
|
-
if (
|
|
35
|
+
if (loading) {
|
|
42
36
|
return <Spin/>;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
39
|
return (
|
|
49
40
|
<TreeSelect
|
|
50
41
|
style={{width: '100%', minWidth: 200}}
|
|
@@ -54,14 +45,13 @@ export class FieldRemoteTreeSelect extends React.Component {
|
|
|
54
45
|
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
55
46
|
value={value || undefined}
|
|
56
47
|
onChange={onChange}
|
|
57
|
-
|
|
58
48
|
filterTreeNode={(inputValue, treeNode) => {
|
|
59
|
-
const {title} = treeNode
|
|
60
|
-
return StringUtils.contains(title, inputValue)
|
|
49
|
+
const {title} = treeNode;
|
|
50
|
+
return StringUtils.contains(title, inputValue);
|
|
61
51
|
}}
|
|
62
52
|
treeLine={{showLeafIcon: true}}
|
|
63
|
-
treeDefaultExpandAll={
|
|
53
|
+
treeDefaultExpandAll={treeDefaultExpandAll}
|
|
64
54
|
/>
|
|
65
55
|
);
|
|
66
56
|
}
|
|
67
|
-
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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,21 +1,18 @@
|
|
|
1
1
|
import {Spin, TreeSelect} from 'antd';
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import {HttpUtils, StringUtils} from "
|
|
3
|
+
import {HttpUtils, StringUtils} from "../../utils";
|
|
5
4
|
|
|
6
5
|
export class FieldRemoteTreeSelectMultiple extends React.Component {
|
|
7
|
-
|
|
8
6
|
static defaultProps = {
|
|
9
7
|
treeDefaultExpandAll: true,
|
|
10
8
|
style: {
|
|
11
9
|
width: '100%',
|
|
12
10
|
minWidth: 200,
|
|
13
11
|
},
|
|
14
|
-
}
|
|
12
|
+
};
|
|
15
13
|
|
|
16
14
|
state = {
|
|
17
15
|
data: [],
|
|
18
|
-
value: [],
|
|
19
16
|
loading: false,
|
|
20
17
|
key: this.props.id,
|
|
21
18
|
};
|
|
@@ -24,33 +21,28 @@ export class FieldRemoteTreeSelectMultiple extends React.Component {
|
|
|
24
21
|
this.loadData();
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
|
|
28
24
|
loadData = async () => {
|
|
29
25
|
const {url} = this.props;
|
|
30
26
|
this.setState({loading: true});
|
|
31
27
|
try {
|
|
32
|
-
const rs = await HttpUtils.get(url)
|
|
28
|
+
const rs = await HttpUtils.get(url);
|
|
33
29
|
this.setState({data: rs});
|
|
34
30
|
} finally {
|
|
35
31
|
this.setState({loading: false});
|
|
36
32
|
}
|
|
37
33
|
};
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
35
|
render() {
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const {value, onChange, style, treeDefaultExpandAll} = this.props;
|
|
37
|
+
const {data, loading} = this.state;
|
|
44
38
|
|
|
45
|
-
if (
|
|
39
|
+
if (loading) {
|
|
46
40
|
return <Spin/>;
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
43
|
return (
|
|
52
44
|
<TreeSelect
|
|
53
|
-
style={
|
|
45
|
+
style={style}
|
|
54
46
|
allowClear={true}
|
|
55
47
|
dropdownStyle={{maxHeight: 400, overflow: 'auto'}}
|
|
56
48
|
treeData={data}
|
|
@@ -58,15 +50,13 @@ export class FieldRemoteTreeSelectMultiple extends React.Component {
|
|
|
58
50
|
value={value || undefined}
|
|
59
51
|
onChange={onChange}
|
|
60
52
|
multiple={true}
|
|
61
|
-
|
|
62
53
|
filterTreeNode={(inputValue, treeNode) => {
|
|
63
|
-
const {title} = treeNode
|
|
64
|
-
return StringUtils.contains(title, inputValue)
|
|
54
|
+
const {title} = treeNode;
|
|
55
|
+
return StringUtils.contains(title, inputValue);
|
|
65
56
|
}}
|
|
66
57
|
treeLine={{showLeafIcon: true}}
|
|
67
|
-
treeDefaultExpandAll={
|
|
68
|
-
|
|
58
|
+
treeDefaultExpandAll={treeDefaultExpandAll}
|
|
69
59
|
/>
|
|
70
60
|
);
|
|
71
61
|
}
|
|
72
|
-
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织机构树
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import {FieldRemoteTree} from "../FieldRemoteTree";
|
|
6
|
+
|
|
7
|
+
export class FieldSysOrgTree extends React.Component {
|
|
8
|
+
static defaultProps = {
|
|
9
|
+
type: 'dept',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
render() {
|
|
13
|
+
const {type, ...rest} = this.props;
|
|
14
|
+
const url = type === 'dept'?
|
|
15
|
+
'/admin/sysOrg/deptTree':
|
|
16
|
+
'/admin/sysOrg/unitTree';
|
|
17
|
+
return <FieldRemoteTree url={url} {...rest} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 组织机构树选择器
|
|
3
3
|
*/
|
|
4
4
|
import React from "react";
|
|
5
|
-
import {FieldRemoteTreeSelect} from "
|
|
6
|
-
|
|
5
|
+
import {FieldRemoteTreeSelect} from "../FieldRemoteTreeSelect";
|
|
7
6
|
|
|
8
7
|
export class FieldSysOrgTreeSelect extends React.Component {
|
|
9
8
|
|
|
10
9
|
static defaultProps = {
|
|
11
10
|
type: 'dept',
|
|
12
|
-
}
|
|
11
|
+
};
|
|
13
12
|
|
|
14
13
|
render() {
|
|
15
|
-
|
|
14
|
+
const {type, ...rest} = this.props;
|
|
16
15
|
const url = type === 'dept'?
|
|
17
16
|
'/admin/sysOrg/deptTree':
|
|
18
|
-
'/admin/sysOrg/unitTree'
|
|
17
|
+
'/admin/sysOrg/unitTree';
|
|
19
18
|
|
|
20
|
-
return <FieldRemoteTreeSelect url={url} {...rest}
|
|
19
|
+
return <FieldRemoteTreeSelect url={url} {...rest}/>;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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,14 +1,15 @@
|
|
|
1
1
|
import {Button, Input, Table} from 'antd'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import {DeleteOutlined, PlusOutlined} from "@ant-design/icons";
|
|
4
|
-
import './
|
|
5
|
-
import {ArrUtils} from "
|
|
4
|
+
import './styles.less'
|
|
5
|
+
import {ArrUtils} from "../../utils";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 可编辑表格
|
|
9
|
+
*/
|
|
7
10
|
export class FieldTable extends React.Component {
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
columns = []
|
|
11
|
-
|
|
12
|
+
columns = [];
|
|
12
13
|
|
|
13
14
|
constructor(props) {
|
|
14
15
|
super(props);
|
|
@@ -16,13 +17,13 @@ export class FieldTable extends React.Component {
|
|
|
16
17
|
this.columns = this.props.columns.map(col => {
|
|
17
18
|
if (col.render == null) {
|
|
18
19
|
col.render = (v, record, index) => {
|
|
19
|
-
return <Input value={v} onChange={(e) => this.onCellChange(index, col.dataIndex, e)}
|
|
20
|
-
}
|
|
20
|
+
return <Input value={v} onChange={(e) => this.onCellChange(index, col.dataIndex, e)}/>;
|
|
21
|
+
};
|
|
21
22
|
} else {
|
|
22
23
|
if (!col._oldRender) {
|
|
23
|
-
col._oldRender = col.render
|
|
24
|
+
col._oldRender = col.render;
|
|
24
25
|
col.render = (v, record, index) => {
|
|
25
|
-
const cmp = col._oldRender(v, record, index)
|
|
26
|
+
const cmp = col._oldRender(v, record, index);
|
|
26
27
|
return React.createElement(cmp.type,
|
|
27
28
|
{
|
|
28
29
|
...cmp.props,
|
|
@@ -30,63 +31,62 @@ export class FieldTable extends React.Component {
|
|
|
30
31
|
onChange: (e) => {
|
|
31
32
|
this.onCellChange(index, col.dataIndex, e);
|
|
32
33
|
}
|
|
33
|
-
})
|
|
34
|
-
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
return col
|
|
38
|
-
})
|
|
38
|
+
return col;
|
|
39
|
+
});
|
|
39
40
|
|
|
40
41
|
this.columns.push({
|
|
41
42
|
title: '操作',
|
|
42
43
|
render: (v, record) => {
|
|
43
44
|
return <Button icon={<DeleteOutlined/>} title='删除' size='small' shape={'circle'}
|
|
44
|
-
onClick={() => this.remove(record)}></Button
|
|
45
|
+
onClick={() => this.remove(record)}></Button>;
|
|
45
46
|
}
|
|
46
|
-
})
|
|
47
|
+
});
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
49
|
+
this.state = {
|
|
50
|
+
dataSource: this.props.value || []
|
|
51
|
+
};
|
|
51
52
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
state = {
|
|
55
56
|
dataSource: []
|
|
56
|
-
}
|
|
57
|
-
|
|
57
|
+
};
|
|
58
58
|
|
|
59
59
|
onCellChange = (index, dataIndex, e) => {
|
|
60
|
-
let {dataSource} = this.state
|
|
61
|
-
let row = dataSource[index]
|
|
60
|
+
let {dataSource} = this.state;
|
|
61
|
+
let row = dataSource[index];
|
|
62
62
|
|
|
63
63
|
let v = e;
|
|
64
64
|
if (e != null && e.hasOwnProperty('target')) {
|
|
65
65
|
v = e.target.value;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
row[dataIndex] = v;
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.setState({dataSource}, this.notifyParent)
|
|
73
|
-
}
|
|
70
|
+
dataSource = [...dataSource];
|
|
71
|
+
this.setState({dataSource}, this.notifyParent);
|
|
72
|
+
};
|
|
74
73
|
|
|
75
74
|
add = () => {
|
|
76
|
-
let {dataSource} = this.state
|
|
75
|
+
let {dataSource} = this.state;
|
|
77
76
|
dataSource = [...dataSource, {}];
|
|
78
|
-
this.setState({dataSource}, this.notifyParent)
|
|
77
|
+
this.setState({dataSource}, this.notifyParent);
|
|
79
78
|
};
|
|
79
|
+
|
|
80
80
|
remove = (record) => {
|
|
81
|
-
let {dataSource} = this.state
|
|
82
|
-
ArrUtils.remove(dataSource, record)
|
|
83
|
-
this.setState({dataSource: [...dataSource]}, this.notifyParent)
|
|
81
|
+
let {dataSource} = this.state;
|
|
82
|
+
ArrUtils.remove(dataSource, record);
|
|
83
|
+
this.setState({dataSource: [...dataSource]}, this.notifyParent);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
notifyParent() {
|
|
87
|
-
let {dataSource} = this.state
|
|
88
|
-
this.props.onChange(dataSource)
|
|
89
|
-
}
|
|
86
|
+
notifyParent = () => {
|
|
87
|
+
let {dataSource} = this.state;
|
|
88
|
+
this.props.onChange && this.props.onChange(dataSource);
|
|
89
|
+
};
|
|
90
90
|
|
|
91
91
|
render() {
|
|
92
92
|
return <div className='edit-table' style={this.props.style}>
|
|
@@ -103,6 +103,6 @@ export class FieldTable extends React.Component {
|
|
|
103
103
|
</Table>
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
</div
|
|
106
|
+
</div>;
|
|
107
107
|
}
|
|
108
|
-
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
package/src/framework/{field-components/FieldTableSelect.jsx → fields/FieldTableSelect/index.jsx}
RENAMED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button, Select} from "antd";
|
|
3
|
-
import {ProTable} from "
|
|
4
|
-
import {HttpUtils} from "
|
|
3
|
+
import {ProTable} from "../../components";
|
|
4
|
+
import {HttpUtils} from "../../utils";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 下拉表格
|
|
8
|
+
*
|
|
9
|
+
* 后端参考接口:
|
|
8
10
|
*/
|
|
9
11
|
export class FieldTableSelect extends React.Component {
|
|
10
12
|
|
|
11
13
|
static defaultProps = {
|
|
12
14
|
placeholder: '请搜索选择',
|
|
13
|
-
}
|
|
15
|
+
};
|
|
14
16
|
|
|
15
17
|
state = {
|
|
16
18
|
open: false,
|
|
17
19
|
label: '',
|
|
18
|
-
}
|
|
20
|
+
};
|
|
19
21
|
|
|
20
22
|
render() {
|
|
21
23
|
return <Select popupRender={this.popupRender}
|
|
@@ -26,10 +28,9 @@ export class FieldTableSelect extends React.Component {
|
|
|
26
28
|
labelRender={() => this.state.label}
|
|
27
29
|
popupMatchSelectWidth={900}
|
|
28
30
|
placeholder={this.props.placeholder}
|
|
29
|
-
|
|
31
|
+
/>;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
|
|
33
34
|
popupRender = () => {
|
|
34
35
|
return <ProTable
|
|
35
36
|
columns={[...this.props.columns, {
|
|
@@ -44,16 +45,16 @@ export class FieldTableSelect extends React.Component {
|
|
|
44
45
|
this.setState({
|
|
45
46
|
label: record.name,
|
|
46
47
|
open: false
|
|
47
|
-
})
|
|
48
|
-
this.props.onChange(record.id)
|
|
49
|
-
}}>选择</Button
|
|
48
|
+
});
|
|
49
|
+
this.props.onChange && this.props.onChange(record.id);
|
|
50
|
+
}}>选择</Button>;
|
|
50
51
|
}
|
|
51
52
|
}]}
|
|
52
53
|
showToolbarSearch
|
|
53
54
|
request={(params) => {
|
|
54
|
-
params.selected = this.props.value
|
|
55
|
+
params.selected = this.props.value;
|
|
55
56
|
return HttpUtils.get(this.props.url, params);
|
|
56
57
|
}}>
|
|
57
|
-
</ProTable
|
|
58
|
+
</ProTable>;
|
|
58
59
|
};
|
|
59
|
-
}
|
|
60
|
+
}
|