@zgfe/modules-settings 1.0.1-a.4 → 1.0.1-a.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/constants/api.d.ts +6 -0
- package/dist/esm/constants/api.js +10 -1
- package/dist/esm/modules/companySetting/appList/index.js +16 -15
- package/dist/esm/modules/companySetting/edit/styles/user.less +22 -0
- package/dist/esm/modules/companySetting/edit/user.js +43 -14
- package/dist/esm/modules/companySetting/edit/userGroup.js +33 -17
- package/dist/esm/modules/companySetting/index.d.ts +4 -0
- package/dist/esm/modules/companySetting/index.js +135 -18
- package/dist/esm/modules/companySetting/user/invite.js +41 -15
- package/dist/esm/modules/companySetting/userGroup/index.d.ts +0 -1
- package/dist/esm/modules/companySetting/userGroup/index.js +2 -4
- package/dist/esm/modules/companySetting/virtualApp/config.d.ts +11 -0
- package/dist/esm/modules/companySetting/virtualApp/config.js +144 -0
- package/dist/esm/modules/companySetting/virtualApp/index.d.ts +6 -1
- package/dist/esm/modules/companySetting/virtualApp/index.js +205 -22
- package/dist/esm/modules/companySetting/virtualApp/panels/list.d.ts +12 -0
- package/dist/esm/modules/companySetting/virtualApp/panels/list.js +169 -0
- package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.d.ts +10 -0
- package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.js +162 -0
- package/dist/esm/modules/companySetting/virtualApp/styles/config.less +36 -0
- package/dist/esm/modules/companySetting/virtualApp/styles/list.less +28 -0
- package/dist/esm/modules/companySetting/virtualApp/styles/sourceItem.less +27 -0
- package/dist/esm/modules/companySetting/virtualApp/styles/table.less +44 -0
- package/dist/esm/modules/companySetting/wechatBinding/index.d.ts +1 -4
- package/dist/esm/modules/personalSetting/info/index.js +4 -4
- package/package.json +3 -2
- package/dist/esm/modules/companySetting/virtualApp/config.vue +0 -167
- package/dist/esm/modules/companySetting/virtualApp/panels/list.vue +0 -208
- package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.vue +0 -162
- package/dist/esm/modules/companySetting/virtualApp/styles/config.sass +0 -28
- package/dist/esm/modules/companySetting/virtualApp/styles/list.sass +0 -21
- package/dist/esm/modules/companySetting/virtualApp/styles/sourceItem.sass +0 -21
- package/dist/esm/modules/companySetting/virtualApp/styles/table.sass +0 -36
|
@@ -8,6 +8,9 @@ declare let apis: {
|
|
|
8
8
|
createApp: string;
|
|
9
9
|
queryAppList: string;
|
|
10
10
|
queryPackageInfo: string;
|
|
11
|
+
queryVirtualApps: string;
|
|
12
|
+
getCompanyAppList: string;
|
|
13
|
+
editVirtualApp: string;
|
|
11
14
|
};
|
|
12
15
|
setting: {
|
|
13
16
|
updateCompanyName: string;
|
|
@@ -33,5 +36,8 @@ declare let apis: {
|
|
|
33
36
|
createFilter: string;
|
|
34
37
|
queryFilter: string;
|
|
35
38
|
};
|
|
39
|
+
eventMeta: {
|
|
40
|
+
queryEventMeta: string;
|
|
41
|
+
};
|
|
36
42
|
};
|
|
37
43
|
export default apis;
|
|
@@ -9,8 +9,14 @@ var apis = {
|
|
|
9
9
|
deleteApp: apiPrefix + '/common/proxy/user/deleteApp.jsp',
|
|
10
10
|
createApp: apiPrefix + '/system/createApp',
|
|
11
11
|
queryAppList: apiPrefix + '/common/proxy/data/v2ajaxGetDataByApp.jsp',
|
|
12
|
-
queryPackageInfo: apiPrefix + '/system/packageInfo'
|
|
12
|
+
queryPackageInfo: apiPrefix + '/system/packageInfo',
|
|
13
|
+
queryVirtualApps: apiPrefix + '/common/proxy/user/sourceApp.jsp',
|
|
14
|
+
// 查询虚拟应用列表
|
|
15
|
+
getCompanyAppList: apiPrefix + '/common/proxy/user/getCompanyAppList.jsp',
|
|
16
|
+
// 查询公司下所有应用列表
|
|
17
|
+
editVirtualApp: apiPrefix + '/common/proxy/user/editDataSource.jsp' // 修改虚拟应用
|
|
13
18
|
},
|
|
19
|
+
|
|
14
20
|
setting: {
|
|
15
21
|
updateCompanyName: apiPrefix + '/common/proxy/company/v2updateInfo.jsp',
|
|
16
22
|
updateLicense: apiPrefix + '/system/license',
|
|
@@ -36,6 +42,9 @@ var apis = {
|
|
|
36
42
|
updateAppName: apiPrefix + '/common/proxy/user/updateAppName.jsp',
|
|
37
43
|
createFilter: apiPrefix + '/common/proxy/user/createFilter.jsp',
|
|
38
44
|
queryFilter: apiPrefix + '/common/proxy/user/queryFilter.jsp'
|
|
45
|
+
},
|
|
46
|
+
eventMeta: {
|
|
47
|
+
queryEventMeta: apiPrefix + '/common/proxy/data/queryEventMetasOfGroup.jsp'
|
|
39
48
|
}
|
|
40
49
|
};
|
|
41
50
|
export default apis;
|
|
@@ -258,6 +258,18 @@ var appList = function appList(props) {
|
|
|
258
258
|
if (inDemoMode()) {
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
|
+
if (!appNameVal) {
|
|
262
|
+
notification.error({
|
|
263
|
+
message: '请输入应用名称'
|
|
264
|
+
});
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (appNameVal.length > 20) {
|
|
268
|
+
notification.error({
|
|
269
|
+
message: '不能超过20个字符'
|
|
270
|
+
});
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
261
273
|
setCreateAppLoading(true);
|
|
262
274
|
var msg = '';
|
|
263
275
|
selfRequest(api.app.createApp, {
|
|
@@ -333,10 +345,7 @@ var appList = function appList(props) {
|
|
|
333
345
|
visible: createdAppPanel,
|
|
334
346
|
closable: true,
|
|
335
347
|
onOk: function onOk() {
|
|
336
|
-
|
|
337
|
-
if (!((_formRef$current3 = formRef.current) !== null && _formRef$current3 !== void 0 && _formRef$current3.getFieldError('appNameVal').length)) {
|
|
338
|
-
onCreateConfirm();
|
|
339
|
-
}
|
|
348
|
+
onCreateConfirm();
|
|
340
349
|
},
|
|
341
350
|
onCancel: function onCancel() {
|
|
342
351
|
setCreatedAppPanel(false);
|
|
@@ -350,19 +359,11 @@ var appList = function appList(props) {
|
|
|
350
359
|
},
|
|
351
360
|
ref: formRef,
|
|
352
361
|
onValuesChange: function onValuesChange() {
|
|
353
|
-
var _formRef$
|
|
354
|
-
setAppNameVal((_formRef$
|
|
362
|
+
var _formRef$current3;
|
|
363
|
+
setAppNameVal((_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldValue('appNameVal'));
|
|
355
364
|
}
|
|
356
365
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
357
|
-
name: 'appNameVal'
|
|
358
|
-
rules: [{
|
|
359
|
-
required: true,
|
|
360
|
-
message: '请输入应用名称'
|
|
361
|
-
}, {
|
|
362
|
-
type: 'string',
|
|
363
|
-
max: 20,
|
|
364
|
-
message: '不能超过20个字符'
|
|
365
|
-
}]
|
|
366
|
+
name: 'appNameVal'
|
|
366
367
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
367
368
|
type: 'text',
|
|
368
369
|
placeholder: '请输入应用名',
|
|
@@ -30,3 +30,25 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
.select-group {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
margin: 10px;
|
|
39
|
+
.all-btn {
|
|
40
|
+
color: #3d62d2;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
.delete-btn {
|
|
44
|
+
color: #f55858;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
#ant-select {
|
|
49
|
+
width: 100%;
|
|
50
|
+
.ant-select-item-option-selected {
|
|
51
|
+
color: #3d62d2 !important;
|
|
52
|
+
background-color: #fff !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
6
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
13
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
14
|
import "./styles/user.less";
|
|
9
15
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
10
|
-
import { Button, Input, notification, Tabs } from 'antd';
|
|
16
|
+
import { Button, Input, notification, Tabs, Select } from 'antd';
|
|
11
17
|
import request from "./../../../utils/ajax";
|
|
12
18
|
import AuthConfig from "./authConfig";
|
|
13
19
|
import AuthConfigCEP from "./authConfigCEP";
|
|
14
|
-
import { BizSelect } from '@zgfe/business-lib';
|
|
15
20
|
import apis from "./../../../constants/api";
|
|
16
21
|
var TextArea = Input.TextArea;
|
|
17
22
|
var Info = function Info(props) {
|
|
@@ -23,6 +28,12 @@ var Info = function Info(props) {
|
|
|
23
28
|
serviceType = props.serviceType,
|
|
24
29
|
onCancel = props.onCancel,
|
|
25
30
|
changeUserAuthCallback = props.changeUserAuthCallback;
|
|
31
|
+
var dealAllGroupInfos = allGroupInfos.map(function (item) {
|
|
32
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
33
|
+
value: item.id,
|
|
34
|
+
label: item.groupName
|
|
35
|
+
});
|
|
36
|
+
});
|
|
26
37
|
var _useContext = useContext(BizGlobalDataContext),
|
|
27
38
|
currentApp = _useContext.currentApp,
|
|
28
39
|
currentUser = _useContext.currentUser,
|
|
@@ -82,12 +93,12 @@ var Info = function Info(props) {
|
|
|
82
93
|
useEffect(function () {
|
|
83
94
|
var authConfig = data.authConfig || {};
|
|
84
95
|
var groupIds = authConfig.groupIds || [];
|
|
85
|
-
setGroups(
|
|
96
|
+
setGroups(dealAllGroupInfos.filter(function (item) {
|
|
86
97
|
return groupIds.includes(item.id);
|
|
87
98
|
}));
|
|
88
99
|
}, []);
|
|
89
|
-
var onChangeGroups = function onChangeGroups(value) {
|
|
90
|
-
setGroups(
|
|
100
|
+
var onChangeGroups = function onChangeGroups(value, option) {
|
|
101
|
+
setGroups(option);
|
|
91
102
|
};
|
|
92
103
|
var onCancelCallback = function onCancelCallback() {
|
|
93
104
|
onCancel && onCancel();
|
|
@@ -210,16 +221,34 @@ var Info = function Info(props) {
|
|
|
210
221
|
display: 'inline-block',
|
|
211
222
|
width: 500
|
|
212
223
|
}
|
|
213
|
-
}, /*#__PURE__*/React.createElement(
|
|
214
|
-
|
|
215
|
-
|
|
224
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
225
|
+
style: {
|
|
226
|
+
width: 284
|
|
227
|
+
},
|
|
228
|
+
options: dealAllGroupInfos,
|
|
216
229
|
value: groups,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
230
|
+
showArrow: true,
|
|
231
|
+
showSearch: true,
|
|
232
|
+
mode: "multiple",
|
|
233
|
+
onChange: onChangeGroups,
|
|
234
|
+
maxTagCount: 2,
|
|
235
|
+
dropdownRender: function dropdownRender(menu) {
|
|
236
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
237
|
+
id: "ant-select"
|
|
238
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: "select-group"
|
|
240
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
setGroups(dealAllGroupInfos);
|
|
243
|
+
},
|
|
244
|
+
className: "all-btn"
|
|
245
|
+
}, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", {
|
|
246
|
+
onClick: function onClick() {
|
|
247
|
+
setGroups([]);
|
|
248
|
+
},
|
|
249
|
+
className: "delete-btn"
|
|
250
|
+
}, "\u6E05\u7A7A")), menu);
|
|
251
|
+
}
|
|
223
252
|
}))), /*#__PURE__*/React.createElement(Tabs, {
|
|
224
253
|
activeKey: currentTab,
|
|
225
254
|
onChange: function onChange(e) {
|
|
@@ -14,11 +14,10 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
14
14
|
import "./styles/userGroup.less";
|
|
15
15
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
16
|
import constants from "./../../../utils/constants";
|
|
17
|
-
import { Button, Input, notification, Tabs, Radio } from 'antd';
|
|
17
|
+
import { Button, Input, notification, Tabs, Radio, Select } from 'antd';
|
|
18
18
|
import request from "./../../../utils/ajax";
|
|
19
19
|
import AuthConfig from "./authConfig";
|
|
20
20
|
import AuthConfigCEP from "./authConfigCEP";
|
|
21
|
-
import { BizSelect } from '@zgfe/business-lib';
|
|
22
21
|
import apis from "./../../../constants/api";
|
|
23
22
|
var TextArea = Input.TextArea;
|
|
24
23
|
var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
@@ -111,7 +110,8 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
111
110
|
data.members.forEach(function (item) {
|
|
112
111
|
result.push({
|
|
113
112
|
id: item.userId,
|
|
114
|
-
|
|
113
|
+
value: item.id,
|
|
114
|
+
label: item.username || item.email
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -129,7 +129,8 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
129
129
|
if (res.flag === 101) {
|
|
130
130
|
setAllMembers(res.company_members.map(function (item) {
|
|
131
131
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
132
|
-
|
|
132
|
+
value: item.id,
|
|
133
|
+
label: item.username || item.email
|
|
133
134
|
});
|
|
134
135
|
}));
|
|
135
136
|
}
|
|
@@ -282,23 +283,38 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
|
|
|
282
283
|
display: 'inline-block',
|
|
283
284
|
width: 'calc(100% - 100px)'
|
|
284
285
|
}
|
|
285
|
-
}, /*#__PURE__*/React.createElement(
|
|
286
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
286
287
|
placeholder: "\u9009\u62E9\u7528\u6237",
|
|
287
|
-
|
|
288
|
+
style: {
|
|
289
|
+
width: 400
|
|
290
|
+
},
|
|
288
291
|
options: allMembers,
|
|
289
292
|
value: user,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
293
|
+
showArrow: true,
|
|
294
|
+
showSearch: true,
|
|
295
|
+
mode: "multiple",
|
|
296
|
+
onChange: function onChange(v, option) {
|
|
297
|
+
setUser(option);
|
|
298
|
+
},
|
|
299
|
+
maxTagCount: 3,
|
|
300
|
+
dropdownRender: function dropdownRender(menu) {
|
|
301
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
302
|
+
id: "ant-select"
|
|
303
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
304
|
+
className: "select-group"
|
|
305
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
306
|
+
onClick: function onClick() {
|
|
307
|
+
setUser(allMembers);
|
|
308
|
+
},
|
|
309
|
+
className: "all-btn"
|
|
310
|
+
}, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", {
|
|
311
|
+
onClick: function onClick() {
|
|
312
|
+
setUser([]);
|
|
313
|
+
},
|
|
314
|
+
className: "delete-btn"
|
|
315
|
+
}, "\u6E05\u7A7A")), menu);
|
|
300
316
|
}
|
|
301
|
-
}))),
|
|
317
|
+
}))), isAdmin ? /*#__PURE__*/React.createElement("div", {
|
|
302
318
|
className: "encryption-wrap"
|
|
303
319
|
}, /*#__PURE__*/React.createElement("div", {
|
|
304
320
|
className: "encryption-name"
|
|
@@ -3,6 +3,10 @@ import './index.less';
|
|
|
3
3
|
declare const CompanySetting: React.FC<{
|
|
4
4
|
zgText: String;
|
|
5
5
|
isMarsUi: Boolean;
|
|
6
|
+
showVirtualApp: Boolean;
|
|
7
|
+
showDataDaily: Boolean;
|
|
8
|
+
showWeChatMenu: Boolean;
|
|
9
|
+
showMarketMenu: Boolean;
|
|
6
10
|
action: String;
|
|
7
11
|
settingCallback?: (type: string, obj?: any) => void;
|
|
8
12
|
}>;
|
|
@@ -17,12 +17,16 @@ import Info from "./info";
|
|
|
17
17
|
import UserGroup from "./userGroup";
|
|
18
18
|
import User from "./user";
|
|
19
19
|
import AppList from "./appList";
|
|
20
|
-
|
|
20
|
+
import VirtualApp from "./virtualApp";
|
|
21
21
|
import Cost from "./cost";
|
|
22
22
|
import WechatBinding from "./wechatBinding";
|
|
23
23
|
var CompanySetting = function CompanySetting(props) {
|
|
24
24
|
var zgText = props.zgText,
|
|
25
25
|
isMarsUi = props.isMarsUi,
|
|
26
|
+
showVirtualApp = props.showVirtualApp,
|
|
27
|
+
showDataDaily = props.showDataDaily,
|
|
28
|
+
showWeChatMenu = props.showWeChatMenu,
|
|
29
|
+
showMarketMenu = props.showMarketMenu,
|
|
26
30
|
action = props.action,
|
|
27
31
|
settingCallback = props.settingCallback;
|
|
28
32
|
|
|
@@ -30,12 +34,6 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
30
34
|
zgText = '数据分析';
|
|
31
35
|
|
|
32
36
|
// #todo 需要修改主应用传入参数和business-lib数据仓库
|
|
33
|
-
var ready = true;
|
|
34
|
-
var showWeChatMenu = false;
|
|
35
|
-
var showMarketMenu = false;
|
|
36
|
-
var showDataDaily = false;
|
|
37
|
-
var showVirtualApp = false;
|
|
38
|
-
var isAdminUser = false;
|
|
39
37
|
var apisOkNum = 0;
|
|
40
38
|
var _useContext = useContext(BizGlobalDataContext),
|
|
41
39
|
currentApp = _useContext.currentApp;
|
|
@@ -267,6 +265,19 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
267
265
|
});
|
|
268
266
|
});
|
|
269
267
|
};
|
|
268
|
+
var updateUserAuth = function updateUserAuth(params) {
|
|
269
|
+
request(api.setting.updateUserAuth, {
|
|
270
|
+
method: 'post',
|
|
271
|
+
params: params
|
|
272
|
+
}).then(function (res) {
|
|
273
|
+
// if (res.flag === 101) {
|
|
274
|
+
// }
|
|
275
|
+
}).catch(function (err) {
|
|
276
|
+
notification.error({
|
|
277
|
+
message: '信息获取失败'
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
};
|
|
270
281
|
var changeCompanyNameCallback = function changeCompanyNameCallback() {
|
|
271
282
|
// 对外提供的api, 在设置模块-》公司设置-》公司信息,修改应用名称,成功修改时调用
|
|
272
283
|
// 用来处理同步主应用可能需要的刷新的逻辑, 可不传
|
|
@@ -286,6 +297,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
286
297
|
id: id
|
|
287
298
|
});
|
|
288
299
|
// 刷新setting模块内的数据
|
|
300
|
+
updateUserAuth(formData);
|
|
289
301
|
getSettingData();
|
|
290
302
|
|
|
291
303
|
// 与主应用同步信息 下面为老代码逻辑
|
|
@@ -309,6 +321,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
309
321
|
id: id
|
|
310
322
|
});
|
|
311
323
|
// 刷新setting模块内的数据
|
|
324
|
+
updateUserAuth(formData);
|
|
312
325
|
getSettingData();
|
|
313
326
|
|
|
314
327
|
// 与主应用同步信息 下面为老代码逻辑
|
|
@@ -465,6 +478,109 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
465
478
|
// }
|
|
466
479
|
};
|
|
467
480
|
|
|
481
|
+
var createVirtualAppCallback = function createVirtualAppCallback(res, formData) {
|
|
482
|
+
// 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 创建成功时调用
|
|
483
|
+
// 用来处理同步主应用可能需要的刷新的逻辑, 可不传
|
|
484
|
+
settingCallback && settingCallback('settingCreateVirtualAppCallback', {
|
|
485
|
+
res: res,
|
|
486
|
+
formData: formData
|
|
487
|
+
});
|
|
488
|
+
updateUserAuth(formData);
|
|
489
|
+
getSettingData();
|
|
490
|
+
|
|
491
|
+
// 与主应用同步信息 下面为老代码逻辑
|
|
492
|
+
// this.$store.commit(mutations.virtualApp.addVirtualApp, res)
|
|
493
|
+
// // 添加数据权限
|
|
494
|
+
// let authConfig = util.clone(this.currentUser.authConfig)
|
|
495
|
+
// if (
|
|
496
|
+
// !(
|
|
497
|
+
// authConfig.dataAuth.length === 1 &&
|
|
498
|
+
// authConfig.dataAuth[0].appId === 0
|
|
499
|
+
// )
|
|
500
|
+
// ) {
|
|
501
|
+
// authConfig.dataAuth.unshift({
|
|
502
|
+
// appId: res.app_info.id,
|
|
503
|
+
// plats: [0]
|
|
504
|
+
// })
|
|
505
|
+
// }
|
|
506
|
+
// let formData = {
|
|
507
|
+
// userId: this.currentUser.id,
|
|
508
|
+
// authConfig: JSON.stringify(authConfig),
|
|
509
|
+
// groupIds: this.userOfGroups.join(',')
|
|
510
|
+
// }
|
|
511
|
+
// this.$store.dispatch(actions.setting.updateUserAuth, formData)
|
|
512
|
+
// this.$store.dispatch(actions.user.getCurrentUser)
|
|
513
|
+
// // 更新应用列表数据
|
|
514
|
+
// this.$store.dispatch(actions.app.queryAppList)
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
var delVirtualAppCallback = function delVirtualAppCallback(res, formData) {
|
|
518
|
+
console.log('delVirtualAppCallback', res, formData);
|
|
519
|
+
|
|
520
|
+
// 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
|
|
521
|
+
// 用来处理同步主应用可能需要的刷新的逻辑, 可不传
|
|
522
|
+
settingCallback && settingCallback('settingDelVirtualAppCallback', res);
|
|
523
|
+
updateUserAuth(formData);
|
|
524
|
+
getSettingData();
|
|
525
|
+
|
|
526
|
+
// 与主应用同步信息 下面为老代码逻辑
|
|
527
|
+
// this.$store.commit(mutations.virtualApp.delVirtualApp, appId)
|
|
528
|
+
// // 更新数据权限
|
|
529
|
+
// let authConfig = util.clone(this.currentUser.authConfig)
|
|
530
|
+
// if (
|
|
531
|
+
// !(
|
|
532
|
+
// authConfig.dataAuth.length === 1 &&
|
|
533
|
+
// authConfig.dataAuth[0].appId === 0
|
|
534
|
+
// )
|
|
535
|
+
// ) {
|
|
536
|
+
// let index = authConfig.dataAuth.findIndex(
|
|
537
|
+
// item => item.appId === appId
|
|
538
|
+
// )
|
|
539
|
+
// if (index > -1) {
|
|
540
|
+
// authConfig.dataAuth.splice(index, 1)
|
|
541
|
+
// }
|
|
542
|
+
// }
|
|
543
|
+
// if (this.currentApp.id === appId) {
|
|
544
|
+
// let hasAuthApplistToDelAfter = this.hasAuthApplist.filter(
|
|
545
|
+
// item => item.id !== appId
|
|
546
|
+
// )
|
|
547
|
+
// let id = hasAuthApplistToDelAfter.length ? hasAuthApplistToDelAfter[0].id : 0
|
|
548
|
+
// this.$router.push({
|
|
549
|
+
// params: {
|
|
550
|
+
// appId: id
|
|
551
|
+
// }
|
|
552
|
+
// })
|
|
553
|
+
// }
|
|
554
|
+
// let formData = {
|
|
555
|
+
// userId: this.currentUser.userId,
|
|
556
|
+
// authConfig: JSON.stringify(authConfig),
|
|
557
|
+
// groupIds: this.userOfGroups.join(',')
|
|
558
|
+
// }
|
|
559
|
+
// this.$store.dispatch(actions.setting.updateUserAuth, formData)
|
|
560
|
+
// this.$store.dispatch(actions.user.getCurrentUser)
|
|
561
|
+
// // 更新应用列表数据
|
|
562
|
+
// this.$store.dispatch(actions.app.queryAppList)
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
var editVirtualAppCallback = function editVirtualAppCallback(id) {
|
|
566
|
+
// 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
|
|
567
|
+
// 用来处理同步主应用可能需要的刷新的逻辑, 可不传
|
|
568
|
+
// settingUpdateGroupAuthCallback && settingUpdateGroupAuthCallback({isUser});
|
|
569
|
+
settingCallback && settingCallback('settingEditVirtualAppCallback', {
|
|
570
|
+
id: id
|
|
571
|
+
});
|
|
572
|
+
getSettingData();
|
|
573
|
+
|
|
574
|
+
// 与主应用同步信息 下面为老代码逻辑
|
|
575
|
+
// if (this.currentApp && this.currentApp.id === params.app_id) {
|
|
576
|
+
// this.$store.dispatch(actions.biz.sys.queryEventMeta, {
|
|
577
|
+
// appId: this.appId,
|
|
578
|
+
// platform: this.platform,
|
|
579
|
+
// force: true
|
|
580
|
+
// })
|
|
581
|
+
// }
|
|
582
|
+
};
|
|
583
|
+
|
|
468
584
|
var changeTab = function changeTab(tab) {
|
|
469
585
|
setCurrentTab(tab);
|
|
470
586
|
setIsShowCreateApp(false);
|
|
@@ -514,7 +630,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
514
630
|
onClick: function onClick() {
|
|
515
631
|
changeTab('appList');
|
|
516
632
|
}
|
|
517
|
-
}, "\u5E94\u7528")) : null,
|
|
633
|
+
}, "\u5E94\u7528")) : null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
518
634
|
style: currentTab == 'virtualApp' ? {
|
|
519
635
|
fontWeight: 'bold',
|
|
520
636
|
color: '#000'
|
|
@@ -522,7 +638,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
522
638
|
onClick: function onClick() {
|
|
523
639
|
changeTab('virtualApp');
|
|
524
640
|
}
|
|
525
|
-
}, "\u865A\u62DF\u5E94\u7528"))
|
|
641
|
+
}, "\u865A\u62DF\u5E94\u7528")), !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
526
642
|
style: currentTab == 'cost' ? {
|
|
527
643
|
fontWeight: 'bold',
|
|
528
644
|
color: '#000'
|
|
@@ -553,7 +669,6 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
553
669
|
isAdmin: isAdmin,
|
|
554
670
|
delGroupCallback: delGroupCallback,
|
|
555
671
|
updateGroupAuthCallback: updateGroupAuthCallback,
|
|
556
|
-
changeUserAuthCallback: changeUserAuthCallback,
|
|
557
672
|
serviceType: serviceType
|
|
558
673
|
}) : currentTab == 'user' ? /*#__PURE__*/React.createElement(User, {
|
|
559
674
|
id: id,
|
|
@@ -583,16 +698,18 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
583
698
|
createAppCallback: createAppCallback,
|
|
584
699
|
gotoAppSetting: gotoAppSetting,
|
|
585
700
|
gotoAppPanel: gotoAppPanel
|
|
586
|
-
}) :
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
701
|
+
}) : currentTab == 'virtualApp' ? /*#__PURE__*/React.createElement(VirtualApp, {
|
|
702
|
+
companyId: companyId,
|
|
703
|
+
authConfig: authConfig,
|
|
704
|
+
id: id,
|
|
705
|
+
allGroupInfos: allGroupInfos,
|
|
706
|
+
createVirtualAppCallback: createVirtualAppCallback,
|
|
707
|
+
delVirtualAppCallback: delVirtualAppCallback,
|
|
708
|
+
editVirtualAppCallback: editVirtualAppCallback
|
|
709
|
+
}) : currentTab == 'cost' ? /*#__PURE__*/React.createElement(Cost, {
|
|
593
710
|
companyAppList: companyAppList,
|
|
594
711
|
companyId: companyId
|
|
595
|
-
}) : null)) : /*#__PURE__*/React.createElement(PageLoading, {
|
|
712
|
+
}) : currentTab == 'weChatBinding' ? /*#__PURE__*/React.createElement(WechatBinding, null) : null)) : /*#__PURE__*/React.createElement(PageLoading, {
|
|
596
713
|
"v-else": true
|
|
597
714
|
}));
|
|
598
715
|
};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
6
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import "./index.less";
|
|
9
|
-
import { BizSelect } from '@zgfe/business-lib';
|
|
10
15
|
import constants from "./../../../utils/constants";
|
|
11
|
-
import { Button, Input, notification } from 'antd';
|
|
16
|
+
import { Button, Input, notification, Select } from 'antd';
|
|
12
17
|
import request from "./../../../utils/ajax";
|
|
13
18
|
import apis from "./../../../constants/api";
|
|
14
19
|
|
|
@@ -20,6 +25,12 @@ var UserGroup = function UserGroup(props) {
|
|
|
20
25
|
var allGroupInfos = props.allGroupInfos,
|
|
21
26
|
showPwdPanel = props.showPwdPanel,
|
|
22
27
|
createMembersCallback = props.createMembersCallback;
|
|
28
|
+
var dealAllGroupInfos = allGroupInfos.map(function (item) {
|
|
29
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
30
|
+
value: item.id,
|
|
31
|
+
label: item.groupName
|
|
32
|
+
});
|
|
33
|
+
});
|
|
23
34
|
var _useState = useState(''),
|
|
24
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
36
|
inviteVal = _useState2[0],
|
|
@@ -144,21 +155,36 @@ var UserGroup = function UserGroup(props) {
|
|
|
144
155
|
width: 200,
|
|
145
156
|
marginRight: 10
|
|
146
157
|
}
|
|
147
|
-
}, /*#__PURE__*/React.createElement(
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
148
159
|
placeholder: "\u9009\u62E9\u52A0\u5165\u7528\u6237\u7EC4",
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
style: {
|
|
161
|
+
width: 200
|
|
162
|
+
},
|
|
163
|
+
options: dealAllGroupInfos,
|
|
151
164
|
value: targetGroup,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
showArrow: true,
|
|
166
|
+
showSearch: true,
|
|
167
|
+
mode: "multiple",
|
|
168
|
+
onChange: function onChange(v, option) {
|
|
169
|
+
setTargetGroup(option);
|
|
170
|
+
},
|
|
171
|
+
maxTagCount: 1,
|
|
172
|
+
dropdownRender: function dropdownRender(menu) {
|
|
173
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
id: "ant-select"
|
|
175
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: "select-group"
|
|
177
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
178
|
+
onClick: function onClick() {
|
|
179
|
+
setTargetGroup(dealAllGroupInfos);
|
|
180
|
+
},
|
|
181
|
+
className: "all-btn"
|
|
182
|
+
}, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", {
|
|
183
|
+
onClick: function onClick() {
|
|
184
|
+
setTargetGroup([]);
|
|
185
|
+
},
|
|
186
|
+
className: "delete-btn"
|
|
187
|
+
}, "\u6E05\u7A7A")), menu);
|
|
162
188
|
}
|
|
163
189
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
164
190
|
onClick: inviteMember,
|
|
@@ -21,8 +21,7 @@ var UserGroup = function UserGroup(props) {
|
|
|
21
21
|
isAdmin = props.isAdmin,
|
|
22
22
|
serviceType = props.serviceType,
|
|
23
23
|
delGroupCallback = props.delGroupCallback,
|
|
24
|
-
updateGroupAuthCallback = props.updateGroupAuthCallback
|
|
25
|
-
changeUserAuthCallback = props.changeUserAuthCallback;
|
|
24
|
+
updateGroupAuthCallback = props.updateGroupAuthCallback;
|
|
26
25
|
var _useContext = useContext(BizGlobalDataContext),
|
|
27
26
|
currentApp = _useContext.currentApp,
|
|
28
27
|
currentUser = _useContext.currentUser,
|
|
@@ -107,8 +106,7 @@ var UserGroup = function UserGroup(props) {
|
|
|
107
106
|
},
|
|
108
107
|
updateGroupAuthCallback: updateGroupAuthCallback,
|
|
109
108
|
allGroupInfos: allGroupInfos,
|
|
110
|
-
serviceType: serviceType
|
|
111
|
-
changeUserAuthCallback: changeUserAuthCallback
|
|
109
|
+
serviceType: serviceType
|
|
112
110
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
113
111
|
className: "group-model-content"
|
|
114
112
|
}, /*#__PURE__*/React.createElement("div", {
|