@zgfe/modules-settings 1.2.4 → 1.2.6-beta.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/es/modules/companySetting/appList/index.js +0 -1
- package/es/modules/companySetting/edit/authConfig.d.ts +2 -2
- package/es/modules/companySetting/edit/authConfig.js +23 -24
- package/es/modules/companySetting/edit/authConfigCEP.js +0 -4
- package/es/modules/companySetting/edit/authGroup.js +0 -1
- package/es/modules/companySetting/edit/authModule.js +0 -2
- package/es/modules/companySetting/edit/multiAuthModule.js +0 -1
- package/es/modules/companySetting/edit/user.js +0 -4
- package/es/modules/companySetting/edit/userGroup.js +4 -1
- package/es/modules/companySetting/index.js +3 -6
- package/es/modules/companySetting/user/index.js +1 -1
- package/es/modules/companySetting/userGroup/authConfigDetail.js +0 -3
- package/es/modules/companySetting/virtualApp/config.js +0 -4
- package/es/modules/companySetting/virtualApp/index.js +0 -2
- package/es/modules/companySetting/virtualApp/panels/list.js +0 -1
- package/es/modules/companySetting/virtualApp/panels/sourceItem.js +0 -2
- package/es/utils/util.js +0 -1
- package/package.json +3 -3
|
@@ -85,7 +85,6 @@ var appList = function appList(props) {
|
|
|
85
85
|
var columns = [{
|
|
86
86
|
title: '应用名称',
|
|
87
87
|
render: function render(data) {
|
|
88
|
-
// console.log(appName, data)
|
|
89
88
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
90
89
|
className: "app-name",
|
|
91
90
|
title: data.appName || '',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/authConfig.less';
|
|
3
3
|
import { AppListItem, Config, LeftMenusItem } from '../../../types';
|
|
4
|
-
declare const
|
|
4
|
+
declare const AuthConfig: React.FC<{
|
|
5
5
|
config: Config;
|
|
6
6
|
appList: Array<AppListItem>;
|
|
7
7
|
leftMenus: LeftMenusItem[];
|
|
8
8
|
ref: any;
|
|
9
9
|
}>;
|
|
10
|
-
export default
|
|
10
|
+
export default AuthConfig;
|
|
@@ -9,7 +9,7 @@ import './styles/authConfig.less';
|
|
|
9
9
|
import constants from './../../../utils/constants';
|
|
10
10
|
import funPermissions from './../../../utils/functionalPermissions';
|
|
11
11
|
import AuthGroup from './authGroup';
|
|
12
|
-
var
|
|
12
|
+
var AuthConfig = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
13
|
var config = props.config,
|
|
14
14
|
appList = props.appList,
|
|
15
15
|
leftMenus = props.leftMenus;
|
|
@@ -55,7 +55,6 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
console.log('functionalPermissions');
|
|
59
58
|
if (functionalPermissions.checked) {
|
|
60
59
|
funAuth.push({
|
|
61
60
|
resource: funPermissions['standard'].all.key,
|
|
@@ -197,7 +196,6 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
197
196
|
funAuth.forEach(function (item) {
|
|
198
197
|
map[item.resource] = item.opts[0];
|
|
199
198
|
});
|
|
200
|
-
console.log(map);
|
|
201
199
|
// 顶部菜单功能权限
|
|
202
200
|
var loopFormatTopMenu = function loopFormatTopMenu(topMenu, checkAll) {
|
|
203
201
|
var menuFunPerConstants = funPermissions['standard'][topMenu.name];
|
|
@@ -259,7 +257,6 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
259
257
|
};
|
|
260
258
|
var menuFun = [];
|
|
261
259
|
var isAll = !!map[funPermissions['standard'].all.key];
|
|
262
|
-
console.log('dskfhk', leftMenus);
|
|
263
260
|
leftMenus.forEach(function (menu) {
|
|
264
261
|
var topMenuFun = loopFormatTopMenu(menu, isAll);
|
|
265
262
|
if (topMenuFun) {
|
|
@@ -270,30 +267,33 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
270
267
|
}
|
|
271
268
|
});
|
|
272
269
|
var settingIsAll = !!map[funPermissions['standard'].setting.default.key];
|
|
270
|
+
var settingChildren = [{
|
|
271
|
+
// ...funPermissions['standard'].setting.company,
|
|
272
|
+
describe: funPermissions['standard'].setting.company.describe,
|
|
273
|
+
key: funPermissions['standard'].setting.company.key,
|
|
274
|
+
disable: false,
|
|
275
|
+
supportVirtualApp: true,
|
|
276
|
+
checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.company.key],
|
|
277
|
+
children: []
|
|
278
|
+
}, {
|
|
279
|
+
// ...funPermissions['standard'].setting.app,
|
|
280
|
+
describe: funPermissions['standard'].setting.app.describe,
|
|
281
|
+
key: funPermissions['standard'].setting.app.key,
|
|
282
|
+
disable: false,
|
|
283
|
+
supportVirtualApp: true,
|
|
284
|
+
checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.app.key],
|
|
285
|
+
children: []
|
|
286
|
+
}];
|
|
273
287
|
menuFun.push({
|
|
274
288
|
describe: funPermissions['standard'].setting.default.describe,
|
|
275
289
|
key: funPermissions['standard'].setting.default.key,
|
|
276
290
|
checked: isAll || !!map[funPermissions['standard'].setting.default.key],
|
|
277
|
-
indeterminate:
|
|
291
|
+
indeterminate: settingChildren.some(function (item) {
|
|
292
|
+
return item.checked;
|
|
293
|
+
}),
|
|
278
294
|
disable: false,
|
|
279
295
|
supportVirtualApp: true,
|
|
280
|
-
children:
|
|
281
|
-
// ...funPermissions['standard'].setting.company,
|
|
282
|
-
describe: funPermissions['standard'].setting.company.describe,
|
|
283
|
-
key: funPermissions['standard'].setting.company.key,
|
|
284
|
-
disable: false,
|
|
285
|
-
supportVirtualApp: true,
|
|
286
|
-
checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.company.key],
|
|
287
|
-
children: []
|
|
288
|
-
}, {
|
|
289
|
-
// ...funPermissions['standard'].setting.app,
|
|
290
|
-
describe: funPermissions['standard'].setting.app.describe,
|
|
291
|
-
key: funPermissions['standard'].setting.app.key,
|
|
292
|
-
disable: false,
|
|
293
|
-
supportVirtualApp: true,
|
|
294
|
-
checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.app.key],
|
|
295
|
-
children: []
|
|
296
|
-
}]
|
|
296
|
+
children: settingChildren
|
|
297
297
|
});
|
|
298
298
|
var checkedArr = menuFun.filter(function (item) {
|
|
299
299
|
return item.checked;
|
|
@@ -301,7 +301,6 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
301
301
|
var indeterminateArr = menuFun.filter(function (item) {
|
|
302
302
|
return item.indeterminate;
|
|
303
303
|
});
|
|
304
|
-
console.log(menuFun);
|
|
305
304
|
setFunctionalPermissions({
|
|
306
305
|
describe: '功能权限',
|
|
307
306
|
key: funPermissions['standard'].all.key,
|
|
@@ -327,4 +326,4 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
327
326
|
}
|
|
328
327
|
}));
|
|
329
328
|
});
|
|
330
|
-
export default
|
|
329
|
+
export default AuthConfig;
|
|
@@ -91,7 +91,6 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
var cepFunAuth = [];
|
|
94
|
-
console.log('functionalPermissions', functionalPermissions);
|
|
95
94
|
functionalPermissions.children && functionalPermissions.children.forEach(function (item) {
|
|
96
95
|
if (item.checked) {
|
|
97
96
|
if (item.radio) {
|
|
@@ -152,14 +151,11 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
152
151
|
allFunConfigList = _CEPData[0],
|
|
153
152
|
allAppList = _CEPData[1],
|
|
154
153
|
checkAll = _CEPData[2];
|
|
155
|
-
console.log(CEPData);
|
|
156
154
|
var _ref = checkAll || {},
|
|
157
155
|
checkAppList = _ref.appList,
|
|
158
156
|
checkFunConfigList = _ref.funConfig;
|
|
159
157
|
var dealFunConfigList = dealDateAddChecked(allFunConfigList || [], checkFunConfigList || []);
|
|
160
|
-
console.log(JSON.stringify(dealFunConfigList));
|
|
161
158
|
dealFunConfigList = dealDateAddIndeterminate(dealFunConfigList || [], checkFunConfigList || []);
|
|
162
|
-
console.log(JSON.stringify(dealFunConfigList));
|
|
163
159
|
var checkedFunArr = dealFunConfigList.filter(function (item) {
|
|
164
160
|
return item.checked;
|
|
165
161
|
});
|
|
@@ -83,7 +83,6 @@ var AuthModule = function AuthModule(props) {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
var dealArr = util.clone(functionGroups);
|
|
86
|
-
console.log('ddd');
|
|
87
86
|
dealArr.forEach(function (item, index) {
|
|
88
87
|
if (data.radio) {
|
|
89
88
|
item.checked = checked && !index;
|
|
@@ -158,7 +157,6 @@ var AuthModule = function AuthModule(props) {
|
|
|
158
157
|
dealData.checked = false;
|
|
159
158
|
dealData.indeterminate = true;
|
|
160
159
|
}
|
|
161
|
-
console.log('dealData', dealData);
|
|
162
160
|
onChange && onChange(dealData);
|
|
163
161
|
};
|
|
164
162
|
return data ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -86,7 +86,6 @@ var multiAuthModule = function multiAuthModule(props) {
|
|
|
86
86
|
dealData.checked = false;
|
|
87
87
|
dealData.indeterminate = true;
|
|
88
88
|
}
|
|
89
|
-
console.log('dealData', dealData);
|
|
90
89
|
onChange && onChange(dealData);
|
|
91
90
|
};
|
|
92
91
|
var onGroupChange = function onGroupChange(e, index, initArr) {
|
|
@@ -108,13 +108,10 @@ var Info = function Info(props) {
|
|
|
108
108
|
onCancel && onCancel();
|
|
109
109
|
};
|
|
110
110
|
var onSaveCallback = function onSaveCallback() {
|
|
111
|
-
// if (currentTab === 'io'){
|
|
112
|
-
// "funAuth":[{"resource":"/user/userList","opts":["all"]},{"resource":"/user/userGroup","opts":["all"]},{"resource":"/user/userTags","opts":["all"]},{"resource":"/setting/company","opts":["all"]}]
|
|
113
111
|
var authConfig = serviceType !== 2 ? refAuthConfig.current.getFormData() : {};
|
|
114
112
|
var groupIdArr = groups.map(function (item) {
|
|
115
113
|
return item.id;
|
|
116
114
|
});
|
|
117
|
-
console.log(authConfig);
|
|
118
115
|
if (serviceType === 2) {
|
|
119
116
|
var dealData = refAuthCEPConfig.current.getFormData();
|
|
120
117
|
authConfig.dataAuth = dealData.dataAuth;
|
|
@@ -186,7 +183,6 @@ var Info = function Info(props) {
|
|
|
186
183
|
});
|
|
187
184
|
if (currentTab === 'cep') {
|
|
188
185
|
var _authConfig = refAuthCEPConfig.current.getFormData();
|
|
189
|
-
console.log(_authConfig);
|
|
190
186
|
// let groupIdArr = groups.map((item) => {
|
|
191
187
|
// return item.id;
|
|
192
188
|
// });
|
|
@@ -229,7 +229,6 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
229
229
|
});
|
|
230
230
|
if (currentTab === 'cep') {
|
|
231
231
|
var _authConfig = refAuthCEPConfig.current.getFormData();
|
|
232
|
-
console.log(_authConfig);
|
|
233
232
|
// let groupIdArr = groups.map((item) => {
|
|
234
233
|
// return item.id;
|
|
235
234
|
// });
|
|
@@ -318,6 +317,10 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
318
317
|
},
|
|
319
318
|
className: "delete-btn"
|
|
320
319
|
}, "\u6E05\u7A7A")), menu);
|
|
320
|
+
},
|
|
321
|
+
filterOption: function filterOption(input, option) {
|
|
322
|
+
var _option$label;
|
|
323
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
|
|
321
324
|
}
|
|
322
325
|
}))), isAdmin ? /*#__PURE__*/React.createElement("div", {
|
|
323
326
|
className: "encryption-wrap"
|
|
@@ -545,12 +545,9 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
545
545
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
546
546
|
while (1) switch (_context4.prev = _context4.next) {
|
|
547
547
|
case 0:
|
|
548
|
-
|
|
549
|
-
// 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
|
|
550
|
-
// 用来处理同步主应用可能需要的刷新的逻辑, 可不传
|
|
551
|
-
_context4.next = 3;
|
|
548
|
+
_context4.next = 2;
|
|
552
549
|
return updateUserAuth(formData);
|
|
553
|
-
case
|
|
550
|
+
case 2:
|
|
554
551
|
getSettingData();
|
|
555
552
|
settingCallback && settingCallback('settingDelVirtualAppCallback', res);
|
|
556
553
|
// 与主应用同步信息 下面为老代码逻辑
|
|
@@ -590,7 +587,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
590
587
|
// this.$store.dispatch(actions.user.getCurrentUser)
|
|
591
588
|
// // 更新应用列表数据
|
|
592
589
|
// this.$store.dispatch(actions.app.queryAppList)
|
|
593
|
-
case
|
|
590
|
+
case 4:
|
|
594
591
|
case "end":
|
|
595
592
|
return _context4.stop();
|
|
596
593
|
}
|
|
@@ -174,7 +174,6 @@ var User = function User(props) {
|
|
|
174
174
|
});
|
|
175
175
|
};
|
|
176
176
|
var showUserEditAuthEvent = function showUserEditAuthEvent(userData) {
|
|
177
|
-
console.log('userData', userData);
|
|
178
177
|
setUserEditAuthState(true);
|
|
179
178
|
setUserEditAuthData(userData);
|
|
180
179
|
};
|
|
@@ -504,6 +503,7 @@ var User = function User(props) {
|
|
|
504
503
|
dataSource: showMembers,
|
|
505
504
|
columns: columns,
|
|
506
505
|
total: showMembers.length,
|
|
506
|
+
rowKey: "id",
|
|
507
507
|
pageSize: showMembers.length / 10
|
|
508
508
|
}), /*#__PURE__*/React.createElement("div", null, isAdmin ? /*#__PURE__*/React.createElement("div", {
|
|
509
509
|
style: {
|
|
@@ -45,7 +45,6 @@ var authConfigDetail = function authConfigDetail(props) {
|
|
|
45
45
|
cepFunConfig = _useState8[0],
|
|
46
46
|
setCepFunConfig = _useState8[1];
|
|
47
47
|
// #todo isAdmin 需要添加
|
|
48
|
-
// console.log('dsfdsfsdfdsfdsfdsf');
|
|
49
48
|
useEffect(function () {
|
|
50
49
|
reworkAppList();
|
|
51
50
|
reworkFunAuth();
|
|
@@ -90,9 +89,7 @@ var authConfigDetail = function authConfigDetail(props) {
|
|
|
90
89
|
setCepAppList(appList || []);
|
|
91
90
|
// 用checked的数据和全部数据进行匹配
|
|
92
91
|
var dealFunConfigList = dealDateAddChecked(CEPAllFunConfigList || [], funConfig || []);
|
|
93
|
-
// console.log(JSON.stringify(dealFunConfigList));
|
|
94
92
|
dealFunConfigList = dealDateAddIndeterminate(dealFunConfigList || [], funConfig || []);
|
|
95
|
-
// console.log(JSON.stringify(dealFunConfigList));
|
|
96
93
|
dealFunConfigList = dealFunConfigList.filter(function (item) {
|
|
97
94
|
return item.checked || item.indeterminate;
|
|
98
95
|
});
|
|
@@ -48,7 +48,6 @@ var Config = function Config(props) {
|
|
|
48
48
|
app_id: app_id,
|
|
49
49
|
event_id: event_id
|
|
50
50
|
} : null;
|
|
51
|
-
console.log('dealData', dealData, index);
|
|
52
51
|
setConfigData(dealData);
|
|
53
52
|
};
|
|
54
53
|
var strMiddleSplit = function strMiddleSplit(str, num) {
|
|
@@ -63,7 +62,6 @@ var Config = function Config(props) {
|
|
|
63
62
|
return str;
|
|
64
63
|
};
|
|
65
64
|
var getSourceAppEventIdArr = function getSourceAppEventIdArr(sourceAppId) {
|
|
66
|
-
console.log('sourceAppIdMap', sourceAppIdMap, sourceApps);
|
|
67
65
|
var sourceData = sourceAppIdMap[sourceAppId] || {};
|
|
68
66
|
return sourceData.source_event_id || [];
|
|
69
67
|
};
|
|
@@ -74,12 +72,10 @@ var Config = function Config(props) {
|
|
|
74
72
|
return item;
|
|
75
73
|
})))
|
|
76
74
|
};
|
|
77
|
-
console.log(params);
|
|
78
75
|
selfRequest(api.app.editVirtualApp, {
|
|
79
76
|
method: 'post',
|
|
80
77
|
data: params
|
|
81
78
|
}).then(function (res) {
|
|
82
|
-
console.log('res', res);
|
|
83
79
|
if (res.code === 10001) {
|
|
84
80
|
notification.success({
|
|
85
81
|
message: '修改成功!'
|
|
@@ -117,7 +117,6 @@ var VirtualApp = function VirtualApp(props) {
|
|
|
117
117
|
message: '创建成功'
|
|
118
118
|
});
|
|
119
119
|
setStatus('list');
|
|
120
|
-
console.log('dsddsdssdsddsds');
|
|
121
120
|
var dealAuthConfig = util.clone(authConfig);
|
|
122
121
|
if (!(dealAuthConfig.dataAuth.length === 1 && dealAuthConfig.dataAuth[0].appId === 0)) {
|
|
123
122
|
dealAuthConfig.dataAuth.unshift({
|
|
@@ -161,7 +160,6 @@ var VirtualApp = function VirtualApp(props) {
|
|
|
161
160
|
var gotoConfig = function gotoConfig(data) {
|
|
162
161
|
setSelectApp(data);
|
|
163
162
|
setIsConfig(true);
|
|
164
|
-
console.log(data);
|
|
165
163
|
};
|
|
166
164
|
return isConfig && selectApp ? /*#__PURE__*/React.createElement(Config, {
|
|
167
165
|
sourceApps: sourceApps,
|
|
@@ -73,7 +73,6 @@ var VirtualApp = function VirtualApp(props) {
|
|
|
73
73
|
message: '删除成功!'
|
|
74
74
|
});
|
|
75
75
|
setDeleteDialogShow(false);
|
|
76
|
-
console.log('toDelete');
|
|
77
76
|
var dealAuthConfig = util.clone(authConfig);
|
|
78
77
|
if (!(dealAuthConfig.dataAuth.length === 1 && dealAuthConfig.dataAuth[0].appId === 0)) {
|
|
79
78
|
var index = dealAuthConfig.dataAuth.findIndex(function (item) {
|
|
@@ -33,7 +33,6 @@ var VirtualApp = function VirtualApp(props) {
|
|
|
33
33
|
checkedSelf = _useState8[0],
|
|
34
34
|
setCheckedSelf = _useState8[1];
|
|
35
35
|
useEffect(function () {
|
|
36
|
-
console.log(sourceEventsId);
|
|
37
36
|
setChosenDataSource(sourceEventsId);
|
|
38
37
|
}, []);
|
|
39
38
|
useEffect(function () {
|
|
@@ -94,7 +93,6 @@ var VirtualApp = function VirtualApp(props) {
|
|
|
94
93
|
return option.title.indexOf(inputValue) > -1;
|
|
95
94
|
};
|
|
96
95
|
var handleChange = function handleChange(targetKeys) {
|
|
97
|
-
console.log(targetKeys);
|
|
98
96
|
setChosenDataSource(targetKeys);
|
|
99
97
|
onChange(checkedSelf ? targetKeys : null, sourceAppId, checkedSelf);
|
|
100
98
|
};
|
package/es/utils/util.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6-beta.0",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/lodash": "^4.14.182",
|
|
39
39
|
"@umijs/fabric": "^2.8.1",
|
|
40
40
|
"@umijs/test": "^3.0.5",
|
|
41
|
-
"@zgfe/business-lib": "^1.1.
|
|
41
|
+
"@zgfe/business-lib": "^1.1.59",
|
|
42
42
|
"@zgfe/modules-demo-manage": "^1.0.1",
|
|
43
43
|
"antd": "4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"umi-request": "^1.4.0",
|
|
52
52
|
"yorkie": "^2.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ac7a119bc7d489ae34b071d4263a5a9b132ac8ea",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|