@jiangood/open-admin 1.3.4 → 2.0.0
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 +3 -0
- package/package.json +5 -9
- package/src/.umi-production/appData.json +324 -338
- package/src/.umi-production/core/helmet.ts +1 -1
- package/src/.umi-production/core/history.ts +1 -1
- package/src/.umi-production/core/historyIntelli.ts +1 -1
- package/src/.umi-production/core/pluginConfig.ts +1 -1
- package/src/.umi-production/core/polyfill.ts +216 -216
- package/src/.umi-production/core/route.tsx +2 -3
- package/src/.umi-production/exports.ts +3 -3
- package/src/.umi-production/testBrowser.tsx +1 -1
- package/src/.umi-production/tsconfig.json +1 -1
- package/src/.umi-production/umi.ts +2 -2
- package/src/framework/components/ErrorBoundary/index.tsx +86 -0
- package/src/framework/components/Gap/{index.jsx → index.tsx} +1 -1
- package/src/framework/components/NamedIcon/index.d.ts +6 -4
- package/src/framework/components/NamedIcon/index.jsx +9 -6
- package/src/framework/components/OrgTree/{index.jsx → index.tsx} +10 -19
- package/src/framework/components/PageLoading/{index.jsx → index.tsx} +2 -5
- package/src/framework/components/ProModal/index.tsx +1 -1
- package/src/framework/components/ProTable/components/ToolBar/{index.jsx → index.tsx} +3 -3
- package/src/framework/components/ProTable/index.less +1 -1
- package/src/framework/components/ProTable/{index.jsx → index.tsx} +9 -7
- package/src/framework/components/ProTable/utils/index.ts +62 -0
- package/src/framework/components/RoleTree/{index.jsx → index.tsx} +7 -17
- package/src/framework/components/ValueType/{index.jsx → index.tsx} +2 -1
- package/src/framework/components/index.ts +2 -1
- package/src/framework/components/system/{ButtonList.jsx → ButtonList.tsx} +2 -2
- package/src/framework/components/system/index.tsx +4 -4
- package/src/framework/fields/BaseRemoteSelect/index.tsx +129 -0
- package/src/framework/fields/FieldDictSelect/{index.jsx → index.tsx} +10 -4
- package/src/framework/fields/FieldRemoteSelect/index.tsx +37 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.tsx +29 -0
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.tsx +33 -0
- package/src/framework/fields/FieldRemoteTree/index.tsx +31 -0
- package/src/framework/fields/FieldRemoteTreeCascader/index.tsx +39 -0
- package/src/framework/fields/FieldRemoteTreeSelect/index.tsx +39 -0
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.tsx +43 -0
- package/src/framework/fields/FieldSysOrgTree/{index.jsx → index.tsx} +2 -2
- package/src/framework/fields/FieldSysOrgTreeSelect/{index.jsx → index.tsx} +2 -2
- package/src/framework/fields/FieldTable/{index.jsx → index.tsx} +5 -5
- package/src/framework/fields/FieldUploadFile/{index.jsx → index.tsx} +1 -3
- package/src/framework/index.ts +0 -1
- package/src/framework/utils/ArrayUtils.ts +186 -0
- package/src/framework/utils/EventBusUtils.ts +0 -1
- package/src/framework/utils/MessageUtils.tsx +0 -2
- package/src/framework/utils/TreeUtils.ts +2 -2
- package/src/framework/utils/index.ts +1 -1
- package/src/framework/utils/system/FormRegistryUtils.ts +0 -1
- package/src/framework/utils/system/PermUtils.ts +2 -2
- package/src/framework/views/ViewApproveStatus/index.tsx +11 -0
- package/src/framework/views/ViewBoolean/index.tsx +6 -0
- package/src/framework/views/ViewFile/{index.jsx → index.tsx} +4 -4
- package/src/framework/views/ViewImage/{index.jsx → index.tsx} +3 -3
- package/src/framework/views/ViewPassword/{index.jsx → index.tsx} +2 -2
- package/src/framework/views/ViewProcessInstanceProgressButton/{index.jsx → index.tsx} +1 -2
- package/src/layouts/PageRender.jsx +6 -6
- package/src/layouts/admin/HeaderRight.jsx +2 -2
- package/src/layouts/admin/TabPageRender.jsx +28 -13
- package/src/layouts/admin/index.jsx +15 -14
- package/src/layouts/admin/index.less +1 -1
- package/src/layouts/index.jsx +12 -13
- package/src/layouts/index.less +2 -2
- package/src/pages/login.jsx +132 -4
- package/src/{framework/pages/LoginPage.less → pages/login.less} +3 -3
- package/src/pages/system/api/index.jsx +10 -10
- package/src/pages/system/dict/index.jsx +4 -3
- package/src/pages/system/file/index.jsx +6 -5
- package/src/pages/system/job/index.jsx +10 -9
- package/src/pages/system/{sysManual → manual}/index.jsx +1 -1
- package/src/pages/system/org/index.jsx +4 -5
- package/src/pages/system/role/index.jsx +5 -5
- package/src/pages/system/role/perm.jsx +6 -6
- package/src/pages/system/user/UserPerm.jsx +4 -4
- package/src/pages/system/user/index.jsx +2 -2
- package/src/pages/userCenter/ChangePassword.jsx +3 -5
- package/src/pages/userCenter/manual.jsx +1 -1
- package/src/pages/userCenter/message.jsx +1 -1
- package/src/framework/components/DownloadFileButton/index.d.ts +0 -11
- package/src/framework/components/Gap/index.d.ts +0 -23
- package/src/framework/components/LinkButton/index.d.ts +0 -14
- package/src/framework/components/OrgTree/index.d.ts +0 -4
- package/src/framework/components/Page/index.d.ts +0 -17
- package/src/framework/components/PageLoading/index.d.ts +0 -1
- package/src/framework/components/ProTable/index.d.ts +0 -42
- package/src/framework/components/ProTable/utils/index.js +0 -43
- package/src/framework/components/RoleTree/index.d.ts +0 -4
- package/src/framework/components/ViewRange/index.d.ts +0 -14
- package/src/framework/components/system/ButtonList.d.ts +0 -8
- package/src/framework/fields/FieldBoolean/index.d.ts +0 -9
- package/src/framework/fields/FieldDate/index.d.ts +0 -23
- package/src/framework/fields/FieldDateRange/index.d.ts +0 -22
- package/src/framework/fields/FieldDictSelect/index.d.ts +0 -12
- package/src/framework/fields/FieldEditor/index.d.ts +0 -14
- package/src/framework/fields/FieldNumberRange/index.d.ts +0 -10
- package/src/framework/fields/FieldPercent/index.d.ts +0 -8
- package/src/framework/fields/FieldRemoteSelect/index.d.ts +0 -44
- package/src/framework/fields/FieldRemoteSelect/index.jsx +0 -66
- package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteSelectMultiple/index.jsx +0 -85
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +0 -21
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.jsx +0 -88
- package/src/framework/fields/FieldRemoteTree/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteTree/index.jsx +0 -50
- package/src/framework/fields/FieldRemoteTreeCascader/index.d.ts +0 -18
- package/src/framework/fields/FieldRemoteTreeCascader/index.jsx +0 -59
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +0 -19
- package/src/framework/fields/FieldRemoteTreeSelect/index.jsx +0 -57
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +0 -20
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.jsx +0 -62
- package/src/framework/fields/FieldSysOrgTree/index.d.ts +0 -9
- package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +0 -9
- package/src/framework/fields/FieldTable/index.d.ts +0 -14
- package/src/framework/fields/FieldTableSelect/index.d.ts +0 -19
- package/src/framework/fields/FieldUploadFile/index.d.ts +0 -31
- package/src/framework/pages/LoginPage.d.ts +0 -16
- package/src/framework/pages/LoginPage.jsx +0 -135
- package/src/framework/pages/LoginPageUtils.ts +0 -36
- package/src/framework/pages/index.ts +0 -2
- package/src/framework/utils/ArrUtils.ts +0 -229
- package/src/framework/views/ViewApproveStatus/index.d.ts +0 -5
- package/src/framework/views/ViewApproveStatus/index.jsx +0 -15
- package/src/framework/views/ViewBoolean/index.d.ts +0 -3
- package/src/framework/views/ViewBoolean/index.jsx +0 -4
- package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +0 -5
- package/src/framework/views/ViewFile/index.d.ts +0 -10
- package/src/framework/views/ViewFileButton/index.d.ts +0 -10
- package/src/framework/views/ViewImage/index.d.ts +0 -6
- package/src/framework/views/ViewPassword/index.d.ts +0 -5
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +0 -12
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +0 -6
- package/src/framework/views/ViewText/index.d.ts +0 -16
- package/src/pages/test/views.jsx +0 -95
- package/src/framework/components/DownloadFileButton/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/LinkButton/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/Page/{index.jsx → index.tsx} +0 -0
- package/src/framework/components/ValueType/{registry.jsx → registry.tsx} +1 -1
- /package/src/framework/components/ViewRange/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldBoolean/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldDate/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldDateRange/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldEditor/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldNumberRange/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldPercent/{index.jsx → index.tsx} +0 -0
- /package/src/framework/fields/FieldTableSelect/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewBooleanEnableDisable/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewFileButton/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewProcessInstanceProgress/{index.jsx → index.tsx} +0 -0
- /package/src/framework/views/ViewText/{index.jsx → index.tsx} +0 -0
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
top: 20%;
|
|
18
18
|
|
|
19
19
|
.ant-form-item-label > label{
|
|
20
|
-
color: white
|
|
20
|
+
color: white;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
.login-page h1 {
|
|
47
|
+
.login-page.login-page h1 {
|
|
48
48
|
margin-bottom: 50px;
|
|
49
49
|
text-align: center;
|
|
50
|
-
color: white
|
|
50
|
+
color: white;
|
|
51
51
|
font-size: x-large;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -2,7 +2,7 @@ import {PlusOutlined} from '@ant-design/icons'
|
|
|
2
2
|
import {Button, Form, Input, message, Modal, Popconfirm, Switch, Table, Tabs} from 'antd'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
ArrayUtils,
|
|
6
6
|
ButtonList,
|
|
7
7
|
FieldBoolean,
|
|
8
8
|
FieldDate,
|
|
@@ -28,7 +28,7 @@ export default class extends React.Component {
|
|
|
28
28
|
tableRef = React.createRef()
|
|
29
29
|
|
|
30
30
|
componentDidMount() {
|
|
31
|
-
HttpUtils.get("/admin/apiAccount/
|
|
31
|
+
HttpUtils.get("/admin/apiAccount/perm-list").then(rs => {
|
|
32
32
|
this.setState({list: rs})
|
|
33
33
|
})
|
|
34
34
|
}
|
|
@@ -76,7 +76,7 @@ export default class extends React.Component {
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
title: '启用',
|
|
79
|
-
dataIndex: '
|
|
79
|
+
dataIndex: 'enabled',
|
|
80
80
|
render(v) {
|
|
81
81
|
return v == null ? null : (v ? '是' : '否')
|
|
82
82
|
},
|
|
@@ -123,16 +123,16 @@ export default class extends React.Component {
|
|
|
123
123
|
onGrantItemChange = (id, checked) => {
|
|
124
124
|
const perms = this.state.formValues.perms
|
|
125
125
|
if (checked) {
|
|
126
|
-
|
|
126
|
+
ArrayUtils.add(perms, id)
|
|
127
127
|
} else {
|
|
128
|
-
|
|
128
|
+
ArrayUtils.remove(perms, id)
|
|
129
129
|
}
|
|
130
130
|
this.setState({formValues: this.state.formValues})
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
onGrant = () => {
|
|
134
134
|
const hide = message.loading('授权中...', 0)
|
|
135
|
-
|
|
135
|
+
const accountId = this.state.formValues.id;
|
|
136
136
|
HttpUtils.post('admin/apiAccount/grant/'+accountId, this.state.formValues.perms).then(rs => {
|
|
137
137
|
this.setState({grantFormOpen: false})
|
|
138
138
|
this.tableRef.current.reload()
|
|
@@ -203,7 +203,7 @@ export default class extends React.Component {
|
|
|
203
203
|
open={this.state.formOpen}
|
|
204
204
|
onOk={() => this.formRef.current.submit()}
|
|
205
205
|
onCancel={() => this.setState({formOpen: false})}
|
|
206
|
-
|
|
206
|
+
destroyOnClose
|
|
207
207
|
mask={{closable:false}}
|
|
208
208
|
>
|
|
209
209
|
|
|
@@ -234,7 +234,7 @@ export default class extends React.Component {
|
|
|
234
234
|
<Form.Item label='有效期' name='endTime' style={{marginTop: 32}}>
|
|
235
235
|
<FieldDate type='YYYY-MM-DD'/>
|
|
236
236
|
</Form.Item>
|
|
237
|
-
<Form.Item label='启用' name='
|
|
237
|
+
<Form.Item label='启用' name='enabled' rules={[{required: true}]}>
|
|
238
238
|
<FieldBoolean/>
|
|
239
239
|
</Form.Item>
|
|
240
240
|
|
|
@@ -242,7 +242,7 @@ export default class extends React.Component {
|
|
|
242
242
|
</Modal>
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
<Modal title='权限列表'
|
|
245
|
+
<Modal title='权限列表' destroyOnClose={true} width={800}
|
|
246
246
|
open={this.state.grantFormOpen}
|
|
247
247
|
onCancel={() => this.setState({grantFormOpen: false, formValues: null})}
|
|
248
248
|
onOk={this.onGrant}
|
|
@@ -260,7 +260,7 @@ export default class extends React.Component {
|
|
|
260
260
|
{
|
|
261
261
|
dataIndex: 'option', title: '操作',
|
|
262
262
|
render: (_, record) => {
|
|
263
|
-
|
|
263
|
+
const id = record.id;
|
|
264
264
|
return <Switch checked={this.state.formValues.perms.includes(id)}
|
|
265
265
|
onChange={(checked) => {
|
|
266
266
|
this.onGrantItemChange(id, checked)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button, Form, Input, InputNumber, Modal, Popconfirm, Splitter, Tag, Tree, Typography} from "antd";
|
|
3
|
+
import {PlusOutlined} from "@ant-design/icons";
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
ButtonList,
|
|
5
7
|
FieldBoolean, FieldDictSelect, FieldRemoteSelect,
|
|
@@ -8,7 +10,6 @@ import {
|
|
|
8
10
|
ProTable,
|
|
9
11
|
ViewBooleanEnableDisable, ViewText
|
|
10
12
|
} from "../../../framework";
|
|
11
|
-
import {PlusOutlined} from "@ant-design/icons";
|
|
12
13
|
|
|
13
14
|
export default class extends React.Component {
|
|
14
15
|
|
|
@@ -132,7 +133,7 @@ export default class extends React.Component {
|
|
|
132
133
|
open={this.state.formOpen}
|
|
133
134
|
onOk={() => this.formRef.current.submit()}
|
|
134
135
|
onCancel={() => this.setState({formOpen: false})}
|
|
135
|
-
|
|
136
|
+
destroyOnClose
|
|
136
137
|
>
|
|
137
138
|
|
|
138
139
|
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
@@ -143,7 +144,7 @@ export default class extends React.Component {
|
|
|
143
144
|
<ViewText />
|
|
144
145
|
</Form.Item>
|
|
145
146
|
<Form.Item label='类型' name='typeCode' rules={[{required: true}]} >
|
|
146
|
-
<FieldRemoteSelect url='/admin/dict/
|
|
147
|
+
<FieldRemoteSelect url='/admin/dict/type-options' />
|
|
147
148
|
</Form.Item>
|
|
148
149
|
<Form.Item label='编码' name='code' rules={[{required: true}]}>
|
|
149
150
|
<Input/>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
2
1
|
import React from 'react'
|
|
3
|
-
import {
|
|
2
|
+
import {Button, Form, Input, Modal, Popconfirm} from 'antd'
|
|
4
3
|
import {CloudUploadOutlined} from "@ant-design/icons";
|
|
5
4
|
|
|
5
|
+
import {ButtonList, FieldDateRange, FieldDictSelect, FieldUploadFile, HttpUtils, ProTable} from "../../../framework";
|
|
6
|
+
|
|
6
7
|
export default class extends React.Component {
|
|
7
8
|
|
|
8
9
|
state = {
|
|
@@ -63,8 +64,8 @@ export default class extends React.Component {
|
|
|
63
64
|
|
|
64
65
|
if (record.imageUrls?.length > 0) {
|
|
65
66
|
for (let item of record.imageUrls) {
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
const url = item.url;
|
|
68
|
+
const label = item.label;
|
|
68
69
|
nodes.push(<a href={(url)} target='_blank' style={{marginLeft: 8}}>{label}</a>)
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -126,7 +127,7 @@ export default class extends React.Component {
|
|
|
126
127
|
this.tableRef.current.reload()
|
|
127
128
|
}}
|
|
128
129
|
footer={null}
|
|
129
|
-
|
|
130
|
+
destroyOnClose
|
|
130
131
|
>
|
|
131
132
|
<Form ref={this.formRef}
|
|
132
133
|
initialValues={this.state.formValues}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import {
|
|
2
3
|
Alert,
|
|
3
4
|
AutoComplete,
|
|
@@ -13,8 +14,8 @@ import {
|
|
|
13
14
|
Switch,
|
|
14
15
|
Tag
|
|
15
16
|
} from 'antd'
|
|
16
|
-
import React from 'react'
|
|
17
17
|
import {PlusOutlined} from "@ant-design/icons";
|
|
18
|
+
|
|
18
19
|
import {ButtonList, HttpUtils, Page, ProTable, StringUtils, ValueType} from "../../../framework";
|
|
19
20
|
|
|
20
21
|
|
|
@@ -63,7 +64,7 @@ export default class extends React.Component {
|
|
|
63
64
|
formRef = React.createRef()
|
|
64
65
|
|
|
65
66
|
componentDidMount() {
|
|
66
|
-
HttpUtils.get('admin/job/
|
|
67
|
+
HttpUtils.get('admin/job/job-class-options').then(rs => {
|
|
67
68
|
this.setState({jobClassOptions: rs})
|
|
68
69
|
})
|
|
69
70
|
}
|
|
@@ -78,7 +79,7 @@ export default class extends React.Component {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
loadJobParamFields(className, jobData) {
|
|
81
|
-
HttpUtils.post("admin/job/
|
|
82
|
+
HttpUtils.post("admin/job/get-job-param-fields", jobData || {}, {className}).then(rs => {
|
|
82
83
|
this.setState({paramList: rs})
|
|
83
84
|
})
|
|
84
85
|
}
|
|
@@ -98,7 +99,7 @@ export default class extends React.Component {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
handleTriggerJob = row => {
|
|
101
|
-
HttpUtils.get('admin/job/
|
|
102
|
+
HttpUtils.get('admin/job/trigger-job', {id: row.id}).then(rs => {
|
|
102
103
|
this.tableRef.current.reload();
|
|
103
104
|
})
|
|
104
105
|
}
|
|
@@ -194,7 +195,7 @@ export default class extends React.Component {
|
|
|
194
195
|
|
|
195
196
|
<Modal title='作业调度'
|
|
196
197
|
open={this.state.formOpen}
|
|
197
|
-
|
|
198
|
+
destroyOnClose
|
|
198
199
|
width={800}
|
|
199
200
|
onOk={() => this.formRef.current.submit()}
|
|
200
201
|
onCancel={() => this.setState({formOpen: false})}
|
|
@@ -253,7 +254,7 @@ export default class extends React.Component {
|
|
|
253
254
|
onCancel={() => this.setState({executeRecordOpen: false})}
|
|
254
255
|
footer={null}
|
|
255
256
|
width={1024}
|
|
256
|
-
|
|
257
|
+
destroyOnClose
|
|
257
258
|
>
|
|
258
259
|
<ProTable columns={[{
|
|
259
260
|
title: '开始时间',
|
|
@@ -288,13 +289,13 @@ export default class extends React.Component {
|
|
|
288
289
|
title: '操作',
|
|
289
290
|
dataIndex: 'option',
|
|
290
291
|
render: (_, record) => {
|
|
291
|
-
|
|
292
|
+
const url = '/admin/sys/log/' + record.id;
|
|
292
293
|
return <a href={url} target='_blank'>日志</a>;
|
|
293
294
|
},
|
|
294
295
|
}
|
|
295
296
|
]} request={params => {
|
|
296
297
|
params.jobId = this.state.formValues.id
|
|
297
|
-
return HttpUtils.get('admin/job/
|
|
298
|
+
return HttpUtils.get('admin/job/execute-record', params);
|
|
298
299
|
}}></ProTable>
|
|
299
300
|
|
|
300
301
|
</Modal>
|
|
@@ -306,7 +307,7 @@ export default class extends React.Component {
|
|
|
306
307
|
this.loadJobParamFields(values.jobClass)
|
|
307
308
|
const option = this.state.jobClassOptions.find(o => o.value === changed.jobClass)
|
|
308
309
|
if (option) {
|
|
309
|
-
|
|
310
|
+
const {label} = option;
|
|
310
311
|
if (StringUtils.contains(label, " ")) { // 取中文名部门设置为name
|
|
311
312
|
this.formRef.current.setFieldValue("name", label.split(" ")[1])
|
|
312
313
|
}
|
|
@@ -44,7 +44,7 @@ export default class extends React.Component {
|
|
|
44
44
|
|
|
45
45
|
const {params} = this.state
|
|
46
46
|
HttpUtils.get('admin/sysOrg/tree', params).then(rs => {
|
|
47
|
-
|
|
47
|
+
const treeData = rs;
|
|
48
48
|
this.setState({treeData})
|
|
49
49
|
}).finally(() => {
|
|
50
50
|
this.setState({treeLoading: false});
|
|
@@ -91,9 +91,9 @@ export default class extends React.Component {
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
render() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const {formValues} = this.state;
|
|
95
|
+
const disabled = formValues == null;
|
|
96
|
+
const params = this.state.params;
|
|
97
97
|
return <Page padding>
|
|
98
98
|
<Card>
|
|
99
99
|
<Space>
|
|
@@ -250,7 +250,6 @@ export default class extends React.Component {
|
|
|
250
250
|
const dropPosition = e.dropPosition - Number(dropPos[dropPos.length - 1]); // the drop position relative to the drop node, inside 0, top -1, bottom 1
|
|
251
251
|
|
|
252
252
|
|
|
253
|
-
console.log(dragNode.title, '->', node.title, 'dropToGap:', dropToGap, "dropPosition:", dropPosition)
|
|
254
253
|
HttpUtils.post('admin/sysOrg/sort', {dropPosition, dropToGap, dropKey, dragKey}).then(this.loadTree)
|
|
255
254
|
};
|
|
256
255
|
}
|
|
@@ -39,7 +39,7 @@ export default class extends React.Component {
|
|
|
39
39
|
|
|
40
40
|
handleEditUser = record => {
|
|
41
41
|
this.setState({usersModalOpen: true, formValues: record})
|
|
42
|
-
HttpUtils.get('admin/sysRole/
|
|
42
|
+
HttpUtils.get('admin/sysRole/user-list', {id: record.id}).then(rs => {
|
|
43
43
|
this.setState({userList: rs.list, targetKeys: rs.selectedKeys})
|
|
44
44
|
})
|
|
45
45
|
}
|
|
@@ -153,7 +153,7 @@ export default class extends React.Component {
|
|
|
153
153
|
id: this.state.formValues.id,
|
|
154
154
|
userIdList: this.state.targetKeys
|
|
155
155
|
}
|
|
156
|
-
HttpUtils.post('admin/sysRole/
|
|
156
|
+
HttpUtils.post('admin/sysRole/grant-users', params).then(rs => {
|
|
157
157
|
this.setState({usersModalOpen: false})
|
|
158
158
|
})
|
|
159
159
|
}
|
|
@@ -197,7 +197,7 @@ export default class extends React.Component {
|
|
|
197
197
|
open={this.state.formOpen}
|
|
198
198
|
onOk={() => this.formRef.current.submit()}
|
|
199
199
|
onCancel={() => this.setState({formOpen: false})}
|
|
200
|
-
|
|
200
|
+
destroyOnClose
|
|
201
201
|
maskClosable={false}
|
|
202
202
|
width={600}
|
|
203
203
|
>
|
|
@@ -238,7 +238,7 @@ export default class extends React.Component {
|
|
|
238
238
|
|
|
239
239
|
<Modal title={'角色用户' + "【" + this.state.formValues?.name + '】'}
|
|
240
240
|
open={this.state.usersModalOpen}
|
|
241
|
-
|
|
241
|
+
destroyOnClose
|
|
242
242
|
maskClosable={false}
|
|
243
243
|
width={800}
|
|
244
244
|
onCancel={() => this.setState({usersModalOpen: false})}
|
|
@@ -271,7 +271,7 @@ export default class extends React.Component {
|
|
|
271
271
|
|
|
272
272
|
<Modal title={'角色授权菜单权限' + "【" + this.state.formValues?.name + '】'}
|
|
273
273
|
open={this.state.menuOpen}
|
|
274
|
-
|
|
274
|
+
destroyOnClose
|
|
275
275
|
maskClosable={false}
|
|
276
276
|
width={800}
|
|
277
277
|
onCancel={() => this.setState({menuOpen: false})}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button, Card, Checkbox, Table, Typography} from "antd";
|
|
3
3
|
import {SaveOutlined} from "@ant-design/icons";
|
|
4
|
-
import {
|
|
4
|
+
import {ArrayUtils, HttpUtils, PageUtils} from "../../../framework";
|
|
5
5
|
export default class extends React.Component {
|
|
6
6
|
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ export default class extends React.Component {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const rowSelectedKey = this.state.rowSelectedKeys[record.id];
|
|
39
39
|
return <Checkbox.Group options={options}
|
|
40
40
|
value={rowSelectedKey}
|
|
41
41
|
onChange={(ks) => {
|
|
@@ -59,10 +59,10 @@ export default class extends React.Component {
|
|
|
59
59
|
HttpUtils.get('admin/sysRole/get', {id: this.roleId}).then(rs => {
|
|
60
60
|
this.setState({roleInfo: rs})
|
|
61
61
|
}),
|
|
62
|
-
HttpUtils.get('admin/sysRole/
|
|
62
|
+
HttpUtils.get('admin/sysRole/perm-tree-table', {id: this.roleId}).then(rs => {
|
|
63
63
|
this.setState({dataSource: rs})
|
|
64
64
|
}),
|
|
65
|
-
HttpUtils.get('admin/sysRole/
|
|
65
|
+
HttpUtils.get('admin/sysRole/own-perms', {id: this.roleId}).then(rs => {
|
|
66
66
|
this.setState({rowSelectedKeys: rs})
|
|
67
67
|
})
|
|
68
68
|
]).then(rs => {
|
|
@@ -80,9 +80,9 @@ export default class extends React.Component {
|
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
82
|
menus.push(menuId)
|
|
83
|
-
|
|
83
|
+
ArrayUtils.addAll(perms, ks)
|
|
84
84
|
}
|
|
85
|
-
HttpUtils.post('admin/sysRole/
|
|
85
|
+
HttpUtils.post('admin/sysRole/save-perms', {id: this.roleId, perms, menus}).then(rs => {
|
|
86
86
|
// Page.open(PageUtils.currentPathname(), PageUtils.currentLabel())
|
|
87
87
|
})
|
|
88
88
|
};
|
|
@@ -20,7 +20,7 @@ export default class UserPerm extends React.Component {
|
|
|
20
20
|
show(item) {
|
|
21
21
|
this.setState({visible: true})
|
|
22
22
|
|
|
23
|
-
HttpUtils.get('admin/sysUser/
|
|
23
|
+
HttpUtils.get('admin/sysUser/get-perm-info', {id: item.id}).then(rs => {
|
|
24
24
|
this.setState({formValues: rs})
|
|
25
25
|
this.formRef.current.setFieldsValue(rs)
|
|
26
26
|
})
|
|
@@ -34,7 +34,7 @@ export default class UserPerm extends React.Component {
|
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
HttpUtils.post('admin/sysUser/
|
|
37
|
+
HttpUtils.post('admin/sysUser/grant-perm', values).then(rs => {
|
|
38
38
|
this.setState({
|
|
39
39
|
visible: false,
|
|
40
40
|
confirmLoading: false
|
|
@@ -49,11 +49,11 @@ export default class UserPerm extends React.Component {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
render() {
|
|
52
|
-
|
|
52
|
+
const {visible, confirmLoading} = this.state
|
|
53
53
|
|
|
54
54
|
return <Modal
|
|
55
55
|
title="授权"
|
|
56
|
-
|
|
56
|
+
destroyOnClose
|
|
57
57
|
width={600}
|
|
58
58
|
open={visible}
|
|
59
59
|
confirmLoading={confirmLoading}
|
|
@@ -30,7 +30,7 @@ export default class extends React.Component {
|
|
|
30
30
|
tableRef = React.createRef()
|
|
31
31
|
|
|
32
32
|
resetPwd(row) {
|
|
33
|
-
HttpUtils.post('admin/sysUser/
|
|
33
|
+
HttpUtils.post('admin/sysUser/reset-pwd', {id: row.id}).then(rs => {
|
|
34
34
|
Modal.success({
|
|
35
35
|
title: '重置密码成功',
|
|
36
36
|
content: rs
|
|
@@ -206,7 +206,7 @@ export default class extends React.Component {
|
|
|
206
206
|
open={this.state.formOpen}
|
|
207
207
|
onOk={() => this.formRef.current.submit()}
|
|
208
208
|
onCancel={() => this.setState({formOpen: false})}
|
|
209
|
-
|
|
209
|
+
destroyOnClose
|
|
210
210
|
>
|
|
211
211
|
|
|
212
212
|
<Form ref={this.formRef} labelCol={{flex: '100px'}}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Button, Form, Input, Modal} from "antd";
|
|
3
|
-
|
|
4
|
-
|
|
5
3
|
import {history} from 'umi'
|
|
6
|
-
import {HttpUtils} from "../../framework";
|
|
4
|
+
import {HttpUtils, SysUtils} from "../../framework";
|
|
7
5
|
|
|
8
6
|
export default class extends React.Component {
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
onFinish = (values) => {
|
|
12
|
-
HttpUtils.post('admin/userCenter/
|
|
10
|
+
HttpUtils.post('admin/userCenter/update-pwd', values).then(() => {
|
|
13
11
|
Modal.success({
|
|
14
12
|
title: '提示',
|
|
15
13
|
content: '修改密码成功',
|
|
@@ -23,7 +21,7 @@ export default class extends React.Component {
|
|
|
23
21
|
|
|
24
22
|
validator = (rule, value) => {
|
|
25
23
|
return new Promise((resolve, reject) => {
|
|
26
|
-
HttpUtils.get("admin/sysUser/
|
|
24
|
+
HttpUtils.get("admin/sysUser/pwd-strength", {password: value}).then(response => {
|
|
27
25
|
const rs = response.data
|
|
28
26
|
if (!rs.success) {
|
|
29
27
|
reject(rs.message)
|
|
@@ -45,7 +45,7 @@ export default class extends React.Component {
|
|
|
45
45
|
return <Page>
|
|
46
46
|
<ProTable
|
|
47
47
|
actionRef={this.tableRef}
|
|
48
|
-
request={(params) => HttpUtils.get('admin/sysManual/
|
|
48
|
+
request={(params) => HttpUtils.get('admin/sysManual/page-for-user', params)}
|
|
49
49
|
columns={this.columns}
|
|
50
50
|
/>
|
|
51
51
|
</Page>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
// 推荐(16+8n)px 作为间隔,n为自然数
|
|
5
|
-
declare type GapProps = {
|
|
6
|
-
/**
|
|
7
|
-
* mini 4px
|
|
8
|
-
* middle 8px
|
|
9
|
-
* large 16px
|
|
10
|
-
*
|
|
11
|
-
* 默认 middle
|
|
12
|
-
*/
|
|
13
|
-
size?: 'small' | 'middle' | 'large';
|
|
14
|
-
|
|
15
|
-
/** 方向:水平或垂直
|
|
16
|
-
* 默认垂直:上下间隔
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
direction?: 'horizontal' | 'vertical';
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export class Gap extends React.Component<GapProps, any> {
|
|
23
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
interface LinkButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* 路径
|
|
7
|
-
*/
|
|
8
|
-
path: string;
|
|
9
|
-
label: string;
|
|
10
|
-
type?: 'primary' | 'default' | 'dashed' | 'link' | 'text' | 'ghost'
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export class LinkButton extends React.Component<LinkButtonProps, any> {
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function PageLoading(props: { message?: string });
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import React from "react";
|
|
3
|
-
import {ColumnsType} from "antd/es/table";
|
|
4
|
-
|
|
5
|
-
declare type ProTableProps = {
|
|
6
|
-
columns: ColumnsType,
|
|
7
|
-
/**
|
|
8
|
-
* 请求函数
|
|
9
|
-
*/
|
|
10
|
-
request: (params:any)=>{};
|
|
11
|
-
|
|
12
|
-
rowKey?: string,
|
|
13
|
-
|
|
14
|
-
// 选择行,通ant table
|
|
15
|
-
rowSelection?: any,
|
|
16
|
-
|
|
17
|
-
toolBarRender?: (params:any, {selectedRows:[],selectedRowKeys:[]})=>{},
|
|
18
|
-
bordered?:boolean,
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 默认每页数量
|
|
22
|
-
*/
|
|
23
|
-
defaultPageSize?:number,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 查询表单的引用
|
|
27
|
-
*/
|
|
28
|
-
formRef?: React.Ref<any>,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
showToolbarSearch?:boolean
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 垂直滚动条, true自动计算, 也可指定高度
|
|
37
|
-
*/
|
|
38
|
-
scrollY?: boolean | number
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export class ProTable extends React.Component<ProTableProps, any> {
|
|
42
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 获取用户的 action 信息
|
|
3
|
-
*
|
|
4
|
-
* @param actionRef
|
|
5
|
-
* @param counter
|
|
6
|
-
* @param onCleanSelected
|
|
7
|
-
*/
|
|
8
|
-
export function useActionType(
|
|
9
|
-
ref,
|
|
10
|
-
action,
|
|
11
|
-
props,
|
|
12
|
-
) {
|
|
13
|
-
/** 这里生成action的映射,保证 action 总是使用的最新 只需要渲染一次即可 */
|
|
14
|
-
const userAction = {
|
|
15
|
-
pageInfo: action.pageInfo,
|
|
16
|
-
reload: async (resetPageIndex) => {
|
|
17
|
-
// 如果为 true,回到第一页
|
|
18
|
-
if (resetPageIndex) {
|
|
19
|
-
await action.setPageInfo({
|
|
20
|
-
current: 1,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
action?.reload();
|
|
24
|
-
},
|
|
25
|
-
reloadAndRest: async () => {
|
|
26
|
-
// reload 之后大概率会切换数据,清空一下选择。
|
|
27
|
-
props.onCleanSelected();
|
|
28
|
-
await action.setPageInfo({
|
|
29
|
-
current: 1,
|
|
30
|
-
});
|
|
31
|
-
await action?.reload();
|
|
32
|
-
},
|
|
33
|
-
reset: async () => {
|
|
34
|
-
await props.resetAll();
|
|
35
|
-
await action?.reset?.();
|
|
36
|
-
await action?.reload();
|
|
37
|
-
},
|
|
38
|
-
clearSelected: () => props.onCleanSelected(),
|
|
39
|
-
setPageInfo: (rest) => action.setPageInfo(rest),
|
|
40
|
-
};
|
|
41
|
-
// eslint-disable-next-line no-param-reassign
|
|
42
|
-
ref.current = userAction;
|
|
43
|
-
}
|