@zgfe/modules-settings 1.0.1-a.1 → 1.0.1-a.3

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.
Files changed (62) hide show
  1. package/dist/esm/constants/api.d.ts +5 -0
  2. package/dist/esm/constants/api.js +8 -1
  3. package/dist/esm/modules/appSettings/appInfo/index.d.ts +3 -1
  4. package/dist/esm/modules/appSettings/appInfo/index.js +73 -21
  5. package/dist/esm/modules/appSettings/dataAccessFilter/index.d.ts +5 -0
  6. package/dist/esm/modules/appSettings/dataAccessFilter/index.js +108 -19
  7. package/dist/esm/modules/appSettings/dataAccessFilter/index.less +5 -0
  8. package/dist/esm/modules/appSettings/index.d.ts +3 -1
  9. package/dist/esm/modules/appSettings/index.js +5 -2
  10. package/dist/esm/modules/appSettings/member/index.js +199 -11
  11. package/dist/esm/modules/companySetting/appList/index.d.ts +3 -3
  12. package/dist/esm/modules/companySetting/appList/index.js +27 -23
  13. package/dist/esm/modules/companySetting/cost/index.js +6 -14
  14. package/dist/esm/modules/companySetting/edit/authConfig.d.ts +2 -1
  15. package/dist/esm/modules/companySetting/edit/authConfig.js +7 -10
  16. package/dist/esm/modules/companySetting/edit/authConfigCEP.d.ts +2 -1
  17. package/dist/esm/modules/companySetting/edit/authConfigCEP.js +6 -20
  18. package/dist/esm/modules/companySetting/edit/authGroup.js +0 -1
  19. package/dist/esm/modules/companySetting/edit/authModule.d.ts +1 -1
  20. package/dist/esm/modules/companySetting/edit/authModule.js +1 -2
  21. package/dist/esm/modules/companySetting/edit/multiAuthModule.d.ts +1 -1
  22. package/dist/esm/modules/companySetting/edit/multiAuthModule.js +0 -1
  23. package/dist/esm/modules/companySetting/edit/user.d.ts +1 -1
  24. package/dist/esm/modules/companySetting/edit/user.js +42 -5
  25. package/dist/esm/modules/companySetting/edit/userGroup.d.ts +1 -2
  26. package/dist/esm/modules/companySetting/edit/userGroup.js +43 -7
  27. package/dist/esm/modules/companySetting/index.d.ts +6 -15
  28. package/dist/esm/modules/companySetting/index.js +108 -47
  29. package/dist/esm/modules/companySetting/info/index.d.ts +2 -2
  30. package/dist/esm/modules/companySetting/info/index.js +17 -11
  31. package/dist/esm/modules/companySetting/user/index.d.ts +7 -20
  32. package/dist/esm/modules/companySetting/user/index.js +16 -13
  33. package/dist/esm/modules/companySetting/user/invite.js +6 -7
  34. package/dist/esm/modules/companySetting/userGroup/authConfigDetail.d.ts +3 -3
  35. package/dist/esm/modules/companySetting/userGroup/authConfigDetail.js +12 -5
  36. package/dist/esm/modules/companySetting/userGroup/groupItem.d.ts +1 -1
  37. package/dist/esm/modules/companySetting/userGroup/index.d.ts +3 -3
  38. package/dist/esm/modules/companySetting/virtualApp/config.vue +167 -0
  39. package/dist/esm/modules/companySetting/virtualApp/index.d.ts +7 -0
  40. package/dist/esm/modules/companySetting/virtualApp/index.js +57 -0
  41. package/dist/esm/modules/companySetting/virtualApp/panels/list.vue +208 -0
  42. package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.vue +162 -0
  43. package/dist/esm/modules/companySetting/virtualApp/styles/config.sass +28 -0
  44. package/dist/esm/modules/companySetting/virtualApp/styles/index.less +21 -0
  45. package/dist/esm/modules/companySetting/virtualApp/styles/list.sass +21 -0
  46. package/dist/esm/modules/companySetting/virtualApp/styles/sourceItem.sass +21 -0
  47. package/dist/esm/modules/companySetting/virtualApp/styles/table.sass +36 -0
  48. package/dist/esm/modules/companySetting/wechatBinding/index.d.ts +7 -0
  49. package/dist/esm/modules/companySetting/wechatBinding/index.js +130 -0
  50. package/dist/esm/modules/companySetting/wechatBinding/index.less +48 -0
  51. package/dist/esm/modules/personalSetting/index.d.ts +3 -1
  52. package/dist/esm/modules/personalSetting/index.js +9 -4
  53. package/dist/esm/modules/personalSetting/info/index.js +34 -15
  54. package/dist/esm/modules/personalSetting/reset/index.d.ts +3 -1
  55. package/dist/esm/modules/personalSetting/reset/index.js +133 -18
  56. package/dist/esm/utils/ajax.d.ts +2 -0
  57. package/dist/esm/utils/ajax.js +37 -0
  58. package/dist/esm/utils/functionalPermissions.d.ts +2 -382
  59. package/dist/esm/utils/util.d.ts +10 -13
  60. package/dist/esm/utils/util.js +2 -2
  61. package/package.json +1 -1
  62. package/dist/esm/modules/dsfdsf +0 -0
@@ -17,6 +17,7 @@ declare let apis: {
17
17
  removeMember: string;
18
18
  resetpwd: string;
19
19
  updateUserAuth: string;
20
+ delSubscribeUser: string;
20
21
  queryFunConfigList: string;
21
22
  queryAppList: string;
22
23
  queryFunConfigByUserId: string;
@@ -25,8 +26,12 @@ declare let apis: {
25
26
  updateUserAuthCEP: string;
26
27
  updateGroupAuth: string;
27
28
  deleteGroup: string;
29
+ wxSubscribeUserList: string;
28
30
  updateUserInfo: string;
29
31
  resetPassword: string;
32
+ updateAppName: string;
33
+ createFilter: string;
34
+ queryFilter: string;
30
35
  };
31
36
  };
32
37
  export default apis;
@@ -19,6 +19,7 @@ var apis = {
19
19
  removeMember: apiPrefix + '/common/proxy/company/v2deleteUser.jsp',
20
20
  resetpwd: apiPrefix + '/common/proxy/user/resetpwd.jsp',
21
21
  updateUserAuth: apiPrefix + '/common/proxy/auth/updateUserAuth.jsp',
22
+ delSubscribeUser: apiPrefix + '/common/proxy//wx_subscribe/deleteWxUserRelation.jsp',
22
23
  queryFunConfigList: '/cep-console/api/v1/permission/queryFunConfigList',
23
24
  queryAppList: '/cep-console/api/v1/permission/queryAppList',
24
25
  queryFunConfigByUserId: '/cep-console/api/v1/permission/queryFunConfigByUserId',
@@ -27,8 +28,14 @@ var apis = {
27
28
  updateUserAuthCEP: '/cep-console/api/v1/permission/updateUserAuth',
28
29
  updateGroupAuth: apiPrefix + '/common/proxy/auth/updateGroupAuth.jsp',
29
30
  deleteGroup: apiPrefix + '/common/proxy/auth/deleteGroup.jsp',
31
+ wxSubscribeUserList: apiPrefix + '/common/proxy/wx_subscribe/getWxSubscribeUserInfoList.jsp',
32
+ // 个人设置
30
33
  updateUserInfo: apiPrefix + '/common/proxy/user/v2ajaxUpdateUserInfo.jsp',
31
- resetPassword: apiPrefix + '/common/proxy/user/v2ajaxmodifypwd.jsp'
34
+ resetPassword: apiPrefix + '/common/proxy/user/v2ajaxmodifypwd.jsp',
35
+ // 应用设置
36
+ updateAppName: apiPrefix + '/common/proxy/user/updateAppName.jsp',
37
+ createFilter: apiPrefix + '/common/proxy/user/createFilter.jsp',
38
+ queryFilter: apiPrefix + '/common/proxy/user/queryFilter.jsp'
32
39
  }
33
40
  };
34
41
  export default apis;
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const AppInfo: React.FC;
2
+ declare const AppInfo: React.FC<{
3
+ settingsCallback: (type: string) => void;
4
+ }>;
3
5
  export default AppInfo;
@@ -1,24 +1,63 @@
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); }
2
- 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; }
3
- 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; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- 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); }
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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
+ 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
+ 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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ // 缺少环境配置:SHOW_APP_ACCOUNT(备注)
8
+ // 缺少isVirtualApp
7
9
  import React, { useContext } from 'react';
8
- import { Button, Form, Input } from 'antd';
10
+ import { Button, Form, Input, notification } from 'antd';
9
11
  import { BizGlobalDataContext } from '@zgfe/business-lib';
10
- import request from "../../../utils/ajax";
12
+ import { urlRequest } from "../../../utils/ajax";
11
13
  import apis from "../../../constants/api";
12
- // 缺少备注
13
- var AppInfo = function AppInfo() {
14
+ import { useState } from 'react';
15
+ import constants from "../../../utils/constants";
16
+ var AppInfo = function AppInfo(props) {
17
+ var settingsCallback = props.settingsCallback;
14
18
  var _useContext = useContext(BizGlobalDataContext),
15
19
  currentApp = _useContext.currentApp;
20
+ var _useState = useState(false),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ loading = _useState2[0],
23
+ setLoading = _useState2[1];
24
+ var _Form$useForm = Form.useForm(),
25
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
26
+ form = _Form$useForm2[0];
16
27
  var onSubmit = function onSubmit(value) {
17
- request(apis.setting.updateUserInfo, _objectSpread(_objectSpread({}, value), {}, {
18
- email: 'init@zg.com'
19
- })).then(function (res) {}, function (err) {});
28
+ setLoading(true);
29
+ urlRequest(apis.setting.updateAppName, {
30
+ method: 'post',
31
+ data: {
32
+ app_name: value.appName,
33
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
34
+ }
35
+ }).then(function (res) {
36
+ if (res.flag === 101) {
37
+ notification.success({
38
+ message: '更改成功'
39
+ });
40
+ // 主应用更新appList
41
+ settingsCallback('updateAppList');
42
+ } else if (res.flag === -102) {
43
+ notification.error({
44
+ message: '开发者角色无权限修改'
45
+ });
46
+ } else if (res.flag === 202) {
47
+ notification.error({
48
+ message: '应用名称已存在'
49
+ });
50
+ }
51
+ }).catch(function (err) {
52
+ notification.error({
53
+ message: '修改失败,请重试'
54
+ });
55
+ }).finally(function () {
56
+ setLoading(false);
57
+ });
20
58
  };
21
- return /*#__PURE__*/React.createElement(Form, {
59
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
60
+ form: form,
22
61
  layout: "vertical",
23
62
  wrapperCol: {
24
63
  span: 8
@@ -27,19 +66,32 @@ var AppInfo = function AppInfo() {
27
66
  initialValues: currentApp
28
67
  }, /*#__PURE__*/React.createElement(Form.Item, {
29
68
  label: "\u5E94\u7528\u540D\u79F0",
69
+ name: "appName",
30
70
  rules: [{
31
71
  required: true,
32
- message: '请输入姓名'
72
+ message: '请输入应用名称'
73
+ }, {
74
+ pattern: constants.regExp.teamAndAppName,
75
+ message: '请输入1~20位字符'
33
76
  }]
34
77
  }, /*#__PURE__*/React.createElement(Input, {
35
78
  placeholder: "\u59D3\u540D"
36
- })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
37
- type: "primary",
38
- htmlType: "submit"
39
- }, "\u4FDD\u5B58")), /*#__PURE__*/React.createElement(Form.Item, {
79
+ })), /*#__PURE__*/React.createElement(Form.Item, {
80
+ shouldUpdate: true
81
+ }, function () {
82
+ return /*#__PURE__*/React.createElement(Button, {
83
+ type: "primary",
84
+ htmlType: "submit",
85
+ loading: loading,
86
+ disabled: !form.isFieldTouched('appName') || !!form.getFieldsError().filter(function (_ref) {
87
+ var errors = _ref.errors;
88
+ return errors.length;
89
+ }).length
90
+ }, "\u4FDD\u5B58");
91
+ }), /*#__PURE__*/React.createElement(Form.Item, {
40
92
  label: "\u5E94\u7528ID"
41
93
  }, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId), /*#__PURE__*/React.createElement(Form.Item, {
42
- label: "\u90AE\u7BB1"
43
- }, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appKey));
94
+ label: "App Key"
95
+ }, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appKey)));
44
96
  };
45
97
  export default AppInfo;
@@ -1,3 +1,8 @@
1
1
  import React from 'react';
2
+ import './index.less';
3
+ export interface IDataAccessFilter {
4
+ ip: string;
5
+ ua: string;
6
+ }
2
7
  declare const AppDataAccessFilter: React.FC;
3
8
  export default AppDataAccessFilter;
@@ -1,37 +1,126 @@
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); }
2
- 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; }
3
- 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; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- 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
- import React from 'react';
8
- import { Button, Form, Input } from 'antd';
9
- import request from "../../../utils/ajax";
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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
+ 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
+ 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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useEffect, useState } from 'react';
8
+ import { Button, Form, Input, notification } from 'antd';
9
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
10
+ import { urlRequest } from "../../../utils/ajax";
10
11
  import apis from "../../../constants/api";
12
+ import { useContext } from 'react';
11
13
  var TextArea = Input.TextArea;
14
+ import "./index.less";
12
15
  var AppDataAccessFilter = function AppDataAccessFilter() {
16
+ var initialValues = {
17
+ ip: '',
18
+ ua: ''
19
+ };
20
+ var _useContext = useContext(BizGlobalDataContext),
21
+ currentApp = _useContext.currentApp;
22
+ var _Form$useForm = Form.useForm(),
23
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
24
+ form = _Form$useForm2[0];
25
+ var _useState = useState({}),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ forceUpdate = _useState2[1];
28
+ var _useState3 = useState(false),
29
+ _useState4 = _slicedToArray(_useState3, 2),
30
+ loading = _useState4[0],
31
+ setLoading = _useState4[1];
32
+ // 保存
13
33
  var onSubmit = function onSubmit(value) {
14
- request(apis.setting.updateUserInfo, _objectSpread(_objectSpread({}, value), {}, {
15
- email: 'init@zg.com'
16
- })).then(function (res) {}, function (err) {});
34
+ var ip = value.ip,
35
+ ua = value.ua;
36
+ urlRequest(apis.setting.createFilter, {
37
+ method: 'post',
38
+ data: {
39
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
40
+ ip: JSON.stringify(ip === null || ip === void 0 ? void 0 : ip.split('\n')),
41
+ ua: JSON.stringify(ua === null || ua === void 0 ? void 0 : ua.split('\n'))
42
+ }
43
+ }).then(function (res) {
44
+ if (res.code === 10001) {
45
+ notification.success({
46
+ message: '设置成功'
47
+ });
48
+ }
49
+ }).catch(function (err) {
50
+ if (err.__CANCEL__) return;
51
+ notification.error({
52
+ message: '设置失败,请重试!'
53
+ });
54
+ }).finally(function () {
55
+ setLoading(false);
56
+ });
57
+ };
58
+ useEffect(function () {
59
+ forceUpdate({});
60
+ // 获取屏蔽数据
61
+ urlRequest(apis.setting.queryFilter, {
62
+ method: 'post',
63
+ data: {
64
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
65
+ }
66
+ }).then(function (res) {
67
+ if (res.code === 10001) {
68
+ var ip = (res.data_access_filter.ip || []).join('\n');
69
+ var ua = (res.data_access_filter.ua || []).join('\n');
70
+ form.setFields([{
71
+ name: 'ip',
72
+ value: ip,
73
+ touched: false
74
+ }, {
75
+ name: 'ua',
76
+ value: ua,
77
+ touched: false
78
+ }]);
79
+ }
80
+ }).catch(function (err) {});
81
+ }, []);
82
+ // 保存按钮禁用逻辑
83
+ var disableBtn = function disableBtn(form) {
84
+ var value = form.getFieldsValue();
85
+ return !form.isFieldTouched('ip') && !form.isFieldTouched('ua') || !value.ip && !value.ua;
86
+ };
87
+ var ipFormLabel = function ipFormLabel() {
88
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "IP\u9ED1\u540D\u5355"), /*#__PURE__*/React.createElement("span", {
89
+ className: "explain"
90
+ }, "\u51FA\u73B0\u5728\u9ED1\u540D\u5355\u4E2D\u7684\u5BA2\u6237\u7AEFIP\uFF0C\u5176\u4E0A\u4F20\u7684\u6570\u636E\u5C06\u4E0D\u88AB\u91C7\u96C6\u5165\u5E93\u3002IP\u5730\u5740\u4E4B\u95F4\u4EE5\u6362\u884C\u7B26\u5206\u9694\u3002"));
91
+ };
92
+ var uaFormLabel = function uaFormLabel() {
93
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, "UserAgent\u9ED1\u540D\u5355"), /*#__PURE__*/React.createElement("span", {
94
+ className: "explain"
95
+ }, "\u4EC5JS\u7AEF\uFF0C\u5982\u679C\u6D4F\u89C8\u5668\u7684UserAgent\u5305\u542B\u9ED1\u540D\u5355\u4E2D\u7684\u6587\u672C\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09\uFF0C\u5219\u5176\u4E0A\u4F20\u7684\u6570\u636E\u5C06\u4E0D\u88AB\u91C7\u96C6\u5165\u5E93\u3002\u591A\u4E2AUserAgent\u4EE5\u6362\u884C\u7B26\u5206\u9694\u3002"));
17
96
  };
18
97
  return /*#__PURE__*/React.createElement(Form, {
98
+ form: form,
19
99
  layout: "vertical",
20
100
  wrapperCol: {
21
101
  span: 24
22
102
  },
23
- onFinish: onSubmit
103
+ onFinish: onSubmit,
104
+ initialValues: initialValues
24
105
  }, /*#__PURE__*/React.createElement(Form.Item, {
25
- label: "IP\u9ED1\u540D\u5355"
106
+ label: ipFormLabel(),
107
+ name: "ip"
26
108
  }, /*#__PURE__*/React.createElement(TextArea, {
27
109
  rows: 6
28
110
  })), /*#__PURE__*/React.createElement(Form.Item, {
29
- label: "UserAgent\u9ED1\u540D\u5355"
111
+ label: uaFormLabel(),
112
+ name: "ua"
30
113
  }, /*#__PURE__*/React.createElement(TextArea, {
31
114
  rows: 6
32
- })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
33
- type: "primary",
34
- htmlType: "submit"
35
- }, "\u4FDD\u5B58")));
115
+ })), /*#__PURE__*/React.createElement(Form.Item, {
116
+ shouldUpdate: true
117
+ }, function () {
118
+ return /*#__PURE__*/React.createElement(Button, {
119
+ type: "primary",
120
+ htmlType: "submit",
121
+ loading: loading,
122
+ disabled: disableBtn(form)
123
+ }, "\u4FDD\u5B58");
124
+ }));
36
125
  };
37
126
  export default AppDataAccessFilter;
@@ -0,0 +1,5 @@
1
+ .explain {
2
+ margin-left: 12px;
3
+ color: #b2b2b2;
4
+ font-size: 12px;
5
+ }
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const PersonalSetting: React.FC;
2
+ declare const PersonalSetting: React.FC<{
3
+ settingsCallback: (type: string) => void;
4
+ }>;
3
5
  export default PersonalSetting;
@@ -4,13 +4,16 @@ import AppInfo from "./appInfo";
4
4
  import AppMember from "./member";
5
5
  import AppSecretKey from "./secretKey";
6
6
  import AppDataAccessFilter from "./dataAccessFilter";
7
- var PersonalSetting = function PersonalSetting() {
7
+ var PersonalSetting = function PersonalSetting(props) {
8
+ var settingsCallback = props.settingsCallback;
8
9
  return /*#__PURE__*/React.createElement(Tabs, {
9
10
  tabPosition: "left"
10
11
  }, /*#__PURE__*/React.createElement(Tabs.TabPane, {
11
12
  tab: "\u5E94\u7528\u4FE1\u606F",
12
13
  key: "1"
13
- }, /*#__PURE__*/React.createElement(AppInfo, null)), /*#__PURE__*/React.createElement(Tabs.TabPane, {
14
+ }, /*#__PURE__*/React.createElement(AppInfo, {
15
+ settingsCallback: settingsCallback
16
+ })), /*#__PURE__*/React.createElement(Tabs.TabPane, {
14
17
  tab: "\u5E94\u7528\u6210\u5458",
15
18
  key: "2"
16
19
  }, /*#__PURE__*/React.createElement(AppMember, null)), /*#__PURE__*/React.createElement(Tabs.TabPane, {
@@ -1,5 +1,18 @@
1
- import React from 'react';
2
- import { Table } from 'antd';
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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
+ 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
+ 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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ // 缺少成员过滤
8
+ import React, { useEffect, useContext } from 'react';
9
+ import { Table, Popover, Tabs } from 'antd';
10
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
11
+ import request from "../../../utils/ajax";
12
+ import apis from "../../../constants/api";
13
+ import { useState } from 'react';
14
+ import AuthConfigDetail from "../../companySetting/userGroup/authConfigDetail";
15
+ import util from "../../../utils/util";
3
16
  var AppMember = function AppMember() {
4
17
  var columns = [{
5
18
  title: '账号',
@@ -9,21 +22,196 @@ var AppMember = function AppMember() {
9
22
  dataIndex: 'username'
10
23
  }, {
11
24
  title: '用户组',
12
- dataIndex: 'authConfig'
25
+ dataIndex: 'authConfig',
26
+ ellipsis: true,
27
+ render: function render(authConfig) {
28
+ return /*#__PURE__*/React.createElement(Popover, {
29
+ overlayStyle: {
30
+ maxWidth: 255
31
+ },
32
+ content: getGroupName(authConfig)
33
+ }, /*#__PURE__*/React.createElement("span", null, getGroupName(authConfig)));
34
+ }
13
35
  }, {
14
36
  title: '权限',
15
- dataIndex: 'authConfig'
16
- }];
17
- var data = [{
18
- key: 1,
19
- email: '111',
20
- username: '1111',
21
- authConfig: {}
37
+ render: function render(data) {
38
+ var dealArr = data.authConfig.groupIds.map(function (id) {
39
+ return groupInfoMap.get(id);
40
+ });
41
+ return /*#__PURE__*/React.createElement("div", {
42
+ className: "operating"
43
+ }, /*#__PURE__*/React.createElement(Popover, {
44
+ content: function content() {
45
+ return /*#__PURE__*/React.createElement(Tabs, {
46
+ defaultActiveKey: "1"
47
+ }, /*#__PURE__*/React.createElement(Tabs.TabPane, {
48
+ tab: "\u4E2A\u4EBA\u6743\u9650",
49
+ key: "1",
50
+ style: {
51
+ width: 300
52
+ }
53
+ }, /*#__PURE__*/React.createElement(AuthConfigDetail, {
54
+ authConfig: data.authConfig.defaultAuth,
55
+ companyAppList: companyAppList,
56
+ leftMenus: leftMenus,
57
+ isMarsUi: isMarsUi,
58
+ id: data.id,
59
+ type: 1
60
+ })), /*#__PURE__*/React.createElement(Tabs.TabPane, {
61
+ tab: "\u6240\u5C5E\u7528\u6237\u7EC4\u6743\u9650",
62
+ key: "2",
63
+ style: {
64
+ width: 300
65
+ }
66
+ }, /*#__PURE__*/React.createElement("div", {
67
+ className: "group-auth-list"
68
+ }, dealArr.length ? /*#__PURE__*/React.createElement("div", null, dealArr.map(function (item) {
69
+ return (
70
+ /*#__PURE__*/
71
+ // .map((item) => (
72
+ React.createElement(AuthConfigDetail, {
73
+ key: item.id,
74
+ authConfig: item.authConfig,
75
+ leftMenus: leftMenus,
76
+ isMarsUi: isMarsUi,
77
+ companyAppList: companyAppList,
78
+ name: item === null || item === void 0 ? void 0 : item.groupName,
79
+ groupId: item.id,
80
+ type: 2
81
+ })
82
+ // )
83
+ );
84
+ })) : /*#__PURE__*/React.createElement(AuthConfigDetail, {
85
+ authConfig: {
86
+ dataAuth: [],
87
+ funAuth: []
88
+ },
89
+ leftMenus: leftMenus,
90
+ isMarsUi: isMarsUi,
91
+ companyAppList: companyAppList,
92
+ name: '',
93
+ type: 2
94
+ }))));
95
+ },
96
+ style: {
97
+ width: 255
98
+ },
99
+ trigger: "click"
100
+ }, /*#__PURE__*/React.createElement("span", {
101
+ className: "icon-eye"
102
+ }, "\u67E5\u770B")))
103
+ // <Popover overlayStyle={{ maxWidth: 255 }} content="fjkjfksj">
104
+ // <span>查看</span>
105
+ // </Popover>
106
+ ;
107
+ }
22
108
  }];
109
+
110
+ var _useContext = useContext(BizGlobalDataContext),
111
+ currentApp = _useContext.currentApp;
112
+ var _useState = useState([]),
113
+ _useState2 = _slicedToArray(_useState, 2),
114
+ memberList = _useState2[0],
115
+ setMemberList = _useState2[1];
116
+ var _useState3 = useState([]),
117
+ _useState4 = _slicedToArray(_useState3, 2),
118
+ groupInfoList = _useState4[0],
119
+ setGroupInfoList = _useState4[1];
120
+ var _useState5 = useState(new Map()),
121
+ _useState6 = _slicedToArray(_useState5, 2),
122
+ groupInfoMap = _useState6[0],
123
+ setGroupInfoMap = _useState6[1];
124
+ var _useState7 = useState([]),
125
+ _useState8 = _slicedToArray(_useState7, 2),
126
+ companyAppList = _useState8[0],
127
+ setCompanyAppList = _useState8[1];
128
+ var _useState9 = useState([]),
129
+ _useState10 = _slicedToArray(_useState9, 2),
130
+ leftMenus = _useState10[0],
131
+ setLeftMenus = _useState10[1];
132
+ var _useState11 = useState(false),
133
+ _useState12 = _slicedToArray(_useState11, 2),
134
+ isMarsUi = _useState12[0],
135
+ setIsMarsUi = _useState12[1];
136
+ useEffect(function () {
137
+ // 请求用户数据
138
+ request(apis.setting.getGroupMembers, {
139
+ method: 'get'
140
+ }).then(function (res) {
141
+ if (res.flag === 101) {
142
+ var _memberList = res.company_members.map(function (item) {
143
+ item.key = item.id;
144
+ return item;
145
+ });
146
+ setMemberList(_memberList);
147
+ }
148
+ }).catch(function (err) {
149
+ console.log(err);
150
+ });
151
+ // 请求用户组
152
+ request(apis.setting.groupInfos, {
153
+ method: 'get'
154
+ }).then(function (res) {
155
+ if (res.flag === 101) {
156
+ setGroupInfoList(res.infos);
157
+ var _groupInfoMap = new Map();
158
+ res.infos.forEach(function (item) {
159
+ _groupInfoMap.set(item.id, item);
160
+ });
161
+ setGroupInfoMap(_groupInfoMap);
162
+ }
163
+ });
164
+ // 请求应用列表
165
+ request(apis.app.queryAppList, {
166
+ method: 'get'
167
+ }).then(function (res) {
168
+ console.log('res.appList', res.applist);
169
+ setCompanyAppList(res.applist);
170
+ });
171
+ // 请求左侧菜单
172
+ request(apis.app.queryLeftMenus, {
173
+ method: 'post',
174
+ data: {
175
+ app_id: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId) || 99677
176
+ }
177
+ }).then(function (res) {
178
+ var menus = res.leftMenus || [];
179
+ var menusNameMap = {};
180
+ var formatMenus = function formatMenus(menus) {
181
+ menus.forEach(function (item) {
182
+ item.routeName = util.getMenuRouterByName(item.name);
183
+ // menusNameMap[item.name] = item;
184
+ if (item.childrens) {
185
+ formatMenus(item.childrens);
186
+ }
187
+ });
188
+ };
189
+ formatMenus(menus);
190
+ setLeftMenus(menus);
191
+ // setMenusNameMap(menusNameMap);
192
+ }).catch(function (err) {
193
+ // todo ????
194
+ });
195
+ // };
196
+ }, []);
197
+
198
+ // 组装用户组数据
199
+ var getGroupName = function getGroupName(_ref) {
200
+ var groupIds = _ref.groupIds;
201
+ return groupIds === null || groupIds === void 0 ? void 0 : groupIds.map(function (groupId) {
202
+ var _groupInfoMap$get;
203
+ return (_groupInfoMap$get = groupInfoMap.get(groupId)) === null || _groupInfoMap$get === void 0 ? void 0 : _groupInfoMap$get.groupName;
204
+ }).join(',');
205
+ };
206
+ var groupAuthConfig = function groupAuthConfig(ids) {
207
+ return groupInfoList.filter(function (item) {
208
+ return ids.includes(item.id);
209
+ });
210
+ };
23
211
  return /*#__PURE__*/React.createElement(Table, {
24
212
  size: "middle",
25
213
  columns: columns,
26
- dataSource: data
214
+ dataSource: memberList
27
215
  });
28
216
  };
29
217
  export default AppMember;
@@ -8,9 +8,9 @@ declare const appList: React.FC<{
8
8
  isDemoAccount: boolean;
9
9
  authConfig: {};
10
10
  id: number;
11
- allGroupInfos: [];
12
- appList: [];
13
- companyRealAppList: [];
11
+ allGroupInfos: any;
12
+ isShowCreateApp: any;
13
+ companyRealAppList: any;
14
14
  zgText: String;
15
15
  companyId: number;
16
16
  delAppCallback: Function;