@jiangood/open-admin 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/common-plugin.js +94 -0
- package/config/config.js +58 -0
- package/config/utils.js +73 -0
- package/package.json +42 -0
- package/src/.umi-production/appData.json +2365 -0
- package/src/.umi-production/core/EmptyRoute.tsx +9 -0
- package/src/.umi-production/core/defineApp.ts +16 -0
- package/src/.umi-production/core/helmet.ts +10 -0
- package/src/.umi-production/core/helmetContext.ts +4 -0
- package/src/.umi-production/core/history.ts +72 -0
- package/src/.umi-production/core/historyIntelli.ts +132 -0
- package/src/.umi-production/core/plugin.ts +40 -0
- package/src/.umi-production/core/pluginConfig.ts +324 -0
- package/src/.umi-production/core/pluginConfigJoi.d.ts +7 -0
- package/src/.umi-production/core/polyfill.ts +220 -0
- package/src/.umi-production/core/route.tsx +54 -0
- package/src/.umi-production/core/routeProps.js +5 -0
- package/src/.umi-production/core/routeProps.ts +6 -0
- package/src/.umi-production/core/terminal.ts +37 -0
- package/src/.umi-production/exports.ts +17 -0
- package/src/.umi-production/testBrowser.tsx +90 -0
- package/src/.umi-production/tsconfig.json +44 -0
- package/src/.umi-production/typings.d.ts +136 -0
- package/src/.umi-production/umi.ts +83 -0
- package/src/framework/components/DownloadFileButton/index.d.ts +11 -0
- package/src/framework/components/DownloadFileButton/index.jsx +33 -0
- package/src/framework/components/Gap/index.d.ts +23 -0
- package/src/framework/components/Gap/index.jsx +46 -0
- package/src/framework/components/LinkButton/index.d.ts +14 -0
- package/src/framework/components/LinkButton/index.jsx +10 -0
- package/src/framework/components/NamedIcon/index.d.ts +5 -0
- package/src/framework/components/NamedIcon/index.jsx +11 -0
- package/src/framework/components/OrgTree/index.d.ts +4 -0
- package/src/framework/components/OrgTree/index.jsx +58 -0
- package/src/framework/components/Page/index.d.ts +17 -0
- package/src/framework/components/Page/index.jsx +30 -0
- package/src/framework/components/Page/index.less +10 -0
- package/src/framework/components/PageLoading/index.d.ts +1 -0
- package/src/framework/components/PageLoading/index.jsx +25 -0
- package/src/framework/components/ProModal/index.tsx +66 -0
- package/src/framework/components/ProTable/components/ToolBar/index.jsx +123 -0
- package/src/framework/components/ProTable/components/ToolBar/index.less +53 -0
- package/src/framework/components/ProTable/index.d.ts +42 -0
- package/src/framework/components/ProTable/index.jsx +260 -0
- package/src/framework/components/ProTable/index.less +14 -0
- package/src/framework/components/ProTable/utils/index.js +43 -0
- package/src/framework/components/RoleTree/index.d.ts +4 -0
- package/src/framework/components/RoleTree/index.jsx +50 -0
- package/src/framework/components/ValueType/index.jsx +34 -0
- package/src/framework/components/ValueType/registry.jsx +26 -0
- package/src/framework/components/ViewRange/index.d.ts +14 -0
- package/src/framework/components/ViewRange/index.jsx +20 -0
- package/src/framework/components/index.ts +13 -0
- package/src/framework/components/system/ButtonList.d.ts +8 -0
- package/src/framework/components/system/ButtonList.jsx +42 -0
- package/src/framework/components/system/HasPerm.tsx +14 -0
- package/src/framework/components/system/index.tsx +29 -0
- package/src/framework/fields/FieldBoolean/index.d.ts +9 -0
- package/src/framework/fields/FieldBoolean/index.jsx +73 -0
- package/src/framework/fields/FieldDate/index.d.ts +23 -0
- package/src/framework/fields/FieldDate/index.jsx +116 -0
- package/src/framework/fields/FieldDateRange/index.d.ts +22 -0
- package/src/framework/fields/FieldDateRange/index.jsx +103 -0
- package/src/framework/fields/FieldDictSelect/index.d.ts +12 -0
- package/src/framework/fields/FieldDictSelect/index.jsx +16 -0
- package/src/framework/fields/FieldEditor/index.d.ts +14 -0
- package/src/framework/fields/FieldEditor/index.jsx +59 -0
- package/src/framework/fields/FieldNumberRange/index.d.ts +10 -0
- package/src/framework/fields/FieldNumberRange/index.jsx +55 -0
- package/src/framework/fields/FieldPercent/index.d.ts +8 -0
- package/src/framework/fields/FieldPercent/index.jsx +30 -0
- package/src/framework/fields/FieldRemoteSelect/index.d.ts +44 -0
- package/src/framework/fields/FieldRemoteSelect/index.jsx +125 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.jsx +85 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +21 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.jsx +88 -0
- package/src/framework/fields/FieldRemoteTree/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTree/index.jsx +50 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.d.ts +18 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.jsx +59 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +19 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.jsx +57 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.jsx +62 -0
- package/src/framework/fields/FieldSysOrgTree/index.d.ts +9 -0
- package/src/framework/fields/FieldSysOrgTree/index.jsx +20 -0
- package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +9 -0
- package/src/framework/fields/FieldSysOrgTreeSelect/index.jsx +22 -0
- package/src/framework/fields/FieldTable/index.d.ts +14 -0
- package/src/framework/fields/FieldTable/index.jsx +108 -0
- package/src/framework/fields/FieldTable/styles.less +29 -0
- package/src/framework/fields/FieldTableSelect/index.d.ts +19 -0
- package/src/framework/fields/FieldTableSelect/index.jsx +60 -0
- package/src/framework/fields/FieldUploadFile/index.d.ts +31 -0
- package/src/framework/fields/FieldUploadFile/index.jsx +139 -0
- package/src/framework/fields/index.ts +22 -0
- package/src/framework/fields/types.ts +16 -0
- package/src/framework/index.ts +5 -0
- package/src/framework/pages/LoginPage.d.ts +16 -0
- package/src/framework/pages/LoginPage.jsx +135 -0
- package/src/framework/pages/LoginPage.less +53 -0
- package/src/framework/pages/LoginPageUtils.ts +36 -0
- package/src/framework/pages/index.ts +2 -0
- package/src/framework/utils/ArrUtils.ts +229 -0
- package/src/framework/utils/ColorsUtils.ts +378 -0
- package/src/framework/utils/DateUtils.ts +187 -0
- package/src/framework/utils/DeviceUtils.ts +46 -0
- package/src/framework/utils/DomUtils.ts +50 -0
- package/src/framework/utils/EventBusUtils.ts +144 -0
- package/src/framework/utils/Logger.ts +40 -0
- package/src/framework/utils/MessageUtils.tsx +170 -0
- package/src/framework/utils/ObjectUtils.ts +118 -0
- package/src/framework/utils/StorageUtils.ts +50 -0
- package/src/framework/utils/StringUtils.ts +436 -0
- package/src/framework/utils/TreeUtils.ts +251 -0
- package/src/framework/utils/UrlUtils.ts +152 -0
- package/src/framework/utils/UuidUtils.ts +88 -0
- package/src/framework/utils/ValidateUtils.ts +28 -0
- package/src/framework/utils/index.ts +15 -0
- package/src/framework/utils/system/DictUtils.ts +97 -0
- package/src/framework/utils/system/FormRegistryUtils.ts +77 -0
- package/src/framework/utils/system/HttpUtils.ts +247 -0
- package/src/framework/utils/system/PageUtils.ts +163 -0
- package/src/framework/utils/system/PermUtils.ts +79 -0
- package/src/framework/utils/system/SysUtils.ts +97 -0
- package/src/framework/utils/system/ThemeUtils.ts +27 -0
- package/src/framework/utils/system/index.ts +7 -0
- package/src/framework/views/ViewApproveStatus/index.d.ts +3 -0
- package/src/framework/views/ViewApproveStatus/index.jsx +21 -0
- package/src/framework/views/ViewBoolean/index.d.ts +3 -0
- package/src/framework/views/ViewBoolean/index.jsx +4 -0
- package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +5 -0
- package/src/framework/views/ViewBooleanEnableDisable/index.jsx +15 -0
- package/src/framework/views/ViewFile/index.d.ts +10 -0
- package/src/framework/views/ViewFile/index.jsx +49 -0
- package/src/framework/views/ViewFileButton/index.d.ts +10 -0
- package/src/framework/views/ViewFileButton/index.jsx +22 -0
- package/src/framework/views/ViewImage/index.d.ts +6 -0
- package/src/framework/views/ViewImage/index.jsx +60 -0
- package/src/framework/views/ViewPassword/index.d.ts +5 -0
- package/src/framework/views/ViewPassword/index.jsx +24 -0
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +12 -0
- package/src/framework/views/ViewProcessInstanceProgress/index.jsx +97 -0
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +6 -0
- package/src/framework/views/ViewProcessInstanceProgressButton/index.jsx +24 -0
- package/src/framework/views/ViewText/index.d.ts +16 -0
- package/src/framework/views/ViewText/index.jsx +42 -0
- package/src/framework/views/index.ts +12 -0
- package/src/framework/views/types.ts +26 -0
- package/src/index.ts +2 -0
- package/src/layouts/PageRender.d.ts +22 -0
- package/src/layouts/PageRender.jsx +90 -0
- package/src/layouts/admin/HeaderRight.jsx +104 -0
- package/src/layouts/admin/TabPageRender.jsx +158 -0
- package/src/layouts/admin/index.jsx +159 -0
- package/src/layouts/admin/index.less +65 -0
- package/src/layouts/index.jsx +187 -0
- package/src/layouts/index.less +24 -0
- package/src/loading.jsx +18 -0
- package/src/pages/404.jsx +13 -0
- package/src/pages/about.jsx +12 -0
- package/src/pages/index.jsx +10 -0
- package/src/pages/login.jsx +16 -0
- package/src/pages/system/api/ApiDoc.jsx +148 -0
- package/src/pages/system/api/index.jsx +267 -0
- package/src/pages/system/api/perm.jsx +69 -0
- package/src/pages/system/dict/Dict.jsx +67 -0
- package/src/pages/system/dict/DictItem.jsx +175 -0
- package/src/pages/system/dict/index.jsx +25 -0
- package/src/pages/system/file/index.jsx +147 -0
- package/src/pages/system/job/index.jsx +324 -0
- package/src/pages/system/log/index.jsx +77 -0
- package/src/pages/system/org/index.jsx +260 -0
- package/src/pages/system/role/index.jsx +302 -0
- package/src/pages/system/role/perm.jsx +107 -0
- package/src/pages/system/sysManual/index.jsx +126 -0
- package/src/pages/system/user/UserPerm.jsx +94 -0
- package/src/pages/system/user/index.jsx +253 -0
- package/src/pages/test/views.jsx +95 -0
- package/src/pages/ureport/index.jsx +16 -0
- package/src/pages/userCenter/ChangePassword.jsx +64 -0
- package/src/pages/userCenter/index.jsx +90 -0
- package/src/pages/userCenter/manual.jsx +57 -0
- package/src/pages/userCenter/message.jsx +103 -0
- package/src/style/global.less +51 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {DictUtils} from "../../utils";
|
|
2
|
+
import {Tag} from "antd";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 查看审批状态组件
|
|
6
|
+
* @param props
|
|
7
|
+
* @constructor
|
|
8
|
+
*/
|
|
9
|
+
export function ViewApproveStatus(props) {
|
|
10
|
+
let {value} = props;
|
|
11
|
+
let txt= DictUtils.dictLabel('approveStatus', value)
|
|
12
|
+
|
|
13
|
+
const colorMap = {
|
|
14
|
+
'DRAFT': 'orange',
|
|
15
|
+
'PENDING': 'blue',
|
|
16
|
+
'APPROVED': 'green',
|
|
17
|
+
'REJECTED': 'red'
|
|
18
|
+
};
|
|
19
|
+
let color = colorMap[value]
|
|
20
|
+
return <Tag color={color}>{txt}</Tag> ;
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from 'antd';
|
|
3
|
+
|
|
4
|
+
export class ViewBooleanEnableDisable extends React.Component {
|
|
5
|
+
|
|
6
|
+
render() {
|
|
7
|
+
const { value } = this.props;
|
|
8
|
+
|
|
9
|
+
if (value == null) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return value ? <Tag color={"green"}>启用</Tag> : <Tag color={"red"}>禁用</Tag>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Carousel, Empty} from 'antd';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class ViewFile extends React.Component {
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
render() {
|
|
9
|
+
let fileId = this.props.value
|
|
10
|
+
|
|
11
|
+
if (!fileId) {
|
|
12
|
+
return <Empty/>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let arr = fileId.split(',');
|
|
16
|
+
|
|
17
|
+
let urlList = arr.map(id => 'admin/sysFile/preview/' + id);
|
|
18
|
+
let height = this.props.height;
|
|
19
|
+
|
|
20
|
+
if(urlList.length === 1){
|
|
21
|
+
const url = urlList[0]
|
|
22
|
+
return <iframe
|
|
23
|
+
src={url}
|
|
24
|
+
width='99%'
|
|
25
|
+
frameBorder={0}
|
|
26
|
+
style={{height}}
|
|
27
|
+
/>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 多个文件则用走马灯
|
|
31
|
+
const iframeList = urlList.map((url) => {
|
|
32
|
+
return <div style={{height}}>
|
|
33
|
+
<iframe
|
|
34
|
+
key={url}
|
|
35
|
+
src={url}
|
|
36
|
+
width='99%'
|
|
37
|
+
frameBorder={0}
|
|
38
|
+
style={{height}}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return <div style={{height}}>
|
|
44
|
+
<Carousel dotPosition={"top"}>
|
|
45
|
+
{iframeList}
|
|
46
|
+
</Carousel>
|
|
47
|
+
</div>
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button} from "antd";
|
|
3
|
+
import { MessageUtils } from "../../utils";
|
|
4
|
+
import { ViewFile } from "../ViewFile";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 文件按钮查看组件
|
|
8
|
+
*/
|
|
9
|
+
export class ViewFileButton extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
const {value, height} = this.props;
|
|
12
|
+
if (!value) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return <Button type="link" size="small" onClick={()=>{
|
|
17
|
+
MessageUtils.alert(<ViewFile value={this.props.value} />)
|
|
18
|
+
}}>
|
|
19
|
+
查看文件
|
|
20
|
+
</Button>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Modal} from 'antd';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class ViewImage extends React.Component {
|
|
6
|
+
|
|
7
|
+
render() {
|
|
8
|
+
let vs = this.props.value
|
|
9
|
+
|
|
10
|
+
if (!vs) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof vs === 'string') {
|
|
15
|
+
vs = vs.split(',');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let urlList = [];
|
|
19
|
+
for (let v of vs) {
|
|
20
|
+
let isId = v.indexOf('/') === -1;
|
|
21
|
+
let isAbsUrl = v.startsWith('http');
|
|
22
|
+
if (isAbsUrl) {
|
|
23
|
+
urlList.push(v);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (isId) {
|
|
28
|
+
urlList.push( 'admin/sysFile/preview/' + v);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
urlList.push( v);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const imgs = urlList.map((url) => (
|
|
36
|
+
<img
|
|
37
|
+
style={{ display: 'inline-block' }}
|
|
38
|
+
key={url}
|
|
39
|
+
src={url}
|
|
40
|
+
onClick={() => this.preview(url)}
|
|
41
|
+
width={60}
|
|
42
|
+
height={60}
|
|
43
|
+
/>
|
|
44
|
+
));
|
|
45
|
+
|
|
46
|
+
return imgs;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
preview = (url) => {
|
|
50
|
+
Modal.info({
|
|
51
|
+
title: '预览图片',
|
|
52
|
+
width: '70vw',
|
|
53
|
+
content: <div style={{maxHeight:'70vh',overflow:'auto'}}>
|
|
54
|
+
<img src={url} style={{maxWidth: '100%'}}/>
|
|
55
|
+
</div>,
|
|
56
|
+
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Space} from "antd";
|
|
3
|
+
import {EyeInvisibleOutlined, EyeOutlined} from "@ant-design/icons";
|
|
4
|
+
|
|
5
|
+
export class ViewPassword extends React.Component {
|
|
6
|
+
|
|
7
|
+
state = {
|
|
8
|
+
visible: false
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
let v = this.props.value;
|
|
13
|
+
if (v == null) {
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
let visible = this.state.visible;
|
|
17
|
+
return <Space>
|
|
18
|
+
<span>{this.state.visible ? v : '******'}</span>
|
|
19
|
+
<a onClick={() => this.setState({visible: !visible})}>
|
|
20
|
+
{visible ? <EyeOutlined/> : <EyeInvisibleOutlined/>}
|
|
21
|
+
</a>
|
|
22
|
+
</Space>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Empty, Modal, Skeleton, Table, Typography} from "antd";
|
|
3
|
+
import {Gap} from "../../components"; import {HttpUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 查看流程处理情况(不含表单)
|
|
7
|
+
*/
|
|
8
|
+
export class ViewProcessInstanceProgress extends React.Component {
|
|
9
|
+
|
|
10
|
+
state = {
|
|
11
|
+
instanceCommentList: [],
|
|
12
|
+
vars: {},
|
|
13
|
+
|
|
14
|
+
id: null,
|
|
15
|
+
starter: null,
|
|
16
|
+
startTime: null,
|
|
17
|
+
name: null,
|
|
18
|
+
|
|
19
|
+
data: {
|
|
20
|
+
commentList: [],
|
|
21
|
+
img: null
|
|
22
|
+
},
|
|
23
|
+
loading: true,
|
|
24
|
+
|
|
25
|
+
errorMsg: null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
const {value} = this.props;
|
|
31
|
+
HttpUtils.get("admin/flowable/my/getInstanceInfo", {businessKey: value}).then(rs => {
|
|
32
|
+
this.setState(rs)
|
|
33
|
+
this.setState({data: rs})
|
|
34
|
+
}).catch(e => {
|
|
35
|
+
this.setState({errorMsg: e})
|
|
36
|
+
}).finally(() => {
|
|
37
|
+
this.setState({loading: false})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
onImgClick = () => {
|
|
43
|
+
const {data} = this.state
|
|
44
|
+
|
|
45
|
+
const {img} = data
|
|
46
|
+
Modal.info({
|
|
47
|
+
title: '流程图',
|
|
48
|
+
width: '70vw',
|
|
49
|
+
content: <div style={{width: '100%', overflow: 'auto', maxHeight: '80vh'}}><img src={img}/></div>
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
if (this.state.errorMsg) {
|
|
55
|
+
return <Empty description={this.state.errorMsg}></Empty>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const {data, loading} = this.state
|
|
59
|
+
const {commentList, img} = data
|
|
60
|
+
if (loading) {
|
|
61
|
+
return <Skeleton/>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
return <>
|
|
66
|
+
<Typography.Title level={4}>{data.name}</Typography.Title>
|
|
67
|
+
<Typography.Text type="secondary">{data.starter} {data.startTime}</Typography.Text>
|
|
68
|
+
<Gap></Gap>
|
|
69
|
+
<img src={img} style={{maxWidth: '100%'}}
|
|
70
|
+
onClick={this.onImgClick}/>
|
|
71
|
+
<Gap></Gap>
|
|
72
|
+
<Table dataSource={commentList}
|
|
73
|
+
|
|
74
|
+
size='small'
|
|
75
|
+
pagination={false}
|
|
76
|
+
rowKey='id'
|
|
77
|
+
columns={[
|
|
78
|
+
{
|
|
79
|
+
dataIndex: 'content',
|
|
80
|
+
title: '操作'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
dataIndex: 'user',
|
|
84
|
+
title: '处理人'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
dataIndex: 'time',
|
|
88
|
+
title: '处理时间'
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
</>
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button} from "antd";
|
|
3
|
+
import {MessageUtils} from "../../utils";
|
|
4
|
+
import {ViewProcessInstanceProgress} from "../ViewProcessInstanceProgress";
|
|
5
|
+
|
|
6
|
+
export class ViewProcessInstanceProgressButton extends React.Component {
|
|
7
|
+
state = {
|
|
8
|
+
open:false,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
onClick = () => {
|
|
12
|
+
console.log('点击追踪流程')
|
|
13
|
+
let content = <ViewProcessInstanceProgress value={this.props.value} />;
|
|
14
|
+
MessageUtils.alert(content,{
|
|
15
|
+
title:'流程审批信息',
|
|
16
|
+
width:800
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
render() {
|
|
20
|
+
return <Button onClick={this.onClick} size='small'>追踪流程</Button>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewProps } from "../types";
|
|
3
|
+
|
|
4
|
+
interface ViewTextProps extends ViewProps<string> {
|
|
5
|
+
/**
|
|
6
|
+
* 是否启用文本省略
|
|
7
|
+
*/
|
|
8
|
+
ellipsis?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 文本省略的最大长度
|
|
11
|
+
*/
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class ViewText extends React.Component<ViewTextProps, any> {
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Typography, Button, Modal, Popover} from "antd";
|
|
3
|
+
import {StringUtils} from "../../utils";
|
|
4
|
+
|
|
5
|
+
export class ViewText extends React.Component {
|
|
6
|
+
|
|
7
|
+
static defaultProps = {
|
|
8
|
+
ellipsis: false,
|
|
9
|
+
maxLength: 15
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
render() {
|
|
13
|
+
const {value, ellipsis, maxLength} = this.props;
|
|
14
|
+
|
|
15
|
+
if(value == null){
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 如果没有启用 ellipsis,使用普通文本显示
|
|
20
|
+
if (!ellipsis) {
|
|
21
|
+
return <Typography.Text> {value}</Typography.Text>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 如果启用了 ellipsis,使用省略功能
|
|
25
|
+
const short = StringUtils.ellipsis(value, maxLength);
|
|
26
|
+
return (
|
|
27
|
+
<Popover placement="topLeft" title={'长文本'} content={<Button onClick={this.showModal}>点击查看全部内容</Button>}>
|
|
28
|
+
{short}
|
|
29
|
+
</Popover>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
showModal = () => {
|
|
34
|
+
const {value} = this.props;
|
|
35
|
+
Modal.info({
|
|
36
|
+
icon: null,
|
|
37
|
+
title: '长文本内容',
|
|
38
|
+
content: <div style={{height: 500, overflowY: 'auto'}}>{value}</div>,
|
|
39
|
+
width: 700
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 查看组件,主要是value 属性
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './ViewPassword';
|
|
4
|
+
export * from './ViewBoolean';
|
|
5
|
+
export * from './ViewApproveStatus'
|
|
6
|
+
export * from './ViewProcessInstanceProgress'
|
|
7
|
+
export * from './ViewProcessInstanceProgressButton'
|
|
8
|
+
export * from './ViewBooleanEnableDisable'
|
|
9
|
+
export * from './ViewImage'
|
|
10
|
+
export * from './ViewFile'
|
|
11
|
+
export * from './ViewText'
|
|
12
|
+
export * from './ViewFileButton'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 通用视图组件属性接口
|
|
5
|
+
* @template T - value 的类型
|
|
6
|
+
*/
|
|
7
|
+
export interface ViewProps<T> {
|
|
8
|
+
/**
|
|
9
|
+
* 视图值
|
|
10
|
+
*/
|
|
11
|
+
value?: T;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 通用视图组件类类型
|
|
16
|
+
* @template T - value 的类型
|
|
17
|
+
*/
|
|
18
|
+
export interface ViewComponent<T> extends React.ComponentClass<ViewProps<T> & any> {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 通用视图组件函数类型
|
|
23
|
+
* @template T - value 的类型
|
|
24
|
+
*/
|
|
25
|
+
export interface ViewFunctionComponent<T> extends React.FC<ViewProps<T> & any> {
|
|
26
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
declare type PageRenderProps = {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 路径 如 /flowable/task/form
|
|
8
|
+
*/
|
|
9
|
+
pathname: string;
|
|
10
|
+
/***
|
|
11
|
+
* 搜索参数 如 /?id=1
|
|
12
|
+
*/
|
|
13
|
+
search?:string;
|
|
14
|
+
|
|
15
|
+
/***
|
|
16
|
+
* 是否把location信息透传到真正页面
|
|
17
|
+
*/
|
|
18
|
+
passLocation?: boolean
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class PageRender extends React.Component<PageRenderProps, any> {
|
|
22
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {matchRoutes, useAppData} from "umi";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {Result} from "antd";
|
|
4
|
+
import {UrlUtils} from "../framework";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 通过指定 pathname 渲染页面
|
|
8
|
+
* @param props
|
|
9
|
+
* 为了规范,接收参数何router保持一致,
|
|
10
|
+
* pathname: 路径 如 /flowable/task/form
|
|
11
|
+
* search:搜索参数 如 /?id=1
|
|
12
|
+
*
|
|
13
|
+
* passLocation: 是否把location信息透传到真正页面
|
|
14
|
+
*
|
|
15
|
+
* @returns {React.JSX.Element|*}
|
|
16
|
+
* @constructor
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
let APP_DATA_CACHE = null
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 写函数组件主要为了使用hooks
|
|
24
|
+
* @param props
|
|
25
|
+
* @returns {Element}
|
|
26
|
+
* @constructor
|
|
27
|
+
*/
|
|
28
|
+
export function PageRender(props) {
|
|
29
|
+
let {pathname, search, passLocation} = props
|
|
30
|
+
|
|
31
|
+
let appData = useAppData()
|
|
32
|
+
if(Object.keys(appData).length === 0){
|
|
33
|
+
appData = APP_DATA_CACHE
|
|
34
|
+
}else {
|
|
35
|
+
APP_DATA_CACHE = appData;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return <_PageRender appData={appData} pathname={pathname} search={search}
|
|
39
|
+
passLocation={passLocation}/>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class _PageRender extends React.Component {
|
|
43
|
+
|
|
44
|
+
render() {
|
|
45
|
+
if (this.props.passLocation) {
|
|
46
|
+
return this.passLocationRender()
|
|
47
|
+
}
|
|
48
|
+
return this.defaultRender()
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
passLocationRender = () => {
|
|
52
|
+
let {pathname, search, appData} = this.props
|
|
53
|
+
|
|
54
|
+
const map = appData.routeComponents
|
|
55
|
+
const key = pathname.substring(1); // 移除第一个斜杠
|
|
56
|
+
let componentType = map[key] || map[key + '/index']
|
|
57
|
+
if (componentType) {
|
|
58
|
+
let params =search ? UrlUtils.getParams(search): {}
|
|
59
|
+
const location = {pathname, search, params}
|
|
60
|
+
return React.createElement(componentType, {location});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
defaultRender = () => {
|
|
66
|
+
let {pathname, appData} = this.props
|
|
67
|
+
let matchArr = matchRoutes(appData.clientRoutes, pathname)
|
|
68
|
+
|
|
69
|
+
if (matchArr != null) {
|
|
70
|
+
if (pathname === '/') {
|
|
71
|
+
// 匹配结果为1,表示未定义index.jsx ,导致死循环
|
|
72
|
+
if (matchArr.length === 1) { // 如果项目中没有定义index.jsx
|
|
73
|
+
return <Result icon={null} title='未定义首页'></Result>
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// 取最匹配的那个
|
|
77
|
+
const mathResult = matchArr[matchArr.length - 1].route
|
|
78
|
+
if(mathResult){
|
|
79
|
+
return mathResult.element;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 如果实在找不到页面组件,则404
|
|
84
|
+
return <Result
|
|
85
|
+
status={404}
|
|
86
|
+
title='页面不存在!'
|
|
87
|
+
subTitle={<div>路由地址:{pathname}</div>}
|
|
88
|
+
/>
|
|
89
|
+
};
|
|
90
|
+
}
|