@deepinnet-components/pc 0.0.61 → 0.0.63
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 +189 -169
- package/dist/UserCenter/ConfigProvider/index.d.ts +4 -3
- package/dist/UserCenter/ConfigProvider/index.js +22 -4
- 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 +10 -2
- package/dist/UserCenter/OrgPage/index.js +89 -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,
|
|
@@ -81,7 +82,9 @@ var Index = function Index(props) {
|
|
|
81
82
|
_props$isNeedExportAc = props.isNeedExportAccount,
|
|
82
83
|
isNeedExportAccount = _props$isNeedExportAc === void 0 ? false : _props$isNeedExportAc,
|
|
83
84
|
_props$requestHeaders = props.requestHeaders,
|
|
84
|
-
requestHeaders = _props$requestHeaders === void 0 ? {} : _props$requestHeaders
|
|
85
|
+
requestHeaders = _props$requestHeaders === void 0 ? {} : _props$requestHeaders,
|
|
86
|
+
_props$accountSearchN = props.accountSearchNeedDepartment,
|
|
87
|
+
accountSearchNeedDepartment = _props$accountSearchN === void 0 ? false : _props$accountSearchN;
|
|
85
88
|
var _useState = useState(),
|
|
86
89
|
_useState2 = _slicedToArray(_useState, 2),
|
|
87
90
|
value = _useState2[0],
|
|
@@ -98,18 +101,21 @@ var Index = function Index(props) {
|
|
|
98
101
|
function editPassword(params) {
|
|
99
102
|
return request.post(api.editPassword, params);
|
|
100
103
|
}
|
|
104
|
+
|
|
101
105
|
// 获取账号列表
|
|
102
106
|
}, {
|
|
103
107
|
key: "getAccountList",
|
|
104
108
|
value: function getAccountList(params) {
|
|
105
109
|
return request.post(api.getAccountList, params);
|
|
106
110
|
}
|
|
111
|
+
|
|
107
112
|
// 保存账号
|
|
108
113
|
}, {
|
|
109
114
|
key: "saveAccount",
|
|
110
115
|
value: function saveAccount(params) {
|
|
111
116
|
return request.post(api.saveAccount, params);
|
|
112
117
|
}
|
|
118
|
+
|
|
113
119
|
// 查询账号详情
|
|
114
120
|
}, {
|
|
115
121
|
key: "getAccountDetail",
|
|
@@ -118,6 +124,7 @@ var Index = function Index(props) {
|
|
|
118
124
|
params: params
|
|
119
125
|
});
|
|
120
126
|
}
|
|
127
|
+
|
|
121
128
|
// 删除账号
|
|
122
129
|
}, {
|
|
123
130
|
key: "deleteAccount",
|
|
@@ -126,12 +133,14 @@ var Index = function Index(props) {
|
|
|
126
133
|
params: params
|
|
127
134
|
});
|
|
128
135
|
}
|
|
136
|
+
|
|
129
137
|
// 冻结账号
|
|
130
138
|
}, {
|
|
131
139
|
key: "freezeAccount",
|
|
132
140
|
value: function freezeAccount(params) {
|
|
133
141
|
return request.post(api.freezeAccount, params);
|
|
134
142
|
}
|
|
143
|
+
|
|
135
144
|
// 解冻账号
|
|
136
145
|
}, {
|
|
137
146
|
key: "unFreezeAccount",
|
|
@@ -145,18 +154,21 @@ var Index = function Index(props) {
|
|
|
145
154
|
value: function getRoleList(params) {
|
|
146
155
|
return request.post(api.getRoleList, params);
|
|
147
156
|
}
|
|
157
|
+
|
|
148
158
|
// 保存角色
|
|
149
159
|
}, {
|
|
150
160
|
key: "saveRole",
|
|
151
161
|
value: function saveRole(params) {
|
|
152
162
|
return request.post(api.saveRole, params);
|
|
153
163
|
}
|
|
164
|
+
|
|
154
165
|
// 角色详情
|
|
155
166
|
}, {
|
|
156
167
|
key: "getRoleDetail",
|
|
157
168
|
value: function getRoleDetail(params) {
|
|
158
169
|
return request.post(api.getRoleDetail, params);
|
|
159
170
|
}
|
|
171
|
+
|
|
160
172
|
// 删除角色
|
|
161
173
|
}, {
|
|
162
174
|
key: "deleteRole",
|
|
@@ -179,18 +191,21 @@ var Index = function Index(props) {
|
|
|
179
191
|
value: function getOrgTree(params) {
|
|
180
192
|
return request.post(api.getOrgTree, params);
|
|
181
193
|
}
|
|
194
|
+
|
|
182
195
|
// 保存组织
|
|
183
196
|
}, {
|
|
184
197
|
key: "saveOrg",
|
|
185
198
|
value: function saveOrg(params) {
|
|
186
199
|
return request.post(api.saveOrg, params);
|
|
187
200
|
}
|
|
201
|
+
|
|
188
202
|
// 更新组织
|
|
189
203
|
}, {
|
|
190
204
|
key: "updateOrg",
|
|
191
205
|
value: function updateOrg(params) {
|
|
192
206
|
return request.post(api.updateOrg, params);
|
|
193
207
|
}
|
|
208
|
+
|
|
194
209
|
// 删除组织
|
|
195
210
|
}, {
|
|
196
211
|
key: "deleteOrg",
|
|
@@ -199,12 +214,14 @@ var Index = function Index(props) {
|
|
|
199
214
|
params: params
|
|
200
215
|
});
|
|
201
216
|
}
|
|
217
|
+
|
|
202
218
|
// 保存成员
|
|
203
219
|
}, {
|
|
204
220
|
key: "saveMember",
|
|
205
221
|
value: function saveMember(params) {
|
|
206
222
|
return request.post(api.saveMember, params);
|
|
207
223
|
}
|
|
224
|
+
|
|
208
225
|
// 删除组织
|
|
209
226
|
}, {
|
|
210
227
|
key: "deleteMember",
|
|
@@ -243,7 +260,8 @@ var Index = function Index(props) {
|
|
|
243
260
|
canEditPassword: canEditPassword,
|
|
244
261
|
orgSortConfig: orgSortConfig,
|
|
245
262
|
isNeedExportAccount: isNeedExportAccount,
|
|
246
|
-
requestHeaders: requestHeaders
|
|
263
|
+
requestHeaders: requestHeaders,
|
|
264
|
+
accountSearchNeedDepartment: accountSearchNeedDepartment
|
|
247
265
|
});
|
|
248
266
|
}, []);
|
|
249
267
|
if (!value) return null;
|
|
@@ -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,11 @@
|
|
|
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
|
+
}
|
|
10
|
+
declare const OrgList: React.ForwardRefExoticComponent<OrgPageProps & React.RefAttributes<OrgPageRef>>;
|
|
3
11
|
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,10 @@ 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;
|
|
92
81
|
var contextValue = useContext(ValueContext);
|
|
93
82
|
var ApiService = contextValue.ApiService,
|
|
94
83
|
Components = contextValue.Components,
|
|
@@ -109,12 +98,15 @@ var OrgList = function OrgList() {
|
|
|
109
98
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
110
99
|
loading = _useState6[0],
|
|
111
100
|
setLoading = _useState6[1];
|
|
101
|
+
var _useState7 = useState([]),
|
|
102
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
103
|
+
setExpandedRowKeys = _useState8[1];
|
|
112
104
|
function getOrgList() {
|
|
113
105
|
return _getOrgList.apply(this, arguments);
|
|
114
106
|
}
|
|
115
107
|
function _getOrgList() {
|
|
116
108
|
_getOrgList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
117
|
-
var _getUrlQuery2, id, params,
|
|
109
|
+
var _getUrlQuery2, id, params, _ref2, success, data, _list, bList, list, orderMap, _breadcrumb, arr;
|
|
118
110
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
119
111
|
while (1) switch (_context.prev = _context.next) {
|
|
120
112
|
case 0:
|
|
@@ -126,9 +118,9 @@ var OrgList = function OrgList() {
|
|
|
126
118
|
_context.next = 5;
|
|
127
119
|
return ApiService.getOrgTree(params);
|
|
128
120
|
case 5:
|
|
129
|
-
|
|
130
|
-
success =
|
|
131
|
-
data =
|
|
121
|
+
_ref2 = _context.sent;
|
|
122
|
+
success = _ref2.success;
|
|
123
|
+
data = _ref2.data;
|
|
132
124
|
if (success) {
|
|
133
125
|
bList = data || [];
|
|
134
126
|
if (orgSortConfig) {
|
|
@@ -188,77 +180,6 @@ var OrgList = function OrgList() {
|
|
|
188
180
|
getOrgList();
|
|
189
181
|
}, [window.location]);
|
|
190
182
|
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
183
|
function handleClickBreadcrumb(item) {
|
|
263
184
|
var newUrl = '';
|
|
264
185
|
var url = new URL(window.location.href);
|
|
@@ -305,7 +226,7 @@ var OrgList = function OrgList() {
|
|
|
305
226
|
orgModalInfo = _useState10[0],
|
|
306
227
|
setOrgModalInfo = _useState10[1];
|
|
307
228
|
function handleAddOrg() {
|
|
308
|
-
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
229
|
+
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !id;
|
|
309
230
|
var pid = [];
|
|
310
231
|
if (id) {
|
|
311
232
|
breadcrumb.forEach(function (item, index) {
|
|
@@ -371,7 +292,6 @@ var OrgList = function OrgList() {
|
|
|
371
292
|
memberModalInfo = _useState12[0],
|
|
372
293
|
setMemberModalInfo = _useState12[1];
|
|
373
294
|
function handleAddMember() {
|
|
374
|
-
var isStart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
375
295
|
var pid = [];
|
|
376
296
|
if (id) {
|
|
377
297
|
breadcrumb.forEach(function (item, index) {
|
|
@@ -386,6 +306,12 @@ var OrgList = function OrgList() {
|
|
|
386
306
|
pid: pid
|
|
387
307
|
});
|
|
388
308
|
}
|
|
309
|
+
useImperativeHandle(ref, function () {
|
|
310
|
+
return {
|
|
311
|
+
handleAddOrg: handleAddOrg,
|
|
312
|
+
handleAddMember: handleAddMember
|
|
313
|
+
};
|
|
314
|
+
});
|
|
389
315
|
function handleEditMember(row) {
|
|
390
316
|
var _row$path2;
|
|
391
317
|
setMemberModalInfo({
|
|
@@ -425,7 +351,74 @@ var OrgList = function OrgList() {
|
|
|
425
351
|
}));
|
|
426
352
|
return _handleDeleteMember.apply(this, arguments);
|
|
427
353
|
}
|
|
428
|
-
|
|
354
|
+
var columns = [{
|
|
355
|
+
title: '名称',
|
|
356
|
+
dataIndex: 'name',
|
|
357
|
+
align: 'left',
|
|
358
|
+
render: function render(_, row) {
|
|
359
|
+
if (row.showType === 1) {
|
|
360
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
361
|
+
className: "cursor-pointer flex items-center",
|
|
362
|
+
onClick: function onClick() {
|
|
363
|
+
handleClickBreadcrumb(row);
|
|
364
|
+
}
|
|
365
|
+
}, /*#__PURE__*/React.createElement("div", null, _), !row.isFirst && /*#__PURE__*/React.createElement("div", {
|
|
366
|
+
className: "ml-1"
|
|
367
|
+
}, /*#__PURE__*/React.createElement(RightOutlined, null)));
|
|
368
|
+
}
|
|
369
|
+
if (row.showType === 2) {
|
|
370
|
+
var _row$identityTypes;
|
|
371
|
+
var obj = memberMap[row.type];
|
|
372
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
373
|
+
className: "flex items-center"
|
|
374
|
+
}, !hideMemberType && /*#__PURE__*/React.createElement(Tag, {
|
|
375
|
+
color: obj === null || obj === void 0 ? void 0 : obj.color
|
|
376
|
+
}, 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", {
|
|
377
|
+
className: "ml-[8px]"
|
|
378
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
|
379
|
+
color: "blue"
|
|
380
|
+
}, "\u98DE\u624B")));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
title: '操作',
|
|
385
|
+
dataIndex: 'action',
|
|
386
|
+
fixed: 'right',
|
|
387
|
+
width: 120,
|
|
388
|
+
render: function render(_, row) {
|
|
389
|
+
var operationList = [{
|
|
390
|
+
text: '编辑',
|
|
391
|
+
handleClick: function handleClick() {
|
|
392
|
+
if (row.showType === 1) {
|
|
393
|
+
handleEditOrg(row);
|
|
394
|
+
}
|
|
395
|
+
if (row.showType === 2) {
|
|
396
|
+
handleEditMember(row);
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
show: true
|
|
400
|
+
}, {
|
|
401
|
+
text: '删除',
|
|
402
|
+
isPopoverBtn: true,
|
|
403
|
+
popoverTitle: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
|
|
404
|
+
handleClick: function handleClick() {
|
|
405
|
+
if (row.showType === 1) {
|
|
406
|
+
handleDeleteOrg(row);
|
|
407
|
+
}
|
|
408
|
+
if (row.showType === 2) {
|
|
409
|
+
handleDeleteMember(row);
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
show: row.showType === 1 && String(row.id) !== String(getUrlQuery().id) || row.showType === 2
|
|
413
|
+
}];
|
|
414
|
+
return /*#__PURE__*/React.createElement(Components.OperationButton, {
|
|
415
|
+
button: operationList.filter(function (item) {
|
|
416
|
+
return item.show;
|
|
417
|
+
})
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}];
|
|
421
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !id && !hideTopBtn && /*#__PURE__*/React.createElement("div", {
|
|
429
422
|
style: {
|
|
430
423
|
display: 'flex',
|
|
431
424
|
justifyContent: 'flex-end'
|
|
@@ -440,7 +433,7 @@ var OrgList = function OrgList() {
|
|
|
440
433
|
paddingLeft: 12,
|
|
441
434
|
paddingRight: 12
|
|
442
435
|
}
|
|
443
|
-
}, "\u6DFB\u52A0\u7EC4\u7EC7")), !!id && /*#__PURE__*/React.createElement("div", {
|
|
436
|
+
}, "\u6DFB\u52A0\u7EC4\u7EC7")), !!id && !hideTopBtn && /*#__PURE__*/React.createElement("div", {
|
|
444
437
|
className: "flex justify-between items-center",
|
|
445
438
|
style: {
|
|
446
439
|
display: 'flex',
|
|
@@ -527,5 +520,5 @@ var OrgList = function OrgList() {
|
|
|
527
520
|
getOrgList();
|
|
528
521
|
}
|
|
529
522
|
}));
|
|
530
|
-
};
|
|
523
|
+
});
|
|
531
524
|
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;
|