@zgfe/modules-settings 1.2.20 → 1.2.21
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/components/selectAppWrapper/index.d.ts +8 -0
- package/es/components/selectAppWrapper/index.js +162 -0
- package/es/components/selectAppWrapper/types.d.ts +344 -0
- package/es/components/selectAppWrapper/types.js +24 -0
- package/es/components/selectAppWrapper/util.d.ts +13 -0
- package/es/components/selectAppWrapper/util.js +158 -0
- package/es/constants/api.d.ts +3 -0
- package/es/constants/api.js +5 -2
- package/es/modules/companySetting/demo.js +2 -2
- package/es/modules/companySetting/role/index.js +185 -15
- package/es/modules/companySetting/role/index.less +39 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.d.ts +15 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.js +69 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.less +30 -0
- package/es/requests/role.d.ts +8 -0
- package/es/requests/role.js +30 -2
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.js +104 -0
- package/package.json +2 -2
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 老系统(vue)基础数据转化程序
|
|
3
|
+
* @param store
|
|
4
|
+
* @returns PropGropus
|
|
5
|
+
*/
|
|
6
|
+
export default function convertAttributeData(store) {
|
|
7
|
+
var _store$eventList, _store$envPropList, _store$userPropList;
|
|
8
|
+
var res = {
|
|
9
|
+
envPropList: [],
|
|
10
|
+
eventGroupList: [],
|
|
11
|
+
userPropList: [],
|
|
12
|
+
eventNameMap: {},
|
|
13
|
+
eventIdMap: {}
|
|
14
|
+
};
|
|
15
|
+
(_store$eventList = store.eventList) === null || _store$eventList === void 0 ? void 0 : _store$eventList.forEach(function (group_) {
|
|
16
|
+
var _res$eventGroupList;
|
|
17
|
+
var group = {
|
|
18
|
+
id: group_.groupId,
|
|
19
|
+
name: group_.groupName,
|
|
20
|
+
eventList: []
|
|
21
|
+
};
|
|
22
|
+
var list = [];
|
|
23
|
+
var markList = [];
|
|
24
|
+
group_.eventList.forEach(function (e) {
|
|
25
|
+
if (e.is_delete) return;
|
|
26
|
+
var event = {
|
|
27
|
+
alias: e.alias_name,
|
|
28
|
+
attrList: e.event_attrs.map(function (item) {
|
|
29
|
+
return {
|
|
30
|
+
alias: item.alias_name,
|
|
31
|
+
eventId: e.event_id,
|
|
32
|
+
id: item.attr_id,
|
|
33
|
+
isHidden: item.hidden,
|
|
34
|
+
key: "eventProp-".concat(item.attr_id),
|
|
35
|
+
label: item.attr_name,
|
|
36
|
+
propCategory: 'eventProp',
|
|
37
|
+
type: item.prop_type,
|
|
38
|
+
realTime: true,
|
|
39
|
+
dimensionSub: item.dimension_sub || 'event_attr'
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
42
|
+
id: e.event_id,
|
|
43
|
+
isDelete: e.is_delete,
|
|
44
|
+
isStop: e.is_stop,
|
|
45
|
+
name: e.event_name,
|
|
46
|
+
eventHidden: e.event_hidden,
|
|
47
|
+
marked: Boolean(e.mark_type),
|
|
48
|
+
clickAnalysis: e.click_analysis,
|
|
49
|
+
owner: e.owner
|
|
50
|
+
};
|
|
51
|
+
res.eventNameMap[event.name] = event;
|
|
52
|
+
res.eventIdMap[event.id] = event;
|
|
53
|
+
if (event.marked) {
|
|
54
|
+
markList.push(event);
|
|
55
|
+
} else {
|
|
56
|
+
list.push(event);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
group.eventList = [].concat(markList, list);
|
|
60
|
+
(_res$eventGroupList = res.eventGroupList) === null || _res$eventGroupList === void 0 ? void 0 : _res$eventGroupList.push(group);
|
|
61
|
+
});
|
|
62
|
+
res.envPropList = (_store$envPropList = store.envPropList) === null || _store$envPropList === void 0 ? void 0 : _store$envPropList.map(function (prop) {
|
|
63
|
+
return {
|
|
64
|
+
id: prop.id || 0,
|
|
65
|
+
isHidden: prop.hidden,
|
|
66
|
+
alias: prop.alias_name,
|
|
67
|
+
category: prop.category,
|
|
68
|
+
key: "envProp-".concat(prop.name),
|
|
69
|
+
label: prop.text,
|
|
70
|
+
name: prop.name,
|
|
71
|
+
propCategory: 'envProp',
|
|
72
|
+
type: prop.type,
|
|
73
|
+
realTime: true,
|
|
74
|
+
dimensionSub: prop.dimension_sub || prop.name
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
res.userPropList = (_store$userPropList = store.userPropList) === null || _store$userPropList === void 0 ? void 0 : _store$userPropList.map(function (prop) {
|
|
78
|
+
return {
|
|
79
|
+
id: prop.id || 0,
|
|
80
|
+
isHidden: prop.hidden,
|
|
81
|
+
alias: prop.alias_name,
|
|
82
|
+
category: prop.category,
|
|
83
|
+
key: "userProp-".concat(prop.name),
|
|
84
|
+
label: prop.text || prop.name,
|
|
85
|
+
name: prop.name,
|
|
86
|
+
propCategory: 'userProp',
|
|
87
|
+
type: prop.type,
|
|
88
|
+
subtype: prop.subtype,
|
|
89
|
+
realTime: prop.category === 'custom',
|
|
90
|
+
dimensionSub: prop.dimension_sub || prop.name
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
return res;
|
|
94
|
+
}
|
|
95
|
+
export function getIcon(name) {
|
|
96
|
+
var hash = {
|
|
97
|
+
// 环境属性
|
|
98
|
+
browser_brand: 'internet',
|
|
99
|
+
browser_version: 'internet',
|
|
100
|
+
website: 'web',
|
|
101
|
+
referer_url: 'web',
|
|
102
|
+
current_url: 'web',
|
|
103
|
+
country: 'region',
|
|
104
|
+
area: 'region',
|
|
105
|
+
city: 'region',
|
|
106
|
+
os: 'platform',
|
|
107
|
+
ov: 'platform',
|
|
108
|
+
resolution_h: 'platform',
|
|
109
|
+
resolution_l: 'platform',
|
|
110
|
+
first_referer_url: 'web',
|
|
111
|
+
ip: 'web',
|
|
112
|
+
utm_source: 'utm',
|
|
113
|
+
utm_medium: 'utm',
|
|
114
|
+
utm_campaign: 'utm',
|
|
115
|
+
utm_content: 'utm',
|
|
116
|
+
utm_term: 'utm',
|
|
117
|
+
version: 'overall',
|
|
118
|
+
channel: 'overall',
|
|
119
|
+
network: 'platform',
|
|
120
|
+
mccmnc: 'platform',
|
|
121
|
+
device_brand: 'overall',
|
|
122
|
+
device_model: 'overall',
|
|
123
|
+
event_duration: 'time',
|
|
124
|
+
// 用户属性
|
|
125
|
+
first_visit_time: 'time',
|
|
126
|
+
last_visit_time: 'time',
|
|
127
|
+
visit_times: 'time',
|
|
128
|
+
duration: 'time',
|
|
129
|
+
name: 'personal',
|
|
130
|
+
app_user_id: 'personal',
|
|
131
|
+
zg_id: 'personal',
|
|
132
|
+
is_anonymous: 'type',
|
|
133
|
+
current_country: 'region',
|
|
134
|
+
current_area: 'region',
|
|
135
|
+
current_city: 'region',
|
|
136
|
+
current_app_version: 'overall',
|
|
137
|
+
current_app_channel: 'overall',
|
|
138
|
+
first_version: 'overall',
|
|
139
|
+
first_channel: 'overall',
|
|
140
|
+
current_device_brand: 'overall',
|
|
141
|
+
current_device_model: 'overall',
|
|
142
|
+
current_mccmnc: 'platform',
|
|
143
|
+
user_referer_url: 'web',
|
|
144
|
+
first_website: 'web',
|
|
145
|
+
first_utm_source: 'utm',
|
|
146
|
+
first_utm_medium: 'utm',
|
|
147
|
+
first_utm_campaign: 'utm',
|
|
148
|
+
first_utm_content: 'utm',
|
|
149
|
+
first_utm_term: 'utm',
|
|
150
|
+
current_browser_brand: 'internet',
|
|
151
|
+
current_browser_version: 'internet',
|
|
152
|
+
current_os: 'platform',
|
|
153
|
+
current_ov: 'platform',
|
|
154
|
+
current_resolution_h: 'platform',
|
|
155
|
+
current_resolution_l: 'platform'
|
|
156
|
+
};
|
|
157
|
+
return hash[name] ? 'icon-' + hash[name] : '';
|
|
158
|
+
}
|
package/es/constants/api.d.ts
CHANGED
package/es/constants/api.js
CHANGED
|
@@ -68,9 +68,12 @@ var apis = {
|
|
|
68
68
|
getPasswordRule: '/zg/web/v2/system/getPasswordRule',
|
|
69
69
|
updateCompanyUser: '/zg/web/v2/company/setting/updateCompanyUser',
|
|
70
70
|
delCompanyUser: '/zg/web/v2/company/setting/delCompanyUser',
|
|
71
|
-
updateCompanyUserStatus: '/zg/web/v2/company/setting/updateCompanyUserStatus'
|
|
71
|
+
updateCompanyUserStatus: '/zg/web/v2/company/setting/updateCompanyUserStatus',
|
|
72
|
+
// 基础数据
|
|
73
|
+
queryEventEnvData: '/zg/web/v2/appusergroup/getEventEnvData',
|
|
74
|
+
qeuryUserPropMeta: '/zg/web/v2/appusergroup/getUserPropMeta',
|
|
75
|
+
queryEventMetasOfGroup: '/zg/web/v2/data/queryEventMetasOfGroup'
|
|
72
76
|
},
|
|
73
|
-
|
|
74
77
|
eventMeta: {
|
|
75
78
|
queryEventMeta: '/zg/web/v2/data/queryEventMetasOfGroup'
|
|
76
79
|
},
|
|
@@ -6,13 +6,13 @@ import util from '../../utils/util';
|
|
|
6
6
|
import { CompanySetting } from '../..';
|
|
7
7
|
export default (function () {
|
|
8
8
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
9
|
-
defaultApp:
|
|
9
|
+
defaultApp: 99677
|
|
10
10
|
}, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
11
11
|
value: {
|
|
12
12
|
funPermissions: funPermissions,
|
|
13
13
|
menusName: constants.menusName,
|
|
14
14
|
getMenuRouterByName: util.getMenuRouterByName,
|
|
15
|
-
authority:
|
|
15
|
+
authority: localStorage.getItem('authorityList') ? JSON.parse(localStorage.getItem('authorityList')) : {}
|
|
16
16
|
}
|
|
17
17
|
}, /*#__PURE__*/React.createElement(CompanySetting, {
|
|
18
18
|
action: ''
|
|
@@ -21,6 +21,7 @@ import { Button, Drawer, Form, Input, Radio, Spin, Table, Tooltip, Tree, notific
|
|
|
21
21
|
import moment from 'moment';
|
|
22
22
|
import { BizDialog, BizSelect, IconFont, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
23
23
|
import { addRole, queryRoleDataConfig, queryRoleDetails, queryRoleMenuTree, queryRolePage, queryCompanyUser, updateRole, deleteRole } from '../../../requests/role';
|
|
24
|
+
import SetDataRangeDialog from './setDataRangeDialog';
|
|
24
25
|
var RoleList = function RoleList(props) {
|
|
25
26
|
// 弹窗
|
|
26
27
|
var _useState = useState(false),
|
|
@@ -110,6 +111,38 @@ var RoleList = function RoleList(props) {
|
|
|
110
111
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
111
112
|
selectArr = _useState36[0],
|
|
112
113
|
setSelectArr = _useState36[1];
|
|
114
|
+
var _useState37 = useState([]),
|
|
115
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
116
|
+
selectAppId = _useState38[0],
|
|
117
|
+
setSelectAppId = _useState38[1];
|
|
118
|
+
var _useState39 = useState([]),
|
|
119
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
120
|
+
appList = _useState40[0],
|
|
121
|
+
setAppList = _useState40[1];
|
|
122
|
+
var _useState41 = useState(false),
|
|
123
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
124
|
+
isModalOpen = _useState42[0],
|
|
125
|
+
setIsModalOpen = _useState42[1];
|
|
126
|
+
var _useState43 = useState(''),
|
|
127
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
128
|
+
dataRangeDialogTitle = _useState44[0],
|
|
129
|
+
setDataRangeDialogTitle = _useState44[1];
|
|
130
|
+
var _useState45 = useState({}),
|
|
131
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
132
|
+
currentSelectAppInfo = _useState46[0],
|
|
133
|
+
setCurrentSelectAppInfo = _useState46[1];
|
|
134
|
+
var _useState47 = useState([]),
|
|
135
|
+
_useState48 = _slicedToArray(_useState47, 2),
|
|
136
|
+
appCondition = _useState48[0],
|
|
137
|
+
setAPPCondition = _useState48[1];
|
|
138
|
+
var _useState49 = useState([]),
|
|
139
|
+
_useState50 = _slicedToArray(_useState49, 2),
|
|
140
|
+
currentJson = _useState50[0],
|
|
141
|
+
setCurrentJson = _useState50[1];
|
|
142
|
+
var _useState51 = useState(1),
|
|
143
|
+
_useState52 = _slicedToArray(_useState51, 2),
|
|
144
|
+
isAllUser = _useState52[0],
|
|
145
|
+
setIsAllUser = _useState52[1];
|
|
113
146
|
var _Form$useForm = Form.useForm(),
|
|
114
147
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
115
148
|
form = _Form$useForm2[0];
|
|
@@ -146,10 +179,6 @@ var RoleList = function RoleList(props) {
|
|
|
146
179
|
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map2 = menuCodeMap.map2) === null || _menuCodeMap$map2 === void 0 ? void 0 : _menuCodeMap$map2.length) === 0) {
|
|
147
180
|
setAppVersionFlTest('请选择城商行功能权限');
|
|
148
181
|
return;
|
|
149
|
-
} else {
|
|
150
|
-
form.setFieldsValue({
|
|
151
|
-
menuCodeMap: menuCodeMap.map2
|
|
152
|
-
});
|
|
153
182
|
}
|
|
154
183
|
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map3 = menuCodeMap.map3) === null || _menuCodeMap$map3 === void 0 ? void 0 : _menuCodeMap$map3.length) === 0) {
|
|
155
184
|
setAppVersionFlTest('请选择证券版本功能权限');
|
|
@@ -195,10 +224,6 @@ var RoleList = function RoleList(props) {
|
|
|
195
224
|
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map8 = menuCodeMap.map2) === null || _menuCodeMap$map8 === void 0 ? void 0 : _menuCodeMap$map8.length) === 0) {
|
|
196
225
|
setAppVersionFlTest('请选择城商行功能权限');
|
|
197
226
|
return;
|
|
198
|
-
} else {
|
|
199
|
-
form.setFieldsValue({
|
|
200
|
-
menuCodeMap: menuCodeMap.map2
|
|
201
|
-
});
|
|
202
227
|
}
|
|
203
228
|
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map9 = menuCodeMap.map3) === null || _menuCodeMap$map9 === void 0 ? void 0 : _menuCodeMap$map9.length) === 0) {
|
|
204
229
|
setAppVersionFlTest('请选择证券版功能权限');
|
|
@@ -293,7 +318,6 @@ var RoleList = function RoleList(props) {
|
|
|
293
318
|
}).then(function (res) {
|
|
294
319
|
if (res && (res === null || res === void 0 ? void 0 : res.data) && res.code === '101000') {
|
|
295
320
|
var _res$data, _res$data$list, _res$data2;
|
|
296
|
-
// const app = util.convertData(res?.data as DepartmentItem[], name);
|
|
297
321
|
setLoading(false);
|
|
298
322
|
var arr = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$list = _res$data.list) === null || _res$data$list === void 0 ? void 0 : _res$data$list.map(function (item) {
|
|
299
323
|
var _item$userSimpleInfos;
|
|
@@ -319,7 +343,7 @@ var RoleList = function RoleList(props) {
|
|
|
319
343
|
var queryRoleDetailsList = function queryRoleDetailsList(params) {
|
|
320
344
|
queryRoleDetails(params).then(function (res) {
|
|
321
345
|
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
322
|
-
var _res$data5, _res$data6;
|
|
346
|
+
var _res$data5, _res$data6, _res$data8;
|
|
323
347
|
var usListArr = usList === null || usList === void 0 ? void 0 : usList.filter(function (item1) {
|
|
324
348
|
var _res$data3;
|
|
325
349
|
return res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.appIds.some(function (item2) {
|
|
@@ -333,7 +357,18 @@ var RoleList = function RoleList(props) {
|
|
|
333
357
|
});
|
|
334
358
|
});
|
|
335
359
|
onChangeAppIds(usListArr, params === null || params === void 0 ? void 0 : params.id, res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.menuCodeMap, res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.settingMenuList);
|
|
336
|
-
var
|
|
360
|
+
var _res$data7 = res.data,
|
|
361
|
+
_menuCodeMap = _res$data7.menuCodeMap,
|
|
362
|
+
authGroupList = _res$data7.authGroupList;
|
|
363
|
+
authGroupList === null || authGroupList === void 0 ? void 0 : authGroupList.forEach(function (item) {
|
|
364
|
+
item.data = JSON.stringify({
|
|
365
|
+
color: item.color || '#8db3e2',
|
|
366
|
+
name: item.name || '0',
|
|
367
|
+
groupType: item.groupType || 0,
|
|
368
|
+
json: JSON.parse(item.json)
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
if (authGroupList === null || authGroupList === void 0 ? void 0 : authGroupList.length) setAPPCondition(authGroupList);
|
|
337
372
|
form.setFieldsValue(_objectSpread(_objectSpread({}, res === null || res === void 0 ? void 0 : res.data), {}, {
|
|
338
373
|
appIds: usListArr === null || usListArr === void 0 ? void 0 : usListArr.map(function (item) {
|
|
339
374
|
return {
|
|
@@ -349,6 +384,7 @@ var RoleList = function RoleList(props) {
|
|
|
349
384
|
};
|
|
350
385
|
})
|
|
351
386
|
}));
|
|
387
|
+
setAppList((res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.appIds) || []);
|
|
352
388
|
setCreatedAppPanel(true);
|
|
353
389
|
}
|
|
354
390
|
}).catch(function (err) {
|
|
@@ -426,11 +462,21 @@ var RoleList = function RoleList(props) {
|
|
|
426
462
|
});
|
|
427
463
|
};
|
|
428
464
|
var onChangeAppIds = function onChangeAppIds(e, roleId, codeMap, settingMenuList) {
|
|
465
|
+
handleDelAppJson(e); // 删除应用的同时删除赋值的数据范围条件
|
|
429
466
|
setAppVersionFl(false);
|
|
430
467
|
var arr = e.map(function (item) {
|
|
431
468
|
return item.appVersion;
|
|
432
469
|
});
|
|
470
|
+
setAppList(e.map(function (item) {
|
|
471
|
+
return item.app_id;
|
|
472
|
+
}) || []);
|
|
433
473
|
setSelectArr(arr);
|
|
474
|
+
// let authInfoParam = {
|
|
475
|
+
// appId: appId,
|
|
476
|
+
// platform: 0,
|
|
477
|
+
// allUser: isAllUser,
|
|
478
|
+
// data: JSON.stringify({ color: '#8db3e2', name: 0, groupType: 0, json: [] }),
|
|
479
|
+
// };
|
|
434
480
|
if (arr.includes(1) && arr.includes(2) && arr.includes(3)) {
|
|
435
481
|
// 三种应用都存在
|
|
436
482
|
setAppVersionFl(arr.includes(1) && arr.includes(2) && arr.includes(3));
|
|
@@ -617,6 +663,40 @@ var RoleList = function RoleList(props) {
|
|
|
617
663
|
}
|
|
618
664
|
}
|
|
619
665
|
};
|
|
666
|
+
function handleDelAppJson(e) {
|
|
667
|
+
// 删除应用的同时删除赋值的数据范围条件
|
|
668
|
+
var appIdsList = e.map(function (item) {
|
|
669
|
+
return item === null || item === void 0 ? void 0 : item.id;
|
|
670
|
+
});
|
|
671
|
+
setSelectAppId(appIdsList);
|
|
672
|
+
var delAppId = filterData(selectAppId, appIdsList);
|
|
673
|
+
var newAppCondition = appCondition;
|
|
674
|
+
var indexToRemove = newAppCondition === null || newAppCondition === void 0 ? void 0 : newAppCondition.findIndex(function (item) {
|
|
675
|
+
return item.appId === delAppId[0];
|
|
676
|
+
});
|
|
677
|
+
if (indexToRemove !== -1) {
|
|
678
|
+
newAppCondition.splice(indexToRemove, 1);
|
|
679
|
+
}
|
|
680
|
+
setAPPCondition(newAppCondition);
|
|
681
|
+
}
|
|
682
|
+
function filterData(array, array2) {
|
|
683
|
+
var result = [];
|
|
684
|
+
for (var key in array) {
|
|
685
|
+
var stra = array[key];
|
|
686
|
+
var count = 0;
|
|
687
|
+
for (var j = 0; j < array2.length; j++) {
|
|
688
|
+
var strb = array2[j];
|
|
689
|
+
if (stra == strb) {
|
|
690
|
+
count++;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
if (count === 0) {
|
|
694
|
+
//表示数组1的这个值没有重复的,放到arr3列表中
|
|
695
|
+
result.push(stra);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return result;
|
|
699
|
+
}
|
|
620
700
|
var onSystemVersion = function onSystemVersion(e, roleId) {
|
|
621
701
|
setSystemVersionId(e.id);
|
|
622
702
|
queryRoleMenuTreeList(roleId, e.id);
|
|
@@ -646,7 +726,9 @@ var RoleList = function RoleList(props) {
|
|
|
646
726
|
systemVersion: appVersionFl ? 0 : 1,
|
|
647
727
|
userIds: value === null || value === void 0 ? void 0 : (_value$userIds = value.userIds) === null || _value$userIds === void 0 ? void 0 : _value$userIds.map(function (item) {
|
|
648
728
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
649
|
-
})
|
|
729
|
+
}),
|
|
730
|
+
roleAuthStatus: 1,
|
|
731
|
+
authInfoParams: appCondition || []
|
|
650
732
|
});
|
|
651
733
|
if (menuCodeMap.map2.length && menuCodeMap.map3.length && !menuCodeMap.map1.length) {
|
|
652
734
|
var _params$menuCodeMap;
|
|
@@ -673,6 +755,8 @@ var RoleList = function RoleList(props) {
|
|
|
673
755
|
settingList2: [],
|
|
674
756
|
settingList3: []
|
|
675
757
|
});
|
|
758
|
+
setAppList([]);
|
|
759
|
+
setAPPCondition([]);
|
|
676
760
|
// 通知数据刷新
|
|
677
761
|
msg = !roleId ? '创建成功' : '编辑成功';
|
|
678
762
|
notification.success({
|
|
@@ -686,6 +770,75 @@ var RoleList = function RoleList(props) {
|
|
|
686
770
|
});
|
|
687
771
|
});
|
|
688
772
|
};
|
|
773
|
+
function renderLabel(node, option) {
|
|
774
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
775
|
+
className: "custom-item"
|
|
776
|
+
}, node, !appList.includes(option.app_id) ? null : /*#__PURE__*/React.createElement("div", {
|
|
777
|
+
onClick: function onClick(e) {
|
|
778
|
+
setCurrentSelectAppInfo(option);
|
|
779
|
+
setDataRangeDialogTitle(node);
|
|
780
|
+
setIsModalOpen(true);
|
|
781
|
+
var currentJson = appCondition.filter(function (item) {
|
|
782
|
+
return item.appId === option.app_id;
|
|
783
|
+
});
|
|
784
|
+
if (currentJson && currentJson.length) {
|
|
785
|
+
var _currentJson$;
|
|
786
|
+
setIsAllUser(currentJson[0].allUser);
|
|
787
|
+
setCurrentJson(currentJson[0].data ? JSON.parse((_currentJson$ = currentJson[0]) === null || _currentJson$ === void 0 ? void 0 : _currentJson$.data).json : JSON.parse(currentJson[0].json));
|
|
788
|
+
} else {
|
|
789
|
+
setIsAllUser(1);
|
|
790
|
+
setCurrentJson([]);
|
|
791
|
+
}
|
|
792
|
+
e.stopPropagation();
|
|
793
|
+
},
|
|
794
|
+
className: "custom-item-right"
|
|
795
|
+
}, "\u8BBE\u7F6E\u6570\u636E\u8303\u56F4", /*#__PURE__*/React.createElement(Tooltip, {
|
|
796
|
+
overlayStyle: {
|
|
797
|
+
maxWidth: 396
|
|
798
|
+
},
|
|
799
|
+
overlayInnerStyle: {
|
|
800
|
+
color: '#FFF',
|
|
801
|
+
fontSize: 14,
|
|
802
|
+
fontWeight: 400,
|
|
803
|
+
letterSpacing: 0.56
|
|
804
|
+
},
|
|
805
|
+
placement: "top",
|
|
806
|
+
title: '您可以设定当前角色可以查看应用下的哪些数据'
|
|
807
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
808
|
+
style: {
|
|
809
|
+
fontSize: 16,
|
|
810
|
+
marginLeft: '8px'
|
|
811
|
+
},
|
|
812
|
+
className: "bsicon tishi"
|
|
813
|
+
}))));
|
|
814
|
+
}
|
|
815
|
+
function setConditionFn(appId, condition, isAllUser) {
|
|
816
|
+
var authInfoParam = {
|
|
817
|
+
appId: appId,
|
|
818
|
+
platform: 0,
|
|
819
|
+
allUser: isAllUser,
|
|
820
|
+
data: JSON.stringify({
|
|
821
|
+
color: '#8db3e2',
|
|
822
|
+
name: 0,
|
|
823
|
+
groupType: 0,
|
|
824
|
+
json: condition
|
|
825
|
+
})
|
|
826
|
+
};
|
|
827
|
+
var newAppCondition = appCondition;
|
|
828
|
+
var indexToRemove = newAppCondition === null || newAppCondition === void 0 ? void 0 : newAppCondition.findIndex(function (item) {
|
|
829
|
+
return item.appId === appId;
|
|
830
|
+
});
|
|
831
|
+
if (indexToRemove !== -1) {
|
|
832
|
+
if (!isAllUser) {
|
|
833
|
+
newAppCondition.splice(indexToRemove, 1, authInfoParam);
|
|
834
|
+
} else {
|
|
835
|
+
newAppCondition.splice(indexToRemove, 1);
|
|
836
|
+
}
|
|
837
|
+
} else {
|
|
838
|
+
newAppCondition.push(authInfoParam);
|
|
839
|
+
}
|
|
840
|
+
setAPPCondition(newAppCondition);
|
|
841
|
+
}
|
|
689
842
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
690
843
|
spinning: loading
|
|
691
844
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -717,7 +870,8 @@ var RoleList = function RoleList(props) {
|
|
|
717
870
|
setRoleId(null);
|
|
718
871
|
form.resetFields();
|
|
719
872
|
form.setFieldsValue({
|
|
720
|
-
isEncryption: 0
|
|
873
|
+
isEncryption: 0,
|
|
874
|
+
roleAuthStatus: 0
|
|
721
875
|
});
|
|
722
876
|
queryRoleDataConfigList(null);
|
|
723
877
|
queryRoleUserList(null);
|
|
@@ -748,6 +902,7 @@ var RoleList = function RoleList(props) {
|
|
|
748
902
|
borderTop: '1px solid #F2F3F4'
|
|
749
903
|
},
|
|
750
904
|
onClose: function onClose() {
|
|
905
|
+
setAppList([]);
|
|
751
906
|
setCreatedAppPanel(false);
|
|
752
907
|
setMenuCodeMap({
|
|
753
908
|
map1: [],
|
|
@@ -758,9 +913,11 @@ var RoleList = function RoleList(props) {
|
|
|
758
913
|
settingList3: []
|
|
759
914
|
});
|
|
760
915
|
setSystemVersionId(1);
|
|
916
|
+
setAPPCondition([]);
|
|
761
917
|
},
|
|
762
918
|
footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
763
919
|
onClick: function onClick() {
|
|
920
|
+
setAppList([]);
|
|
764
921
|
setCreatedAppPanel(false);
|
|
765
922
|
setMenuCodeMap({
|
|
766
923
|
map1: [],
|
|
@@ -770,6 +927,7 @@ var RoleList = function RoleList(props) {
|
|
|
770
927
|
settingList2: [],
|
|
771
928
|
settingList3: []
|
|
772
929
|
});
|
|
930
|
+
setAPPCondition([]);
|
|
773
931
|
}
|
|
774
932
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
775
933
|
loading: createAppLoading,
|
|
@@ -828,7 +986,9 @@ var RoleList = function RoleList(props) {
|
|
|
828
986
|
},
|
|
829
987
|
placeholder: '请选择应用权限',
|
|
830
988
|
labelField: "app_name",
|
|
831
|
-
keyField: "id"
|
|
989
|
+
keyField: "id",
|
|
990
|
+
overlayClassName: isModalOpen ? 'label-group-overlay' : '',
|
|
991
|
+
customLabel: renderLabel
|
|
832
992
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
833
993
|
label: "\u529F\u80FD\u6743\u9650",
|
|
834
994
|
className: "menuCode-map"
|
|
@@ -914,7 +1074,17 @@ var RoleList = function RoleList(props) {
|
|
|
914
1074
|
onCancel: function onCancel() {
|
|
915
1075
|
setDelPanelState(false);
|
|
916
1076
|
}
|
|
917
|
-
}, "\u786E\u8BA4\u8981\u5220\u9664\u5F53\u524D\u89D2\u8272\u5417?"), /*#__PURE__*/React.createElement(
|
|
1077
|
+
}, "\u786E\u8BA4\u8981\u5220\u9664\u5F53\u524D\u89D2\u8272\u5417?"), /*#__PURE__*/React.createElement(SetDataRangeDialog, {
|
|
1078
|
+
isModalOpen: isModalOpen,
|
|
1079
|
+
setIsModalOpen: setIsModalOpen,
|
|
1080
|
+
dataRangeDialogTitle: dataRangeDialogTitle,
|
|
1081
|
+
currentSelectAppInfo: currentSelectAppInfo,
|
|
1082
|
+
setConditionFn: setConditionFn,
|
|
1083
|
+
currentJson: currentJson,
|
|
1084
|
+
setCurrentJson: setCurrentJson,
|
|
1085
|
+
setIsAllUser: setIsAllUser,
|
|
1086
|
+
isAllUser: isAllUser
|
|
1087
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
918
1088
|
className: "role-list-content"
|
|
919
1089
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
920
1090
|
rowKey: "roleId",
|
|
@@ -101,7 +101,34 @@
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
.custom-item {
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
|
|
108
|
+
.tishi {
|
|
109
|
+
color: #9aa1a9;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
104
113
|
.role-dialog-content {
|
|
114
|
+
.group-config {
|
|
115
|
+
display: flex;
|
|
116
|
+
margin-bottom: 24px;
|
|
117
|
+
padding-left: 120px;
|
|
118
|
+
|
|
119
|
+
.config-name {
|
|
120
|
+
margin-right: 12px;
|
|
121
|
+
color: #5f6085;
|
|
122
|
+
font-size: 14px;
|
|
123
|
+
line-height: 30px;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.biz-user-condition-type-label {
|
|
128
|
+
margin-left: -7px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
105
132
|
.ant-form-item {
|
|
106
133
|
.ant-form-item-control-input {
|
|
107
134
|
width: 484px;
|
|
@@ -218,3 +245,15 @@
|
|
|
218
245
|
}
|
|
219
246
|
}
|
|
220
247
|
}
|
|
248
|
+
|
|
249
|
+
.ant-tooltip {
|
|
250
|
+
z-index: 9999;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.label-group-overlay {
|
|
254
|
+
display: none;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.set-data-dialog {
|
|
258
|
+
width: 2000px;
|
|
259
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { AppInfoProps } from '@zgfe/business-lib/es/context';
|
|
4
|
+
declare const SetDataRangeDialog: React.FC<{
|
|
5
|
+
isModalOpen: boolean;
|
|
6
|
+
setIsModalOpen: Function;
|
|
7
|
+
dataRangeDialogTitle: ReactNode;
|
|
8
|
+
currentSelectAppInfo: AppInfoProps;
|
|
9
|
+
setConditionFn: Function;
|
|
10
|
+
currentJson: any[];
|
|
11
|
+
setCurrentJson: Function;
|
|
12
|
+
setIsAllUser: Function;
|
|
13
|
+
isAllUser: number;
|
|
14
|
+
}>;
|
|
15
|
+
export default SetDataRangeDialog;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Radio, message } from 'antd';
|
|
3
|
+
import { BizDialog } from '@zgfe/business-lib';
|
|
4
|
+
import './index.less';
|
|
5
|
+
import util from '../../../../utils/util';
|
|
6
|
+
import SelectAppWrapper from '../../../../components/selectAppWrapper';
|
|
7
|
+
var SetDataRangeDialog = function SetDataRangeDialog(props) {
|
|
8
|
+
var isModalOpen = props.isModalOpen,
|
|
9
|
+
setIsModalOpen = props.setIsModalOpen,
|
|
10
|
+
dataRangeDialogTitle = props.dataRangeDialogTitle,
|
|
11
|
+
currentSelectAppInfo = props.currentSelectAppInfo,
|
|
12
|
+
setConditionFn = props.setConditionFn,
|
|
13
|
+
currentJson = props.currentJson,
|
|
14
|
+
setCurrentJson = props.setCurrentJson,
|
|
15
|
+
isAllUser = props.isAllUser,
|
|
16
|
+
setIsAllUser = props.setIsAllUser;
|
|
17
|
+
function onChangeCondition(data) {
|
|
18
|
+
setCurrentJson(data);
|
|
19
|
+
}
|
|
20
|
+
function onConfirm() {
|
|
21
|
+
if (currentJson.length && !isAllUser) {
|
|
22
|
+
var res = util.validateUserCondition(currentJson);
|
|
23
|
+
if (res) return message.error(res);
|
|
24
|
+
}
|
|
25
|
+
setConditionFn(currentSelectAppInfo.app_id, currentJson, isAllUser);
|
|
26
|
+
setIsModalOpen(false);
|
|
27
|
+
setCurrentJson([]);
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/React.createElement(BizDialog, {
|
|
30
|
+
className: "set-data-dialog",
|
|
31
|
+
title: dataRangeDialogTitle,
|
|
32
|
+
open: isModalOpen,
|
|
33
|
+
closable: true,
|
|
34
|
+
style: {
|
|
35
|
+
minWidth: !isAllUser ? '80%' : '520px'
|
|
36
|
+
},
|
|
37
|
+
onCancel: function onCancel() {
|
|
38
|
+
setIsModalOpen(false);
|
|
39
|
+
setCurrentJson([]);
|
|
40
|
+
},
|
|
41
|
+
onOk: function onOk() {
|
|
42
|
+
return onConfirm();
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
45
|
+
buttonStyle: "outline",
|
|
46
|
+
value: isAllUser,
|
|
47
|
+
onChange: function onChange(value) {
|
|
48
|
+
setIsAllUser(value.target.value);
|
|
49
|
+
if (value.target.value) {
|
|
50
|
+
setCurrentJson([]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
54
|
+
value: 1
|
|
55
|
+
}, "\u5168\u90E8\u6570\u636E"), /*#__PURE__*/React.createElement(Radio, {
|
|
56
|
+
value: 0
|
|
57
|
+
}, "\u7B5B\u9009\u7528\u6237")), !isAllUser ? /*#__PURE__*/React.createElement("li", {
|
|
58
|
+
className: "group-config condition"
|
|
59
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "config-name"
|
|
61
|
+
}, "\u5B9A\u4E49"), /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "config-value"
|
|
63
|
+
}), /*#__PURE__*/React.createElement(SelectAppWrapper, {
|
|
64
|
+
currentSelectAppInfo: currentSelectAppInfo,
|
|
65
|
+
onChangeCondition: onChangeCondition,
|
|
66
|
+
currentJson: currentJson
|
|
67
|
+
})) : null);
|
|
68
|
+
};
|
|
69
|
+
export default SetDataRangeDialog;
|