@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,152 @@
|
|
|
1
|
+
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {ButtonList, FieldDateRange, FieldDictSelect, FieldUploadFile, HttpUtil, ProTable, SysUtil} from "../../../framework";
|
|
4
|
+
import {CloudUploadOutlined} from "@ant-design/icons";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class extends React.Component {
|
|
8
|
+
|
|
9
|
+
state = {
|
|
10
|
+
formOpen: false,
|
|
11
|
+
formValues: {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
tableRef = React.createRef()
|
|
15
|
+
formRef = React.createRef()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
columns = [
|
|
19
|
+
{
|
|
20
|
+
title: '原始名称',
|
|
21
|
+
tooltip: '上传时候的文件名',
|
|
22
|
+
dataIndex: 'originName',
|
|
23
|
+
width:200,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: '存储名称',
|
|
27
|
+
dataIndex: 'objectName',
|
|
28
|
+
tooltip: '文件唯一标识id'
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
title: '文件大小',
|
|
33
|
+
dataIndex: 'sizeInfo',
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
title: 'mime',
|
|
38
|
+
dataIndex: 'mimeType',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: '扩展名',
|
|
42
|
+
dataIndex: 'suffix',
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
{
|
|
46
|
+
title: '上传时间',
|
|
47
|
+
dataIndex: 'createTime',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: '上传者',
|
|
51
|
+
dataIndex: 'createUserLabel',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: '预览',
|
|
55
|
+
dataIndex: 'id',
|
|
56
|
+
render(id,record){
|
|
57
|
+
const nodes = [ <a href={SysUtil.wrapServerUrl( 'sysFile/preview/' + record.id) } target='_blank'>预览</a>]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if(record.imageUrls?.length > 0){
|
|
61
|
+
for(let item of record.imageUrls){
|
|
62
|
+
let url = item.url;
|
|
63
|
+
let label = item.label;
|
|
64
|
+
nodes.push(<a href={SysUtil.wrapServerUrl( url) } target='_blank' style={{marginLeft:8}} >{label}</a>)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return nodes;
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: '操作',
|
|
74
|
+
dataIndex: 'option',
|
|
75
|
+
render: (_, record) => (
|
|
76
|
+
<ButtonList>
|
|
77
|
+
<Popconfirm perm='sysFile:delete' title='是否确定删除文件信息'
|
|
78
|
+
onConfirm={() => this.handleDelete(record)}>
|
|
79
|
+
<a>删除</a>
|
|
80
|
+
</Popconfirm>
|
|
81
|
+
</ButtonList>
|
|
82
|
+
),
|
|
83
|
+
},
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
handleDelete = row => {
|
|
88
|
+
HttpUtil.get('admin/sysFile/delete', row).then(rs => {
|
|
89
|
+
this.tableRef.current.reload()
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
render() {
|
|
96
|
+
return <>
|
|
97
|
+
<ProTable
|
|
98
|
+
actionRef={this.tableRef}
|
|
99
|
+
toolBarRender={() => {
|
|
100
|
+
return <Button type='primary' icon={<CloudUploadOutlined/>}
|
|
101
|
+
onClick={() => this.setState({formOpen: true})}>
|
|
102
|
+
上传文件
|
|
103
|
+
</Button>
|
|
104
|
+
}}
|
|
105
|
+
request={(params) => {
|
|
106
|
+
return HttpUtil.pageData('admin/sysFile/page', params);
|
|
107
|
+
}}
|
|
108
|
+
|
|
109
|
+
columns={this.columns}
|
|
110
|
+
|
|
111
|
+
>
|
|
112
|
+
<Form.Item label='文件名' name='originName'>
|
|
113
|
+
<Input/>
|
|
114
|
+
</Form.Item>
|
|
115
|
+
<Form.Item label='对象名称' name='objectName'>
|
|
116
|
+
<Input/>
|
|
117
|
+
</Form.Item>
|
|
118
|
+
<Form.Item label='类型' name='type'>
|
|
119
|
+
<FieldDictSelect typeCode='materialType'/>
|
|
120
|
+
</Form.Item>
|
|
121
|
+
|
|
122
|
+
<Form.Item label='上传时间' name='dateRange'>
|
|
123
|
+
<FieldDateRange/>
|
|
124
|
+
</Form.Item>
|
|
125
|
+
</ProTable>
|
|
126
|
+
|
|
127
|
+
<Modal open={this.state.formOpen} title='上传文件'
|
|
128
|
+
width={800}
|
|
129
|
+
onCancel={() => {
|
|
130
|
+
this.setState({formOpen: false})
|
|
131
|
+
this.tableRef.current.reload()
|
|
132
|
+
}}
|
|
133
|
+
footer={null}
|
|
134
|
+
destroyOnHidden
|
|
135
|
+
>
|
|
136
|
+
<Form ref={this.formRef}
|
|
137
|
+
initialValues={this.state.formValues}
|
|
138
|
+
>
|
|
139
|
+
<Form.Item name='文件'>
|
|
140
|
+
<FieldUploadFile accept="*/*"/>
|
|
141
|
+
</Form.Item>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</Form>
|
|
145
|
+
</Modal>
|
|
146
|
+
|
|
147
|
+
</>
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, {Fragment} from 'react';
|
|
2
|
+
import {Form, Input, Tag} from "antd";
|
|
3
|
+
import {Ellipsis, FieldDateRange, HttpUtil, ProTable} from "../../../framework";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default class extends React.Component {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
columns = [
|
|
10
|
+
{
|
|
11
|
+
title: '操作',
|
|
12
|
+
dataIndex: 'operation',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
title: '操作者',
|
|
16
|
+
dataIndex: 'username'
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
title: 'ip',
|
|
21
|
+
dataIndex: 'ip',
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
title: '时间',
|
|
27
|
+
dataIndex: 'operationTime',
|
|
28
|
+
sorter: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: '参数',
|
|
32
|
+
dataIndex: 'params',
|
|
33
|
+
render(v) {
|
|
34
|
+
return <Ellipsis pre={true}>{v}</Ellipsis>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: '结果',
|
|
40
|
+
dataIndex: 'success',
|
|
41
|
+
render(v) {
|
|
42
|
+
return <>
|
|
43
|
+
<Tag color={v ? 'green' : 'red'}>{v ? '成功' : '失败'}</Tag>
|
|
44
|
+
</>
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: '错误消息',
|
|
49
|
+
dataIndex: 'error',
|
|
50
|
+
render(v) {
|
|
51
|
+
return <Ellipsis>{v}</Ellipsis>
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
return <>
|
|
59
|
+
<ProTable
|
|
60
|
+
request={(params) => HttpUtil.pageData('admin/sysLog/page', params)}
|
|
61
|
+
columns={this.columns}
|
|
62
|
+
>
|
|
63
|
+
<Form.Item label='操作' name='operation'>
|
|
64
|
+
<Input/>
|
|
65
|
+
</Form.Item>
|
|
66
|
+
<Form.Item label='时间' name='dateRange'>
|
|
67
|
+
<FieldDateRange format={"YYYY"}/>
|
|
68
|
+
</Form.Item>
|
|
69
|
+
</ProTable>
|
|
70
|
+
|
|
71
|
+
</>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined} from '@ant-design/icons';
|
|
2
|
+
import {Button, Card, Checkbox, Empty, Form, Input, Popconfirm, Space, Splitter, Switch, Tree} from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
FieldDictRadio,
|
|
6
|
+
FieldRadioBoolean,
|
|
7
|
+
FieldRemoteTreeSelect,
|
|
8
|
+
FieldUserSelect,
|
|
9
|
+
Gap,
|
|
10
|
+
HttpUtil,
|
|
11
|
+
NamedIcon,
|
|
12
|
+
Page
|
|
13
|
+
} from "../../../framework";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export default class extends React.Component {
|
|
17
|
+
|
|
18
|
+
state = {
|
|
19
|
+
formLoading: false,
|
|
20
|
+
formValues: undefined,
|
|
21
|
+
submitLoading: false,
|
|
22
|
+
formEditing: false,
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
params: {
|
|
26
|
+
onlyShowEnabled: true,
|
|
27
|
+
onlyShowUnit: false,
|
|
28
|
+
searchText: null
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
treeData: [],
|
|
32
|
+
treeLoading: false,
|
|
33
|
+
draggable: false,
|
|
34
|
+
}
|
|
35
|
+
actionRef = React.createRef();
|
|
36
|
+
treeRef = React.createRef();
|
|
37
|
+
|
|
38
|
+
componentDidMount() {
|
|
39
|
+
this.loadTree()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
loadTree = () => {
|
|
43
|
+
this.setState({treeLoading: true})
|
|
44
|
+
|
|
45
|
+
const {params} = this.state
|
|
46
|
+
HttpUtil.get('admin/sysOrg/tree', params).then(rs => {
|
|
47
|
+
let treeData = rs;
|
|
48
|
+
this.setState({treeData})
|
|
49
|
+
}).finally(() => {
|
|
50
|
+
this.setState({treeLoading: false});
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
handleDelete = record => {
|
|
55
|
+
HttpUtil.get('admin/sysOrg/delete', {id:record.id})
|
|
56
|
+
.then(rs => {
|
|
57
|
+
this.setState({formValues: null})
|
|
58
|
+
this.loadTree()
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
onSelect = (selectedKeys) => {
|
|
64
|
+
if (selectedKeys.length === 0) {
|
|
65
|
+
this.setState({formValues: null})
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const key = selectedKeys[0]
|
|
70
|
+
this.setState({formLoading: true, formEditing: false})
|
|
71
|
+
HttpUtil.get( "admin/sysOrg/detail", {id: key}).then(rs => {
|
|
72
|
+
this.setState({formValues: rs})
|
|
73
|
+
}).finally(() => {
|
|
74
|
+
this.setState({formLoading: false})
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
onFinish = (values) => {
|
|
79
|
+
this.setState({submitLoading: true, formEditing: false})
|
|
80
|
+
HttpUtil.post( 'admin/sysOrg/save', values).then(rs => {
|
|
81
|
+
this.loadTree()
|
|
82
|
+
}).finally(() => {
|
|
83
|
+
this.setState({submitLoading: false})
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
onDraggableChange = e => {
|
|
89
|
+
this.setState({draggable: e})
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
render() {
|
|
94
|
+
let {formValues} = this.state;
|
|
95
|
+
let disabled = formValues == null;
|
|
96
|
+
let params = this.state.params;
|
|
97
|
+
return <Page padding>
|
|
98
|
+
<Card>
|
|
99
|
+
<Space>
|
|
100
|
+
|
|
101
|
+
<Input.Search placeholder='搜索' value={params.searchText} onChange={e => {
|
|
102
|
+
params.searchText = e.target.value
|
|
103
|
+
this.setState({params}, this.loadTree)
|
|
104
|
+
}}/>
|
|
105
|
+
<Checkbox checked={params.onlyShowEnabled}
|
|
106
|
+
onChange={e => {
|
|
107
|
+
params.onlyShowEnabled = e.target.checked;
|
|
108
|
+
this.setState({params}, this.loadTree);
|
|
109
|
+
}}>仅显示启用</Checkbox>
|
|
110
|
+
|
|
111
|
+
<Checkbox checked={params.onlyShowUnit}
|
|
112
|
+
onChange={e => {
|
|
113
|
+
params.onlyShowUnit = e.target.checked;
|
|
114
|
+
this.setState({params}, this.loadTree);
|
|
115
|
+
}}>仅显示单位</Checkbox>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</Space>
|
|
119
|
+
</Card>
|
|
120
|
+
<Gap/>
|
|
121
|
+
<Splitter>
|
|
122
|
+
<Splitter.Panel defaultSize={500}>
|
|
123
|
+
<Card loading={this.state.treeLoading}
|
|
124
|
+
title='组织机构'
|
|
125
|
+
extra={<Space>
|
|
126
|
+
|
|
127
|
+
<div>
|
|
128
|
+
拖拽排序 <Switch
|
|
129
|
+
value={this.state.draggable}
|
|
130
|
+
onChange={this.onDraggableChange}/>
|
|
131
|
+
</div>
|
|
132
|
+
<Button size='small' shape={"round"} icon={<SyncOutlined/>}
|
|
133
|
+
onClick={this.loadTree}></Button>
|
|
134
|
+
</Space>}>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<Tree ref={this.treeRef}
|
|
138
|
+
treeData={this.state.treeData}
|
|
139
|
+
onSelect={this.onSelect}
|
|
140
|
+
showIcon
|
|
141
|
+
blockNode
|
|
142
|
+
icon={item => {
|
|
143
|
+
return <NamedIcon name={item.data.iconName}/>;
|
|
144
|
+
}}
|
|
145
|
+
draggable={this.state.draggable}
|
|
146
|
+
onDrop={this.onDrop}
|
|
147
|
+
showLine
|
|
148
|
+
defaultExpandAll
|
|
149
|
+
>
|
|
150
|
+
</Tree>
|
|
151
|
+
{this.state.treeData.length === 0 && <Empty/>}
|
|
152
|
+
</Card>
|
|
153
|
+
</Splitter.Panel>
|
|
154
|
+
|
|
155
|
+
<Splitter>
|
|
156
|
+
<Card
|
|
157
|
+
loading={this.state.formLoading}
|
|
158
|
+
extra={<Space>
|
|
159
|
+
<Button type='primary' onClick={() => {
|
|
160
|
+
this.setState({
|
|
161
|
+
formLoading: true,
|
|
162
|
+
formEditing: true,
|
|
163
|
+
formValues: {
|
|
164
|
+
pid: formValues?.id,
|
|
165
|
+
}
|
|
166
|
+
}, () => {
|
|
167
|
+
this.setState({formLoading: false})
|
|
168
|
+
})
|
|
169
|
+
}}>
|
|
170
|
+
<PlusOutlined/> 新增
|
|
171
|
+
</Button>
|
|
172
|
+
<Button disabled={disabled} onClick={() => {
|
|
173
|
+
this.setState({
|
|
174
|
+
formEditing: true
|
|
175
|
+
})
|
|
176
|
+
}}>
|
|
177
|
+
<EditOutlined/> 编辑
|
|
178
|
+
</Button>
|
|
179
|
+
|
|
180
|
+
<Popconfirm title={'是否确定删除组织机构'} disabled={disabled}
|
|
181
|
+
onConfirm={() => this.handleDelete(formValues)}>
|
|
182
|
+
<Button icon={<DeleteOutlined/>} disabled={disabled}>删除</Button>
|
|
183
|
+
</Popconfirm>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
</Space>}
|
|
188
|
+
>
|
|
189
|
+
|
|
190
|
+
{formValues == null ? <Empty description='未选择机构'/> : <Form
|
|
191
|
+
disabled={!this.state.formEditing}
|
|
192
|
+
labelCol={{flex: '150px'}}
|
|
193
|
+
wrapperCol={{flex: '400px'}}
|
|
194
|
+
initialValues={formValues}
|
|
195
|
+
onFinish={this.onFinish}
|
|
196
|
+
>
|
|
197
|
+
<Form.Item noStyle name='id'>
|
|
198
|
+
</Form.Item>
|
|
199
|
+
<Form.Item label='父节点' name='pid'>
|
|
200
|
+
<FieldRemoteTreeSelect url='admin/sysOrg/tree'/>
|
|
201
|
+
</Form.Item>
|
|
202
|
+
<Form.Item label='名称' name='name' rules={[{required: true}]}>
|
|
203
|
+
<Input />
|
|
204
|
+
</Form.Item>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<Form.Item label='类型' name='type' rules={[{required: true}]}>
|
|
208
|
+
<FieldDictRadio typeCode='orgType'/>
|
|
209
|
+
</Form.Item>
|
|
210
|
+
|
|
211
|
+
<Form.Item label='部门领导' name={['leader','id']} >
|
|
212
|
+
<FieldUserSelect />
|
|
213
|
+
</Form.Item>
|
|
214
|
+
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
215
|
+
<FieldRadioBoolean/>
|
|
216
|
+
</Form.Item>
|
|
217
|
+
<Form.Item label='扩展字段1' name='extra1'>
|
|
218
|
+
<Input />
|
|
219
|
+
</Form.Item>
|
|
220
|
+
<Form.Item label='扩展字段2' name='extra2'>
|
|
221
|
+
<Input />
|
|
222
|
+
</Form.Item>
|
|
223
|
+
<Form.Item label='扩展字段3' name='extra3'>
|
|
224
|
+
<Input />
|
|
225
|
+
</Form.Item>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
<Form.Item label=' ' colon={false}>
|
|
231
|
+
<Button type="primary" htmlType='submit'
|
|
232
|
+
loading={this.state.submitLoading}>保存</Button>
|
|
233
|
+
</Form.Item>
|
|
234
|
+
|
|
235
|
+
</Form>
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</Card>
|
|
240
|
+
</Splitter>
|
|
241
|
+
|
|
242
|
+
</Splitter>
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
</Page>
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
onDrop = (e) => {
|
|
249
|
+
const {dragNode, dropToGap, node} = e;
|
|
250
|
+
const dropKey = node.key;
|
|
251
|
+
const dragKey = dragNode.key;
|
|
252
|
+
|
|
253
|
+
const dropPos = e.node.pos.split('-');
|
|
254
|
+
const dropPosition = e.dropPosition - Number(dropPos[dropPos.length - 1]); // the drop position relative to the drop node, inside 0, top -1, bottom 1
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
console.log(dragNode.title, '->', node.title, 'dropToGap:', dropToGap, "dropPosition:" ,dropPosition)
|
|
258
|
+
HttpUtil.post('admin/sysOrg/sort', {dropPosition, dropToGap, dropKey, dragKey}).then(this.loadTree)
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|