@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,107 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Card, Checkbox, Table, Typography} from "antd";
|
|
3
|
+
import {SaveOutlined} from "@ant-design/icons";
|
|
4
|
+
import {ArrUtils, HttpUtils, PageUtils} from "../../../framework";
|
|
5
|
+
export default class extends React.Component {
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
state = {
|
|
9
|
+
loading: false,
|
|
10
|
+
roleInfo: {},
|
|
11
|
+
|
|
12
|
+
dataSource: [],
|
|
13
|
+
rowSelectedKeys: {},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
columns = [
|
|
17
|
+
{
|
|
18
|
+
title: '菜单',
|
|
19
|
+
dataIndex: 'name',
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
title: '权限',
|
|
24
|
+
dataIndex: 'permCodes',
|
|
25
|
+
render: (permCodes, record) => {
|
|
26
|
+
if (permCodes == null) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
const {permNames} = record
|
|
30
|
+
const options = [];
|
|
31
|
+
for (let i = 0; i < permCodes.length; i++) {
|
|
32
|
+
const label = permNames[i];
|
|
33
|
+
const value = permCodes[i];
|
|
34
|
+
options.push({label, value});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
let rowSelectedKey = this.state.rowSelectedKeys[record.id];
|
|
39
|
+
return <Checkbox.Group options={options}
|
|
40
|
+
value={rowSelectedKey}
|
|
41
|
+
onChange={(ks) => {
|
|
42
|
+
const rowSelectedKeys = this.state.rowSelectedKeys;
|
|
43
|
+
rowSelectedKeys[record.id] = ks;
|
|
44
|
+
this.setState({rowSelectedKeys})
|
|
45
|
+
}}/>
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
componentDidMount() {
|
|
51
|
+
this.roleId = PageUtils.currentParams().id;
|
|
52
|
+
this.loadData();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
loadData() {
|
|
57
|
+
this.setState({loading: true})
|
|
58
|
+
Promise.all([
|
|
59
|
+
HttpUtils.get('admin/sysRole/get', {id: this.roleId}).then(rs => {
|
|
60
|
+
this.setState({roleInfo: rs})
|
|
61
|
+
}),
|
|
62
|
+
HttpUtils.get('admin/sysRole/permTreeTable', {id: this.roleId}).then(rs => {
|
|
63
|
+
this.setState({dataSource: rs})
|
|
64
|
+
}),
|
|
65
|
+
HttpUtils.get('admin/sysRole/ownPerms', {id: this.roleId}).then(rs => {
|
|
66
|
+
this.setState({rowSelectedKeys: rs})
|
|
67
|
+
})
|
|
68
|
+
]).then(rs => {
|
|
69
|
+
this.setState({loading: false})
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
savePerms = () => {
|
|
74
|
+
const {rowSelectedKeys} = this.state;
|
|
75
|
+
const perms = [];
|
|
76
|
+
const menus = []
|
|
77
|
+
for (let menuId in rowSelectedKeys) {
|
|
78
|
+
const ks = rowSelectedKeys[menuId];
|
|
79
|
+
if (ks == null || ks.length === 0) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
menus.push(menuId)
|
|
83
|
+
ArrUtils.addAll(perms, ks)
|
|
84
|
+
}
|
|
85
|
+
HttpUtils.post('admin/sysRole/savePerms', {id: this.roleId, perms, menus}).then(rs => {
|
|
86
|
+
// Page.open(PageUtils.currentPathname(), PageUtils.currentLabel())
|
|
87
|
+
})
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
render() {
|
|
92
|
+
return <>
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<Card title='角色权限设置' loading={this.state.loading}
|
|
96
|
+
variant={"borderless"}
|
|
97
|
+
extra={<Button type='primary' icon={<SaveOutlined/>} onClick={this.savePerms}>保存权限</Button>}>
|
|
98
|
+
<Typography.Text>角色名称:{this.state.roleInfo.name}, 编码:{this.state.roleInfo.code} </Typography.Text>
|
|
99
|
+
<Table dataSource={this.state.dataSource}
|
|
100
|
+
columns={this.columns}
|
|
101
|
+
size='small' bordered pagination={false} rowKey='id'
|
|
102
|
+
expandable={{defaultExpandAllRows: true}}
|
|
103
|
+
></Table>
|
|
104
|
+
</Card>
|
|
105
|
+
</>
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import {ButtonList, FieldUploadFile, HttpUtils, Page, ProTable} from "../../../framework";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
formValues: {},
|
|
11
|
+
formOpen: false
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
formRef = React.createRef()
|
|
15
|
+
tableRef = React.createRef()
|
|
16
|
+
|
|
17
|
+
handleAdd = () => {
|
|
18
|
+
this.setState({formOpen: true, formValues: {}})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
handleEdit = record => {
|
|
22
|
+
this.setState({formOpen: true, formValues: record})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
onFinish = values => {
|
|
26
|
+
HttpUtils.post('admin/sysManual/save', values).then(rs => {
|
|
27
|
+
this.setState({formOpen: false})
|
|
28
|
+
this.tableRef.current.reload()
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
handleDelete = record => {
|
|
33
|
+
HttpUtils.get('admin/sysManual/delete', {id: record.id}).then(rs => {
|
|
34
|
+
this.tableRef.current.reload()
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
columns = [
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
title: '名称',
|
|
42
|
+
dataIndex: 'name',
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
title: '版本',
|
|
49
|
+
dataIndex: 'version',
|
|
50
|
+
render(version) {
|
|
51
|
+
return 'v' + version;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
title: '文件',
|
|
57
|
+
dataIndex: 'fileId',
|
|
58
|
+
render(id) {
|
|
59
|
+
const url = 'admin/sysFile/preview/' + id;
|
|
60
|
+
return <a href={url} target='_blank'>查看文件</a>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: '操作',
|
|
66
|
+
dataIndex: 'option',
|
|
67
|
+
render: (_, record) => (
|
|
68
|
+
<ButtonList>
|
|
69
|
+
<Button size='small' perm='sysManual:save' onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
70
|
+
<Popconfirm perm='sysManual:delete' title='是否确定删除操作手册'
|
|
71
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
72
|
+
<Button size='small'>删除</Button>
|
|
73
|
+
</Popconfirm>
|
|
74
|
+
</ButtonList>
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
render() {
|
|
81
|
+
return <Page>
|
|
82
|
+
<ProTable
|
|
83
|
+
actionRef={this.tableRef}
|
|
84
|
+
toolBarRender={(params, {selectedRows, selectedRowKeys}) => {
|
|
85
|
+
return <ButtonList>
|
|
86
|
+
<Button perm='sysManual:save' type='primary' onClick={this.handleAdd}>
|
|
87
|
+
<PlusOutlined/> 新增
|
|
88
|
+
</Button>
|
|
89
|
+
</ButtonList>
|
|
90
|
+
}}
|
|
91
|
+
request={(params) => HttpUtils.get('admin/sysManual/page', params)}
|
|
92
|
+
columns={this.columns}
|
|
93
|
+
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Modal title='操作手册'
|
|
97
|
+
open={this.state.formOpen}
|
|
98
|
+
onOk={() => this.formRef.current.submit()}
|
|
99
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
100
|
+
destroyOnHidden
|
|
101
|
+
maskClosable={false}
|
|
102
|
+
>
|
|
103
|
+
|
|
104
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
105
|
+
initialValues={this.state.formValues}
|
|
106
|
+
onFinish={this.onFinish}
|
|
107
|
+
>
|
|
108
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
109
|
+
|
|
110
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
111
|
+
<Input/>
|
|
112
|
+
</Form.Item>
|
|
113
|
+
|
|
114
|
+
<Form.Item label='文件' name='fileId' rules={[{required: true}]}>
|
|
115
|
+
<FieldUploadFile accept=".pdf" maxCount={1}/>
|
|
116
|
+
</Form.Item>
|
|
117
|
+
|
|
118
|
+
</Form>
|
|
119
|
+
</Modal>
|
|
120
|
+
</Page>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {Form, Modal} from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {FieldDictSelect, FieldRemoteSelectMultiple, FieldSysOrgTree, HttpUtils} from "../../../framework";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class UserPerm extends React.Component {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
visible: false,
|
|
11
|
+
|
|
12
|
+
confirmLoading: false,
|
|
13
|
+
|
|
14
|
+
formValues: {
|
|
15
|
+
dataPermType: null
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
formRef = React.createRef()
|
|
19
|
+
|
|
20
|
+
show(item) {
|
|
21
|
+
this.setState({visible: true})
|
|
22
|
+
|
|
23
|
+
HttpUtils.get('admin/sysUser/getPermInfo', {id: item.id}).then(rs => {
|
|
24
|
+
this.setState({formValues: rs})
|
|
25
|
+
this.formRef.current.setFieldsValue(rs)
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
handleSave = (values) => {
|
|
30
|
+
values.grantOrgIdList = this.state.checked
|
|
31
|
+
|
|
32
|
+
this.setState({
|
|
33
|
+
confirmLoading: true
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
HttpUtils.post('admin/sysUser/grantPerm', values).then(rs => {
|
|
38
|
+
this.setState({
|
|
39
|
+
visible: false,
|
|
40
|
+
confirmLoading: false
|
|
41
|
+
})
|
|
42
|
+
this.props.onOk()
|
|
43
|
+
}).finally(() => {
|
|
44
|
+
this.setState({
|
|
45
|
+
confirmLoading: false
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
render() {
|
|
52
|
+
let {visible, confirmLoading} = this.state
|
|
53
|
+
|
|
54
|
+
return <Modal
|
|
55
|
+
title="授权"
|
|
56
|
+
destroyOnHidden
|
|
57
|
+
width={600}
|
|
58
|
+
open={visible}
|
|
59
|
+
confirmLoading={confirmLoading}
|
|
60
|
+
onCancel={() => this.setState({visible: false})}
|
|
61
|
+
onOk={() => this.formRef.current.submit()}
|
|
62
|
+
>
|
|
63
|
+
|
|
64
|
+
<Form ref={this.formRef}
|
|
65
|
+
onFinish={this.handleSave}
|
|
66
|
+
onValuesChange={(change, values) => {
|
|
67
|
+
this.setState({formValues: values})
|
|
68
|
+
}}
|
|
69
|
+
labelCol={{flex: '100px'}}
|
|
70
|
+
>
|
|
71
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
72
|
+
<Form.Item label='角色' name='roleIds' rules={[{required: true}]}>
|
|
73
|
+
<FieldRemoteSelectMultiple url='admin/sysRole/options'/>
|
|
74
|
+
</Form.Item>
|
|
75
|
+
<Form.Item label='数据权限' name='dataPermType' rules={[{required: true}]}>
|
|
76
|
+
<FieldDictSelect typeCode='dataPermType'/>
|
|
77
|
+
</Form.Item>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
{this.state.formValues.dataPermType === 'CUSTOM' && <>
|
|
81
|
+
<Form.Item label='组织机构' name='orgIds'>
|
|
82
|
+
<FieldSysOrgTree/>
|
|
83
|
+
</Form.Item>
|
|
84
|
+
</>}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</Form>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</Modal>
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons';
|
|
2
|
+
import {Button, Form, Input, Modal, Popconfirm, Splitter, Tabs} from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ButtonList,
|
|
6
|
+
DictUtils,
|
|
7
|
+
FieldBoolean,
|
|
8
|
+
FieldSysOrgTreeSelect,
|
|
9
|
+
HttpUtils,
|
|
10
|
+
OrgTree,
|
|
11
|
+
Page,
|
|
12
|
+
ProTable,
|
|
13
|
+
RoleTree
|
|
14
|
+
} from "../../../framework";
|
|
15
|
+
import UserPerm from "./UserPerm";
|
|
16
|
+
|
|
17
|
+
export default class extends React.Component {
|
|
18
|
+
|
|
19
|
+
state = {
|
|
20
|
+
showAddForm: false,
|
|
21
|
+
showEditForm: false,
|
|
22
|
+
formValues: {},
|
|
23
|
+
|
|
24
|
+
currentOrgId: null,
|
|
25
|
+
currentRoleId: null,
|
|
26
|
+
}
|
|
27
|
+
permRef = React.createRef();
|
|
28
|
+
|
|
29
|
+
formRef = React.createRef()
|
|
30
|
+
tableRef = React.createRef()
|
|
31
|
+
|
|
32
|
+
resetPwd(row) {
|
|
33
|
+
HttpUtils.post('admin/sysUser/resetPwd', {id: row.id}).then(rs => {
|
|
34
|
+
Modal.success({
|
|
35
|
+
title: '重置密码成功',
|
|
36
|
+
content: rs
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
handleDelete = r => {
|
|
42
|
+
HttpUtils.get('admin/sysUser/delete', {id: r.id}).then(rs => {
|
|
43
|
+
this.tableRef.current.reload();
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onSelectOrg = (key) => {
|
|
48
|
+
this.setState({currentOrgId: key}, () => this.tableRef.current.reload())
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onSelectRole = (key) => {
|
|
52
|
+
this.setState({currentRoleId: key}, () => this.tableRef.current.reload())
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
handleAdd = () => {
|
|
56
|
+
this.setState({formOpen: true, formValues: {}})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
handleEdit = record => {
|
|
60
|
+
record.deptId = record.deptId || record.unitId
|
|
61
|
+
this.setState({formOpen: true, formValues: record})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
columns = [
|
|
65
|
+
{
|
|
66
|
+
title: '单位',
|
|
67
|
+
dataIndex: 'unitLabel',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: '部门',
|
|
71
|
+
dataIndex: 'deptLabel',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: '姓名',
|
|
75
|
+
dataIndex: 'name',
|
|
76
|
+
sorter: true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: '登录账号',
|
|
80
|
+
dataIndex: 'account',
|
|
81
|
+
sorter: true
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
{
|
|
86
|
+
title: '手机',
|
|
87
|
+
dataIndex: 'phone'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: '邮箱',
|
|
91
|
+
dataIndex: 'email'
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
{
|
|
95
|
+
title: '角色',
|
|
96
|
+
dataIndex: 'roleIds',
|
|
97
|
+
render: (_, row) => {
|
|
98
|
+
if (row.roleNames) {
|
|
99
|
+
return row.roleNames.join(',')
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: '状态',
|
|
105
|
+
dataIndex: 'enabled',
|
|
106
|
+
render(v) {
|
|
107
|
+
return v == null ? null : (v ? '是' : '否')
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: '数据权限',
|
|
112
|
+
dataIndex: 'dataPermType',
|
|
113
|
+
render(v) {
|
|
114
|
+
return DictUtils.dictTag('dataPermType', v)
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
title: '创建时间',
|
|
120
|
+
dataIndex: 'createTime',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: '操作',
|
|
124
|
+
dataIndex: 'option',
|
|
125
|
+
fixed: 'right',
|
|
126
|
+
render: (_, record) => {
|
|
127
|
+
return <ButtonList>
|
|
128
|
+
<Button size='small' perm='sysUser:save' onClick={() => this.handleEdit(record)}> 编辑 </Button>
|
|
129
|
+
|
|
130
|
+
<Button size='small' perm='sysUser:grantPerm'
|
|
131
|
+
onClick={() => this.permRef.current.show(record)}> 授权 </Button>
|
|
132
|
+
|
|
133
|
+
<Popconfirm perm='sysUser:resetPwd' title='确认重置密码?' onConfirm={() => this.resetPwd(record)}>
|
|
134
|
+
<Button size='small'>重置密码</Button>
|
|
135
|
+
</Popconfirm>
|
|
136
|
+
|
|
137
|
+
<Popconfirm perm='sysUser:delete' title={'是否确定删除用户'}
|
|
138
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
139
|
+
<Button size='small'>删除</Button>
|
|
140
|
+
</Popconfirm>
|
|
141
|
+
</ButtonList>;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
onFinish = values => {
|
|
147
|
+
HttpUtils.post('admin/sysUser/save', values).then(rs => {
|
|
148
|
+
this.setState({formOpen: false})
|
|
149
|
+
this.tableRef.current.reload()
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
render() {
|
|
154
|
+
|
|
155
|
+
return <Page>
|
|
156
|
+
<Splitter>
|
|
157
|
+
<Splitter.Panel defaultSize={400}>
|
|
158
|
+
<Tabs
|
|
159
|
+
type='card'
|
|
160
|
+
size='small'
|
|
161
|
+
items={[
|
|
162
|
+
{
|
|
163
|
+
key: 'org',
|
|
164
|
+
label: '按组织机构',
|
|
165
|
+
children: <OrgTree onChange={this.onSelectOrg}/>
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: 'role',
|
|
169
|
+
label: '按角色',
|
|
170
|
+
children: <RoleTree onSelect={this.onSelectRole}/>
|
|
171
|
+
}
|
|
172
|
+
]}/>
|
|
173
|
+
|
|
174
|
+
</Splitter.Panel>
|
|
175
|
+
<Splitter.Panel style={{paddingLeft: 16}}>
|
|
176
|
+
<ProTable
|
|
177
|
+
actionRef={this.tableRef}
|
|
178
|
+
toolBarRender={() => {
|
|
179
|
+
return <ButtonList>
|
|
180
|
+
<Button
|
|
181
|
+
perm='sysUser:save'
|
|
182
|
+
type="primary"
|
|
183
|
+
onClick={this.handleAdd}>
|
|
184
|
+
<PlusOutlined/> 新增
|
|
185
|
+
</Button>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
</ButtonList>
|
|
189
|
+
}}
|
|
190
|
+
showToolbarSearch
|
|
191
|
+
request={(params) => {
|
|
192
|
+
params.orgId = this.state.currentOrgId
|
|
193
|
+
params.roleId = this.state.currentRoleId
|
|
194
|
+
return HttpUtils.get('admin/sysUser/page', params)
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
columns={this.columns}
|
|
198
|
+
>
|
|
199
|
+
|
|
200
|
+
</ProTable>
|
|
201
|
+
</Splitter.Panel>
|
|
202
|
+
</Splitter>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
<Modal title='系统用户'
|
|
206
|
+
open={this.state.formOpen}
|
|
207
|
+
onOk={() => this.formRef.current.submit()}
|
|
208
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
209
|
+
destroyOnHidden
|
|
210
|
+
>
|
|
211
|
+
|
|
212
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
213
|
+
initialValues={this.state.formValues}
|
|
214
|
+
onFinish={this.onFinish}>
|
|
215
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
216
|
+
|
|
217
|
+
<Form.Item label='所属机构' name='deptId' rules={[{required: true}]}>
|
|
218
|
+
<FieldSysOrgTreeSelect/>
|
|
219
|
+
</Form.Item>
|
|
220
|
+
|
|
221
|
+
<Form.Item label='姓名' name='name' rules={[{required: true}]}>
|
|
222
|
+
<Input/>
|
|
223
|
+
</Form.Item>
|
|
224
|
+
<Form.Item label='账号' name='account' rules={[{required: true}]}>
|
|
225
|
+
<Input/>
|
|
226
|
+
</Form.Item>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<Form.Item label='电话' name='phone'>
|
|
230
|
+
<Input/>
|
|
231
|
+
</Form.Item>
|
|
232
|
+
<Form.Item label='邮箱' name='email'>
|
|
233
|
+
<Input/>
|
|
234
|
+
</Form.Item>
|
|
235
|
+
|
|
236
|
+
<Form.Item label='启用状态' name='enabled' rules={[{required: true}]}>
|
|
237
|
+
<FieldBoolean/>
|
|
238
|
+
</Form.Item>
|
|
239
|
+
|
|
240
|
+
</Form>
|
|
241
|
+
</Modal>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
<UserPerm ref={this.permRef} onOk={() => this.tableRef.current.reload()}/>
|
|
245
|
+
|
|
246
|
+
</Page>
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {ViewText, ViewBoolean, ViewBooleanEnableDisable, ViewFile, ViewFileButton, ViewImage, ViewPassword, ViewApproveStatus, ViewProcessInstanceProgress, ViewProcessInstanceProgressButton} from "../../framework";
|
|
2
|
+
|
|
3
|
+
export function ViewTextTest() {
|
|
4
|
+
return <ViewText value='你好' />
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function ViewBooleanTest() {
|
|
8
|
+
return <ViewBoolean value={true} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ViewBooleanEnableDisableTest() {
|
|
12
|
+
return <ViewBooleanEnableDisable value={true} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ViewTextEllipsisTest() {
|
|
16
|
+
return <ViewText value='这是一段很长的文本,用于测试省略显示功能' ellipsis={true} maxLength={10} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function ViewFileTest() {
|
|
20
|
+
return <ViewFile value='file123' height='200px' />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function ViewFileButtonTest() {
|
|
24
|
+
return <ViewFileButton value='file123' height='200px' />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ViewImageTest() {
|
|
28
|
+
return <ViewImage value='https://via.placeholder.com/150' />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function ViewPasswordTest() {
|
|
32
|
+
return <ViewPassword value='password123' />
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function ViewApproveStatusTest() {
|
|
36
|
+
return <ViewApproveStatus value='approved' />
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function ViewProcessInstanceProgressTest() {
|
|
40
|
+
return <ViewProcessInstanceProgress value='process123' />
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function ViewProcessInstanceProgressButtonTest() {
|
|
44
|
+
return <ViewProcessInstanceProgressButton value='process123' />
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function () {
|
|
48
|
+
return <>
|
|
49
|
+
<h1>View 组件测试</h1>
|
|
50
|
+
<div style={{marginBottom: '20px'}}>
|
|
51
|
+
<h2>ViewText</h2>
|
|
52
|
+
<ViewTextTest/>
|
|
53
|
+
</div>
|
|
54
|
+
<div style={{marginBottom: '20px'}}>
|
|
55
|
+
<h2>ViewBoolean</h2>
|
|
56
|
+
<ViewBooleanTest/>
|
|
57
|
+
</div>
|
|
58
|
+
<div style={{marginBottom: '20px'}}>
|
|
59
|
+
<h2>ViewBooleanEnableDisable</h2>
|
|
60
|
+
<ViewBooleanEnableDisableTest/>
|
|
61
|
+
</div>
|
|
62
|
+
<div style={{marginBottom: '20px'}}>
|
|
63
|
+
<h2>ViewText (with ellipsis)</h2>
|
|
64
|
+
<ViewTextEllipsisTest/>
|
|
65
|
+
</div>
|
|
66
|
+
<div style={{marginBottom: '20px'}}>
|
|
67
|
+
<h2>ViewFile</h2>
|
|
68
|
+
<ViewFileTest/>
|
|
69
|
+
</div>
|
|
70
|
+
<div style={{marginBottom: '20px'}}>
|
|
71
|
+
<h2>ViewFileButton</h2>
|
|
72
|
+
<ViewFileButtonTest/>
|
|
73
|
+
</div>
|
|
74
|
+
<div style={{marginBottom: '20px'}}>
|
|
75
|
+
<h2>ViewImage</h2>
|
|
76
|
+
<ViewImageTest/>
|
|
77
|
+
</div>
|
|
78
|
+
<div style={{marginBottom: '20px'}}>
|
|
79
|
+
<h2>ViewPassword</h2>
|
|
80
|
+
<ViewPasswordTest/>
|
|
81
|
+
</div>
|
|
82
|
+
<div style={{marginBottom: '20px'}}>
|
|
83
|
+
<h2>ViewApproveStatus</h2>
|
|
84
|
+
<ViewApproveStatusTest/>
|
|
85
|
+
</div>
|
|
86
|
+
<div style={{marginBottom: '20px'}}>
|
|
87
|
+
<h2>ViewProcessInstanceProgress</h2>
|
|
88
|
+
<ViewProcessInstanceProgressTest/>
|
|
89
|
+
</div>
|
|
90
|
+
<div style={{marginBottom: '20px'}}>
|
|
91
|
+
<h2>ViewProcessInstanceProgressButton</h2>
|
|
92
|
+
<ViewProcessInstanceProgressButtonTest/>
|
|
93
|
+
</div>
|
|
94
|
+
</>
|
|
95
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Button} from "antd";
|
|
3
|
+
|
|
4
|
+
export default class extends React.Component {
|
|
5
|
+
|
|
6
|
+
render() {
|
|
7
|
+
return <div style={{display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
|
|
8
|
+
<Button type='primary' href='/ureport/designer'>打开设计器</Button>
|
|
9
|
+
</div>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|