cfel-base-components 2.2.5 → 2.3.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/package.json +1 -1
- package/src/apiRequest/config.ts +0 -1
- package/src/components/layout/index.tsx +8 -7
- package/src/components/universal-pages/cpcRole/index.tsx +15 -1
- package/src/components/universal-pages/cpcRoleInfo/api.ts +15 -0
- package/src/components/universal-pages/cpcRoleInfo/index.scss +15 -2
- package/src/components/universal-pages/cpcRoleInfo/index.tsx +382 -153
package/package.json
CHANGED
package/src/apiRequest/config.ts
CHANGED
|
@@ -3,6 +3,11 @@ import { Layout, Menu, MenuProps, Popover } from 'antd';
|
|
|
3
3
|
import { SwapOutlined, FormOutlined } from '@ant-design/icons';
|
|
4
4
|
import "./index.scss"
|
|
5
5
|
|
|
6
|
+
const currencyList = [
|
|
7
|
+
{ value: 'JPY', label: '日元', icon: '¥' },
|
|
8
|
+
{ value: 'USD', label: '美元', icon: "$" },
|
|
9
|
+
{ value: 'CNY', label: '人民币', icon: '¥' }
|
|
10
|
+
]
|
|
6
11
|
export interface LiosLayoutlProps {
|
|
7
12
|
appName?: any;
|
|
8
13
|
productCode: string;
|
|
@@ -94,11 +99,6 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
94
99
|
|
|
95
100
|
const [collapsed, setCollapsed] = useState(false);
|
|
96
101
|
|
|
97
|
-
const [currencyList, setCurrencyList] = useState([
|
|
98
|
-
{ value: 'JPY', label: '日元', icon: '¥' },
|
|
99
|
-
{ value: 'USD', label: '美元', icon: "$" },
|
|
100
|
-
{ value: 'CNY', label: '人民币', icon: '¥' }
|
|
101
|
-
])
|
|
102
102
|
|
|
103
103
|
// useEffect(() => {
|
|
104
104
|
// if (!productList) return
|
|
@@ -165,7 +165,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
{
|
|
168
|
-
amountInfo &&
|
|
168
|
+
amountInfo &&
|
|
169
169
|
<div className='lios-li'>
|
|
170
170
|
<div className='lios-key'>抵用金余额</div>
|
|
171
171
|
<div className='lios-value'><span>{currencyText(currencyCode)}</span>
|
|
@@ -173,7 +173,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
173
173
|
</div>
|
|
174
174
|
</div>
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
</div>
|
|
178
178
|
}
|
|
179
179
|
{
|
|
@@ -239,6 +239,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
239
239
|
const MenuStyle = {
|
|
240
240
|
width: collapsed ? 80 : 240
|
|
241
241
|
}
|
|
242
|
+
|
|
242
243
|
return (
|
|
243
244
|
<Layout className="layout-warp">
|
|
244
245
|
{
|
|
@@ -20,7 +20,6 @@ import "./index.scss"
|
|
|
20
20
|
export interface RoleProps {
|
|
21
21
|
historyAction: any;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
export default function Role({
|
|
25
24
|
historyAction
|
|
26
25
|
}: RoleProps) {
|
|
@@ -41,6 +40,21 @@ export default function Role({
|
|
|
41
40
|
title: '角色名称',
|
|
42
41
|
dataIndex: 'roleName',
|
|
43
42
|
key: 'roleName',
|
|
43
|
+
render: (text: any, data: any) => {
|
|
44
|
+
return (
|
|
45
|
+
<span
|
|
46
|
+
style={{ cursor: "pointer", color: "#1677ff" }}
|
|
47
|
+
onClick={() => {
|
|
48
|
+
historyAction?.push({
|
|
49
|
+
pathname: `/role-info`,
|
|
50
|
+
search: `?roleCode=${data.roleCode}`,
|
|
51
|
+
});
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{data?.roleName}
|
|
55
|
+
</span>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
44
58
|
},
|
|
45
59
|
{
|
|
46
60
|
title: '角色编码',
|
|
@@ -20,3 +20,18 @@ export const roleUnboundAccounts= (data?: any) => {
|
|
|
20
20
|
export const getRole= (data?: any) => {
|
|
21
21
|
return request.post("/api/permission/role/getRole.json", { ...data })
|
|
22
22
|
}
|
|
23
|
+
//返回角色下的资源订阅树
|
|
24
|
+
export const getAuthTree = (data?: any) => {
|
|
25
|
+
return request.post(
|
|
26
|
+
"/sdk/permission/rbac/console/resource-role/getAuthTree.json",
|
|
27
|
+
{ ...data },
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
//分页查询权限策略授权信息
|
|
31
|
+
export const policyAuthorizePage = (data?: any) => {
|
|
32
|
+
return request.post(
|
|
33
|
+
"/sdk/permission/abac/console/policy-authorize/page.json",
|
|
34
|
+
{ ...data },
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
.basicInfoWrap {
|
|
2
|
-
padding: 0 24px
|
|
3
|
-
}
|
|
2
|
+
padding: 0 24px;
|
|
3
|
+
}
|
|
4
|
+
.jsonWarp {
|
|
5
|
+
padding: 0px 44px 10px;
|
|
6
|
+
}
|
|
7
|
+
.tableActionWarp {
|
|
8
|
+
float: right;
|
|
9
|
+
margin-bottom: 15px;
|
|
10
|
+
}
|
|
11
|
+
.paginBox {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
align-items: center;
|
|
15
|
+
margin: 10px 0px;
|
|
16
|
+
}
|
|
@@ -1,134 +1,269 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from
|
|
2
|
-
import useTableHooks from "../../../hooks/useTableHooks"
|
|
3
|
-
|
|
4
|
-
import PageContainer from
|
|
5
|
-
import QueryFilter from
|
|
6
|
-
import ProTable from
|
|
7
|
-
import Pagination from
|
|
8
|
-
import { get } from
|
|
9
|
-
import { ProFormText
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import useTableHooks from "../../../hooks/useTableHooks";
|
|
3
|
+
|
|
4
|
+
import PageContainer from "../../base-component/PageContainer";
|
|
5
|
+
import QueryFilter from "../../base-component/QueryFilter";
|
|
6
|
+
import ProTable from "../../base-component/ProTable";
|
|
7
|
+
import Pagination from "../../base-component/Pagination";
|
|
8
|
+
import { get } from "lodash";
|
|
9
|
+
import { ProFormText } from "@ant-design/pro-components";
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
Divider,
|
|
13
|
+
Modal,
|
|
14
|
+
Descriptions,
|
|
15
|
+
Space,
|
|
16
|
+
message,
|
|
17
|
+
Tabs,
|
|
18
|
+
Table,
|
|
19
|
+
} from "antd";
|
|
20
|
+
import EditAccountDrawer from "./EditAccountDrawer/index";
|
|
21
|
+
import { timeFormatter, getUrlParams } from "../../../utils";
|
|
13
22
|
import {
|
|
14
23
|
pageBoundAccounts,
|
|
15
24
|
roleBoundAccounts,
|
|
16
25
|
roleUnboundAccounts,
|
|
17
26
|
getRole,
|
|
18
|
-
queryByKeyword
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
queryByKeyword,
|
|
28
|
+
// getAuthTree,
|
|
29
|
+
policyAuthorizePage,
|
|
30
|
+
} from "./api";
|
|
31
|
+
import "./index.scss";
|
|
32
|
+
import { InteractionOutlined } from "@ant-design/icons";
|
|
33
|
+
import dayjs from "dayjs";
|
|
34
|
+
|
|
35
|
+
export interface RoleInfoProps {
|
|
36
|
+
isShowTab: {
|
|
37
|
+
main: boolean;
|
|
38
|
+
tableResource: boolean;
|
|
39
|
+
tableEmpower: boolean;
|
|
40
|
+
tableData: boolean;
|
|
41
|
+
};
|
|
42
|
+
getAuthTree?: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default function RoleInfo({ isShowTab, getAuthTree }: RoleInfoProps) {
|
|
46
|
+
const searchFormRef: any = useRef();
|
|
47
|
+
const [roleCode, setRoleCode] = useState(getUrlParams("roleCode"));
|
|
48
|
+
const [roleInfo, setRoleInfo]: any = useState({});
|
|
26
49
|
const [editAccountOpen, setEditAccountOpen] = useState(false);
|
|
50
|
+
const [tabCheck, setTabCheck] = useState("main");
|
|
51
|
+
|
|
52
|
+
const [ResourceTableData, setResourceTableData]: any = useState([]); //关联资源
|
|
53
|
+
const [isTableLoading, setisTableLoading] = useState(false);
|
|
54
|
+
|
|
55
|
+
const [TableItemData, setTableItemData]: any = useState([
|
|
56
|
+
{
|
|
57
|
+
key: "main",
|
|
58
|
+
label: `关联账号`,
|
|
59
|
+
icon: <InteractionOutlined />,
|
|
60
|
+
},
|
|
61
|
+
]); //tab 数据
|
|
27
62
|
|
|
28
63
|
const columns: any = [
|
|
29
64
|
{
|
|
30
|
-
title:
|
|
31
|
-
dataIndex:
|
|
32
|
-
key:
|
|
65
|
+
title: "名称",
|
|
66
|
+
dataIndex: "name",
|
|
67
|
+
key: "name",
|
|
33
68
|
},
|
|
34
69
|
{
|
|
35
|
-
title:
|
|
36
|
-
dataIndex:
|
|
37
|
-
key:
|
|
70
|
+
title: "账号",
|
|
71
|
+
dataIndex: "account",
|
|
72
|
+
key: "account",
|
|
38
73
|
},
|
|
39
74
|
{
|
|
40
|
-
title:
|
|
41
|
-
dataIndex:
|
|
42
|
-
key:
|
|
75
|
+
title: "工号",
|
|
76
|
+
dataIndex: "jobNumber",
|
|
77
|
+
key: "jobNumber",
|
|
43
78
|
},
|
|
44
79
|
{
|
|
45
|
-
title:
|
|
46
|
-
dataIndex:
|
|
47
|
-
key:
|
|
80
|
+
title: "手机号",
|
|
81
|
+
dataIndex: "mobile",
|
|
82
|
+
key: "mobile",
|
|
48
83
|
},
|
|
49
84
|
{
|
|
50
|
-
title:
|
|
51
|
-
dataIndex:
|
|
52
|
-
key:
|
|
85
|
+
title: "邮箱",
|
|
86
|
+
dataIndex: "email",
|
|
87
|
+
key: "email",
|
|
53
88
|
copyable: true,
|
|
54
89
|
},
|
|
55
90
|
{
|
|
56
|
-
title:
|
|
57
|
-
dataIndex:
|
|
58
|
-
key:
|
|
91
|
+
title: "是否企业管理员",
|
|
92
|
+
dataIndex: "isAdmin",
|
|
93
|
+
key: "isAdmin",
|
|
59
94
|
render: (cell: any) => {
|
|
60
95
|
if (cell) {
|
|
61
|
-
return
|
|
96
|
+
return "是";
|
|
62
97
|
} else {
|
|
63
|
-
return
|
|
98
|
+
return "否";
|
|
64
99
|
}
|
|
65
|
-
}
|
|
100
|
+
},
|
|
66
101
|
},
|
|
67
102
|
{
|
|
68
|
-
title:
|
|
69
|
-
dataIndex:
|
|
70
|
-
key:
|
|
103
|
+
title: "创建时间",
|
|
104
|
+
dataIndex: "gmtCreate",
|
|
105
|
+
key: "gmtCreate",
|
|
71
106
|
render: (cell: any) => {
|
|
72
|
-
return timeFormatter(cell)
|
|
73
|
-
}
|
|
107
|
+
return timeFormatter(cell);
|
|
108
|
+
},
|
|
74
109
|
},
|
|
75
110
|
{
|
|
76
|
-
title:
|
|
77
|
-
dataIndex:
|
|
78
|
-
key:
|
|
111
|
+
title: "修改时间",
|
|
112
|
+
dataIndex: "gmtModified",
|
|
113
|
+
key: "gmtModified",
|
|
79
114
|
render: (cell: any) => {
|
|
80
|
-
return timeFormatter(cell)
|
|
81
|
-
}
|
|
115
|
+
return timeFormatter(cell);
|
|
116
|
+
},
|
|
82
117
|
},
|
|
83
118
|
{
|
|
84
|
-
title:
|
|
119
|
+
title: "操作",
|
|
85
120
|
width: 80,
|
|
86
121
|
fixed: "right",
|
|
87
|
-
render: (rowdata: any
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
render: (rowdata: any) => (
|
|
123
|
+
<Space>
|
|
124
|
+
<a
|
|
125
|
+
onClick={() => {
|
|
126
|
+
Modal.confirm({
|
|
127
|
+
title: "确认解绑吗?",
|
|
128
|
+
content: "",
|
|
129
|
+
onOk: () => {
|
|
130
|
+
roleUnboundAccountsFunc(rowdata.id);
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
解绑
|
|
136
|
+
</a>
|
|
137
|
+
</Space>
|
|
138
|
+
),
|
|
99
139
|
},
|
|
100
140
|
];
|
|
101
141
|
|
|
142
|
+
const TableResource: any = [
|
|
143
|
+
{
|
|
144
|
+
title: "资源名称",
|
|
145
|
+
dataIndex: "name",
|
|
146
|
+
key: "name",
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
const TablePolicy: any = [
|
|
150
|
+
{
|
|
151
|
+
title: "授权主体",
|
|
152
|
+
dataIndex: "subject",
|
|
153
|
+
key: "subject",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: "权限策略",
|
|
157
|
+
dataIndex: "policy",
|
|
158
|
+
key: "policy",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
title: "资源组",
|
|
162
|
+
dataIndex: "group",
|
|
163
|
+
key: "group",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
title: "授权时间",
|
|
167
|
+
dataIndex: "gmtModified",
|
|
168
|
+
key: "gmtModified",
|
|
169
|
+
render: (text: any, data: any) => {
|
|
170
|
+
return dayjs(text).format("YYYY-MM-DD HH:mm:ss") || "数据格式错误";
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
];
|
|
102
174
|
useEffect(() => {
|
|
103
|
-
|
|
104
|
-
}, [])
|
|
175
|
+
init();
|
|
176
|
+
}, []);
|
|
177
|
+
|
|
178
|
+
const init = () => {
|
|
179
|
+
let data: any = [];
|
|
180
|
+
if (isShowTab?.tableResource) {
|
|
181
|
+
data.push({
|
|
182
|
+
label: "关联资源",
|
|
183
|
+
key: "tableResource",
|
|
184
|
+
icon: <InteractionOutlined />,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (isShowTab?.tableEmpower) {
|
|
188
|
+
data.push({
|
|
189
|
+
label: "关联授权",
|
|
190
|
+
key: "tableEmpower",
|
|
191
|
+
icon: <InteractionOutlined />,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (isShowTab?.tableData) {
|
|
195
|
+
data.push({
|
|
196
|
+
label: "关联数据",
|
|
197
|
+
key: "tableData",
|
|
198
|
+
icon: <InteractionOutlined />,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
setTableItemData([...TableItemData, ...data]);
|
|
202
|
+
};
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
if (tabCheck == "tableEmpower") {
|
|
205
|
+
policy?.execute({
|
|
206
|
+
subjectCodes: [roleCode],
|
|
207
|
+
}); // 获取授权策略
|
|
208
|
+
} else if (tabCheck == "tableResource") {
|
|
209
|
+
getAuthTreeFunc(); // 获取关联资源
|
|
210
|
+
} else {
|
|
211
|
+
initGetData();
|
|
212
|
+
}
|
|
213
|
+
}, [tabCheck]);
|
|
214
|
+
|
|
215
|
+
//获取关联资源
|
|
216
|
+
const getAuthTreeFunc = () => {
|
|
217
|
+
setisTableLoading(true);
|
|
218
|
+
getAuthTree && getAuthTree({
|
|
219
|
+
roleCode: roleCode,
|
|
220
|
+
}).then((res: any) => {
|
|
221
|
+
setisTableLoading(false);
|
|
222
|
+
let data: any = resourceAction(res);
|
|
223
|
+
setResourceTableData(data);
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const resourceAction: any = (data: any) => {
|
|
228
|
+
if (Object.prototype.toString.call(data) === "[object Array]") {
|
|
229
|
+
data.map((item: any) => {
|
|
230
|
+
return resourceAction(item);
|
|
231
|
+
});
|
|
232
|
+
return data;
|
|
233
|
+
} else if (Object.prototype.toString.call(data) === "[object Object]") {
|
|
234
|
+
if (data.children && data.children.length !== 0) {
|
|
235
|
+
return resourceAction(data.children);
|
|
236
|
+
} else {
|
|
237
|
+
delete data.children;
|
|
238
|
+
return data;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
105
242
|
|
|
106
243
|
//初始化请求数据
|
|
107
|
-
const initGetData = (
|
|
108
|
-
let roleCode = getUrlParams('roleCode')
|
|
109
|
-
setRoleCode(roleCode)
|
|
244
|
+
const initGetData = () => {
|
|
110
245
|
if (roleCode) {
|
|
111
|
-
getRoleFunc({ roleCode })
|
|
112
|
-
execute({
|
|
246
|
+
getRoleFunc({ roleCode });
|
|
247
|
+
execute({ roleCode: roleCode });
|
|
113
248
|
}
|
|
114
|
-
}
|
|
249
|
+
};
|
|
115
250
|
const getRoleFunc = (data: any) => {
|
|
116
|
-
setRoleInfo({})
|
|
251
|
+
setRoleInfo({});
|
|
117
252
|
getRole({
|
|
118
253
|
...data,
|
|
119
254
|
}).then((res: any) => {
|
|
120
|
-
setRoleInfo(res || {})
|
|
121
|
-
})
|
|
122
|
-
}
|
|
255
|
+
setRoleInfo(res || {});
|
|
256
|
+
});
|
|
257
|
+
};
|
|
123
258
|
const roleUnboundAccountsFunc = (account: any) => {
|
|
124
259
|
roleUnboundAccounts({
|
|
125
|
-
|
|
126
|
-
|
|
260
|
+
accountIds: [account],
|
|
261
|
+
roleCode: roleCode,
|
|
127
262
|
}).then((res: any) => {
|
|
128
|
-
message.success(
|
|
129
|
-
execute({
|
|
130
|
-
})
|
|
131
|
-
}
|
|
263
|
+
message.success("解绑成功");
|
|
264
|
+
execute({ roleCode: roleCode });
|
|
265
|
+
});
|
|
266
|
+
};
|
|
132
267
|
|
|
133
268
|
const readDataList = ({
|
|
134
269
|
innerPageNo,
|
|
@@ -139,108 +274,202 @@ export default function RoleInfo() {
|
|
|
139
274
|
currentPage: innerPageNo,
|
|
140
275
|
pageSize: innerPageSize,
|
|
141
276
|
...searchFormRef.current,
|
|
142
|
-
...otherOptions
|
|
277
|
+
...otherOptions,
|
|
143
278
|
}).then((res: any) => {
|
|
144
|
-
let records = get(res, "records", [])
|
|
145
|
-
let total = get(res, "total", 0)
|
|
279
|
+
let records = get(res, "records", []);
|
|
280
|
+
let total = get(res, "total", 0);
|
|
146
281
|
return {
|
|
147
282
|
dataList: records,
|
|
148
|
-
totalCount: total
|
|
149
|
-
}
|
|
150
|
-
})
|
|
151
|
-
}
|
|
283
|
+
totalCount: total,
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
};
|
|
152
287
|
const { execute, dataList, isLoading, pagination } = useTableHooks({
|
|
153
|
-
asyncFunction: readDataList
|
|
154
|
-
})
|
|
288
|
+
asyncFunction: readDataList,
|
|
289
|
+
});
|
|
155
290
|
|
|
156
291
|
const handleRoload = () => {
|
|
157
|
-
execute({
|
|
158
|
-
}
|
|
292
|
+
execute({ roleCode: roleCode });
|
|
293
|
+
};
|
|
159
294
|
|
|
160
295
|
const getQueryBoundRolesFunc = async () => {
|
|
161
|
-
setEditAccountOpen(true)
|
|
162
|
-
}
|
|
296
|
+
setEditAccountOpen(true);
|
|
297
|
+
};
|
|
163
298
|
|
|
164
299
|
const roleBoundAccountsFunc = ({ accountIds }: any) => {
|
|
165
300
|
return roleBoundAccounts({
|
|
166
|
-
|
|
167
|
-
|
|
301
|
+
accountIds: accountIds,
|
|
302
|
+
roleCode: roleCode,
|
|
168
303
|
}).then((res: any) => {
|
|
169
|
-
message.success(`添加账号成功`)
|
|
170
|
-
execute({
|
|
171
|
-
setEditAccountOpen(false)
|
|
172
|
-
})
|
|
173
|
-
}
|
|
304
|
+
message.success(`添加账号成功`);
|
|
305
|
+
execute({ roleCode: roleCode });
|
|
306
|
+
setEditAccountOpen(false);
|
|
307
|
+
});
|
|
308
|
+
};
|
|
174
309
|
//搜索关键字
|
|
175
310
|
const queryByKeywordFunc = ({ keyword }: any) => {
|
|
176
311
|
return queryByKeyword({
|
|
177
|
-
keyword
|
|
178
|
-
})
|
|
179
|
-
}
|
|
312
|
+
keyword,
|
|
313
|
+
});
|
|
314
|
+
};
|
|
180
315
|
|
|
181
316
|
const handleOnReset: any = async (values: any) => {
|
|
182
|
-
searchFormRef.current = { ...values }
|
|
317
|
+
searchFormRef.current = { ...values };
|
|
183
318
|
execute({
|
|
184
319
|
innerPageNo: 1,
|
|
185
|
-
|
|
186
|
-
})
|
|
187
|
-
}
|
|
320
|
+
roleCode: roleCode,
|
|
321
|
+
});
|
|
322
|
+
};
|
|
188
323
|
|
|
189
324
|
const handleOnFinish: any = async (values: any) => {
|
|
190
|
-
searchFormRef.current = { ...values }
|
|
191
|
-
execute({
|
|
192
|
-
}
|
|
325
|
+
searchFormRef.current = { ...values };
|
|
326
|
+
execute({ roleCode: roleCode });
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const readDataListByPolicy = ({
|
|
330
|
+
innerPageNo,
|
|
331
|
+
innerPageSize,
|
|
332
|
+
...otherOptions
|
|
333
|
+
}: any) => {
|
|
334
|
+
return policyAuthorizePage({
|
|
335
|
+
currentPage: innerPageNo,
|
|
336
|
+
pageSize: innerPageSize,
|
|
337
|
+
...otherOptions,
|
|
338
|
+
}).then((res: any) => {
|
|
339
|
+
let records = get(res, "records", []);
|
|
340
|
+
let total = get(res, "total", 0);
|
|
341
|
+
return {
|
|
342
|
+
dataList: records,
|
|
343
|
+
totalCount: total,
|
|
344
|
+
};
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
let policy = useTableHooks({
|
|
348
|
+
asyncFunction: readDataListByPolicy,
|
|
349
|
+
});
|
|
350
|
+
|
|
193
351
|
return (
|
|
194
352
|
<PageContainer>
|
|
195
353
|
<Divider orientation="left">{roleInfo?.roleName || "-"}</Divider>
|
|
196
354
|
<Descriptions className="basicInfoWrap">
|
|
197
|
-
<Descriptions.Item label="角色名称">
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<Descriptions.Item label="
|
|
201
|
-
|
|
355
|
+
<Descriptions.Item label="角色名称">
|
|
356
|
+
{roleInfo?.roleName || ""}
|
|
357
|
+
</Descriptions.Item>
|
|
358
|
+
<Descriptions.Item label="角色编码">
|
|
359
|
+
{roleInfo?.roleCode || ""}
|
|
360
|
+
</Descriptions.Item>
|
|
361
|
+
<Descriptions.Item label="角色描述">
|
|
362
|
+
{roleInfo?.description || ""}
|
|
363
|
+
</Descriptions.Item>
|
|
364
|
+
<Descriptions.Item label="创建时间">
|
|
365
|
+
{timeFormatter(roleInfo?.gmtCreate) || ""}
|
|
366
|
+
</Descriptions.Item>
|
|
367
|
+
<Descriptions.Item label="更新时间">
|
|
368
|
+
{timeFormatter(roleInfo?.gmtModified) || ""}
|
|
369
|
+
</Descriptions.Item>
|
|
202
370
|
</Descriptions>
|
|
203
371
|
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
372
|
+
<div>
|
|
373
|
+
<Divider orientation="left">当前角色关联内容</Divider>
|
|
374
|
+
<div className="jsonWarp">
|
|
375
|
+
<Tabs
|
|
376
|
+
onChange={(e) => {
|
|
377
|
+
setTabCheck(e);
|
|
378
|
+
}}
|
|
379
|
+
items={TableItemData}
|
|
380
|
+
/>
|
|
381
|
+
{tabCheck == "main" && (
|
|
382
|
+
<>
|
|
383
|
+
<QueryFilter
|
|
384
|
+
style={{ padding: "0px" }}
|
|
385
|
+
size="middle"
|
|
386
|
+
onReset={handleOnReset}
|
|
387
|
+
onFinish={handleOnFinish}
|
|
388
|
+
>
|
|
389
|
+
<ProFormText name="keyword" label="关键词" />
|
|
390
|
+
</QueryFilter>
|
|
391
|
+
<ProTable
|
|
392
|
+
size="small"
|
|
393
|
+
dataSource={dataList}
|
|
394
|
+
loading={isLoading}
|
|
395
|
+
columns={columns}
|
|
396
|
+
rowKey="id"
|
|
397
|
+
options={{
|
|
398
|
+
reload: handleRoload,
|
|
399
|
+
}}
|
|
400
|
+
toolBarRender={() => {
|
|
401
|
+
return [
|
|
402
|
+
<Button
|
|
403
|
+
type="primary"
|
|
404
|
+
onClick={() => {
|
|
405
|
+
getQueryBoundRolesFunc();
|
|
406
|
+
}}
|
|
407
|
+
>
|
|
408
|
+
添加账号
|
|
409
|
+
</Button>,
|
|
410
|
+
];
|
|
411
|
+
}}
|
|
412
|
+
/>
|
|
413
|
+
|
|
414
|
+
<Pagination
|
|
415
|
+
{...pagination}
|
|
416
|
+
onChange={(innerPageNo: number, innerPageSize: number) => {
|
|
417
|
+
execute({
|
|
418
|
+
innerPageNo,
|
|
419
|
+
innerPageSize,
|
|
420
|
+
roleCode: roleCode,
|
|
421
|
+
});
|
|
422
|
+
}}
|
|
423
|
+
/>
|
|
424
|
+
</>
|
|
425
|
+
)}
|
|
426
|
+
{tabCheck == "tableResource" && (
|
|
427
|
+
<>
|
|
428
|
+
<Table
|
|
429
|
+
style={{ width: "100%" }}
|
|
430
|
+
size="small"
|
|
431
|
+
rowKey="id"
|
|
432
|
+
loading={isTableLoading}
|
|
433
|
+
pagination={false}
|
|
434
|
+
columns={TableResource}
|
|
435
|
+
dataSource={ResourceTableData || []}
|
|
436
|
+
/>
|
|
437
|
+
</>
|
|
438
|
+
)}
|
|
439
|
+
|
|
440
|
+
{tabCheck == "tableEmpower" && (
|
|
441
|
+
<>
|
|
442
|
+
<Table
|
|
443
|
+
style={{ width: "100%" }}
|
|
444
|
+
size="small"
|
|
445
|
+
rowKey="id"
|
|
446
|
+
dataSource={policy?.dataList}
|
|
447
|
+
loading={policy?.isLoading}
|
|
448
|
+
columns={TablePolicy}
|
|
449
|
+
pagination={false}
|
|
450
|
+
/>
|
|
451
|
+
<Pagination
|
|
452
|
+
{...policy?.pagination}
|
|
453
|
+
onChange={(innerPageNo: number, innerPageSize: number) => {
|
|
454
|
+
policy?.execute({
|
|
455
|
+
innerPageNo,
|
|
456
|
+
innerPageSize,
|
|
457
|
+
subjectCodes: [roleCode],
|
|
458
|
+
});
|
|
459
|
+
}}
|
|
460
|
+
/>
|
|
461
|
+
</>
|
|
462
|
+
)}
|
|
463
|
+
{tabCheck == "tableData" && <></>}
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
{/* */}
|
|
237
467
|
<EditAccountDrawer
|
|
238
468
|
open={editAccountOpen} // 状态
|
|
239
469
|
editOpenStatus={setEditAccountOpen} //修改弹框显隐事件
|
|
240
470
|
roleBoundAccountsFunc={roleBoundAccountsFunc}
|
|
241
471
|
queryByKeywordFunc={queryByKeywordFunc} //搜索事件
|
|
242
472
|
></EditAccountDrawer>
|
|
243
|
-
|
|
244
473
|
</PageContainer>
|
|
245
|
-
)
|
|
246
|
-
}
|
|
474
|
+
);
|
|
475
|
+
}
|