@jiangood/springboot-admin-starter 0.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 +10 -0
- package/config/config.local.js +10 -0
- package/config/defaultConfig.js +35 -0
- package/config/plugins/forms.js +44 -0
- package/config/plugins/routes.js +82 -0
- package/package.json +41 -0
- package/src/.npmignore +6 -0
- package/src/app.js +0 -0
- package/src/asserts/login_bg.jpg +0 -0
- package/src/asserts/welcome.png +0 -0
- package/src/components/InstanceInfo.jsx +138 -0
- package/src/components/InstanceStatusInfo.jsx +79 -0
- package/src/components/StreamLog.jsx +27 -0
- package/src/components/flow/BpmnUtils.js +85 -0
- package/src/components/flow/customTranslate/customTranslate.js +19 -0
- package/src/components/flow/customTranslate/translations.js +79 -0
- package/src/components/flow/design/contextPad.js +50 -0
- package/src/components/flow/design/form/ConditionForm.jsx +316 -0
- package/src/components/flow/design/form/ServiceTaskForm.jsx +55 -0
- package/src/components/flow/design/form/TimerEventDefinitionForm.jsx +62 -0
- package/src/components/flow/design/form/UserTaskForm.jsx +211 -0
- package/src/components/flow/design/palette.js +39 -0
- package/src/components/monitor/AllDefinition.jsx +46 -0
- package/src/components/monitor/AllInstance.jsx +76 -0
- package/src/forms/demoForm.jsx +16 -0
- package/src/framework/components/ButtonList.d.ts +9 -0
- package/src/framework/components/ButtonList.jsx +91 -0
- package/src/framework/components/DownloadFileButton.d.ts +11 -0
- package/src/framework/components/DownloadFileButton.jsx +33 -0
- package/src/framework/components/Echarts/index.d.ts +10 -0
- package/src/framework/components/Echarts/index.jsx +49 -0
- package/src/framework/components/EditTable/index.d.ts +11 -0
- package/src/framework/components/EditTable/index.jsx +85 -0
- package/src/framework/components/EditTable/index.less +29 -0
- package/src/framework/components/Ellipsis.jsx +39 -0
- package/src/framework/components/Ellipsis.less +8 -0
- package/src/framework/components/FieldRemoteTree.jsx +20 -0
- package/src/framework/components/Gap/index.d.ts +10 -0
- package/src/framework/components/Gap/index.jsx +15 -0
- package/src/framework/components/Gap/index.less +3 -0
- package/src/framework/components/HasPerm.jsx +18 -0
- package/src/framework/components/ImageView.d.ts +12 -0
- package/src/framework/components/ImageView.jsx +64 -0
- package/src/framework/components/LinkButton.d.ts +14 -0
- package/src/framework/components/LinkButton.jsx +13 -0
- package/src/framework/components/MsgBox.jsx +180 -0
- package/src/framework/components/NamedIcon.tsx +15 -0
- package/src/framework/components/OrgTree.jsx +60 -0
- package/src/framework/components/Page/index.d.ts +10 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading.jsx +31 -0
- package/src/framework/components/Panel/index.d.ts +11 -0
- package/src/framework/components/Panel/index.jsx +24 -0
- package/src/framework/components/Panel/index.less +0 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +124 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +38 -0
- package/src/framework/components/ProTable/index.jsx +258 -0
- package/src/framework/components/ProTable/index.less +3 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree.jsx +53 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +38 -0
- package/src/framework/components/field/FieldAutoTime/index.tsx +46 -0
- package/src/framework/components/field/FieldBoolean/index.tsx +92 -0
- package/src/framework/components/field/FieldEditTable/index.d.ts +13 -0
- package/src/framework/components/field/FieldEditTable/index.jsx +103 -0
- package/src/framework/components/field/FieldEditTable/index.less +29 -0
- package/src/framework/components/field/FieldEditor.jsx +48 -0
- package/src/framework/components/field/FieldFileBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldFileBase64/index.jsx +23 -0
- package/src/framework/components/field/FieldImageBase64/index.d.ts +15 -0
- package/src/framework/components/field/FieldImageBase64/index.jsx +22 -0
- package/src/framework/components/field/FieldInput.jsx +13 -0
- package/src/framework/components/field/FieldOrgTree/index.tsx +45 -0
- package/src/framework/components/field/FieldPassword.jsx +11 -0
- package/src/framework/components/field/FieldProps.ts +19 -0
- package/src/framework/components/field/FieldRemoteTreeCascader.jsx +75 -0
- package/src/framework/components/field/FieldRemoteTreeCheckable.jsx +81 -0
- package/src/framework/components/field/FieldRemoteTreeMultipleSelect.jsx +100 -0
- package/src/framework/components/field/FieldRemoteTreeSelect.jsx +82 -0
- package/src/framework/components/field/FieldSelectPosition/index.tsx +85 -0
- package/src/framework/components/field/FieldTree.jsx +45 -0
- package/src/framework/components/field/dict/index.tsx +110 -0
- package/src/framework/components/field/flat-multiple-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-multiple-select/index.jsx +116 -0
- package/src/framework/components/field/flat-multiple-select/index.less +12 -0
- package/src/framework/components/field/flat-select/index.d.ts +4 -0
- package/src/framework/components/field/flat-select/index.jsx +107 -0
- package/src/framework/components/field/flat-select/index.less +12 -0
- package/src/framework/components/field/index.js +33 -0
- package/src/framework/components/field/input-number-percent/index.d.ts +11 -0
- package/src/framework/components/field/input-number-percent/index.jsx +28 -0
- package/src/framework/components/field/select/FieldSelect/index.d.ts +39 -0
- package/src/framework/components/field/select/FieldSelect/index.jsx +156 -0
- package/src/framework/components/field/select/FieldTableSelect/index.d.ts +29 -0
- package/src/framework/components/field/select/FieldTableSelect/index.jsx +155 -0
- package/src/framework/components/field/select/index.jsx +2 -0
- package/src/framework/components/field/switch-y-n/index.d.ts +11 -0
- package/src/framework/components/field/switch-y-n/index.jsx +31 -0
- package/src/framework/components/field/text/index.tsx +7 -0
- package/src/framework/components/field/time/DatePickerString.tsx +37 -0
- package/src/framework/components/field/time/DateTimePickerString.tsx +42 -0
- package/src/framework/components/field/time/FieldDateRange.d.ts +9 -0
- package/src/framework/components/field/time/FieldDateRange.jsx +49 -0
- package/src/framework/components/field/time/HHmmPickerString.tsx +42 -0
- package/src/framework/components/field/time/MonthPickerString.tsx +45 -0
- package/src/framework/components/field/time/TimePickerTool.ts +14 -0
- package/src/framework/components/field/time/YearPickerString.tsx +41 -0
- package/src/framework/components/field/time/YearQuarterString.tsx +38 -0
- package/src/framework/components/field/time/index.tsx +7 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.d.ts +22 -0
- package/src/framework/components/field/upload/FieldUploadCropImage/index.jsx +11 -0
- package/src/framework/components/field/upload/FieldUploadFile.d.ts +35 -0
- package/src/framework/components/field/upload/FieldUploadFile.jsx +145 -0
- package/src/framework/components/field/upload/FieldUploadImage.d.ts +7 -0
- package/src/framework/components/field/upload/FieldUploadImage.jsx +16 -0
- package/src/framework/components/field/upload/index.jsx +3 -0
- package/src/framework/components/index.js +25 -0
- package/src/framework/components/system.jsx +29 -0
- package/src/framework/components/view/ViewBoolean.jsx +15 -0
- package/src/framework/components/view/ViewBooleanEnableDisable.jsx +16 -0
- package/src/framework/components/view/ViewEllipsis.d.ts +11 -0
- package/src/framework/components/view/ViewEllipsis.jsx +30 -0
- package/src/framework/components/view/ViewFile.d.ts +10 -0
- package/src/framework/components/view/ViewFile.jsx +50 -0
- package/src/framework/components/view/ViewFileButton.d.ts +10 -0
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +9 -0
- package/src/framework/components/view/ViewImage.jsx +61 -0
- package/src/framework/components/view/ViewPassword.jsx +24 -0
- package/src/framework/components/view/ViewRange/index.d.ts +16 -0
- package/src/framework/components/view/ViewRange/index.jsx +20 -0
- package/src/framework/components/view/ViewText.jsx +9 -0
- package/src/framework/components/view/index.js +12 -0
- package/src/framework/index.js +3 -0
- package/src/framework/system/FormRegistry.js +58 -0
- package/src/framework/system/dict.js +88 -0
- package/src/framework/system/http.jsx +290 -0
- package/src/framework/system/index.js +13 -0
- package/src/framework/system/page.js +109 -0
- package/src/framework/system/permission.js +44 -0
- package/src/framework/system/sys.js +60 -0
- package/src/framework/system/theme.js +17 -0
- package/src/framework/utils/arr.js +118 -0
- package/src/framework/utils/browser.js +24 -0
- package/src/framework/utils/color.js +269 -0
- package/src/framework/utils/date.js +173 -0
- package/src/framework/utils/debounce.js +33 -0
- package/src/framework/utils/dom.js +16 -0
- package/src/framework/utils/eventBus.js +70 -0
- package/src/framework/utils/html.js +13 -0
- package/src/framework/utils/index.js +17 -0
- package/src/framework/utils/obj.js +72 -0
- package/src/framework/utils/storage.js +37 -0
- package/src/framework/utils/str.js +297 -0
- package/src/framework/utils/tree.js +175 -0
- package/src/framework/utils/uid.js +76 -0
- package/src/framework/utils/url.js +84 -0
- package/src/framework/utils/validate.js +9 -0
- package/src/index.js +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 +174 -0
- package/src/layouts/admin/index.less +64 -0
- package/src/layouts/index.jsx +163 -0
- package/src/layouts/index.less +45 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +14 -0
- package/src/pages/api/accessLog/index.jsx +108 -0
- package/src/pages/api/accountResource/index.jsx +149 -0
- package/src/pages/api/doc.jsx +135 -0
- package/src/pages/api/index.jsx +163 -0
- package/src/pages/api/resource.jsx +18 -0
- package/src/pages/flowable/design/index.css +7 -0
- package/src/pages/flowable/design/index.jsx +297 -0
- package/src/pages/flowable/index.jsx +128 -0
- package/src/pages/flowable/instance/view.jsx +13 -0
- package/src/pages/flowable/monitor.jsx +106 -0
- package/src/pages/flowable/task/form.jsx +99 -0
- package/src/pages/flowable/task/index.jsx +200 -0
- package/src/pages/flowable/test/form.jsx +31 -0
- package/src/pages/flowable/test/index.jsx +54 -0
- package/src/pages/index.jsx +25 -0
- package/src/pages/job/index.jsx +239 -0
- package/src/pages/job/logList.jsx +100 -0
- package/src/pages/job/status.jsx +84 -0
- package/src/pages/login.jsx +144 -0
- package/src/pages/login.less +53 -0
- package/src/pages/system/config/index.jsx +136 -0
- package/src/pages/system/dict/Dict.jsx +73 -0
- package/src/pages/system/dict/DictItem.jsx +177 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +152 -0
- package/src/pages/system/log/index.jsx +78 -0
- package/src/pages/system/org/index.jsx +263 -0
- package/src/pages/system/role/index.jsx +314 -0
- package/src/pages/system/role/perm.jsx +111 -0
- package/src/pages/system/sysManual/index.jsx +127 -0
- package/src/pages/system/user/UserPerm.jsx +132 -0
- package/src/pages/system/user/index.jsx +261 -0
- package/src/pages/test.jsx +16 -0
- package/src/pages/ureport/index.jsx +43 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +63 -0
- package/src/pages/userCenter/message.jsx +105 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {Tree} from "antd";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default class extends React.Component{
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
return <Tree
|
|
9
|
+
multiple
|
|
10
|
+
checkable
|
|
11
|
+
onCheck={this.onCheck}
|
|
12
|
+
checkedKeys={checked}
|
|
13
|
+
treeData={treeData}
|
|
14
|
+
defaultExpandAll
|
|
15
|
+
checkStrictly
|
|
16
|
+
|
|
17
|
+
>
|
|
18
|
+
</Tree>
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './index.less'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 上下间隔
|
|
6
|
+
*/
|
|
7
|
+
export class Gap extends React.Component {
|
|
8
|
+
|
|
9
|
+
render() {
|
|
10
|
+
const {n =0} = this.props;
|
|
11
|
+
let height = 16 + 8 * n
|
|
12
|
+
|
|
13
|
+
return <div className='tmgg-gap' style={{height}}></div>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {PermUtil} from "../system";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 使用该组件,可以判断权限
|
|
6
|
+
* @param
|
|
7
|
+
*/
|
|
8
|
+
export class HasPerm extends React.Component {
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
let {code} = this.props;
|
|
12
|
+
|
|
13
|
+
if (PermUtil.hasPermission(code)) {
|
|
14
|
+
return this.props.children;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Modal} from 'antd';
|
|
3
|
+
import {SysUtil} from "../system";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 可以使用 fileId 或 url 属性
|
|
8
|
+
*
|
|
9
|
+
* // 推荐使用 , 支持id, url, 并支持逗号分隔符
|
|
10
|
+
* value?: string | string[];
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export class ImageView extends React.Component {
|
|
15
|
+
preview = (url) => {
|
|
16
|
+
Modal.info({
|
|
17
|
+
title: '预览图片',
|
|
18
|
+
width: '70vw',
|
|
19
|
+
content: <img src={url} width="100%" />,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
render() {
|
|
24
|
+
let vs = this.props.id
|
|
25
|
+
|
|
26
|
+
if (!vs) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (typeof vs === 'string') {
|
|
31
|
+
vs = vs.split(',');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let urlList = [];
|
|
35
|
+
for (let v of vs) {
|
|
36
|
+
let isId = v.indexOf('/') === -1;
|
|
37
|
+
let isAbsUrl = v.startsWith('http');
|
|
38
|
+
if (isAbsUrl) {
|
|
39
|
+
urlList.push(v);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isId) {
|
|
44
|
+
urlList.push(SysUtil.getServerUrl() + 'sysFile/preview/' + v);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
urlList.push(SysUtil.getServerUrl() + v);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const imgs = urlList.map((url) => (
|
|
52
|
+
<img
|
|
53
|
+
style={{ display: 'inline-block' }}
|
|
54
|
+
key={url}
|
|
55
|
+
src={url}
|
|
56
|
+
onClick={() => this.preview(url)}
|
|
57
|
+
width={60}
|
|
58
|
+
height={60}
|
|
59
|
+
/>
|
|
60
|
+
));
|
|
61
|
+
|
|
62
|
+
return imgs;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
declare type 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,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button} from "antd";
|
|
3
|
+
import {PageUtil} from "../system";
|
|
4
|
+
|
|
5
|
+
export class LinkButton extends React.Component {
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
const {path,label, children, size='small', ...rest} = this.props;
|
|
9
|
+
return <Button size={size} {...rest} onClick={()=>{
|
|
10
|
+
PageUtil.open(path,label)
|
|
11
|
+
}}>{children}</Button>
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Input, message, Modal, Typography} from "antd";
|
|
3
|
+
|
|
4
|
+
export class MsgBox {
|
|
5
|
+
|
|
6
|
+
static _ref = React.createRef();
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
static toast(msg, success=true){
|
|
10
|
+
if(success){
|
|
11
|
+
message.success(msg)
|
|
12
|
+
}else {
|
|
13
|
+
message.error(msg)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static alert(msg, title = '提示') {
|
|
19
|
+
let instance = this._ref.current;
|
|
20
|
+
if (instance) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
instance.show('alert', msg, title, resolve);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return Promise.resolve(false);
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static confirm(msg, title = '确认') {
|
|
30
|
+
console.log('confirm', this._ref.current)
|
|
31
|
+
let instance = this._ref.current;
|
|
32
|
+
if (instance) {
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
instance.show('confirm', msg, title, resolve);
|
|
35
|
+
});
|
|
36
|
+
}else {
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
return Promise.resolve(false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static prompt(msg, defaultValue = '', title = '输入') {
|
|
43
|
+
let instance = this._ref.current;
|
|
44
|
+
if (instance) {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
instance.show('prompt', msg, title, resolve);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return Promise.resolve(null);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class MsgBoxComponent extends React.Component {
|
|
54
|
+
|
|
55
|
+
state = {
|
|
56
|
+
open: false,
|
|
57
|
+
title: '提示',
|
|
58
|
+
type: 'alert',
|
|
59
|
+
msg: null,
|
|
60
|
+
inputValue: '',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
resolvePromise = null; //
|
|
64
|
+
|
|
65
|
+
componentDidMount() {
|
|
66
|
+
MsgBox._ref.current = this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
componentWillUnmount() {
|
|
70
|
+
if (MsgBox._ref.current === this) {
|
|
71
|
+
MsgBox._ref.current = null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
show = (type, msg, title, resolvePromise) => {
|
|
76
|
+
this.setState({
|
|
77
|
+
open: true,
|
|
78
|
+
type: type,
|
|
79
|
+
msg: msg,
|
|
80
|
+
title: title,
|
|
81
|
+
inputValue: type === 'prompt' ? (this.state.inputValue || '') : '',
|
|
82
|
+
});
|
|
83
|
+
this.resolvePromise = resolvePromise
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
handleOk = () => {
|
|
87
|
+
const {type, inputValue} = this.state;
|
|
88
|
+
const resolvePromise = this.resolvePromise
|
|
89
|
+
|
|
90
|
+
this.setState({open: false});
|
|
91
|
+
|
|
92
|
+
if (resolvePromise) {
|
|
93
|
+
switch (type) {
|
|
94
|
+
case 'confirm':
|
|
95
|
+
resolvePromise(true);
|
|
96
|
+
break;
|
|
97
|
+
case 'prompt':
|
|
98
|
+
resolvePromise(inputValue);
|
|
99
|
+
break;
|
|
100
|
+
default:
|
|
101
|
+
resolvePromise(null);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
handleCancel = () => {
|
|
108
|
+
const {type, resolvePromise} = this.state;
|
|
109
|
+
|
|
110
|
+
this.setState({open: false});
|
|
111
|
+
|
|
112
|
+
if (resolvePromise) {
|
|
113
|
+
switch (type) {
|
|
114
|
+
case 'confirm':
|
|
115
|
+
resolvePromise(false);
|
|
116
|
+
break;
|
|
117
|
+
case 'prompt':
|
|
118
|
+
resolvePromise(null);
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
resolvePromise(null);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
handleInputChange = (e) => {
|
|
128
|
+
this.setState({inputValue: e.target.value});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
renderContent = () => {
|
|
132
|
+
const {type, msg, inputValue} = this.state;
|
|
133
|
+
|
|
134
|
+
switch (type) {
|
|
135
|
+
case 'alert':
|
|
136
|
+
case 'confirm':
|
|
137
|
+
return <Typography.Text>{msg}</Typography.Text>;
|
|
138
|
+
case 'prompt':
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
<Typography.Text>{msg}</Typography.Text>
|
|
142
|
+
<Input
|
|
143
|
+
value={inputValue}
|
|
144
|
+
onChange={this.handleInputChange}
|
|
145
|
+
placeholder="请输入内容"
|
|
146
|
+
/>
|
|
147
|
+
</>
|
|
148
|
+
);
|
|
149
|
+
default:
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
const {type} = this.state;
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<Modal
|
|
158
|
+
open={this.state.open}
|
|
159
|
+
title={this.state.title}
|
|
160
|
+
destroyOnHidden={true}
|
|
161
|
+
maskClosable={false}
|
|
162
|
+
onOk={this.handleOk}
|
|
163
|
+
onCancel={this.handleCancel}
|
|
164
|
+
okText='确定'
|
|
165
|
+
cancelText='取消'
|
|
166
|
+
width={400}
|
|
167
|
+
transitionName=""
|
|
168
|
+
maskTransitionName=""
|
|
169
|
+
footer={(node, {OkBtn, CancelBtn}) => {
|
|
170
|
+
if (type === 'alert') {
|
|
171
|
+
return <OkBtn/> // 不要取消按钮
|
|
172
|
+
}
|
|
173
|
+
return node;
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{this.renderContent()}
|
|
177
|
+
</Modal>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Icons from '@ant-design/icons';
|
|
2
|
+
|
|
3
|
+
declare type NamedIconProps = {
|
|
4
|
+
name: string
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function NamedIcon(props:NamedIconProps){
|
|
8
|
+
let {name, ...rest} = props;
|
|
9
|
+
const IconType = Icons[name]
|
|
10
|
+
|
|
11
|
+
if(IconType){
|
|
12
|
+
return <IconType {...rest}></IconType>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {Alert, Skeleton, Tree} from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {HttpUtil} from "../system";
|
|
4
|
+
import * as Icons from '@ant-design/icons';
|
|
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
|
+
HttpUtil.get('admin/sysOrg/unitTree').then(tree => {
|
|
19
|
+
this.setState({treeData: tree,treeDataLoading: false})
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
onSelectOrg = orgIds => {
|
|
24
|
+
let orgId = orgIds[0] || null;
|
|
25
|
+
this.props.onChange(orgId)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
render() {
|
|
30
|
+
let {treeData, treeDataLoading} = this.state
|
|
31
|
+
if (treeDataLoading) {
|
|
32
|
+
return <Skeleton title='加载中...'/>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (treeData.length === 0) {
|
|
36
|
+
return <Alert type={"warning"} message={'组织机构数据为空'}>
|
|
37
|
+
</Alert>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return <Tree
|
|
41
|
+
treeData={treeData}
|
|
42
|
+
defaultExpandAll
|
|
43
|
+
onSelect={this.onSelectOrg}
|
|
44
|
+
showIcon
|
|
45
|
+
blockNode
|
|
46
|
+
icon={item=>{
|
|
47
|
+
const icon = Icons[item.iconName]
|
|
48
|
+
if(icon){
|
|
49
|
+
return React.createElement(icon)
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
</Tree>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './index.less'
|
|
3
|
+
import {theme} from "../../system";
|
|
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 = theme["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,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Alert, Spin} from "antd";
|
|
3
|
+
import {theme} from "../system";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 页面加载中的动画
|
|
7
|
+
*/
|
|
8
|
+
export class PageLoading extends React.Component {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
const msg = this.props.message || '页面加载中...';
|
|
13
|
+
|
|
14
|
+
return <div style={{height: '100vh', width: '100%',
|
|
15
|
+
display:'flex', alignItems:'center', justifyContent:"center",
|
|
16
|
+
color:theme["primary-color"]
|
|
17
|
+
}}>
|
|
18
|
+
<div style={{textAlign:"center", marginTop:'-10rem'}}>
|
|
19
|
+
<div>
|
|
20
|
+
<Spin size={"large"}></Spin>
|
|
21
|
+
</div>
|
|
22
|
+
<div style={{marginTop:'1rem'}}>
|
|
23
|
+
<Alert message={msg}></Alert>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './index.less'
|
|
3
|
+
import {Card, Empty, Spin} from "antd";
|
|
4
|
+
|
|
5
|
+
export class Panel extends React.Component{
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
return <Card title={this.props.title} size='small'>
|
|
9
|
+
{this.renderContent()}
|
|
10
|
+
</Card>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
renderContent(){
|
|
14
|
+
if(this.props.loading){
|
|
15
|
+
return <Spin />
|
|
16
|
+
}
|
|
17
|
+
if(this.props.empty){
|
|
18
|
+
return <Empty />
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return this.props.children || <Empty />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
File without changes
|
|
@@ -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
|
+
}
|