@deepinnet-components/pc 0.0.62 → 0.0.65
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/dist/UserCenter/AccountPage/components/CreateAccount/index.js +31 -31
- package/dist/UserCenter/AccountPage/components/EditPasswordModal/index.js +6 -7
- package/dist/UserCenter/AccountPage/index.d.ts +9 -2
- package/dist/UserCenter/AccountPage/index.js +168 -164
- package/dist/UserCenter/ConfigProvider/index.js +17 -2
- package/dist/UserCenter/OrgPage/components/CreateMember/index.js +3 -3
- package/dist/UserCenter/OrgPage/components/CreateOrg/index.js +3 -3
- package/dist/UserCenter/OrgPage/index.d.ts +11 -2
- package/dist/UserCenter/OrgPage/index.js +91 -96
- package/dist/UserCenter/RolePage/components/Create/index.js +18 -104
- package/dist/UserCenter/RolePage/index.d.ts +9 -2
- package/dist/UserCenter/RolePage/index.js +77 -72
- package/dist/UserCenter/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -10,10 +10,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React
|
|
14
|
-
import
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { useEffect, useState } from 'react';
|
|
15
15
|
import locale from 'antd/locale/zh_CN';
|
|
16
16
|
import { ConfigProvider } from 'antd';
|
|
17
|
+
import ValueContext from "../context";
|
|
17
18
|
var Index = function Index(props) {
|
|
18
19
|
var request = props.request,
|
|
19
20
|
_props$api = props.api,
|
|
@@ -100,18 +101,21 @@ var Index = function Index(props) {
|
|
|
100
101
|
function editPassword(params) {
|
|
101
102
|
return request.post(api.editPassword, params);
|
|
102
103
|
}
|
|
104
|
+
|
|
103
105
|
// 获取账号列表
|
|
104
106
|
}, {
|
|
105
107
|
key: "getAccountList",
|
|
106
108
|
value: function getAccountList(params) {
|
|
107
109
|
return request.post(api.getAccountList, params);
|
|
108
110
|
}
|
|
111
|
+
|
|
109
112
|
// 保存账号
|
|
110
113
|
}, {
|
|
111
114
|
key: "saveAccount",
|
|
112
115
|
value: function saveAccount(params) {
|
|
113
116
|
return request.post(api.saveAccount, params);
|
|
114
117
|
}
|
|
118
|
+
|
|
115
119
|
// 查询账号详情
|
|
116
120
|
}, {
|
|
117
121
|
key: "getAccountDetail",
|
|
@@ -120,6 +124,7 @@ var Index = function Index(props) {
|
|
|
120
124
|
params: params
|
|
121
125
|
});
|
|
122
126
|
}
|
|
127
|
+
|
|
123
128
|
// 删除账号
|
|
124
129
|
}, {
|
|
125
130
|
key: "deleteAccount",
|
|
@@ -128,12 +133,14 @@ var Index = function Index(props) {
|
|
|
128
133
|
params: params
|
|
129
134
|
});
|
|
130
135
|
}
|
|
136
|
+
|
|
131
137
|
// 冻结账号
|
|
132
138
|
}, {
|
|
133
139
|
key: "freezeAccount",
|
|
134
140
|
value: function freezeAccount(params) {
|
|
135
141
|
return request.post(api.freezeAccount, params);
|
|
136
142
|
}
|
|
143
|
+
|
|
137
144
|
// 解冻账号
|
|
138
145
|
}, {
|
|
139
146
|
key: "unFreezeAccount",
|
|
@@ -147,18 +154,21 @@ var Index = function Index(props) {
|
|
|
147
154
|
value: function getRoleList(params) {
|
|
148
155
|
return request.post(api.getRoleList, params);
|
|
149
156
|
}
|
|
157
|
+
|
|
150
158
|
// 保存角色
|
|
151
159
|
}, {
|
|
152
160
|
key: "saveRole",
|
|
153
161
|
value: function saveRole(params) {
|
|
154
162
|
return request.post(api.saveRole, params);
|
|
155
163
|
}
|
|
164
|
+
|
|
156
165
|
// 角色详情
|
|
157
166
|
}, {
|
|
158
167
|
key: "getRoleDetail",
|
|
159
168
|
value: function getRoleDetail(params) {
|
|
160
169
|
return request.post(api.getRoleDetail, params);
|
|
161
170
|
}
|
|
171
|
+
|
|
162
172
|
// 删除角色
|
|
163
173
|
}, {
|
|
164
174
|
key: "deleteRole",
|
|
@@ -181,18 +191,21 @@ var Index = function Index(props) {
|
|
|
181
191
|
value: function getOrgTree(params) {
|
|
182
192
|
return request.post(api.getOrgTree, params);
|
|
183
193
|
}
|
|
194
|
+
|
|
184
195
|
// 保存组织
|
|
185
196
|
}, {
|
|
186
197
|
key: "saveOrg",
|
|
187
198
|
value: function saveOrg(params) {
|
|
188
199
|
return request.post(api.saveOrg, params);
|
|
189
200
|
}
|
|
201
|
+
|
|
190
202
|
// 更新组织
|
|
191
203
|
}, {
|
|
192
204
|
key: "updateOrg",
|
|
193
205
|
value: function updateOrg(params) {
|
|
194
206
|
return request.post(api.updateOrg, params);
|
|
195
207
|
}
|
|
208
|
+
|
|
196
209
|
// 删除组织
|
|
197
210
|
}, {
|
|
198
211
|
key: "deleteOrg",
|
|
@@ -201,12 +214,14 @@ var Index = function Index(props) {
|
|
|
201
214
|
params: params
|
|
202
215
|
});
|
|
203
216
|
}
|
|
217
|
+
|
|
204
218
|
// 保存成员
|
|
205
219
|
}, {
|
|
206
220
|
key: "saveMember",
|
|
207
221
|
value: function saveMember(params) {
|
|
208
222
|
return request.post(api.saveMember, params);
|
|
209
223
|
}
|
|
224
|
+
|
|
210
225
|
// 删除组织
|
|
211
226
|
}, {
|
|
212
227
|
key: "deleteMember",
|
|
@@ -53,6 +53,9 @@ var CreateMember = function CreateMember(props) {
|
|
|
53
53
|
var ApiService = contextValue.ApiService,
|
|
54
54
|
hideMemberType = contextValue.hideMemberType,
|
|
55
55
|
showMemberPilot = contextValue.showMemberPilot;
|
|
56
|
+
var form = useMemo(function () {
|
|
57
|
+
return createForm({});
|
|
58
|
+
}, []);
|
|
56
59
|
useEffect(function () {
|
|
57
60
|
if (visible) {
|
|
58
61
|
if (addOrEdit === 'add') {
|
|
@@ -261,9 +264,6 @@ var CreateMember = function CreateMember(props) {
|
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
};
|
|
264
|
-
var form = useMemo(function () {
|
|
265
|
-
return createForm({});
|
|
266
|
-
}, []);
|
|
267
267
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
268
268
|
title: title,
|
|
269
269
|
open: visible,
|
|
@@ -39,6 +39,9 @@ var CreateOrg = function CreateOrg(props) {
|
|
|
39
39
|
onSuccess = props.onSuccess;
|
|
40
40
|
var contextValue = useContext(ValueContext);
|
|
41
41
|
var ApiService = contextValue.ApiService;
|
|
42
|
+
var form = useMemo(function () {
|
|
43
|
+
return createForm({});
|
|
44
|
+
}, []);
|
|
42
45
|
useEffect(function () {
|
|
43
46
|
if (visible) {
|
|
44
47
|
if (addOrEdit === 'add') {
|
|
@@ -205,9 +208,6 @@ var CreateOrg = function CreateOrg(props) {
|
|
|
205
208
|
}
|
|
206
209
|
};
|
|
207
210
|
}
|
|
208
|
-
var form = useMemo(function () {
|
|
209
|
-
return createForm({});
|
|
210
|
-
}, []);
|
|
211
211
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
212
212
|
title: title,
|
|
213
213
|
open: visible,
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface OrgPageRef {
|
|
4
|
+
handleAddOrg: (isStart?: boolean) => void;
|
|
5
|
+
handleAddMember: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface OrgPageProps {
|
|
8
|
+
hideTopBtn?: ReactNode;
|
|
9
|
+
onOrgIdChange?: any;
|
|
10
|
+
}
|
|
11
|
+
declare const OrgList: React.ForwardRefExoticComponent<OrgPageProps & React.RefAttributes<OrgPageRef>>;
|
|
3
12
|
export default OrgList;
|
|
@@ -19,24 +19,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
import { RightOutlined } from '@ant-design/icons';
|
|
21
21
|
import { ShenduTable } from "../..";
|
|
22
|
-
import { Breadcrumb, Button, Space, Tag,
|
|
23
|
-
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import { Breadcrumb, Button, Space, Tag, message } from 'antd';
|
|
23
|
+
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
24
24
|
import { getUrlQuery } from "../utils";
|
|
25
25
|
import { MEMBER_TYPE_ENUM, MEMBER_TYPE_TEXT_ENUM } from "../enum";
|
|
26
|
+
import ValueContext from "../context";
|
|
26
27
|
import CreateMember from "./components/CreateMember";
|
|
27
28
|
import CreateOrg from "./components/CreateOrg";
|
|
28
|
-
import ValueContext from "../context";
|
|
29
|
-
var ellipsisRenderObj = {
|
|
30
|
-
ellipsis: {
|
|
31
|
-
showTitle: false
|
|
32
|
-
},
|
|
33
|
-
render: function render(_) {
|
|
34
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
35
|
-
placement: "topLeft",
|
|
36
|
-
title: _
|
|
37
|
-
}, _ || '-');
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
29
|
function loopKeys() {
|
|
41
30
|
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
42
31
|
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -85,10 +74,11 @@ var memberMap = _defineProperty(_defineProperty({}, MEMBER_TYPE_ENUM.NORMAL, {
|
|
|
85
74
|
name: MEMBER_TYPE_TEXT_ENUM[MEMBER_TYPE_ENUM.RESPONSIBLE],
|
|
86
75
|
color: 'cyan'
|
|
87
76
|
});
|
|
88
|
-
|
|
89
77
|
// 组织管理
|
|
90
|
-
var OrgList = function
|
|
78
|
+
var OrgList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
91
79
|
var _orgList$;
|
|
80
|
+
var hideTopBtn = _ref.hideTopBtn,
|
|
81
|
+
onOrgIdChange = _ref.onOrgIdChange;
|
|
92
82
|
var contextValue = useContext(ValueContext);
|
|
93
83
|
var ApiService = contextValue.ApiService,
|
|
94
84
|
Components = contextValue.Components,
|
|
@@ -109,12 +99,15 @@ var OrgList = function OrgList() {
|
|
|
109
99
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
110
100
|
loading = _useState6[0],
|
|
111
101
|
setLoading = _useState6[1];
|
|
102
|
+
var _useState7 = useState([]),
|
|
103
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
104
|
+
setExpandedRowKeys = _useState8[1];
|
|
112
105
|
function getOrgList() {
|
|
113
106
|
return _getOrgList.apply(this, arguments);
|
|
114
107
|
}
|
|
115
108
|
function _getOrgList() {
|
|
116
109
|
_getOrgList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
117
|
-
var _getUrlQuery2, id, params,
|
|
110
|
+
var _getUrlQuery2, id, params, _ref2, success, data, _list, bList, list, orderMap, _breadcrumb, arr;
|
|
118
111
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
119
112
|
while (1) switch (_context.prev = _context.next) {
|
|
120
113
|
case 0:
|
|
@@ -126,9 +119,9 @@ var OrgList = function OrgList() {
|
|
|
126
119
|
_context.next = 5;
|
|
127
120
|
return ApiService.getOrgTree(params);
|
|
128
121
|
case 5:
|
|
129
|
-
|
|
130
|
-
success =
|
|
131
|
-
data =
|
|
122
|
+
_ref2 = _context.sent;
|
|
123
|
+
success = _ref2.success;
|
|
124
|
+
data = _ref2.data;
|
|
132
125
|
if (success) {
|
|
133
126
|
bList = data || [];
|
|
134
127
|
if (orgSortConfig) {
|
|
@@ -188,78 +181,8 @@ var OrgList = function OrgList() {
|
|
|
188
181
|
getOrgList();
|
|
189
182
|
}, [window.location]);
|
|
190
183
|
var tableRef = useRef(null);
|
|
191
|
-
var columns = [{
|
|
192
|
-
title: '名称',
|
|
193
|
-
dataIndex: 'name',
|
|
194
|
-
align: 'left',
|
|
195
|
-
render: function render(_, row) {
|
|
196
|
-
if (row.showType === 1) {
|
|
197
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
198
|
-
className: "cursor-pointer flex items-center",
|
|
199
|
-
onClick: function onClick() {
|
|
200
|
-
handleClickBreadcrumb(row);
|
|
201
|
-
}
|
|
202
|
-
}, /*#__PURE__*/React.createElement("div", null, _), !row.isFirst && /*#__PURE__*/React.createElement("div", {
|
|
203
|
-
className: "ml-1"
|
|
204
|
-
}, /*#__PURE__*/React.createElement(RightOutlined, null)));
|
|
205
|
-
}
|
|
206
|
-
if (row.showType === 2) {
|
|
207
|
-
var _row$identityTypes;
|
|
208
|
-
var obj = memberMap[row.type];
|
|
209
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
210
|
-
className: "flex items-center"
|
|
211
|
-
}, !hideMemberType && /*#__PURE__*/React.createElement(Tag, {
|
|
212
|
-
color: obj === null || obj === void 0 ? void 0 : obj.color
|
|
213
|
-
}, obj === null || obj === void 0 ? void 0 : obj.name), /*#__PURE__*/React.createElement("div", null, _), row.phone && /*#__PURE__*/React.createElement("div", null, "\uFF08", row.phone, "\uFF09"), !!showMemberPilot && ((_row$identityTypes = row.identityTypes) === null || _row$identityTypes === void 0 ? void 0 : _row$identityTypes.includes('pilot')) && /*#__PURE__*/React.createElement("div", {
|
|
214
|
-
className: "ml-[8px]"
|
|
215
|
-
}, /*#__PURE__*/React.createElement(Tag, {
|
|
216
|
-
color: 'blue'
|
|
217
|
-
}, "\u98DE\u624B")));
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
title: '操作',
|
|
222
|
-
dataIndex: 'action',
|
|
223
|
-
fixed: 'right',
|
|
224
|
-
width: 120,
|
|
225
|
-
render: function render(_, row) {
|
|
226
|
-
var operationList = [{
|
|
227
|
-
text: '编辑',
|
|
228
|
-
handleClick: function handleClick() {
|
|
229
|
-
if (row.showType === 1) {
|
|
230
|
-
handleEditOrg(row);
|
|
231
|
-
}
|
|
232
|
-
if (row.showType === 2) {
|
|
233
|
-
handleEditMember(row);
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
show: true
|
|
237
|
-
}, {
|
|
238
|
-
text: '删除',
|
|
239
|
-
isPopoverBtn: true,
|
|
240
|
-
popoverTitle: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
|
|
241
|
-
handleClick: function handleClick() {
|
|
242
|
-
if (row.showType === 1) {
|
|
243
|
-
handleDeleteOrg(row);
|
|
244
|
-
}
|
|
245
|
-
if (row.showType === 2) {
|
|
246
|
-
handleDeleteMember(row);
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
show: row.showType === 1 && String(row.id) !== String(getUrlQuery().id) || row.showType === 2
|
|
250
|
-
}];
|
|
251
|
-
return /*#__PURE__*/React.createElement(Components.OperationButton, {
|
|
252
|
-
button: operationList.filter(function (item) {
|
|
253
|
-
return item.show;
|
|
254
|
-
})
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}];
|
|
258
|
-
var _useState7 = useState([]),
|
|
259
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
260
|
-
expandedRowKeys = _useState8[0],
|
|
261
|
-
setExpandedRowKeys = _useState8[1];
|
|
262
184
|
function handleClickBreadcrumb(item) {
|
|
185
|
+
onOrgIdChange === null || onOrgIdChange === void 0 || onOrgIdChange(item.id);
|
|
263
186
|
var newUrl = '';
|
|
264
187
|
var url = new URL(window.location.href);
|
|
265
188
|
var searchParams = url.searchParams;
|
|
@@ -305,7 +228,7 @@ var OrgList = function OrgList() {
|
|
|
305
228
|
orgModalInfo = _useState10[0],
|
|
306
229
|
setOrgModalInfo = _useState10[1];
|
|
307
230
|
function handleAddOrg() {
|
|
308
|
-
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
231
|
+
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !id;
|
|
309
232
|
var pid = [];
|
|
310
233
|
if (id) {
|
|
311
234
|
breadcrumb.forEach(function (item, index) {
|
|
@@ -371,7 +294,6 @@ var OrgList = function OrgList() {
|
|
|
371
294
|
memberModalInfo = _useState12[0],
|
|
372
295
|
setMemberModalInfo = _useState12[1];
|
|
373
296
|
function handleAddMember() {
|
|
374
|
-
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
375
297
|
var pid = [];
|
|
376
298
|
if (id) {
|
|
377
299
|
breadcrumb.forEach(function (item, index) {
|
|
@@ -386,6 +308,12 @@ var OrgList = function OrgList() {
|
|
|
386
308
|
pid: pid
|
|
387
309
|
});
|
|
388
310
|
}
|
|
311
|
+
useImperativeHandle(ref, function () {
|
|
312
|
+
return {
|
|
313
|
+
handleAddOrg: handleAddOrg,
|
|
314
|
+
handleAddMember: handleAddMember
|
|
315
|
+
};
|
|
316
|
+
});
|
|
389
317
|
function handleEditMember(row) {
|
|
390
318
|
var _row$path2;
|
|
391
319
|
setMemberModalInfo({
|
|
@@ -425,7 +353,74 @@ var OrgList = function OrgList() {
|
|
|
425
353
|
}));
|
|
426
354
|
return _handleDeleteMember.apply(this, arguments);
|
|
427
355
|
}
|
|
428
|
-
|
|
356
|
+
var columns = [{
|
|
357
|
+
title: '名称',
|
|
358
|
+
dataIndex: 'name',
|
|
359
|
+
align: 'left',
|
|
360
|
+
render: function render(_, row) {
|
|
361
|
+
if (row.showType === 1) {
|
|
362
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
363
|
+
className: "cursor-pointer flex items-center",
|
|
364
|
+
onClick: function onClick() {
|
|
365
|
+
handleClickBreadcrumb(row);
|
|
366
|
+
}
|
|
367
|
+
}, /*#__PURE__*/React.createElement("div", null, _), !row.isFirst && /*#__PURE__*/React.createElement("div", {
|
|
368
|
+
className: "ml-1"
|
|
369
|
+
}, /*#__PURE__*/React.createElement(RightOutlined, null)));
|
|
370
|
+
}
|
|
371
|
+
if (row.showType === 2) {
|
|
372
|
+
var _row$identityTypes;
|
|
373
|
+
var obj = memberMap[row.type];
|
|
374
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
375
|
+
className: "flex items-center"
|
|
376
|
+
}, !hideMemberType && /*#__PURE__*/React.createElement(Tag, {
|
|
377
|
+
color: obj === null || obj === void 0 ? void 0 : obj.color
|
|
378
|
+
}, obj === null || obj === void 0 ? void 0 : obj.name), /*#__PURE__*/React.createElement("div", null, _), row.phone && /*#__PURE__*/React.createElement("div", null, "\uFF08", row.phone, "\uFF09"), !!showMemberPilot && ((_row$identityTypes = row.identityTypes) === null || _row$identityTypes === void 0 ? void 0 : _row$identityTypes.includes('pilot')) && /*#__PURE__*/React.createElement("div", {
|
|
379
|
+
className: "ml-[8px]"
|
|
380
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
|
381
|
+
color: "blue"
|
|
382
|
+
}, "\u98DE\u624B")));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
title: '操作',
|
|
387
|
+
dataIndex: 'action',
|
|
388
|
+
fixed: 'right',
|
|
389
|
+
width: 120,
|
|
390
|
+
render: function render(_, row) {
|
|
391
|
+
var operationList = [{
|
|
392
|
+
text: '编辑',
|
|
393
|
+
handleClick: function handleClick() {
|
|
394
|
+
if (row.showType === 1) {
|
|
395
|
+
handleEditOrg(row);
|
|
396
|
+
}
|
|
397
|
+
if (row.showType === 2) {
|
|
398
|
+
handleEditMember(row);
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
show: true
|
|
402
|
+
}, {
|
|
403
|
+
text: '删除',
|
|
404
|
+
isPopoverBtn: true,
|
|
405
|
+
popoverTitle: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
|
|
406
|
+
handleClick: function handleClick() {
|
|
407
|
+
if (row.showType === 1) {
|
|
408
|
+
handleDeleteOrg(row);
|
|
409
|
+
}
|
|
410
|
+
if (row.showType === 2) {
|
|
411
|
+
handleDeleteMember(row);
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
show: row.showType === 1 && String(row.id) !== String(getUrlQuery().id) || row.showType === 2
|
|
415
|
+
}];
|
|
416
|
+
return /*#__PURE__*/React.createElement(Components.OperationButton, {
|
|
417
|
+
button: operationList.filter(function (item) {
|
|
418
|
+
return item.show;
|
|
419
|
+
})
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}];
|
|
423
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !id && !hideTopBtn && /*#__PURE__*/React.createElement("div", {
|
|
429
424
|
style: {
|
|
430
425
|
display: 'flex',
|
|
431
426
|
justifyContent: 'flex-end'
|
|
@@ -449,7 +444,7 @@ var OrgList = function OrgList() {
|
|
|
449
444
|
}
|
|
450
445
|
}, /*#__PURE__*/React.createElement(Breadcrumb, {
|
|
451
446
|
items: breadcrumbItems
|
|
452
|
-
}), /*#__PURE__*/React.createElement(Space, {
|
|
447
|
+
}), !hideTopBtn && /*#__PURE__*/React.createElement(Space, {
|
|
453
448
|
size: 16
|
|
454
449
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
455
450
|
type: "primary",
|
|
@@ -527,5 +522,5 @@ var OrgList = function OrgList() {
|
|
|
527
522
|
getOrgList();
|
|
528
523
|
}
|
|
529
524
|
}));
|
|
530
|
-
};
|
|
525
|
+
});
|
|
531
526
|
export default OrgList;
|
|
@@ -11,7 +11,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
11
11
|
import { Form, FormButtonGroup, FormItem, Input } from '@formily/antd-v5';
|
|
12
12
|
import { createForm } from '@formily/core';
|
|
13
13
|
import { createSchemaField } from '@formily/react';
|
|
14
|
-
import { Button, Spin, message
|
|
14
|
+
import { Button, Radio, Spin, message } from 'antd';
|
|
15
15
|
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import AuthSelect from "../../../AuthSelect";
|
|
17
17
|
import ValueContext from "../../../context";
|
|
@@ -23,92 +23,6 @@ var SchemaField = createSchemaField({
|
|
|
23
23
|
Radio: Radio
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
var schema = {
|
|
27
|
-
type: 'object',
|
|
28
|
-
properties: {
|
|
29
|
-
roleName: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
title: '角色名称',
|
|
32
|
-
'x-decorator': 'FormItem',
|
|
33
|
-
'x-component': 'Input',
|
|
34
|
-
'x-component-props': {
|
|
35
|
-
placeholder: '请输入角色名称',
|
|
36
|
-
allowClear: true,
|
|
37
|
-
maxLength: 10,
|
|
38
|
-
showCount: true
|
|
39
|
-
},
|
|
40
|
-
'x-validator': [{
|
|
41
|
-
required: true,
|
|
42
|
-
message: '请输入角色名称'
|
|
43
|
-
}]
|
|
44
|
-
},
|
|
45
|
-
desc: {
|
|
46
|
-
type: 'string',
|
|
47
|
-
title: '角色描述',
|
|
48
|
-
'x-decorator': 'FormItem',
|
|
49
|
-
'x-component': 'Input.TextArea',
|
|
50
|
-
'x-component-props': {
|
|
51
|
-
placeholder: '请输入角色描述',
|
|
52
|
-
allowClear: true,
|
|
53
|
-
maxLength: 100,
|
|
54
|
-
showCount: true,
|
|
55
|
-
rows: 4
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
authKeys: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
title: '功能权限',
|
|
61
|
-
'x-decorator': 'FormItem',
|
|
62
|
-
'x-component': 'AuthSelect',
|
|
63
|
-
'x-component-props': {},
|
|
64
|
-
'x-validator': [{
|
|
65
|
-
required: true,
|
|
66
|
-
message: '至少选择一个权限'
|
|
67
|
-
}]
|
|
68
|
-
},
|
|
69
|
-
dataScope: {
|
|
70
|
-
type: 'string',
|
|
71
|
-
title: '数据权限',
|
|
72
|
-
'x-decorator': 'FormItem',
|
|
73
|
-
'x-component': 'Radio.Group',
|
|
74
|
-
'x-component-props': {
|
|
75
|
-
style: {
|
|
76
|
-
display: 'flex',
|
|
77
|
-
flexDirection: 'column',
|
|
78
|
-
gap: 8,
|
|
79
|
-
marginTop: 6
|
|
80
|
-
},
|
|
81
|
-
options1: [{
|
|
82
|
-
value: 4,
|
|
83
|
-
label: '全局数据'
|
|
84
|
-
}, {
|
|
85
|
-
value: 3,
|
|
86
|
-
label: '组织数据(全局)'
|
|
87
|
-
},
|
|
88
|
-
// {
|
|
89
|
-
// value: 2,
|
|
90
|
-
// label: '组织数据(本级及下属)',
|
|
91
|
-
// },
|
|
92
|
-
{
|
|
93
|
-
value: 1,
|
|
94
|
-
label: '个人数据'
|
|
95
|
-
}]
|
|
96
|
-
},
|
|
97
|
-
'x-validator': [{
|
|
98
|
-
required: true,
|
|
99
|
-
message: '请选择数据权限'
|
|
100
|
-
}],
|
|
101
|
-
'x-reactions': [{
|
|
102
|
-
dependencies: [],
|
|
103
|
-
fulfill: {
|
|
104
|
-
state: {
|
|
105
|
-
visible: '{{!!showDataAuth}}'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}]
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
26
|
|
|
113
27
|
// 新增/编辑角色
|
|
114
28
|
var CreateRole = function CreateRole(props) {
|
|
@@ -126,6 +40,23 @@ var CreateRole = function CreateRole(props) {
|
|
|
126
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
127
41
|
schema = _useState2[0],
|
|
128
42
|
setSchema = _useState2[1];
|
|
43
|
+
var form = useMemo(function () {
|
|
44
|
+
return createForm({
|
|
45
|
+
initialValues: {
|
|
46
|
+
// dataScope: 4,
|
|
47
|
+
},
|
|
48
|
+
effects: function effects() {}
|
|
49
|
+
});
|
|
50
|
+
}, [visible]);
|
|
51
|
+
var _useState3 = useState(addOrEdit === 'edit'),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
getDataLoading = _useState4[0],
|
|
54
|
+
setGetDataLoading = _useState4[1];
|
|
55
|
+
var _useState5 = useState(false),
|
|
56
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57
|
+
loading = _useState6[0],
|
|
58
|
+
setLoading = _useState6[1];
|
|
59
|
+
var canSubmit = useRef(true);
|
|
129
60
|
useEffect(function () {
|
|
130
61
|
if (dataAuthType === 1) {
|
|
131
62
|
setSchema({
|
|
@@ -354,23 +285,6 @@ var CreateRole = function CreateRole(props) {
|
|
|
354
285
|
form.reset();
|
|
355
286
|
}
|
|
356
287
|
}, [visible, actionRow, schema]);
|
|
357
|
-
var form = useMemo(function () {
|
|
358
|
-
return createForm({
|
|
359
|
-
initialValues: {
|
|
360
|
-
// dataScope: 4,
|
|
361
|
-
},
|
|
362
|
-
effects: function effects() {}
|
|
363
|
-
});
|
|
364
|
-
}, [visible]);
|
|
365
|
-
var _useState3 = useState(addOrEdit === 'edit'),
|
|
366
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
367
|
-
getDataLoading = _useState4[0],
|
|
368
|
-
setGetDataLoading = _useState4[1];
|
|
369
|
-
var _useState5 = useState(false),
|
|
370
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
371
|
-
loading = _useState6[0],
|
|
372
|
-
setLoading = _useState6[1];
|
|
373
|
-
var canSubmit = useRef(true);
|
|
374
288
|
var handleSubmit = /*#__PURE__*/function () {
|
|
375
289
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
376
290
|
var values, _values$desc, params, _yield$ApiService$sav, success, _values$desc2, _params, _yield$ApiService$sav2, _success;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface RolePageRef {
|
|
4
|
+
handleAddRole: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface RolePageProps {
|
|
7
|
+
hideTopBtn?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const RoleList: React.ForwardRefExoticComponent<RolePageProps & React.RefAttributes<RolePageRef>>;
|
|
3
10
|
export default RoleList;
|