@zgfe/modules-settings 1.2.16 → 1.2.20-role.10
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 +3 -1
- package/es/modules/companySetting/appList/index.less +4 -0
- package/es/modules/companySetting/cost/index.js +1 -1
- package/es/modules/companySetting/demo.js +2 -2
- package/es/modules/companySetting/index.js +1 -0
- package/es/modules/companySetting/role/index.js +449 -46
- package/es/modules/companySetting/role/index.less +39 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.d.ts +14 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.js +73 -0
- package/es/modules/companySetting/role/setDataRangeDialog/index.less +30 -0
- package/es/requests/role.d.ts +2 -0
- package/es/types/app.d.ts +5 -1
- package/es/types/app.js +4 -0
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.js +104 -0
- package/package.json +2 -2
|
@@ -343,7 +343,9 @@ var appList = function appList(props) {
|
|
|
343
343
|
value: AppVersion.common
|
|
344
344
|
}, "\u901A\u7528\u7248\u672C"), /*#__PURE__*/React.createElement(Radio, {
|
|
345
345
|
value: AppVersion.bank
|
|
346
|
-
}, "\u57CE\u5546\u884C\u573A\u666F\u7248\u672C")
|
|
346
|
+
}, "\u57CE\u5546\u884C\u573A\u666F\u7248\u672C"), /*#__PURE__*/React.createElement(Radio, {
|
|
347
|
+
value: AppVersion.finance
|
|
348
|
+
}, "\u8BC1\u5238\u7248\u672C")))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
347
349
|
name: 'appNameVal',
|
|
348
350
|
className: "app-list-form-item"
|
|
349
351
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -81,7 +81,7 @@ var Cost = function Cost(props) {
|
|
|
81
81
|
}
|
|
82
82
|
}, []);
|
|
83
83
|
useEffect(function () {
|
|
84
|
-
var data = packageInfo
|
|
84
|
+
var data = packageInfo || {};
|
|
85
85
|
setOverview([data.billingCycle, appCount, data.ratedAppCount, data.licenseEvnetCount, data.ratedEventCount, data.eventCount]);
|
|
86
86
|
}, [packageInfo, appCount]);
|
|
87
87
|
useEffect(function () {
|
|
@@ -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: ''
|
|
@@ -537,6 +537,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
537
537
|
className: "company-setting-tabs",
|
|
538
538
|
destroyInactiveTabPane: true,
|
|
539
539
|
activeKey: activeKey,
|
|
540
|
+
// activeKey={'userGroup'}
|
|
540
541
|
onChange: changeTab,
|
|
541
542
|
items: items.filter(function (item) {
|
|
542
543
|
return item.hidden !== true;
|
|
@@ -19,8 +19,9 @@ import './index.less';
|
|
|
19
19
|
import util from './../../../utils/util';
|
|
20
20
|
import { Button, Drawer, Form, Input, Radio, Spin, Table, Tooltip, Tree, notification } from 'antd';
|
|
21
21
|
import moment from 'moment';
|
|
22
|
-
import { BizDialog, BizSelect, IconFont, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
22
|
+
import { BizDialog, BizSelect, IconFont, BizGlobalDataContext, BizUserCondition } 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),
|
|
@@ -77,8 +78,10 @@ var RoleList = function RoleList(props) {
|
|
|
77
78
|
var _useState23 = useState({
|
|
78
79
|
map1: [],
|
|
79
80
|
map2: [],
|
|
81
|
+
map3: [],
|
|
80
82
|
settingList1: [],
|
|
81
|
-
settingList2: []
|
|
83
|
+
settingList2: [],
|
|
84
|
+
settingList3: []
|
|
82
85
|
}),
|
|
83
86
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
84
87
|
menuCodeMap = _useState24[0],
|
|
@@ -88,15 +91,10 @@ var RoleList = function RoleList(props) {
|
|
|
88
91
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
89
92
|
roleList = _useState26[0],
|
|
90
93
|
setRoleList = _useState26[1];
|
|
91
|
-
var _useState27 = useState([
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
label: '城商行',
|
|
96
|
-
id: 2
|
|
97
|
-
}]),
|
|
98
|
-
_useState28 = _slicedToArray(_useState27, 1),
|
|
99
|
-
versionList = _useState28[0];
|
|
94
|
+
var _useState27 = useState([]),
|
|
95
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
96
|
+
versionList = _useState28[0],
|
|
97
|
+
setVersionList = _useState28[1];
|
|
100
98
|
var _useState29 = useState({}),
|
|
101
99
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
102
100
|
functionList = _useState30[0],
|
|
@@ -109,6 +107,42 @@ var RoleList = function RoleList(props) {
|
|
|
109
107
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
110
108
|
usList = _useState34[0],
|
|
111
109
|
setUsList = _useState34[1];
|
|
110
|
+
var _useState35 = useState([]),
|
|
111
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
112
|
+
selectArr = _useState36[0],
|
|
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(0),
|
|
131
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
132
|
+
currentAppId = _useState46[0],
|
|
133
|
+
setCurrentAppId = _useState46[1];
|
|
134
|
+
var _useState47 = useState([]),
|
|
135
|
+
_useState48 = _slicedToArray(_useState47, 2),
|
|
136
|
+
appCondition = _useState48[0],
|
|
137
|
+
setAPPCondition = _useState48[1];
|
|
138
|
+
var _useState49 = useState(0),
|
|
139
|
+
_useState50 = _slicedToArray(_useState49, 2),
|
|
140
|
+
isRoleAuthStatus = _useState50[0],
|
|
141
|
+
setIsRoleAuthStatus = _useState50[1];
|
|
142
|
+
var _useState51 = useState([]),
|
|
143
|
+
_useState52 = _slicedToArray(_useState51, 2),
|
|
144
|
+
currentJson = _useState52[0],
|
|
145
|
+
setCurrentJson = _useState52[1];
|
|
112
146
|
var _Form$useForm = Form.useForm(),
|
|
113
147
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
114
148
|
form = _Form$useForm2[0];
|
|
@@ -131,27 +165,105 @@ var RoleList = function RoleList(props) {
|
|
|
131
165
|
}, [userList]);
|
|
132
166
|
useEffect(function () {
|
|
133
167
|
if (appVersionFl) {
|
|
134
|
-
var _menuCodeMap$map, _menuCodeMap$map2;
|
|
135
168
|
form.setFieldsValue({
|
|
136
169
|
menuCodeMap: []
|
|
137
170
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
171
|
+
// selectArr
|
|
172
|
+
if (selectArr.includes(1) && selectArr.includes(2) && selectArr.includes(3)) {
|
|
173
|
+
var _menuCodeMap$map, _menuCodeMap$map2, _menuCodeMap$map3;
|
|
174
|
+
// 通用、城商行、证券
|
|
175
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map = menuCodeMap.map1) === null || _menuCodeMap$map === void 0 ? void 0 : _menuCodeMap$map.length) === 0) {
|
|
176
|
+
setAppVersionFlTest('请选择通用版本功能权限');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map2 = menuCodeMap.map2) === null || _menuCodeMap$map2 === void 0 ? void 0 : _menuCodeMap$map2.length) === 0) {
|
|
180
|
+
setAppVersionFlTest('请选择城商行功能权限');
|
|
181
|
+
return;
|
|
182
|
+
} else {
|
|
183
|
+
form.setFieldsValue({
|
|
184
|
+
menuCodeMap: menuCodeMap.map2
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map3 = menuCodeMap.map3) === null || _menuCodeMap$map3 === void 0 ? void 0 : _menuCodeMap$map3.length) === 0) {
|
|
188
|
+
setAppVersionFlTest('请选择证券版本功能权限');
|
|
189
|
+
return;
|
|
190
|
+
} else {
|
|
191
|
+
form.setFieldsValue({
|
|
192
|
+
menuCodeMap: menuCodeMap.map3
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
} else if (selectArr.includes(1) && selectArr.includes(2)) {
|
|
196
|
+
var _menuCodeMap$map4, _menuCodeMap$map5;
|
|
197
|
+
// 通用城商行
|
|
198
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map4 = menuCodeMap.map1) === null || _menuCodeMap$map4 === void 0 ? void 0 : _menuCodeMap$map4.length) === 0) {
|
|
199
|
+
setAppVersionFlTest('请选择通用版本功能权限');
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map5 = menuCodeMap.map2) === null || _menuCodeMap$map5 === void 0 ? void 0 : _menuCodeMap$map5.length) === 0) {
|
|
203
|
+
setAppVersionFlTest('请选择城商行功能权限');
|
|
204
|
+
return;
|
|
205
|
+
} else {
|
|
206
|
+
form.setFieldsValue({
|
|
207
|
+
menuCodeMap: menuCodeMap.map2
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
} else if (selectArr.includes(1) && selectArr.includes(3)) {
|
|
211
|
+
var _menuCodeMap$map6, _menuCodeMap$map7;
|
|
212
|
+
// 通用证券
|
|
213
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map6 = menuCodeMap.map1) === null || _menuCodeMap$map6 === void 0 ? void 0 : _menuCodeMap$map6.length) === 0) {
|
|
214
|
+
setAppVersionFlTest('请选择通用版本功能权限');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map7 = menuCodeMap.map3) === null || _menuCodeMap$map7 === void 0 ? void 0 : _menuCodeMap$map7.length) === 0) {
|
|
218
|
+
setAppVersionFlTest('请选择证券版功能权限');
|
|
219
|
+
return;
|
|
220
|
+
} else {
|
|
221
|
+
form.setFieldsValue({
|
|
222
|
+
menuCodeMap: menuCodeMap.map3
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
} else if (selectArr.includes(2) && selectArr.includes(3)) {
|
|
226
|
+
var _menuCodeMap$map8, _menuCodeMap$map9;
|
|
227
|
+
// 城商行证券
|
|
228
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map8 = menuCodeMap.map2) === null || _menuCodeMap$map8 === void 0 ? void 0 : _menuCodeMap$map8.length) === 0) {
|
|
229
|
+
setAppVersionFlTest('请选择城商行功能权限');
|
|
230
|
+
return;
|
|
231
|
+
} else {
|
|
232
|
+
form.setFieldsValue({
|
|
233
|
+
menuCodeMap: menuCodeMap.map2
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map9 = menuCodeMap.map3) === null || _menuCodeMap$map9 === void 0 ? void 0 : _menuCodeMap$map9.length) === 0) {
|
|
237
|
+
setAppVersionFlTest('请选择证券版功能权限');
|
|
238
|
+
return;
|
|
239
|
+
} else {
|
|
240
|
+
form.setFieldsValue({
|
|
241
|
+
menuCodeMap: menuCodeMap.map3
|
|
242
|
+
});
|
|
243
|
+
}
|
|
149
244
|
}
|
|
150
245
|
} else {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
246
|
+
// 单独存在的
|
|
247
|
+
switch (systemVersionId) {
|
|
248
|
+
case 1:
|
|
249
|
+
form.setFieldsValue({
|
|
250
|
+
menuCodeMap: menuCodeMap.map1
|
|
251
|
+
});
|
|
252
|
+
setAppVersionFlTest('请选择通用版本功能权');
|
|
253
|
+
break;
|
|
254
|
+
case 2:
|
|
255
|
+
form.setFieldsValue({
|
|
256
|
+
menuCodeMap: menuCodeMap.map2
|
|
257
|
+
});
|
|
258
|
+
setAppVersionFlTest('请选择城商行功能权限');
|
|
259
|
+
break;
|
|
260
|
+
case 3:
|
|
261
|
+
form.setFieldsValue({
|
|
262
|
+
menuCodeMap: menuCodeMap.map3
|
|
263
|
+
});
|
|
264
|
+
setAppVersionFlTest('请选择证券版本功能权限');
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
155
267
|
}
|
|
156
268
|
}, [menuCodeMap, appVersionFl]);
|
|
157
269
|
// 列表数据
|
|
@@ -214,7 +326,6 @@ var RoleList = function RoleList(props) {
|
|
|
214
326
|
}).then(function (res) {
|
|
215
327
|
if (res && (res === null || res === void 0 ? void 0 : res.data) && res.code === '101000') {
|
|
216
328
|
var _res$data, _res$data$list, _res$data2;
|
|
217
|
-
// const app = util.convertData(res?.data as DepartmentItem[], name);
|
|
218
329
|
setLoading(false);
|
|
219
330
|
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) {
|
|
220
331
|
var _item$userSimpleInfos;
|
|
@@ -240,7 +351,7 @@ var RoleList = function RoleList(props) {
|
|
|
240
351
|
var queryRoleDetailsList = function queryRoleDetailsList(params) {
|
|
241
352
|
queryRoleDetails(params).then(function (res) {
|
|
242
353
|
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
243
|
-
var _res$data5, _res$data6;
|
|
354
|
+
var _res$data5, _res$data6, _res$data8;
|
|
244
355
|
var usListArr = usList === null || usList === void 0 ? void 0 : usList.filter(function (item1) {
|
|
245
356
|
var _res$data3;
|
|
246
357
|
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) {
|
|
@@ -254,6 +365,18 @@ var RoleList = function RoleList(props) {
|
|
|
254
365
|
});
|
|
255
366
|
});
|
|
256
367
|
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);
|
|
368
|
+
var _res$data7 = res.data,
|
|
369
|
+
_menuCodeMap = _res$data7.menuCodeMap,
|
|
370
|
+
authGroupList = _res$data7.authGroupList;
|
|
371
|
+
authGroupList.forEach(function (item) {
|
|
372
|
+
item.data = JSON.stringify({
|
|
373
|
+
color: item.color || '#8db3e2',
|
|
374
|
+
name: item.name || '0',
|
|
375
|
+
groupType: item.groupType || 0,
|
|
376
|
+
json: JSON.parse(item.json)
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
setAPPCondition(authGroupList);
|
|
257
380
|
form.setFieldsValue(_objectSpread(_objectSpread({}, res === null || res === void 0 ? void 0 : res.data), {}, {
|
|
258
381
|
appIds: usListArr === null || usListArr === void 0 ? void 0 : usListArr.map(function (item) {
|
|
259
382
|
return {
|
|
@@ -261,7 +384,7 @@ var RoleList = function RoleList(props) {
|
|
|
261
384
|
};
|
|
262
385
|
}),
|
|
263
386
|
systemVersion: {
|
|
264
|
-
id: 1
|
|
387
|
+
id: !_menuCodeMap[Object.keys(_menuCodeMap)[0]].length ? 2 : 1
|
|
265
388
|
},
|
|
266
389
|
userIds: userListArr === null || userListArr === void 0 ? void 0 : userListArr.map(function (item) {
|
|
267
390
|
return {
|
|
@@ -269,6 +392,7 @@ var RoleList = function RoleList(props) {
|
|
|
269
392
|
};
|
|
270
393
|
})
|
|
271
394
|
}));
|
|
395
|
+
setAppList((res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.appIds) || []);
|
|
272
396
|
setCreatedAppPanel(true);
|
|
273
397
|
}
|
|
274
398
|
}).catch(function (err) {
|
|
@@ -346,11 +470,47 @@ var RoleList = function RoleList(props) {
|
|
|
346
470
|
});
|
|
347
471
|
};
|
|
348
472
|
var onChangeAppIds = function onChangeAppIds(e, roleId, codeMap, settingMenuList) {
|
|
473
|
+
handleDelAppJson(e); // 删除应用的同时删除赋值的数据范围条件
|
|
349
474
|
setAppVersionFl(false);
|
|
350
475
|
var arr = e.map(function (item) {
|
|
351
476
|
return item.appVersion;
|
|
352
477
|
});
|
|
353
|
-
|
|
478
|
+
setAppList(e.map(function (item) {
|
|
479
|
+
return item.app_id;
|
|
480
|
+
}) || []);
|
|
481
|
+
setSelectArr(arr);
|
|
482
|
+
if (arr.includes(1) && arr.includes(2) && arr.includes(3)) {
|
|
483
|
+
// 三种应用都存在
|
|
484
|
+
setAppVersionFl(arr.includes(1) && arr.includes(2) && arr.includes(3));
|
|
485
|
+
onSystemVersion({
|
|
486
|
+
label: '通用版本',
|
|
487
|
+
id: 1
|
|
488
|
+
}, roleId);
|
|
489
|
+
form.setFieldsValue({
|
|
490
|
+
systemVersion: {
|
|
491
|
+
id: 1
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
setMenuCodeMap({
|
|
495
|
+
map1: codeMap['1'] || codeMap.map1,
|
|
496
|
+
map2: codeMap['2'] || codeMap.map2,
|
|
497
|
+
map3: codeMap['3'] || codeMap.map3,
|
|
498
|
+
settingList1: settingMenuList || [],
|
|
499
|
+
settingList2: settingMenuList || [],
|
|
500
|
+
settingList3: settingMenuList || []
|
|
501
|
+
});
|
|
502
|
+
setVersionList([{
|
|
503
|
+
label: '通用版本',
|
|
504
|
+
id: 1
|
|
505
|
+
}, {
|
|
506
|
+
label: '城商行',
|
|
507
|
+
id: 2
|
|
508
|
+
}, {
|
|
509
|
+
label: '证券',
|
|
510
|
+
id: 3
|
|
511
|
+
}]);
|
|
512
|
+
} else if (arr.includes(1) && arr.includes(2)) {
|
|
513
|
+
// 通用和城商行存在
|
|
354
514
|
setAppVersionFl(arr.includes(1) && arr.includes(2));
|
|
355
515
|
onSystemVersion({
|
|
356
516
|
label: '通用版本',
|
|
@@ -364,11 +524,75 @@ var RoleList = function RoleList(props) {
|
|
|
364
524
|
setMenuCodeMap({
|
|
365
525
|
map1: codeMap['1'] || codeMap.map1,
|
|
366
526
|
map2: codeMap['2'] || codeMap.map2,
|
|
527
|
+
map3: [],
|
|
528
|
+
settingList1: settingMenuList || [],
|
|
529
|
+
settingList2: settingMenuList || [],
|
|
530
|
+
settingList3: []
|
|
531
|
+
});
|
|
532
|
+
setVersionList([{
|
|
533
|
+
label: '通用版本',
|
|
534
|
+
id: 1
|
|
535
|
+
}, {
|
|
536
|
+
label: '城商行',
|
|
537
|
+
id: 2
|
|
538
|
+
}]);
|
|
539
|
+
} else if (arr.includes(1) && arr.includes(3)) {
|
|
540
|
+
// 通用和证券存在
|
|
541
|
+
setAppVersionFl(arr.includes(1) && arr.includes(3));
|
|
542
|
+
onSystemVersion({
|
|
543
|
+
label: '通用版本',
|
|
544
|
+
id: 1
|
|
545
|
+
}, roleId);
|
|
546
|
+
form.setFieldsValue({
|
|
547
|
+
systemVersion: {
|
|
548
|
+
id: 1
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
setMenuCodeMap({
|
|
552
|
+
map1: codeMap['1'] || codeMap.map1,
|
|
553
|
+
map2: [],
|
|
554
|
+
map3: codeMap['3'] || codeMap.map3,
|
|
367
555
|
settingList1: settingMenuList || [],
|
|
368
|
-
settingList2:
|
|
556
|
+
settingList2: [],
|
|
557
|
+
settingList3: settingMenuList || []
|
|
369
558
|
});
|
|
559
|
+
setVersionList([{
|
|
560
|
+
label: '通用版本',
|
|
561
|
+
id: 1
|
|
562
|
+
}, {
|
|
563
|
+
label: '证券',
|
|
564
|
+
id: 3
|
|
565
|
+
}]);
|
|
566
|
+
} else if (arr.includes(2) && arr.includes(3)) {
|
|
567
|
+
// 城商行和证券存在
|
|
568
|
+
setAppVersionFl(arr.includes(2) && arr.includes(3));
|
|
569
|
+
onSystemVersion({
|
|
570
|
+
label: '城商行',
|
|
571
|
+
id: 2
|
|
572
|
+
}, roleId);
|
|
573
|
+
form.setFieldsValue({
|
|
574
|
+
systemVersion: {
|
|
575
|
+
id: 2
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
setMenuCodeMap({
|
|
579
|
+
map1: [],
|
|
580
|
+
map2: codeMap['2'] || codeMap.map2,
|
|
581
|
+
map3: codeMap['3'] || codeMap.map3,
|
|
582
|
+
settingList1: [],
|
|
583
|
+
settingList2: settingMenuList || [],
|
|
584
|
+
settingList3: settingMenuList || []
|
|
585
|
+
});
|
|
586
|
+
setVersionList([{
|
|
587
|
+
label: '城商行',
|
|
588
|
+
id: 2
|
|
589
|
+
}, {
|
|
590
|
+
label: '证券',
|
|
591
|
+
id: 3
|
|
592
|
+
}]);
|
|
370
593
|
} else {
|
|
371
594
|
if (arr.length === 0 || arr.includes(1)) {
|
|
595
|
+
// 只有通用
|
|
372
596
|
onSystemVersion({
|
|
373
597
|
label: '通用版本',
|
|
374
598
|
id: 1
|
|
@@ -381,11 +605,18 @@ var RoleList = function RoleList(props) {
|
|
|
381
605
|
setMenuCodeMap({
|
|
382
606
|
map1: codeMap['1'] || codeMap.map1,
|
|
383
607
|
map2: [],
|
|
608
|
+
map3: [],
|
|
384
609
|
settingList1: settingMenuList || [],
|
|
385
|
-
settingList2: []
|
|
610
|
+
settingList2: [],
|
|
611
|
+
settingList3: []
|
|
386
612
|
});
|
|
613
|
+
setVersionList([{
|
|
614
|
+
label: '通用版本',
|
|
615
|
+
id: 1
|
|
616
|
+
}]);
|
|
387
617
|
}
|
|
388
618
|
if (arr.includes(2)) {
|
|
619
|
+
// 只有城商行
|
|
389
620
|
onSystemVersion({
|
|
390
621
|
label: '城商行',
|
|
391
622
|
id: 2
|
|
@@ -398,12 +629,76 @@ var RoleList = function RoleList(props) {
|
|
|
398
629
|
setMenuCodeMap({
|
|
399
630
|
map1: [],
|
|
400
631
|
map2: codeMap['2'] || codeMap.map2,
|
|
632
|
+
map3: [],
|
|
633
|
+
settingList1: [],
|
|
634
|
+
settingList2: settingMenuList || [],
|
|
635
|
+
settingList3: []
|
|
636
|
+
});
|
|
637
|
+
setVersionList([{
|
|
638
|
+
label: '城商行',
|
|
639
|
+
id: 2
|
|
640
|
+
}]);
|
|
641
|
+
}
|
|
642
|
+
if (arr.includes(3)) {
|
|
643
|
+
// 只有证券
|
|
644
|
+
onSystemVersion({
|
|
645
|
+
label: '证券',
|
|
646
|
+
id: 3
|
|
647
|
+
}, roleId);
|
|
648
|
+
form.setFieldsValue({
|
|
649
|
+
systemVersion: {
|
|
650
|
+
id: 3
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
setMenuCodeMap({
|
|
654
|
+
map1: [],
|
|
655
|
+
map2: [],
|
|
656
|
+
map3: codeMap['3'] || codeMap.map3,
|
|
401
657
|
settingList1: [],
|
|
402
|
-
settingList2:
|
|
658
|
+
settingList2: [],
|
|
659
|
+
settingList3: settingMenuList || []
|
|
403
660
|
});
|
|
661
|
+
setVersionList([{
|
|
662
|
+
label: '证券',
|
|
663
|
+
id: 3
|
|
664
|
+
}]);
|
|
404
665
|
}
|
|
405
666
|
}
|
|
406
667
|
};
|
|
668
|
+
function handleDelAppJson(e) {
|
|
669
|
+
// 删除应用的同时删除赋值的数据范围条件
|
|
670
|
+
var appIdsList = e.map(function (item) {
|
|
671
|
+
return item === null || item === void 0 ? void 0 : item.id;
|
|
672
|
+
});
|
|
673
|
+
setSelectAppId(appIdsList);
|
|
674
|
+
var delAppId = filterData(selectAppId, appIdsList);
|
|
675
|
+
var newAppCondition = appCondition;
|
|
676
|
+
var indexToRemove = newAppCondition.findIndex(function (item) {
|
|
677
|
+
return item.appId === delAppId[0];
|
|
678
|
+
});
|
|
679
|
+
if (indexToRemove !== -1) {
|
|
680
|
+
newAppCondition.splice(indexToRemove, 1);
|
|
681
|
+
}
|
|
682
|
+
setAPPCondition(newAppCondition);
|
|
683
|
+
}
|
|
684
|
+
function filterData(array, array2) {
|
|
685
|
+
var result = [];
|
|
686
|
+
for (var key in array) {
|
|
687
|
+
var stra = array[key];
|
|
688
|
+
var count = 0;
|
|
689
|
+
for (var j = 0; j < array2.length; j++) {
|
|
690
|
+
var strb = array2[j];
|
|
691
|
+
if (stra == strb) {
|
|
692
|
+
count++;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if (count === 0) {
|
|
696
|
+
//表示数组1的这个值没有重复的,放到arr3列表中
|
|
697
|
+
result.push(stra);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
return result;
|
|
701
|
+
}
|
|
407
702
|
var onSystemVersion = function onSystemVersion(e, roleId) {
|
|
408
703
|
setSystemVersionId(e.id);
|
|
409
704
|
queryRoleMenuTreeList(roleId, e.id);
|
|
@@ -420,22 +715,30 @@ var RoleList = function RoleList(props) {
|
|
|
420
715
|
};
|
|
421
716
|
// 编辑||创建
|
|
422
717
|
var onFinish = function onFinish(value) {
|
|
423
|
-
var _value$appIds,
|
|
718
|
+
var _value$appIds, _value$appIds2, _value$userIds;
|
|
424
719
|
// setCreateAppLoading(true);
|
|
425
720
|
var msg = '';
|
|
426
|
-
var unionArray = _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap === null || menuCodeMap === void 0 ? void 0 : menuCodeMap.settingList1), _toConsumableArray(menuCodeMap === null || menuCodeMap === void 0 ? void 0 : menuCodeMap.settingList2))));
|
|
721
|
+
var unionArray = _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap === null || menuCodeMap === void 0 ? void 0 : menuCodeMap.settingList1), _toConsumableArray(menuCodeMap === null || menuCodeMap === void 0 ? void 0 : menuCodeMap.settingList2), _toConsumableArray(menuCodeMap === null || menuCodeMap === void 0 ? void 0 : menuCodeMap.settingList3))));
|
|
427
722
|
var appIdsList = value === null || value === void 0 ? void 0 : (_value$appIds = value.appIds) === null || _value$appIds === void 0 ? void 0 : _value$appIds.map(function (item) {
|
|
428
723
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
429
724
|
});
|
|
430
725
|
var params = _objectSpread(_objectSpread({}, value), {}, {
|
|
431
726
|
id: roleId,
|
|
432
|
-
menuCodeMap: (_menuCodeMap = {}, _defineProperty(_menuCodeMap, 1, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map1), _toConsumableArray(unionArray))))), _defineProperty(_menuCodeMap, 2, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map2), _toConsumableArray(unionArray))))), _menuCodeMap),
|
|
433
727
|
appIds: (usList === null || usList === void 0 ? void 0 : usList.length) === (value === null || value === void 0 ? void 0 : (_value$appIds2 = value.appIds) === null || _value$appIds2 === void 0 ? void 0 : _value$appIds2.length) ? [0].concat(_toConsumableArray(appIdsList)) : appIdsList,
|
|
434
728
|
systemVersion: appVersionFl ? 0 : 1,
|
|
435
729
|
userIds: value === null || value === void 0 ? void 0 : (_value$userIds = value.userIds) === null || _value$userIds === void 0 ? void 0 : _value$userIds.map(function (item) {
|
|
436
730
|
return item === null || item === void 0 ? void 0 : item.id;
|
|
437
|
-
})
|
|
731
|
+
}),
|
|
732
|
+
roleAuthStatus: isRoleAuthStatus,
|
|
733
|
+
authInfoParams: appCondition || []
|
|
438
734
|
});
|
|
735
|
+
if (menuCodeMap.map2.length && menuCodeMap.map3.length && !menuCodeMap.map1.length) {
|
|
736
|
+
var _params$menuCodeMap;
|
|
737
|
+
params.menuCodeMap = (_params$menuCodeMap = {}, _defineProperty(_params$menuCodeMap, 1, _toConsumableArray(new Set(_toConsumableArray(menuCodeMap.map1)))), _defineProperty(_params$menuCodeMap, 2, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map2), _toConsumableArray(unionArray))))), _defineProperty(_params$menuCodeMap, 3, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map3), _toConsumableArray(unionArray))))), _params$menuCodeMap);
|
|
738
|
+
} else {
|
|
739
|
+
var _params$menuCodeMap2;
|
|
740
|
+
params.menuCodeMap = (_params$menuCodeMap2 = {}, _defineProperty(_params$menuCodeMap2, 1, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map1), _toConsumableArray(unionArray))))), _defineProperty(_params$menuCodeMap2, 2, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map2), _toConsumableArray(unionArray))))), _defineProperty(_params$menuCodeMap2, 3, _toConsumableArray(new Set([].concat(_toConsumableArray(menuCodeMap.map3), _toConsumableArray(unionArray))))), _params$menuCodeMap2);
|
|
741
|
+
}
|
|
439
742
|
(!roleId ? addRole : updateRole)(params).then(function (res) {
|
|
440
743
|
if ((res === null || res === void 0 ? void 0 : res.code) !== '101000') {
|
|
441
744
|
setTimeout(function () {
|
|
@@ -449,8 +752,10 @@ var RoleList = function RoleList(props) {
|
|
|
449
752
|
setMenuCodeMap({
|
|
450
753
|
map1: [],
|
|
451
754
|
map2: [],
|
|
755
|
+
map3: [],
|
|
452
756
|
settingList1: [],
|
|
453
|
-
settingList2: []
|
|
757
|
+
settingList2: [],
|
|
758
|
+
settingList3: []
|
|
454
759
|
});
|
|
455
760
|
// 通知数据刷新
|
|
456
761
|
msg = !roleId ? '创建成功' : '编辑成功';
|
|
@@ -465,6 +770,70 @@ var RoleList = function RoleList(props) {
|
|
|
465
770
|
});
|
|
466
771
|
});
|
|
467
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
|
+
setCurrentAppId(option.app_id);
|
|
779
|
+
setDataRangeDialogTitle(node);
|
|
780
|
+
setIsModalOpen(true);
|
|
781
|
+
var currentJson = appCondition.filter(function (item) {
|
|
782
|
+
return item.appId === option.app_id;
|
|
783
|
+
});
|
|
784
|
+
if (currentJson.length) {
|
|
785
|
+
var _currentJson$;
|
|
786
|
+
setCurrentJson(currentJson[0].data ? JSON.parse((_currentJson$ = currentJson[0]) === null || _currentJson$ === void 0 ? void 0 : _currentJson$.data).json : JSON.parse(currentJson[0].json));
|
|
787
|
+
setIsRoleAuthStatus(1);
|
|
788
|
+
} else {
|
|
789
|
+
setCurrentJson([]);
|
|
790
|
+
setIsRoleAuthStatus(0);
|
|
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) {
|
|
816
|
+
var authInfoParam = {
|
|
817
|
+
appId: appId,
|
|
818
|
+
platform: 0,
|
|
819
|
+
data: JSON.stringify({
|
|
820
|
+
color: '#8db3e2',
|
|
821
|
+
name: 0,
|
|
822
|
+
groupType: 0,
|
|
823
|
+
json: condition
|
|
824
|
+
})
|
|
825
|
+
};
|
|
826
|
+
var newAppCondition = appCondition;
|
|
827
|
+
var indexToRemove = newAppCondition.findIndex(function (item) {
|
|
828
|
+
return item.appId === appId;
|
|
829
|
+
});
|
|
830
|
+
if (indexToRemove !== -1) {
|
|
831
|
+
newAppCondition.splice(indexToRemove, 1, authInfoParam);
|
|
832
|
+
} else {
|
|
833
|
+
newAppCondition.push(authInfoParam);
|
|
834
|
+
}
|
|
835
|
+
setAPPCondition(newAppCondition);
|
|
836
|
+
}
|
|
468
837
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
469
838
|
spinning: loading
|
|
470
839
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -496,7 +865,8 @@ var RoleList = function RoleList(props) {
|
|
|
496
865
|
setRoleId(null);
|
|
497
866
|
form.resetFields();
|
|
498
867
|
form.setFieldsValue({
|
|
499
|
-
isEncryption: 0
|
|
868
|
+
isEncryption: 0,
|
|
869
|
+
roleAuthStatus: 0
|
|
500
870
|
});
|
|
501
871
|
queryRoleDataConfigList(null);
|
|
502
872
|
queryRoleUserList(null);
|
|
@@ -527,23 +897,29 @@ var RoleList = function RoleList(props) {
|
|
|
527
897
|
borderTop: '1px solid #F2F3F4'
|
|
528
898
|
},
|
|
529
899
|
onClose: function onClose() {
|
|
900
|
+
setAppList([]);
|
|
530
901
|
setCreatedAppPanel(false);
|
|
531
902
|
setMenuCodeMap({
|
|
532
903
|
map1: [],
|
|
533
904
|
map2: [],
|
|
905
|
+
map3: [],
|
|
534
906
|
settingList1: [],
|
|
535
|
-
settingList2: []
|
|
907
|
+
settingList2: [],
|
|
908
|
+
settingList3: []
|
|
536
909
|
});
|
|
537
910
|
setSystemVersionId(1);
|
|
538
911
|
},
|
|
539
912
|
footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
540
913
|
onClick: function onClick() {
|
|
914
|
+
setAppList([]);
|
|
541
915
|
setCreatedAppPanel(false);
|
|
542
916
|
setMenuCodeMap({
|
|
543
917
|
map1: [],
|
|
544
918
|
map2: [],
|
|
919
|
+
map3: [],
|
|
545
920
|
settingList1: [],
|
|
546
|
-
settingList2: []
|
|
921
|
+
settingList2: [],
|
|
922
|
+
settingList3: []
|
|
547
923
|
});
|
|
548
924
|
}
|
|
549
925
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -603,7 +979,24 @@ var RoleList = function RoleList(props) {
|
|
|
603
979
|
},
|
|
604
980
|
placeholder: '请选择应用权限',
|
|
605
981
|
labelField: "app_name",
|
|
606
|
-
keyField: "id"
|
|
982
|
+
keyField: "id",
|
|
983
|
+
overlayClassName: isModalOpen ? 'label-group-overlay' : '',
|
|
984
|
+
customLabel: renderLabel
|
|
985
|
+
}), /*#__PURE__*/React.createElement(BizUserCondition, {
|
|
986
|
+
openCdpCondition: true,
|
|
987
|
+
openBusinessDataCondition: true,
|
|
988
|
+
openOrderDataCondition: true,
|
|
989
|
+
openTagCondition: true,
|
|
990
|
+
userTagsData: [],
|
|
991
|
+
defaultValue: currentJson,
|
|
992
|
+
onChange: function onChange(e) {
|
|
993
|
+
console.log(e);
|
|
994
|
+
},
|
|
995
|
+
orConditionNum: 3,
|
|
996
|
+
andConditionNum: 8,
|
|
997
|
+
eventAttrNum: 3,
|
|
998
|
+
isRealTime: true,
|
|
999
|
+
key: currentAppId
|
|
607
1000
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
608
1001
|
label: "\u529F\u80FD\u6743\u9650",
|
|
609
1002
|
className: "menuCode-map"
|
|
@@ -641,8 +1034,8 @@ var RoleList = function RoleList(props) {
|
|
|
641
1034
|
title: 'name',
|
|
642
1035
|
key: 'menuCode'
|
|
643
1036
|
},
|
|
644
|
-
checkedKeys: systemVersionId === 1 ? menuCodeMap.map1 : menuCodeMap.map2,
|
|
645
|
-
defaultExpandedKeys: !roleId ? [0] : systemVersionId === 1 ? menuCodeMap.map1 : menuCodeMap.map2,
|
|
1037
|
+
checkedKeys: systemVersionId === 1 ? menuCodeMap.map1 : systemVersionId === 2 ? menuCodeMap.map2 : menuCodeMap.map3,
|
|
1038
|
+
defaultExpandedKeys: !roleId ? [0] : systemVersionId === 1 ? menuCodeMap.map1 : systemVersionId === 2 ? menuCodeMap.map2 : menuCodeMap.map3,
|
|
646
1039
|
autoExpandParent: true,
|
|
647
1040
|
treeData: functionList
|
|
648
1041
|
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -689,7 +1082,17 @@ var RoleList = function RoleList(props) {
|
|
|
689
1082
|
onCancel: function onCancel() {
|
|
690
1083
|
setDelPanelState(false);
|
|
691
1084
|
}
|
|
692
|
-
}, "\u786E\u8BA4\u8981\u5220\u9664\u5F53\u524D\u89D2\u8272\u5417?"), /*#__PURE__*/React.createElement(
|
|
1085
|
+
}, "\u786E\u8BA4\u8981\u5220\u9664\u5F53\u524D\u89D2\u8272\u5417?"), /*#__PURE__*/React.createElement(SetDataRangeDialog, {
|
|
1086
|
+
isModalOpen: isModalOpen,
|
|
1087
|
+
setIsModalOpen: setIsModalOpen,
|
|
1088
|
+
dataRangeDialogTitle: dataRangeDialogTitle,
|
|
1089
|
+
currentAppId: currentAppId,
|
|
1090
|
+
setConditionFn: setConditionFn,
|
|
1091
|
+
isRoleAuthStatus: isRoleAuthStatus,
|
|
1092
|
+
setIsRoleAuthStatus: setIsRoleAuthStatus,
|
|
1093
|
+
currentJson: currentJson,
|
|
1094
|
+
setCurrentJson: setCurrentJson
|
|
1095
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
693
1096
|
className: "role-list-content"
|
|
694
1097
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
695
1098
|
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,14 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare const SetDataRangeDialog: React.FC<{
|
|
4
|
+
isModalOpen: boolean;
|
|
5
|
+
setIsModalOpen: Function;
|
|
6
|
+
dataRangeDialogTitle: ReactNode;
|
|
7
|
+
currentAppId: number;
|
|
8
|
+
setConditionFn: Function;
|
|
9
|
+
currentJson: any[];
|
|
10
|
+
setCurrentJson: Function;
|
|
11
|
+
isRoleAuthStatus: number;
|
|
12
|
+
setIsRoleAuthStatus: Function;
|
|
13
|
+
}>;
|
|
14
|
+
export default SetDataRangeDialog;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Radio, message } from 'antd';
|
|
3
|
+
import { BizDialog, DemoWrapper, BizUserCondition } from '@zgfe/business-lib';
|
|
4
|
+
import './index.less';
|
|
5
|
+
import util from '../../../../utils/util';
|
|
6
|
+
var SetDataRangeDialog = function SetDataRangeDialog(props) {
|
|
7
|
+
var isModalOpen = props.isModalOpen,
|
|
8
|
+
setIsModalOpen = props.setIsModalOpen,
|
|
9
|
+
dataRangeDialogTitle = props.dataRangeDialogTitle,
|
|
10
|
+
currentAppId = props.currentAppId,
|
|
11
|
+
setConditionFn = props.setConditionFn,
|
|
12
|
+
currentJson = props.currentJson,
|
|
13
|
+
setCurrentJson = props.setCurrentJson,
|
|
14
|
+
isRoleAuthStatus = props.isRoleAuthStatus,
|
|
15
|
+
setIsRoleAuthStatus = props.setIsRoleAuthStatus;
|
|
16
|
+
function onChangeCondition(data) {
|
|
17
|
+
setCurrentJson(data);
|
|
18
|
+
}
|
|
19
|
+
function onConfirm() {
|
|
20
|
+
if (!currentJson) return;
|
|
21
|
+
var res = util.validateUserCondition(currentJson);
|
|
22
|
+
if (res) return message.error(res);
|
|
23
|
+
setConditionFn(currentAppId, currentJson);
|
|
24
|
+
setIsModalOpen(false);
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/React.createElement(BizDialog, {
|
|
27
|
+
className: "set-data-dialog",
|
|
28
|
+
title: dataRangeDialogTitle,
|
|
29
|
+
open: isModalOpen,
|
|
30
|
+
closable: true,
|
|
31
|
+
style: {
|
|
32
|
+
minWidth: isRoleAuthStatus ? '80%' : '520px'
|
|
33
|
+
},
|
|
34
|
+
onCancel: function onCancel() {
|
|
35
|
+
setIsModalOpen(false);
|
|
36
|
+
},
|
|
37
|
+
onOk: function onOk() {
|
|
38
|
+
return onConfirm();
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
41
|
+
buttonStyle: "outline",
|
|
42
|
+
value: isRoleAuthStatus,
|
|
43
|
+
onChange: function onChange(value) {
|
|
44
|
+
setIsRoleAuthStatus(value.target.value);
|
|
45
|
+
}
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
47
|
+
value: 0
|
|
48
|
+
}, "\u5168\u90E8\u6570\u636E"), /*#__PURE__*/React.createElement(Radio, {
|
|
49
|
+
value: 1
|
|
50
|
+
}, "\u7B5B\u9009\u7528\u6237")), isRoleAuthStatus ? /*#__PURE__*/React.createElement("li", {
|
|
51
|
+
className: "group-config condition"
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: "config-name"
|
|
54
|
+
}, "\u5B9A\u4E49"), /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "config-value"
|
|
56
|
+
}), /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
57
|
+
defaultApp: currentAppId
|
|
58
|
+
}, /*#__PURE__*/React.createElement(BizUserCondition, {
|
|
59
|
+
openCdpCondition: true,
|
|
60
|
+
openBusinessDataCondition: true,
|
|
61
|
+
openOrderDataCondition: true,
|
|
62
|
+
openTagCondition: true,
|
|
63
|
+
userTagsData: [],
|
|
64
|
+
defaultValue: currentJson,
|
|
65
|
+
onChange: onChangeCondition,
|
|
66
|
+
orConditionNum: 3,
|
|
67
|
+
andConditionNum: 8,
|
|
68
|
+
eventAttrNum: 3,
|
|
69
|
+
isRealTime: true,
|
|
70
|
+
key: currentAppId
|
|
71
|
+
}))) : null);
|
|
72
|
+
};
|
|
73
|
+
export default SetDataRangeDialog;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.set-data-dialog {
|
|
2
|
+
.ant-card-head-title {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.group-config {
|
|
7
|
+
display: flex;
|
|
8
|
+
margin-top: 26px;
|
|
9
|
+
|
|
10
|
+
.config-name {
|
|
11
|
+
margin-right: 20px;
|
|
12
|
+
color: #5f6085;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ant-card {
|
|
18
|
+
width: 100%;
|
|
19
|
+
border: none;
|
|
20
|
+
|
|
21
|
+
.ant-card-head {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.biz-user-condition {
|
|
26
|
+
background-color: #fff;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/es/requests/role.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare const queryRolePage: (data: {
|
|
|
9
9
|
userIds: number[];
|
|
10
10
|
menuCodeMap: {};
|
|
11
11
|
settingMenuList: [];
|
|
12
|
+
authGroupList: [];
|
|
13
|
+
roleAuthStatus: number;
|
|
12
14
|
}> | null>, queryRoleDataConfig: (data: {
|
|
13
15
|
id: number | null;
|
|
14
16
|
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryRoleMenuTree: (data: {
|
package/es/types/app.d.ts
CHANGED
package/es/types/app.js
CHANGED
package/es/utils/util.d.ts
CHANGED
|
@@ -231,5 +231,6 @@ declare const util: {
|
|
|
231
231
|
disabled: boolean | number;
|
|
232
232
|
children: object[] | undefined;
|
|
233
233
|
}[];
|
|
234
|
+
validateUserCondition(conditions: any[]): "" | "用户定义不能为空" | "事件不能为空" | "用户标签不能为空" | "明细数据不能为空" | "明细表不能为空" | "字段不能为空" | "筛选规则不能为空" | "筛选条件不能为空" | "值类型不能为空" | "用户属性不能为空" | "属性值不能为空" | "时间不能为空" | "次数不能为空" | "事件属性不能为空";
|
|
234
235
|
};
|
|
235
236
|
export default util;
|
package/es/utils/util.js
CHANGED
|
@@ -721,6 +721,110 @@ var util = {
|
|
|
721
721
|
newItem.children = (newItem === null || newItem === void 0 ? void 0 : newItem.children) && (newItem === null || newItem === void 0 ? void 0 : newItem.children.length) > 0 ? util.menuTreeData(newItem === null || newItem === void 0 ? void 0 : newItem.children) : undefined;
|
|
722
722
|
return newItem;
|
|
723
723
|
});
|
|
724
|
+
},
|
|
725
|
+
validateUserCondition: function validateUserCondition(conditions) {
|
|
726
|
+
if (!conditions.length) return '用户定义不能为空';
|
|
727
|
+
var _iterator2 = _createForOfIteratorHelper(conditions),
|
|
728
|
+
_step2;
|
|
729
|
+
try {
|
|
730
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
731
|
+
var orConditions = _step2.value;
|
|
732
|
+
if (!orConditions.length) return '用户定义不能为空';
|
|
733
|
+
var _iterator3 = _createForOfIteratorHelper(orConditions),
|
|
734
|
+
_step3;
|
|
735
|
+
try {
|
|
736
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
737
|
+
var orCondition = _step3.value;
|
|
738
|
+
if (orCondition.eventId === 0) return '事件不能为空';
|
|
739
|
+
if (orCondition.eventId === undefined) {
|
|
740
|
+
if (orCondition.labels) {
|
|
741
|
+
var _orCondition$labels$v;
|
|
742
|
+
if (((_orCondition$labels$v = orCondition.labels.values) === null || _orCondition$labels$v === void 0 ? void 0 : _orCondition$labels$v.length) === 0) return '用户标签不能为空';
|
|
743
|
+
} else if (orCondition.dataset) {
|
|
744
|
+
if (!orCondition.dataset.length) return '明细数据不能为空';
|
|
745
|
+
var _iterator4 = _createForOfIteratorHelper(orCondition.dataset),
|
|
746
|
+
_step4;
|
|
747
|
+
try {
|
|
748
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
749
|
+
var item = _step4.value;
|
|
750
|
+
if (!item || !item.datasetTable) return '明细表不能为空';
|
|
751
|
+
if (!item.fieldName) return '字段不能为空';
|
|
752
|
+
if (!item.operator) return '筛选规则不能为空';
|
|
753
|
+
if (!/^is null$|^is not null$/.test(item.operator) && !item.params.length) {
|
|
754
|
+
return '筛选条件不能为空';
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
} catch (err) {
|
|
758
|
+
_iterator4.e(err);
|
|
759
|
+
} finally {
|
|
760
|
+
_iterator4.f();
|
|
761
|
+
}
|
|
762
|
+
} else if (orCondition.data_set_csh) {
|
|
763
|
+
if (!orCondition.data_set_csh.length) return '明细数据不能为空';
|
|
764
|
+
var _iterator5 = _createForOfIteratorHelper(orCondition.data_set_csh),
|
|
765
|
+
_step5;
|
|
766
|
+
try {
|
|
767
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
768
|
+
var _item = _step5.value;
|
|
769
|
+
if (!_item || !_item.datasetTable) return '明细表不能为空';
|
|
770
|
+
if (!_item.fieldName) return '字段不能为空';
|
|
771
|
+
if (!_item.operator) return '筛选规则不能为空';
|
|
772
|
+
if (_item.subCondition) {
|
|
773
|
+
if (!_item.subCondition.datasetTable) return '明细表不能为空';
|
|
774
|
+
if (!_item.subCondition.fieldName) return '字段不能为空';
|
|
775
|
+
if (!_item.subCondition.operator) return '筛选规则不能为空';
|
|
776
|
+
if (!_item.subCondition.calculate) return '值类型不能为空';
|
|
777
|
+
}
|
|
778
|
+
if (!/^is null$|^is not null$/.test(_item.operator) && !(_item.params || _item.between && _item.between[0] && _item.between[1])) {
|
|
779
|
+
return '筛选条件不能为空';
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
} catch (err) {
|
|
783
|
+
_iterator5.e(err);
|
|
784
|
+
} finally {
|
|
785
|
+
_iterator5.f();
|
|
786
|
+
}
|
|
787
|
+
} else if (!orCondition.attrs.length || !orCondition.attrs[0].attrName) {
|
|
788
|
+
return '用户属性不能为空';
|
|
789
|
+
} else if (!/^is null$|^is not null$/.test(orCondition.attrs[0].operator) && !orCondition.attrs[0].params.length) {
|
|
790
|
+
return '属性值不能为空';
|
|
791
|
+
}
|
|
792
|
+
} else {
|
|
793
|
+
if (orCondition.runPeriod && orCondition.runPeriod.values && (!orCondition.runPeriod.values[0] || !orCondition.runPeriod.values[1])) {
|
|
794
|
+
return '时间不能为空';
|
|
795
|
+
}
|
|
796
|
+
if (orCondition.runTimes && !orCondition.runTimes.values[0]) {
|
|
797
|
+
return '次数不能为空';
|
|
798
|
+
}
|
|
799
|
+
if (orCondition.attrs) {
|
|
800
|
+
var _iterator6 = _createForOfIteratorHelper(orCondition.attrs),
|
|
801
|
+
_step6;
|
|
802
|
+
try {
|
|
803
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
804
|
+
var attr = _step6.value;
|
|
805
|
+
if (!attr.attrId && !attr.attrName) return '事件属性不能为空';
|
|
806
|
+
if (!attr.params.length && !/^is null$|^is not null$/.test(attr.operator)) return '属性值不能为空';
|
|
807
|
+
}
|
|
808
|
+
} catch (err) {
|
|
809
|
+
_iterator6.e(err);
|
|
810
|
+
} finally {
|
|
811
|
+
_iterator6.f();
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
} catch (err) {
|
|
817
|
+
_iterator3.e(err);
|
|
818
|
+
} finally {
|
|
819
|
+
_iterator3.f();
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
} catch (err) {
|
|
823
|
+
_iterator2.e(err);
|
|
824
|
+
} finally {
|
|
825
|
+
_iterator2.f();
|
|
826
|
+
}
|
|
827
|
+
return '';
|
|
724
828
|
}
|
|
725
829
|
};
|
|
726
830
|
export default util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20-role.10",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"umi-request": "^1.4.0",
|
|
52
52
|
"yorkie": "^2.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "223ee939b360e3cabd731c2f320d380855e7040a",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|