@zgfe/modules-settings 1.0.1-a.9 → 1.1.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/{dist/esm → es}/components/pageLoading/index.d.ts +1 -0
- package/{dist/esm → es}/components/pageLoading/index.js +2 -2
- package/es/components/pageLoading/index.less +7 -0
- package/es/components/settingTabs/demo/index.d.ts +3 -0
- package/es/components/settingTabs/demo/index.js +20 -0
- package/{dist/esm → es}/components/settingTabs/index.d.ts +4 -5
- package/{dist/esm → es}/components/settingTabs/index.js +61 -10
- package/{dist/esm → es}/components/settingTabs/index.less +16 -7
- package/es/components/settingTabs/types.d.ts +7 -0
- package/es/components/settingTabs/types.js +1 -0
- package/{dist/esm → es}/constants/api.d.ts +3 -0
- package/{dist/esm → es}/constants/api.js +4 -3
- package/{dist/esm → es}/constants/icons/iconfont.css +0 -7
- package/{dist/esm → es}/constants/icons/iconfont.js +0 -0
- package/es/index.js +4 -0
- package/{dist/esm → es}/modules/appSettings/appInfo/index.js +41 -23
- package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.js +8 -9
- package/es/modules/appSettings/index.js +52 -0
- package/{dist/esm → es}/modules/appSettings/member/index.js +44 -54
- package/{dist/esm → es}/modules/appSettings/virtualSource/index.js +30 -36
- package/{dist/esm → es}/modules/appSettings/virtualSource/styles/table.less +1 -1
- package/es/modules/companySetting/appList/index.d.ts +21 -0
- package/{dist/esm → es}/modules/companySetting/appList/index.js +40 -31
- package/{dist/esm → es}/modules/companySetting/appList/index.less +1 -8
- package/es/modules/companySetting/cost/index.d.ts +9 -0
- package/{dist/esm → es}/modules/companySetting/cost/index.js +6 -6
- package/{dist/esm → es}/modules/companySetting/cost/index.less +1 -1
- package/es/modules/companySetting/cost/types.d.ts +63 -0
- package/es/modules/companySetting/cost/types.js +1 -0
- package/es/modules/companySetting/edit/authConfig.d.ts +11 -0
- package/{dist/esm → es}/modules/companySetting/edit/authConfig.js +15 -14
- package/{dist/esm → es}/modules/companySetting/edit/authConfigCEP.d.ts +3 -5
- package/{dist/esm → es}/modules/companySetting/edit/authConfigCEP.js +18 -68
- package/{dist/esm → es}/modules/companySetting/edit/authGroup.d.ts +2 -1
- package/{dist/esm → es}/modules/companySetting/edit/authGroup.js +9 -10
- package/es/modules/companySetting/edit/authModule.d.ts +8 -0
- package/{dist/esm → es}/modules/companySetting/edit/authModule.js +12 -18
- package/{dist/esm → es}/modules/companySetting/edit/multiAuthModule.d.ts +3 -2
- package/{dist/esm → es}/modules/companySetting/edit/multiAuthModule.js +9 -17
- package/es/modules/companySetting/edit/user.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/edit/user.js +60 -53
- package/es/modules/companySetting/edit/userGroup.d.ts +16 -0
- package/{dist/esm → es}/modules/companySetting/edit/userGroup.js +76 -71
- package/es/modules/companySetting/index.d.ts +11 -0
- package/es/modules/companySetting/index.js +740 -0
- package/{dist/esm → es}/modules/companySetting/info/index.d.ts +3 -3
- package/{dist/esm → es}/modules/companySetting/info/index.js +8 -5
- package/{dist/esm → es}/modules/companySetting/info/index.less +1 -1
- package/{dist/esm → es}/modules/companySetting/style/common.less +3 -3
- package/es/modules/companySetting/style/reset.less +117 -0
- package/es/modules/companySetting/user/index.d.ts +21 -0
- package/{dist/esm → es}/modules/companySetting/user/index.js +62 -64
- package/{dist/esm → es}/modules/companySetting/user/index.less +8 -8
- package/es/modules/companySetting/user/invite.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/user/invite.js +8 -12
- package/es/modules/companySetting/userGroup/authConfigDetail.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/userGroup/authConfigDetail.js +62 -82
- package/es/modules/companySetting/userGroup/groupItem.d.ts +13 -0
- package/{dist/esm → es}/modules/companySetting/userGroup/groupItem.js +11 -11
- package/es/modules/companySetting/userGroup/index.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/userGroup/index.js +9 -8
- package/{dist/esm → es}/modules/companySetting/userGroup/style/index.less +1 -1
- package/es/modules/companySetting/virtualApp/config.d.ts +12 -0
- package/{dist/esm → es}/modules/companySetting/virtualApp/config.js +7 -7
- package/es/modules/companySetting/virtualApp/index.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/virtualApp/index.js +12 -14
- package/es/modules/companySetting/virtualApp/panels/list.d.ts +15 -0
- package/{dist/esm → es}/modules/companySetting/virtualApp/panels/list.js +10 -10
- package/es/modules/companySetting/virtualApp/panels/sourceItem.d.ts +10 -0
- package/{dist/esm → es}/modules/companySetting/virtualApp/panels/sourceItem.js +4 -6
- package/{dist/esm → es}/modules/companySetting/virtualApp/styles/config.less +2 -1
- package/{dist/esm → es}/modules/companySetting/virtualApp/styles/index.less +1 -1
- package/{dist/esm → es}/modules/companySetting/virtualApp/styles/table.less +1 -1
- package/{dist/esm → es}/modules/companySetting/wechatBinding/index.js +11 -11
- package/{dist/esm → es}/modules/companySetting/wechatBinding/index.less +1 -1
- package/es/modules/personalSetting/images/banner.png +0 -0
- package/es/modules/personalSetting/images/unbinding.png +0 -0
- package/{dist/esm → es}/modules/personalSetting/index.d.ts +0 -1
- package/es/modules/personalSetting/index.js +40 -0
- package/{dist/esm → es}/modules/personalSetting/info/index.js +10 -10
- package/{dist/esm → es}/modules/personalSetting/reset/index.js +39 -39
- package/es/modules/personalSetting/styles/unbinding.less +73 -0
- package/es/modules/personalSetting/unbinding/index.d.ts +4 -0
- package/es/modules/personalSetting/unbinding/index.js +104 -0
- package/{dist/esm → es}/modules/systemSetting/index.d.ts +0 -1
- package/{dist/esm → es}/modules/systemSetting/index.js +8 -4
- package/es/modules/systemSetting/notice/configItem/index.d.ts +8 -0
- package/{dist/esm → es}/modules/systemSetting/notice/configItem/index.js +5 -5
- package/{dist/esm → es}/modules/systemSetting/notice/edit/index.d.ts +2 -8
- package/{dist/esm → es}/modules/systemSetting/notice/edit/index.js +2 -3
- package/{dist/esm → es}/modules/systemSetting/notice/index.d.ts +1 -1
- package/{dist/esm → es}/modules/systemSetting/notice/index.js +12 -11
- package/es/types/app.d.ts +140 -0
- package/es/types/app.js +1 -0
- package/es/types/companySetting.d.ts +199 -0
- package/es/types/companySetting.js +1 -0
- package/es/types/index.d.ts +4 -0
- package/es/types/index.js +4 -0
- package/es/types/personal.d.ts +21 -0
- package/es/types/personal.js +1 -0
- package/es/types/system.d.ts +38 -0
- package/es/types/system.js +1 -0
- package/{dist/esm → es}/utils/constants.js +0 -64
- package/{dist/esm → es}/utils/functionalPermissions.js +0 -1
- package/package.json +6 -6
- package/dist/esm/components/pageLoading/index.less +0 -11
- package/dist/esm/constants/styles/base.sass +0 -9
- package/dist/esm/constants/styles/cleverUI.css +0 -7
- package/dist/esm/constants/styles/constants.sass +0 -60
- package/dist/esm/constants/styles/customUITheme.sass +0 -54
- package/dist/esm/constants/styles/reset.sass +0 -61
- package/dist/esm/index.js +0 -4
- package/dist/esm/modules/appSettings/demo/index.d.ts +0 -3
- package/dist/esm/modules/appSettings/demo/index.js +0 -6
- package/dist/esm/modules/appSettings/index.js +0 -87
- package/dist/esm/modules/appSettings/index.less +0 -21
- package/dist/esm/modules/companySetting/appList/index.d.ts +0 -21
- package/dist/esm/modules/companySetting/cost/index.d.ts +0 -8
- package/dist/esm/modules/companySetting/edit/authConfig.d.ts +0 -10
- package/dist/esm/modules/companySetting/edit/authModule.d.ts +0 -7
- package/dist/esm/modules/companySetting/edit/user.d.ts +0 -14
- package/dist/esm/modules/companySetting/edit/userGroup.d.ts +0 -15
- package/dist/esm/modules/companySetting/index.d.ts +0 -14
- package/dist/esm/modules/companySetting/index.js +0 -718
- package/dist/esm/modules/companySetting/user/index.d.ts +0 -19
- package/dist/esm/modules/companySetting/user/invite.d.ts +0 -10
- package/dist/esm/modules/companySetting/userGroup/authConfigDetail.d.ts +0 -16
- package/dist/esm/modules/companySetting/userGroup/groupItem.d.ts +0 -11
- package/dist/esm/modules/companySetting/userGroup/index.d.ts +0 -14
- package/dist/esm/modules/companySetting/virtualApp/config.d.ts +0 -11
- package/dist/esm/modules/companySetting/virtualApp/index.d.ts +0 -12
- package/dist/esm/modules/companySetting/virtualApp/panels/list.d.ts +0 -12
- package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.d.ts +0 -10
- package/dist/esm/modules/personalSetting/index.js +0 -62
- package/dist/esm/modules/personalSetting/index.less +0 -2
- package/dist/esm/modules/systemSetting/index.less +0 -2
- package/dist/esm/modules/systemSetting/notice/configItem/index.d.ts +0 -7
- /package/{dist/esm → es}/components/demo.d.ts +0 -0
- /package/{dist/esm → es}/components/demo.js +0 -0
- /package/{dist/esm → es}/constants/icons/demo.css +0 -0
- /package/{dist/esm → es}/constants/icons/demo_index.html +0 -0
- /package/{dist/esm → es}/constants/icons/iconfont.json +0 -0
- /package/{dist/esm → es}/constants/icons/iconfont.ttf +0 -0
- /package/{dist/esm → es}/constants/icons/iconfont.woff +0 -0
- /package/{dist/esm → es}/constants/icons/iconfont.woff2 +0 -0
- /package/{dist/esm → es}/global.d.ts +0 -0
- /package/{dist/esm → es}/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/appInfo/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.less +0 -0
- /package/{dist/esm → es}/modules/appSettings/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/member/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/secretKey/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/secretKey/index.js +0 -0
- /package/{dist/esm → es}/modules/appSettings/virtualSource/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/appSettings/virtualSource/styles/index.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/edit/styles/authConfig.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/edit/styles/authGroup.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/edit/styles/authModule.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/edit/styles/user.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/edit/styles/userGroup.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/index.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/userGroup/index.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/userGroup/style/authConfigDetail.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/virtualApp/styles/list.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/virtualApp/styles/sourceItem.less +0 -0
- /package/{dist/esm → es}/modules/companySetting/wechatBinding/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/personalSetting/info/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/personalSetting/reset/index.d.ts +0 -0
- /package/{dist/esm → es}/modules/systemSetting/notice/configItem/index.less +0 -0
- /package/{dist/esm → es}/modules/systemSetting/notice/edit/index.less +0 -0
- /package/{dist/esm → es}/utils/ajax.d.ts +0 -0
- /package/{dist/esm → es}/utils/ajax.js +0 -0
- /package/{dist/esm → es}/utils/base64.d.ts +0 -0
- /package/{dist/esm → es}/utils/base64.js +0 -0
- /package/{dist/esm → es}/utils/constants.d.ts +0 -0
- /package/{dist/esm → es}/utils/functionalPermissions.d.ts +0 -0
- /package/{dist/esm → es}/utils/util.d.ts +0 -0
- /package/{dist/esm → es}/utils/util.js +0 -0
|
@@ -11,14 +11,13 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
11
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
12
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
13
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
14
|
-
import
|
|
14
|
+
import './styles/user.less';
|
|
15
15
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
|
-
import { Button,
|
|
17
|
-
import request from
|
|
18
|
-
import AuthConfig from
|
|
19
|
-
import AuthConfigCEP from
|
|
20
|
-
import apis from
|
|
21
|
-
var TextArea = Input.TextArea;
|
|
16
|
+
import { Button, notification, Tabs, Select } from 'antd';
|
|
17
|
+
import request from './../../../utils/ajax';
|
|
18
|
+
import AuthConfig from './authConfig';
|
|
19
|
+
import AuthConfigCEP from './authConfigCEP';
|
|
20
|
+
import apis from './../../../constants/api';
|
|
22
21
|
var Info = function Info(props) {
|
|
23
22
|
var ENVIRONMENT = props.ENVIRONMENT,
|
|
24
23
|
data = props.data,
|
|
@@ -31,7 +30,7 @@ var Info = function Info(props) {
|
|
|
31
30
|
changeUserAuthCallback = props.changeUserAuthCallback;
|
|
32
31
|
var dealAllGroupInfos = allGroupInfos.map(function (item) {
|
|
33
32
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
34
|
-
value: item.id,
|
|
33
|
+
value: item.id + '',
|
|
35
34
|
label: item.groupName
|
|
36
35
|
});
|
|
37
36
|
});
|
|
@@ -39,11 +38,12 @@ var Info = function Info(props) {
|
|
|
39
38
|
currentApp = _useContext.currentApp,
|
|
40
39
|
currentUser = _useContext.currentUser,
|
|
41
40
|
isDemo = _useContext.isDemo;
|
|
41
|
+
// SelectProps<string, { value: number; label: string; }>
|
|
42
42
|
var _useState = useState([]),
|
|
43
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
44
|
groups = _useState2[0],
|
|
45
45
|
setGroups = _useState2[1];
|
|
46
|
-
var _useState3 = useState([]),
|
|
46
|
+
var _useState3 = useState([[], [], {}]),
|
|
47
47
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
48
|
CEPData = _useState4[0],
|
|
49
49
|
setCEPData = _useState4[1];
|
|
@@ -58,41 +58,45 @@ var Info = function Info(props) {
|
|
|
58
58
|
var refAuthConfig = useRef();
|
|
59
59
|
var refAuthCEPConfig = useRef();
|
|
60
60
|
useEffect(function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
61
|
+
if (serviceType !== 1) {
|
|
62
|
+
Promise.all([request(apis.setting.queryFunConfigList, {
|
|
63
|
+
method: 'post'
|
|
64
|
+
}).then(function (res) {
|
|
65
|
+
if (res && res.code + '' === '200') {
|
|
66
|
+
return res.data;
|
|
67
|
+
}
|
|
68
|
+
throw new Error('接口返回错误');
|
|
69
|
+
}), request(apis.setting.queryAppList, {
|
|
70
|
+
method: 'post'
|
|
71
|
+
}).then(function (res) {
|
|
72
|
+
if (res && res.code + '' === '200') {
|
|
73
|
+
return res.data;
|
|
74
|
+
}
|
|
75
|
+
throw new Error('接口返回错误');
|
|
76
|
+
}), request(apis.setting.queryFunConfigByUserId, {
|
|
77
|
+
method: 'post',
|
|
78
|
+
data: {
|
|
79
|
+
userId: data.id,
|
|
80
|
+
type: 1
|
|
81
|
+
}
|
|
82
|
+
}).then(function (res) {
|
|
83
|
+
if (res && res.code + '' === '200') {
|
|
84
|
+
return res.data;
|
|
85
|
+
}
|
|
86
|
+
throw new Error('接口返回错误');
|
|
87
|
+
})]).then(function (posts) {
|
|
88
|
+
setCEPData([posts[0] || [], posts[1] || [], posts[2] || {}]);
|
|
89
|
+
}).catch(function () {
|
|
90
|
+
notification.error({
|
|
91
|
+
message: '接口返回错误'
|
|
92
|
+
});
|
|
91
93
|
});
|
|
92
|
-
}
|
|
94
|
+
}
|
|
93
95
|
}, []);
|
|
94
96
|
useEffect(function () {
|
|
95
|
-
var authConfig = data.authConfig || {
|
|
97
|
+
var authConfig = data.authConfig || {
|
|
98
|
+
groupIds: []
|
|
99
|
+
};
|
|
96
100
|
var groupIds = authConfig.groupIds || [];
|
|
97
101
|
setGroups(dealAllGroupInfos.filter(function (item) {
|
|
98
102
|
return groupIds.includes(item.id);
|
|
@@ -157,17 +161,23 @@ var Info = function Info(props) {
|
|
|
157
161
|
method: 'post',
|
|
158
162
|
params: formData
|
|
159
163
|
}).then(function (res) {
|
|
160
|
-
|
|
161
|
-
if (ENVIRONMENT == 'saas' && res.flag == -10003) {
|
|
164
|
+
if (ENVIRONMENT == 'saas' && (res === null || res === void 0 ? void 0 : res.flag) == -10003) {
|
|
162
165
|
notification.error({
|
|
163
166
|
message: '该用户未接受邀请,暂时无法操作'
|
|
164
167
|
});
|
|
165
168
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
if ((res === null || res === void 0 ? void 0 : res.flag) == 101) {
|
|
170
|
+
changeUserAuthCallback && changeUserAuthCallback(data.id);
|
|
171
|
+
notification.success({
|
|
172
|
+
message: '保存成功'
|
|
173
|
+
});
|
|
174
|
+
onCancel();
|
|
175
|
+
} else {
|
|
176
|
+
notification.error({
|
|
177
|
+
message: '权限修改失败'
|
|
178
|
+
});
|
|
179
|
+
}
|
|
169
180
|
setBtnLoading(false);
|
|
170
|
-
onCancel();
|
|
171
181
|
}).catch(function (error) {
|
|
172
182
|
console.log(error);
|
|
173
183
|
setBtnLoading(false);
|
|
@@ -195,7 +205,7 @@ var Info = function Info(props) {
|
|
|
195
205
|
method: 'post',
|
|
196
206
|
data: _formData
|
|
197
207
|
}).then(function () {
|
|
198
|
-
changeUserAuthCallback && changeUserAuthCallback(data
|
|
208
|
+
changeUserAuthCallback && changeUserAuthCallback(data.id);
|
|
199
209
|
notification.success({
|
|
200
210
|
message: '保存成功'
|
|
201
211
|
});
|
|
@@ -265,7 +275,7 @@ var Info = function Info(props) {
|
|
|
265
275
|
key: "io"
|
|
266
276
|
}, /*#__PURE__*/React.createElement(AuthConfig, {
|
|
267
277
|
ref: refAuthConfig,
|
|
268
|
-
config: data.authConfig.defaultAuth,
|
|
278
|
+
config: data.authConfig ? data.authConfig.defaultAuth : {},
|
|
269
279
|
appList: companyAppList,
|
|
270
280
|
isMarsUi: isMarsUi,
|
|
271
281
|
leftMenus: leftMenus
|
|
@@ -275,10 +285,7 @@ var Info = function Info(props) {
|
|
|
275
285
|
}, /*#__PURE__*/React.createElement(AuthConfigCEP, {
|
|
276
286
|
ref: refAuthCEPConfig,
|
|
277
287
|
CEPData: CEPData,
|
|
278
|
-
|
|
279
|
-
appList: companyAppList,
|
|
280
|
-
isMarsUi: isMarsUi,
|
|
281
|
-
leftMenus: leftMenus
|
|
288
|
+
isMarsUi: isMarsUi
|
|
282
289
|
})) : null), /*#__PURE__*/React.createElement("div", {
|
|
283
290
|
className: "company-setting-footer"
|
|
284
291
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles/userGroup.less';
|
|
3
|
+
import { AllGroupInfosItem, AppListItem, LeftMenusItem } from '../../../types';
|
|
4
|
+
declare const CompanySettingUserGroup: React.FC<{
|
|
5
|
+
id: number;
|
|
6
|
+
data: AllGroupInfosItem | undefined;
|
|
7
|
+
allGroupInfos: Array<AllGroupInfosItem>;
|
|
8
|
+
companyAppList: AppListItem[];
|
|
9
|
+
isMarsUi: boolean;
|
|
10
|
+
leftMenus: LeftMenusItem[];
|
|
11
|
+
isAdmin: boolean;
|
|
12
|
+
serviceType: number;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
updateGroupAuthCallback: (isUser: boolean) => void;
|
|
15
|
+
}>;
|
|
16
|
+
export default CompanySettingUserGroup;
|
|
@@ -10,16 +10,15 @@ 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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import constants from "./../../../utils/constants";
|
|
13
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
14
|
+
import './styles/userGroup.less';
|
|
15
|
+
import constants from './../../../utils/constants';
|
|
17
16
|
import { Button, Input, notification, Tabs, Radio, Select } from 'antd';
|
|
18
|
-
import request from
|
|
19
|
-
import AuthConfig from
|
|
20
|
-
import AuthConfigCEP from
|
|
21
|
-
import apis from
|
|
22
|
-
|
|
17
|
+
import request from './../../../utils/ajax';
|
|
18
|
+
import AuthConfig from './authConfig';
|
|
19
|
+
import AuthConfigCEP from './authConfigCEP';
|
|
20
|
+
import apis from './../../../constants/api';
|
|
21
|
+
// interface UserItem {id: number; value: number; label: string}
|
|
23
22
|
var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
24
23
|
var id = props.id,
|
|
25
24
|
data = props.data,
|
|
@@ -31,10 +30,6 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
31
30
|
serviceType = props.serviceType,
|
|
32
31
|
onCancel = props.onCancel,
|
|
33
32
|
updateGroupAuthCallback = props.updateGroupAuthCallback;
|
|
34
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
35
|
-
currentApp = _useContext.currentApp,
|
|
36
|
-
currentUser = _useContext.currentUser,
|
|
37
|
-
isDemo = _useContext.isDemo;
|
|
38
33
|
var _useState = useState(''),
|
|
39
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
35
|
name = _useState2[0],
|
|
@@ -55,7 +50,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
55
50
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
51
|
allMembers = _useState10[0],
|
|
57
52
|
setAllMembers = _useState10[1];
|
|
58
|
-
var _useState11 = useState([]),
|
|
53
|
+
var _useState11 = useState([[], [], {}]),
|
|
59
54
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
60
55
|
CEPData = _useState12[0],
|
|
61
56
|
setCEPData = _useState12[1];
|
|
@@ -70,66 +65,68 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
70
65
|
var refAuthConfig = useRef();
|
|
71
66
|
var refAuthCEPConfig = useRef();
|
|
72
67
|
useEffect(function () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
if (serviceType !== 1) {
|
|
69
|
+
Promise.all([request(apis.setting.queryFunConfigList, {
|
|
70
|
+
method: 'post'
|
|
71
|
+
}).then(function (res) {
|
|
72
|
+
if (res && res.code + '' === '200') {
|
|
73
|
+
return res.data;
|
|
74
|
+
}
|
|
75
|
+
throw new Error('接口返回错误');
|
|
76
|
+
}), request(apis.setting.queryAppList, {
|
|
77
|
+
method: 'post'
|
|
78
|
+
}).then(function (res) {
|
|
79
|
+
if (res && res.code + '' === '200') {
|
|
80
|
+
return res.data;
|
|
81
|
+
}
|
|
82
|
+
throw new Error('接口返回错误');
|
|
83
|
+
}), data && data.id && request(apis.setting.queryFunConfigByUserId, {
|
|
84
|
+
method: 'post',
|
|
85
|
+
data: {
|
|
86
|
+
groupId: data.id,
|
|
87
|
+
type: 2
|
|
88
|
+
}
|
|
89
|
+
}).then(function (res) {
|
|
90
|
+
if (res && res.code + '' === '200') {
|
|
91
|
+
return res.data;
|
|
92
|
+
}
|
|
93
|
+
throw new Error('接口返回错误');
|
|
94
|
+
})]).then(function (posts) {
|
|
95
|
+
setCEPData([posts[0] || [], posts[1] || [], posts[2] || {}]);
|
|
96
|
+
}).catch(function () {
|
|
97
|
+
notification.error({
|
|
98
|
+
message: '接口返回错误'
|
|
99
|
+
});
|
|
103
100
|
});
|
|
104
|
-
}
|
|
101
|
+
}
|
|
105
102
|
}, []);
|
|
106
103
|
useEffect(function () {
|
|
107
|
-
setName(data.groupName || '');
|
|
104
|
+
setName(data && data.groupName || '');
|
|
108
105
|
var result = [];
|
|
109
106
|
if (data && data.members) {
|
|
110
107
|
data.members.forEach(function (item) {
|
|
111
108
|
result.push({
|
|
112
109
|
id: item.userId,
|
|
113
|
-
value: item.userId,
|
|
110
|
+
value: item.userId + '',
|
|
114
111
|
label: item.username || item.email
|
|
115
112
|
});
|
|
116
113
|
});
|
|
117
114
|
}
|
|
118
115
|
setUser(result);
|
|
119
116
|
setOldUser(result);
|
|
120
|
-
setIsEncryption(data.isEncryption || 0);
|
|
117
|
+
setIsEncryption(data && data.isEncryption || 0);
|
|
121
118
|
}, [props.data]);
|
|
122
119
|
useEffect(function () {
|
|
123
|
-
setName(data.groupName || '');
|
|
120
|
+
setName(data && data.groupName || '');
|
|
124
121
|
}, [props.allGroupInfos]);
|
|
125
122
|
useEffect(function () {
|
|
126
123
|
request(apis.setting.getGroupMembers, {
|
|
127
124
|
method: 'get'
|
|
128
125
|
}).then(function (res) {
|
|
129
|
-
if (res.flag === 101) {
|
|
130
|
-
setAllMembers(res.company_members.map(function (item) {
|
|
126
|
+
if ((res === null || res === void 0 ? void 0 : res.flag) === 101) {
|
|
127
|
+
setAllMembers(((res === null || res === void 0 ? void 0 : res.company_members) || []).map(function (item) {
|
|
131
128
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
132
|
-
value: item.id,
|
|
129
|
+
value: item.id + '',
|
|
133
130
|
label: item.username || item.email
|
|
134
131
|
});
|
|
135
132
|
}));
|
|
@@ -150,7 +147,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
150
147
|
var groupNameArr = allGroupInfos.map(function (item) {
|
|
151
148
|
return item.groupName;
|
|
152
149
|
});
|
|
153
|
-
if (!data
|
|
150
|
+
if (!data && groupNameArr.includes(name)) {
|
|
154
151
|
// 如果props data没有传值 就是新建组 新建的时候不检查组名重复
|
|
155
152
|
notification.error({
|
|
156
153
|
message: '用户组名称重复'
|
|
@@ -198,7 +195,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
198
195
|
authConfig.funAuth = funAuth;
|
|
199
196
|
}
|
|
200
197
|
var formData = {
|
|
201
|
-
groupId: data.id || 0,
|
|
198
|
+
groupId: data && data.id || 0,
|
|
202
199
|
groupName: name,
|
|
203
200
|
authConfig: JSON.stringify(authConfig),
|
|
204
201
|
userIds: userIdArr.join(','),
|
|
@@ -207,17 +204,23 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
207
204
|
request(apis.setting.updateGroupAuth, {
|
|
208
205
|
method: 'post',
|
|
209
206
|
params: formData
|
|
210
|
-
}).then(function () {
|
|
207
|
+
}).then(function (res) {
|
|
211
208
|
// let arr = []
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
if ((res === null || res === void 0 ? void 0 : res.flag) == 101) {
|
|
210
|
+
var hasCurrentUser = user.concat(oldUser).map(function (item) {
|
|
211
|
+
return item.id;
|
|
212
|
+
}).includes(id);
|
|
213
|
+
updateGroupAuthCallback && updateGroupAuthCallback(hasCurrentUser);
|
|
214
|
+
notification.success({
|
|
215
|
+
message: '保存成功'
|
|
216
|
+
});
|
|
217
|
+
onCancel();
|
|
218
|
+
} else {
|
|
219
|
+
notification.error({
|
|
220
|
+
message: '权限修改失败'
|
|
221
|
+
});
|
|
222
|
+
}
|
|
219
223
|
setBtnLoading(false);
|
|
220
|
-
onCancel();
|
|
221
224
|
}).catch(function (error) {
|
|
222
225
|
console.log(error);
|
|
223
226
|
setBtnLoading(false);
|
|
@@ -232,7 +235,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
232
235
|
// return item.id;
|
|
233
236
|
// });
|
|
234
237
|
var _formData = {
|
|
235
|
-
groupId: data.id,
|
|
238
|
+
groupId: data && data.id,
|
|
236
239
|
appIds: _authConfig.dataAuth.map(function (item) {
|
|
237
240
|
return item.appId;
|
|
238
241
|
}),
|
|
@@ -245,7 +248,10 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
245
248
|
method: 'post',
|
|
246
249
|
data: _formData
|
|
247
250
|
}).then(function () {
|
|
248
|
-
|
|
251
|
+
var hasCurrentUser = user.concat(oldUser).map(function (item) {
|
|
252
|
+
return item.id;
|
|
253
|
+
}).includes(id);
|
|
254
|
+
updateGroupAuthCallback && updateGroupAuthCallback(hasCurrentUser);
|
|
249
255
|
notification.success({
|
|
250
256
|
message: '保存成功'
|
|
251
257
|
});
|
|
@@ -264,7 +270,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
264
270
|
className: "company-setting-user-group"
|
|
265
271
|
}, /*#__PURE__*/React.createElement("div", {
|
|
266
272
|
className: "company-setting-group-title"
|
|
267
|
-
}, data.id ? /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91\u7528\u6237\u7EC4") : /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u7528\u6237\u7EC4")), /*#__PURE__*/React.createElement("div", {
|
|
273
|
+
}, data && data.id ? /*#__PURE__*/React.createElement("span", null, "\u7F16\u8F91\u7528\u6237\u7EC4") : /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u7528\u6237\u7EC4")), /*#__PURE__*/React.createElement("div", {
|
|
268
274
|
className: "company-setting-user-name"
|
|
269
275
|
}, /*#__PURE__*/React.createElement("span", null, "\u540D\u79F0\uFF1A"), /*#__PURE__*/React.createElement(Input, {
|
|
270
276
|
placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u7EC4\u540D\u79F0",
|
|
@@ -345,7 +351,7 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
345
351
|
key: "io"
|
|
346
352
|
}, /*#__PURE__*/React.createElement(AuthConfig, {
|
|
347
353
|
ref: refAuthConfig,
|
|
348
|
-
config: data.authConfig,
|
|
354
|
+
config: data && data.authConfig || {},
|
|
349
355
|
appList: companyAppList,
|
|
350
356
|
isMarsUi: isMarsUi,
|
|
351
357
|
leftMenus: leftMenus
|
|
@@ -355,10 +361,9 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
355
361
|
}, /*#__PURE__*/React.createElement(AuthConfigCEP, {
|
|
356
362
|
ref: refAuthCEPConfig,
|
|
357
363
|
CEPData: CEPData,
|
|
358
|
-
config
|
|
359
|
-
appList
|
|
360
|
-
isMarsUi: isMarsUi
|
|
361
|
-
leftMenus: leftMenus
|
|
364
|
+
// config={data.authConfig}
|
|
365
|
+
// appList={companyAppList}
|
|
366
|
+
isMarsUi: isMarsUi
|
|
362
367
|
})) : null), /*#__PURE__*/React.createElement("div", {
|
|
363
368
|
className: "company-setting-footer"
|
|
364
369
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare const CompanySetting: React.FC<{
|
|
4
|
+
showWeChatMenu: boolean;
|
|
5
|
+
showMarketMenu: boolean;
|
|
6
|
+
action: string;
|
|
7
|
+
settingCallback?: (type: string, obj?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export default CompanySetting;
|