@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,314 @@
|
|
|
1
|
+
import {PlusOutlined} from '@ant-design/icons'
|
|
2
|
+
import {Button, Form, Input, InputNumber, Modal, Popconfirm, Transfer, Tree} from 'antd'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import {ButtonList, Ellipsis, FieldRadioBoolean, HttpUtil, Page, PageUtil, ProTable} from "../../../framework";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
formValues: {},
|
|
11
|
+
formOpen: false,
|
|
12
|
+
|
|
13
|
+
usersModalOpen: false,
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
userList: [],
|
|
17
|
+
targetKeys: [],
|
|
18
|
+
selectedKeys: [],
|
|
19
|
+
|
|
20
|
+
menuOpen:false,
|
|
21
|
+
menuTree:[],
|
|
22
|
+
menuTreeLoading:false,
|
|
23
|
+
menuChecked:[],
|
|
24
|
+
menuHalfChecked:[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
formRef = React.createRef()
|
|
28
|
+
tableRef = React.createRef()
|
|
29
|
+
|
|
30
|
+
columns = [
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
title: '名称',
|
|
34
|
+
dataIndex: 'name',
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
title: '编号',
|
|
41
|
+
dataIndex: 'code',
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
{
|
|
47
|
+
title: '排序',
|
|
48
|
+
dataIndex: 'seq',
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
{
|
|
54
|
+
title: '备注',
|
|
55
|
+
dataIndex: 'remark',
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
title: '启用',
|
|
62
|
+
dataIndex: 'enabled',
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
render(v) {
|
|
66
|
+
return v == null ? null : (v ? '是' : '否')
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: '是否内置',
|
|
73
|
+
dataIndex: 'builtin',
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
render(v) {
|
|
77
|
+
return v == null ? null : (v ? '是' : '否')
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
title: '权限码',
|
|
85
|
+
dataIndex: 'perms',
|
|
86
|
+
width: 300,
|
|
87
|
+
render(v) {
|
|
88
|
+
if (v) {
|
|
89
|
+
return <Ellipsis>{v.join(',')}</Ellipsis>
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
{
|
|
97
|
+
title: '操作',
|
|
98
|
+
dataIndex: 'option',
|
|
99
|
+
render: (_, record) => {
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<ButtonList>
|
|
103
|
+
<Button size='small' perm='sysRole:save'
|
|
104
|
+
onClick={() => this.handleEditUser(record)}>用户设置</Button>
|
|
105
|
+
|
|
106
|
+
<Button size='small' perm='sysRole:save' disabled={record.builtin}
|
|
107
|
+
onClick={() => PageUtil.open('/system/role/perm?id='+record.id, '角色权限设置')}>权限设置</Button>
|
|
108
|
+
|
|
109
|
+
<Button size='small' perm='sysRole:save' disabled={record.builtin}
|
|
110
|
+
onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
111
|
+
<Popconfirm perm='sysRole:delete' disabled={record.builtin} title='是否确定删除系统角色'
|
|
112
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
113
|
+
<Button size='small'>删除</Button>
|
|
114
|
+
</Popconfirm>
|
|
115
|
+
</ButtonList>
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
handleAdd = () => {
|
|
122
|
+
this.setState({formOpen: true, formValues: {}})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
handleEdit = record => {
|
|
126
|
+
this.setState({formOpen: true, formValues: record}, () => {
|
|
127
|
+
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
handleEditUser = record => {
|
|
133
|
+
this.setState({usersModalOpen: true, formValues: record})
|
|
134
|
+
HttpUtil.get('admin/sysRole/userList', {id: record.id}).then(rs => {
|
|
135
|
+
this.setState({userList: rs.list, targetKeys: rs.selectedKeys})
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
onFinish = values => {
|
|
142
|
+
HttpUtil.post('admin/sysRole/save', values).then(rs => {
|
|
143
|
+
this.setState({formOpen: false})
|
|
144
|
+
this.tableRef.current.reload()
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
handleDelete = record => {
|
|
150
|
+
HttpUtil.get('admin/sysRole/delete', {id: record.id}).then(rs => {
|
|
151
|
+
this.tableRef.current.reload()
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
handleSaveUsers =()=>{
|
|
156
|
+
const params = {
|
|
157
|
+
id: this.state.formValues.id,
|
|
158
|
+
userIdList:this.state.targetKeys
|
|
159
|
+
}
|
|
160
|
+
HttpUtil.post('admin/sysRole/grantUsers', params).then(rs => {
|
|
161
|
+
this.setState({usersModalOpen:false})
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
handleEditMenu =(record)=>{
|
|
166
|
+
this.setState({menuOpen:true,formValues:record,menuTreeLoading:true})
|
|
167
|
+
HttpUtil.get('admin/sysRole/ownMenu', {id: record.id}).then(rs => {
|
|
168
|
+
this.setState({menuChecked:rs.checked,menuHalfChecked:rs.halfChecked})
|
|
169
|
+
})
|
|
170
|
+
HttpUtil.get('admin/sysRole/menuTree').then(rs => {
|
|
171
|
+
this.setState({menuTree:rs, menuTreeLoading:false})
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
handleGrantMenu =()=>{
|
|
175
|
+
const params = {
|
|
176
|
+
id: this.state.formValues.id,
|
|
177
|
+
menuIds:[...this.state.menuChecked, ...this.state.menuHalfChecked]
|
|
178
|
+
}
|
|
179
|
+
HttpUtil.post('admin/sysRole/grantMenu', params).then(rs => {
|
|
180
|
+
debugger
|
|
181
|
+
this.setState({menuOpen:false})
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
render() {
|
|
186
|
+
return <Page>
|
|
187
|
+
<ProTable
|
|
188
|
+
actionRef={this.tableRef}
|
|
189
|
+
toolBarRender={() => {
|
|
190
|
+
return <ButtonList>
|
|
191
|
+
<Button perm='sysRole:save' type='primary' onClick={this.handleAdd}>
|
|
192
|
+
<PlusOutlined/> 新增
|
|
193
|
+
</Button>
|
|
194
|
+
</ButtonList>
|
|
195
|
+
}}
|
|
196
|
+
request={(params) => HttpUtil.pageData('admin/sysRole/page', params)}
|
|
197
|
+
columns={this.columns}
|
|
198
|
+
|
|
199
|
+
/>
|
|
200
|
+
|
|
201
|
+
<Modal title='系统角色'
|
|
202
|
+
open={this.state.formOpen}
|
|
203
|
+
onOk={() => this.formRef.current.submit()}
|
|
204
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
205
|
+
destroyOnHidden
|
|
206
|
+
maskClosable={false}
|
|
207
|
+
width={600}
|
|
208
|
+
>
|
|
209
|
+
|
|
210
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
211
|
+
initialValues={this.state.formValues}
|
|
212
|
+
onFinish={this.onFinish}
|
|
213
|
+
>
|
|
214
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
218
|
+
<Input/>
|
|
219
|
+
</Form.Item>
|
|
220
|
+
|
|
221
|
+
<Form.Item label='编码' name='code' rules={[{required: true}]}>
|
|
222
|
+
<Input/>
|
|
223
|
+
</Form.Item>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
<Form.Item label='排序' name='seq'>
|
|
227
|
+
<InputNumber/>
|
|
228
|
+
</Form.Item>
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
<Form.Item label='备注' name='remark'>
|
|
232
|
+
<Input/>
|
|
233
|
+
</Form.Item>
|
|
234
|
+
|
|
235
|
+
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
236
|
+
<FieldRadioBoolean/>
|
|
237
|
+
</Form.Item>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
</Form>
|
|
243
|
+
</Modal>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<Modal title={'角色用户' +"【" +this.state.formValues?.name + '】'}
|
|
247
|
+
open={this.state.usersModalOpen }
|
|
248
|
+
destroyOnHidden
|
|
249
|
+
maskClosable={false}
|
|
250
|
+
width={800}
|
|
251
|
+
onCancel={() => this.setState({usersModalOpen: false})}
|
|
252
|
+
onOk={this.handleSaveUsers}
|
|
253
|
+
>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<Transfer
|
|
257
|
+
listStyle={{height:'60vh', width:300}}
|
|
258
|
+
|
|
259
|
+
dataSource={this.state.userList} titles={["未选择", "已选择"]}
|
|
260
|
+
targetKeys={this.state.targetKeys}
|
|
261
|
+
selectedKeys={this.state.selectedKeys}
|
|
262
|
+
render={item => item.title}
|
|
263
|
+
onChange={(nextTargetKeys, direction, moveKeys) => {
|
|
264
|
+
this.setState({
|
|
265
|
+
targetKeys: nextTargetKeys
|
|
266
|
+
})
|
|
267
|
+
}}
|
|
268
|
+
onSelectChange={(sourceSelectedKeys, targetSelectedKeys)=>{
|
|
269
|
+
this.setState({
|
|
270
|
+
selectedKeys: [...sourceSelectedKeys, ...targetSelectedKeys]
|
|
271
|
+
})
|
|
272
|
+
}}
|
|
273
|
+
showSearch
|
|
274
|
+
/>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
</Modal>
|
|
278
|
+
|
|
279
|
+
<Modal title={'角色授权菜单权限' +"【" +this.state.formValues?.name + '】'}
|
|
280
|
+
open={this.state.menuOpen }
|
|
281
|
+
destroyOnHidden
|
|
282
|
+
maskClosable={false}
|
|
283
|
+
width={800}
|
|
284
|
+
onCancel={() => this.setState({menuOpen: false})}
|
|
285
|
+
onOk={this.handleGrantMenu}
|
|
286
|
+
loading={this.state.menuTreeLoading}
|
|
287
|
+
>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
<Tree
|
|
291
|
+
height={600}
|
|
292
|
+
treeData={this.state.menuTree}
|
|
293
|
+
multiple
|
|
294
|
+
checkable
|
|
295
|
+
checkedKeys={{checked:this.state.menuChecked}}
|
|
296
|
+
onCheck={(keys,e) =>{
|
|
297
|
+
this.setState({menuChecked:keys,menuHalfChecked:e.halfCheckedKeys})
|
|
298
|
+
}}
|
|
299
|
+
defaultExpandAll
|
|
300
|
+
titleRender={node=>{
|
|
301
|
+
return <span title={node.perm} >{node.title}</span>
|
|
302
|
+
}}
|
|
303
|
+
>
|
|
304
|
+
</Tree>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
</Modal>
|
|
309
|
+
</Page>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Alert, Button, Card, Checkbox, Table, Typography} from "antd";
|
|
3
|
+
import {SaveOutlined} from "@ant-design/icons";
|
|
4
|
+
import {ArrUtil, HttpUtil, PageUtil} from "../../../framework";
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
loading: false,
|
|
11
|
+
roleInfo: {},
|
|
12
|
+
|
|
13
|
+
dataSource: [],
|
|
14
|
+
rowSelectedKeys: {},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
columns = [
|
|
18
|
+
{
|
|
19
|
+
title: '菜单',
|
|
20
|
+
dataIndex: 'name',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
title: '权限',
|
|
25
|
+
dataIndex: 'perms',
|
|
26
|
+
render: (perms, record) => {
|
|
27
|
+
if (perms == null) {
|
|
28
|
+
if (record.path) {
|
|
29
|
+
return <Alert type='error' message='错误:无按钮权限,请在application-data-**.yml中添加'/>
|
|
30
|
+
}
|
|
31
|
+
// 文件夹
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
const options = perms.map(perm => {
|
|
35
|
+
return {
|
|
36
|
+
label: perm.name,
|
|
37
|
+
value: perm.perm
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
let rowSelectedKey = this.state.rowSelectedKeys[record.id];
|
|
43
|
+
return <Checkbox.Group options={options}
|
|
44
|
+
value={rowSelectedKey}
|
|
45
|
+
onChange={(ks) => {
|
|
46
|
+
const rowSelectedKeys = this.state.rowSelectedKeys;
|
|
47
|
+
rowSelectedKeys[record.id] = ks;
|
|
48
|
+
this.setState({rowSelectedKeys})
|
|
49
|
+
}}/>
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
componentDidMount() {
|
|
55
|
+
this.roleId = PageUtil.currentParams().id;
|
|
56
|
+
this.loadData();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
loadData() {
|
|
61
|
+
this.setState({loading: true})
|
|
62
|
+
Promise.all([
|
|
63
|
+
HttpUtil.get('admin/sysRole/get', {id: this.roleId}).then(rs => {
|
|
64
|
+
this.setState({roleInfo: rs})
|
|
65
|
+
}),
|
|
66
|
+
HttpUtil.get('admin/sysRole/permTreeTable', {id: this.roleId}).then(rs => {
|
|
67
|
+
this.setState({dataSource: rs})
|
|
68
|
+
}),
|
|
69
|
+
HttpUtil.get('admin/sysRole/ownPerms', {id: this.roleId}).then(rs => {
|
|
70
|
+
this.setState({rowSelectedKeys: rs})
|
|
71
|
+
})
|
|
72
|
+
]).then(rs => {
|
|
73
|
+
this.setState({loading: false})
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
savePerms = () => {
|
|
78
|
+
const {rowSelectedKeys} = this.state;
|
|
79
|
+
const perms = [];
|
|
80
|
+
const menus = []
|
|
81
|
+
for (let menuId in rowSelectedKeys) {
|
|
82
|
+
const ks = rowSelectedKeys[menuId];
|
|
83
|
+
if (ks == null || ks.length === 0) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
menus.push(menuId)
|
|
87
|
+
ArrUtil.addAll(perms, ks)
|
|
88
|
+
}
|
|
89
|
+
HttpUtil.post('admin/sysRole/savePerms', {id: this.roleId, perms, menus}).then(rs => {
|
|
90
|
+
// Page.open(PageUtil.currentPathname(), PageUtil.currentLabel())
|
|
91
|
+
})
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
render() {
|
|
96
|
+
return <>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<Card title='角色权限设置' loading={this.state.loading}
|
|
100
|
+
variant={"borderless"}
|
|
101
|
+
extra={<Button type='primary' icon={<SaveOutlined/>} onClick={this.savePerms}>保存权限</Button>}>
|
|
102
|
+
<Typography.Text>角色名称:{this.state.roleInfo.name}, 编码:{this.state.roleInfo.code} </Typography.Text>
|
|
103
|
+
<Table dataSource={this.state.dataSource}
|
|
104
|
+
columns={this.columns}
|
|
105
|
+
size='small' bordered pagination={false} rowKey='id'
|
|
106
|
+
expandable={{defaultExpandAllRows: true}}
|
|
107
|
+
></Table>
|
|
108
|
+
</Card>
|
|
109
|
+
</>
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
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, HttpUtil, Page, ProTable, SysUtil} 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
|
+
columns = [
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
title: '名称',
|
|
21
|
+
dataIndex: 'name',
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
{
|
|
27
|
+
title: '版本',
|
|
28
|
+
dataIndex: 'version',
|
|
29
|
+
render(version) {
|
|
30
|
+
return 'v' +version;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
{
|
|
35
|
+
title: '文件',
|
|
36
|
+
dataIndex: 'fileId',
|
|
37
|
+
render(id){
|
|
38
|
+
const url = SysUtil.wrapServerUrl('admin/sysFile/preview/' + id);
|
|
39
|
+
return <a href={url} target='_blank'>查看文件</a>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '操作',
|
|
45
|
+
dataIndex: 'option',
|
|
46
|
+
render: (_, record) => (
|
|
47
|
+
<ButtonList>
|
|
48
|
+
<Button size='small' perm='sysManual:save' onClick={() => this.handleEdit(record)}>编辑</Button>
|
|
49
|
+
<Popconfirm perm='sysManual:delete' title='是否确定删除操作手册' onConfirm={() => this.handleDelete(record)}>
|
|
50
|
+
<Button size='small'>删除</Button>
|
|
51
|
+
</Popconfirm>
|
|
52
|
+
</ButtonList>
|
|
53
|
+
),
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
handleAdd = () => {
|
|
59
|
+
this.setState({formOpen: true, formValues: {}})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
handleEdit = record => {
|
|
63
|
+
this.setState({formOpen: true, formValues: record})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
onFinish = values => {
|
|
68
|
+
HttpUtil.post('admin/sysManual/save', values).then(rs => {
|
|
69
|
+
this.setState({formOpen: false})
|
|
70
|
+
this.tableRef.current.reload()
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
handleDelete = record => {
|
|
76
|
+
HttpUtil.get('admin/sysManual/delete', {id: record.id}).then(rs => {
|
|
77
|
+
this.tableRef.current.reload()
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
render() {
|
|
82
|
+
return <Page>
|
|
83
|
+
<ProTable
|
|
84
|
+
actionRef={this.tableRef}
|
|
85
|
+
toolBarRender={(params, {selectedRows, selectedRowKeys}) => {
|
|
86
|
+
return <ButtonList>
|
|
87
|
+
<Button perm='sysManual:save' type='primary' onClick={this.handleAdd}>
|
|
88
|
+
<PlusOutlined/> 新增
|
|
89
|
+
</Button>
|
|
90
|
+
</ButtonList>
|
|
91
|
+
}}
|
|
92
|
+
request={(params) => HttpUtil.pageData('admin/sysManual/page', params)}
|
|
93
|
+
columns={this.columns}
|
|
94
|
+
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<Modal title='操作手册'
|
|
98
|
+
open={this.state.formOpen}
|
|
99
|
+
onOk={() => this.formRef.current.submit()}
|
|
100
|
+
onCancel={() => this.setState({formOpen: false})}
|
|
101
|
+
destroyOnHidden
|
|
102
|
+
maskClosable={false}
|
|
103
|
+
>
|
|
104
|
+
|
|
105
|
+
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
106
|
+
initialValues={this.state.formValues}
|
|
107
|
+
onFinish={this.onFinish}
|
|
108
|
+
>
|
|
109
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
110
|
+
|
|
111
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
112
|
+
<Input/>
|
|
113
|
+
</Form.Item>
|
|
114
|
+
|
|
115
|
+
<Form.Item label='文件' name='fileId' rules={[{required: true}]}>
|
|
116
|
+
<FieldUploadFile accept=".pdf" maxCount={1} listType='text'/>
|
|
117
|
+
</Form.Item>
|
|
118
|
+
|
|
119
|
+
</Form>
|
|
120
|
+
</Modal>
|
|
121
|
+
</Page>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {Form, Modal, Spin, Tree} from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {FieldDictSelect, FieldSelect, HttpUtil} 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
|
+
show(item) {
|
|
19
|
+
this.setState({visible: true})
|
|
20
|
+
|
|
21
|
+
HttpUtil.get('admin/sysUser/getPermInfo', {id: item.id}).then(rs => {
|
|
22
|
+
this.setState({formValues: rs})
|
|
23
|
+
this.formRef.current.setFieldsValue(rs)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
handleSave = (values) => {
|
|
28
|
+
values.grantOrgIdList = this.state.checked
|
|
29
|
+
|
|
30
|
+
this.setState({
|
|
31
|
+
confirmLoading: true
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
HttpUtil.post('admin/sysUser/grantPerm', values).then(rs => {
|
|
36
|
+
this.setState({
|
|
37
|
+
visible: false,
|
|
38
|
+
confirmLoading: false
|
|
39
|
+
})
|
|
40
|
+
this.props.onOk()
|
|
41
|
+
}).finally(()=>{
|
|
42
|
+
this.setState({
|
|
43
|
+
confirmLoading: false
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
formRef = React.createRef()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
render() {
|
|
55
|
+
let {visible, treeData, confirmLoading, checked} = this.state
|
|
56
|
+
|
|
57
|
+
return <Modal
|
|
58
|
+
title="授权"
|
|
59
|
+
destroyOnHidden
|
|
60
|
+
width={600}
|
|
61
|
+
open={visible}
|
|
62
|
+
confirmLoading={confirmLoading}
|
|
63
|
+
onCancel={() => this.setState({visible: false})}
|
|
64
|
+
onOk={() => this.formRef.current.submit()}
|
|
65
|
+
>
|
|
66
|
+
|
|
67
|
+
<Form ref={this.formRef}
|
|
68
|
+
onFinish={this.handleSave}
|
|
69
|
+
onValuesChange={(change, values) => {
|
|
70
|
+
this.setState({formValues: values})
|
|
71
|
+
}}
|
|
72
|
+
labelCol={{flex: '100px'}}
|
|
73
|
+
>
|
|
74
|
+
<Form.Item name='id' noStyle></Form.Item>
|
|
75
|
+
<Form.Item label='角色' name='roleIds' rules={[{required: true}]}>
|
|
76
|
+
<FieldSelect url='admin/sysRole/options' multiple/>
|
|
77
|
+
</Form.Item>
|
|
78
|
+
<Form.Item label='数据权限' name='dataPermType' rules={[{required: true}]}>
|
|
79
|
+
<FieldDictSelect typeCode='dataPermType' />
|
|
80
|
+
</Form.Item>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
{this.state.formValues.dataPermType === 'CUSTOM' && <>
|
|
84
|
+
<Form.Item label='组织机构' name='orgIds'>
|
|
85
|
+
<FieldTree/>
|
|
86
|
+
</Form.Item>
|
|
87
|
+
</>}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
</Form>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</Modal>
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
class FieldTree extends React.Component {
|
|
100
|
+
|
|
101
|
+
state = {
|
|
102
|
+
treeLoading: true,
|
|
103
|
+
treeData: [],
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
componentDidMount() {
|
|
107
|
+
HttpUtil.get('admin/sysOrg/unitTree').then(treeData => {
|
|
108
|
+
this.setState({treeData, treeLoading: false})
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
render() {
|
|
114
|
+
if (this.state.treeLoading) {
|
|
115
|
+
return <Spin />
|
|
116
|
+
}
|
|
117
|
+
return <Tree
|
|
118
|
+
multiple
|
|
119
|
+
checkable
|
|
120
|
+
onCheck={e => this.props.onChange(e.checked)}
|
|
121
|
+
checkedKeys={this.props.value}
|
|
122
|
+
treeData={this.state.treeData}
|
|
123
|
+
defaultExpandAll
|
|
124
|
+
checkStrictly
|
|
125
|
+
>
|
|
126
|
+
</Tree>
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|