@zgfe/modules-settings 1.0.1-a.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/{dist/esm → es}/components/pageLoading/index.d.ts +1 -0
  2. package/{dist/esm → es}/components/pageLoading/index.js +2 -2
  3. package/es/components/pageLoading/index.less +7 -0
  4. package/es/components/settingTabs/demo/index.d.ts +3 -0
  5. package/es/components/settingTabs/demo/index.js +20 -0
  6. package/{dist/esm → es}/components/settingTabs/index.d.ts +4 -5
  7. package/{dist/esm → es}/components/settingTabs/index.js +61 -10
  8. package/{dist/esm → es}/components/settingTabs/index.less +16 -7
  9. package/es/components/settingTabs/types.d.ts +7 -0
  10. package/es/components/settingTabs/types.js +1 -0
  11. package/{dist/esm → es}/constants/api.d.ts +3 -0
  12. package/{dist/esm → es}/constants/api.js +4 -3
  13. package/{dist/esm → es}/constants/icons/iconfont.css +0 -7
  14. package/{dist/esm → es}/constants/icons/iconfont.js +0 -0
  15. package/es/index.js +4 -0
  16. package/{dist/esm → es}/modules/appSettings/appInfo/index.js +41 -23
  17. package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.js +8 -9
  18. package/es/modules/appSettings/index.js +52 -0
  19. package/{dist/esm → es}/modules/appSettings/member/index.js +44 -54
  20. package/{dist/esm → es}/modules/appSettings/virtualSource/index.js +30 -36
  21. package/{dist/esm → es}/modules/appSettings/virtualSource/styles/table.less +1 -1
  22. package/es/modules/companySetting/appList/index.d.ts +21 -0
  23. package/{dist/esm → es}/modules/companySetting/appList/index.js +40 -31
  24. package/{dist/esm → es}/modules/companySetting/appList/index.less +1 -8
  25. package/es/modules/companySetting/cost/index.d.ts +9 -0
  26. package/{dist/esm → es}/modules/companySetting/cost/index.js +6 -6
  27. package/{dist/esm → es}/modules/companySetting/cost/index.less +1 -1
  28. package/es/modules/companySetting/cost/types.d.ts +63 -0
  29. package/es/modules/companySetting/cost/types.js +1 -0
  30. package/es/modules/companySetting/edit/authConfig.d.ts +11 -0
  31. package/{dist/esm → es}/modules/companySetting/edit/authConfig.js +15 -14
  32. package/{dist/esm → es}/modules/companySetting/edit/authConfigCEP.d.ts +3 -5
  33. package/{dist/esm → es}/modules/companySetting/edit/authConfigCEP.js +18 -68
  34. package/{dist/esm → es}/modules/companySetting/edit/authGroup.d.ts +2 -1
  35. package/{dist/esm → es}/modules/companySetting/edit/authGroup.js +9 -10
  36. package/es/modules/companySetting/edit/authModule.d.ts +8 -0
  37. package/{dist/esm → es}/modules/companySetting/edit/authModule.js +12 -18
  38. package/{dist/esm → es}/modules/companySetting/edit/multiAuthModule.d.ts +3 -2
  39. package/{dist/esm → es}/modules/companySetting/edit/multiAuthModule.js +9 -17
  40. package/es/modules/companySetting/edit/user.d.ts +15 -0
  41. package/{dist/esm → es}/modules/companySetting/edit/user.js +60 -53
  42. package/es/modules/companySetting/edit/userGroup.d.ts +16 -0
  43. package/{dist/esm → es}/modules/companySetting/edit/userGroup.js +76 -71
  44. package/es/modules/companySetting/index.d.ts +11 -0
  45. package/es/modules/companySetting/index.js +740 -0
  46. package/{dist/esm → es}/modules/companySetting/info/index.d.ts +3 -3
  47. package/{dist/esm → es}/modules/companySetting/info/index.js +8 -5
  48. package/{dist/esm → es}/modules/companySetting/info/index.less +1 -1
  49. package/{dist/esm → es}/modules/companySetting/style/common.less +3 -3
  50. package/es/modules/companySetting/style/reset.less +117 -0
  51. package/es/modules/companySetting/user/index.d.ts +21 -0
  52. package/{dist/esm → es}/modules/companySetting/user/index.js +62 -64
  53. package/{dist/esm → es}/modules/companySetting/user/index.less +8 -8
  54. package/es/modules/companySetting/user/invite.d.ts +15 -0
  55. package/{dist/esm → es}/modules/companySetting/user/invite.js +8 -12
  56. package/es/modules/companySetting/userGroup/authConfigDetail.d.ts +15 -0
  57. package/{dist/esm → es}/modules/companySetting/userGroup/authConfigDetail.js +62 -82
  58. package/es/modules/companySetting/userGroup/groupItem.d.ts +13 -0
  59. package/{dist/esm → es}/modules/companySetting/userGroup/groupItem.js +11 -11
  60. package/es/modules/companySetting/userGroup/index.d.ts +15 -0
  61. package/{dist/esm → es}/modules/companySetting/userGroup/index.js +9 -8
  62. package/{dist/esm → es}/modules/companySetting/userGroup/style/index.less +1 -1
  63. package/es/modules/companySetting/virtualApp/config.d.ts +12 -0
  64. package/{dist/esm → es}/modules/companySetting/virtualApp/config.js +7 -7
  65. package/es/modules/companySetting/virtualApp/index.d.ts +15 -0
  66. package/{dist/esm → es}/modules/companySetting/virtualApp/index.js +12 -14
  67. package/es/modules/companySetting/virtualApp/panels/list.d.ts +15 -0
  68. package/{dist/esm → es}/modules/companySetting/virtualApp/panels/list.js +10 -10
  69. package/es/modules/companySetting/virtualApp/panels/sourceItem.d.ts +10 -0
  70. package/{dist/esm → es}/modules/companySetting/virtualApp/panels/sourceItem.js +4 -6
  71. package/{dist/esm → es}/modules/companySetting/virtualApp/styles/config.less +2 -1
  72. package/{dist/esm → es}/modules/companySetting/virtualApp/styles/index.less +1 -1
  73. package/{dist/esm → es}/modules/companySetting/virtualApp/styles/table.less +1 -1
  74. package/{dist/esm → es}/modules/companySetting/wechatBinding/index.js +11 -11
  75. package/{dist/esm → es}/modules/companySetting/wechatBinding/index.less +1 -1
  76. package/es/modules/personalSetting/images/banner.png +0 -0
  77. package/es/modules/personalSetting/images/unbinding.png +0 -0
  78. package/{dist/esm → es}/modules/personalSetting/index.d.ts +0 -1
  79. package/es/modules/personalSetting/index.js +40 -0
  80. package/{dist/esm → es}/modules/personalSetting/info/index.js +10 -10
  81. package/{dist/esm → es}/modules/personalSetting/reset/index.js +39 -39
  82. package/es/modules/personalSetting/styles/unbinding.less +73 -0
  83. package/es/modules/personalSetting/unbinding/index.d.ts +4 -0
  84. package/es/modules/personalSetting/unbinding/index.js +104 -0
  85. package/{dist/esm → es}/modules/systemSetting/index.d.ts +0 -1
  86. package/{dist/esm → es}/modules/systemSetting/index.js +8 -4
  87. package/es/modules/systemSetting/notice/configItem/index.d.ts +8 -0
  88. package/{dist/esm → es}/modules/systemSetting/notice/configItem/index.js +5 -5
  89. package/{dist/esm → es}/modules/systemSetting/notice/edit/index.d.ts +2 -8
  90. package/{dist/esm → es}/modules/systemSetting/notice/edit/index.js +2 -3
  91. package/{dist/esm → es}/modules/systemSetting/notice/index.d.ts +1 -1
  92. package/{dist/esm → es}/modules/systemSetting/notice/index.js +12 -11
  93. package/es/types/app.d.ts +140 -0
  94. package/es/types/app.js +1 -0
  95. package/es/types/companySetting.d.ts +199 -0
  96. package/es/types/companySetting.js +1 -0
  97. package/es/types/index.d.ts +4 -0
  98. package/es/types/index.js +4 -0
  99. package/es/types/personal.d.ts +21 -0
  100. package/es/types/personal.js +1 -0
  101. package/es/types/system.d.ts +38 -0
  102. package/es/types/system.js +1 -0
  103. package/{dist/esm → es}/utils/constants.js +0 -64
  104. package/{dist/esm → es}/utils/functionalPermissions.js +0 -1
  105. package/package.json +6 -6
  106. package/dist/esm/components/pageLoading/index.less +0 -11
  107. package/dist/esm/constants/styles/base.sass +0 -9
  108. package/dist/esm/constants/styles/cleverUI.css +0 -7
  109. package/dist/esm/constants/styles/constants.sass +0 -60
  110. package/dist/esm/constants/styles/customUITheme.sass +0 -54
  111. package/dist/esm/constants/styles/reset.sass +0 -61
  112. package/dist/esm/index.js +0 -4
  113. package/dist/esm/modules/appSettings/demo/index.d.ts +0 -3
  114. package/dist/esm/modules/appSettings/demo/index.js +0 -6
  115. package/dist/esm/modules/appSettings/index.js +0 -87
  116. package/dist/esm/modules/appSettings/index.less +0 -21
  117. package/dist/esm/modules/companySetting/appList/index.d.ts +0 -21
  118. package/dist/esm/modules/companySetting/cost/index.d.ts +0 -8
  119. package/dist/esm/modules/companySetting/edit/authConfig.d.ts +0 -10
  120. package/dist/esm/modules/companySetting/edit/authModule.d.ts +0 -7
  121. package/dist/esm/modules/companySetting/edit/user.d.ts +0 -14
  122. package/dist/esm/modules/companySetting/edit/userGroup.d.ts +0 -15
  123. package/dist/esm/modules/companySetting/index.d.ts +0 -14
  124. package/dist/esm/modules/companySetting/index.js +0 -718
  125. package/dist/esm/modules/companySetting/user/index.d.ts +0 -19
  126. package/dist/esm/modules/companySetting/user/invite.d.ts +0 -10
  127. package/dist/esm/modules/companySetting/userGroup/authConfigDetail.d.ts +0 -16
  128. package/dist/esm/modules/companySetting/userGroup/groupItem.d.ts +0 -11
  129. package/dist/esm/modules/companySetting/userGroup/index.d.ts +0 -14
  130. package/dist/esm/modules/companySetting/virtualApp/config.d.ts +0 -11
  131. package/dist/esm/modules/companySetting/virtualApp/index.d.ts +0 -12
  132. package/dist/esm/modules/companySetting/virtualApp/panels/list.d.ts +0 -12
  133. package/dist/esm/modules/companySetting/virtualApp/panels/sourceItem.d.ts +0 -10
  134. package/dist/esm/modules/personalSetting/index.js +0 -62
  135. package/dist/esm/modules/personalSetting/index.less +0 -2
  136. package/dist/esm/modules/systemSetting/index.less +0 -2
  137. package/dist/esm/modules/systemSetting/notice/configItem/index.d.ts +0 -7
  138. /package/{dist/esm → es}/components/demo.d.ts +0 -0
  139. /package/{dist/esm → es}/components/demo.js +0 -0
  140. /package/{dist/esm → es}/constants/icons/demo.css +0 -0
  141. /package/{dist/esm → es}/constants/icons/demo_index.html +0 -0
  142. /package/{dist/esm → es}/constants/icons/iconfont.json +0 -0
  143. /package/{dist/esm → es}/constants/icons/iconfont.ttf +0 -0
  144. /package/{dist/esm → es}/constants/icons/iconfont.woff +0 -0
  145. /package/{dist/esm → es}/constants/icons/iconfont.woff2 +0 -0
  146. /package/{dist/esm → es}/global.d.ts +0 -0
  147. /package/{dist/esm → es}/index.d.ts +0 -0
  148. /package/{dist/esm → es}/modules/appSettings/appInfo/index.d.ts +0 -0
  149. /package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.d.ts +0 -0
  150. /package/{dist/esm → es}/modules/appSettings/dataAccessFilter/index.less +0 -0
  151. /package/{dist/esm → es}/modules/appSettings/index.d.ts +0 -0
  152. /package/{dist/esm → es}/modules/appSettings/member/index.d.ts +0 -0
  153. /package/{dist/esm → es}/modules/appSettings/secretKey/index.d.ts +0 -0
  154. /package/{dist/esm → es}/modules/appSettings/secretKey/index.js +0 -0
  155. /package/{dist/esm → es}/modules/appSettings/virtualSource/index.d.ts +0 -0
  156. /package/{dist/esm → es}/modules/appSettings/virtualSource/styles/index.less +0 -0
  157. /package/{dist/esm → es}/modules/companySetting/edit/styles/authConfig.less +0 -0
  158. /package/{dist/esm → es}/modules/companySetting/edit/styles/authGroup.less +0 -0
  159. /package/{dist/esm → es}/modules/companySetting/edit/styles/authModule.less +0 -0
  160. /package/{dist/esm → es}/modules/companySetting/edit/styles/user.less +0 -0
  161. /package/{dist/esm → es}/modules/companySetting/edit/styles/userGroup.less +0 -0
  162. /package/{dist/esm → es}/modules/companySetting/index.less +0 -0
  163. /package/{dist/esm → es}/modules/companySetting/userGroup/index.less +0 -0
  164. /package/{dist/esm → es}/modules/companySetting/userGroup/style/authConfigDetail.less +0 -0
  165. /package/{dist/esm → es}/modules/companySetting/virtualApp/styles/list.less +0 -0
  166. /package/{dist/esm → es}/modules/companySetting/virtualApp/styles/sourceItem.less +0 -0
  167. /package/{dist/esm → es}/modules/companySetting/wechatBinding/index.d.ts +0 -0
  168. /package/{dist/esm → es}/modules/personalSetting/info/index.d.ts +0 -0
  169. /package/{dist/esm → es}/modules/personalSetting/reset/index.d.ts +0 -0
  170. /package/{dist/esm → es}/modules/systemSetting/notice/configItem/index.less +0 -0
  171. /package/{dist/esm → es}/modules/systemSetting/notice/edit/index.less +0 -0
  172. /package/{dist/esm → es}/utils/ajax.d.ts +0 -0
  173. /package/{dist/esm → es}/utils/ajax.js +0 -0
  174. /package/{dist/esm → es}/utils/base64.d.ts +0 -0
  175. /package/{dist/esm → es}/utils/base64.js +0 -0
  176. /package/{dist/esm → es}/utils/constants.d.ts +0 -0
  177. /package/{dist/esm → es}/utils/functionalPermissions.d.ts +0 -0
  178. /package/{dist/esm → es}/utils/util.d.ts +0 -0
  179. /package/{dist/esm → es}/utils/util.js +0 -0
@@ -1,718 +0,0 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
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; }
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; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import React, { useContext, useEffect, useState } from 'react';
9
- import "./index.less";
10
- import { BizGlobalDataContext } from '@zgfe/business-lib';
11
- import request from "./../../utils/ajax";
12
- import util from "./../../utils/util";
13
- import api from "./../../constants/api";
14
- import PageLoading from "../../components/pageLoading";
15
- import { notification } from 'antd';
16
- import Info from "./info";
17
- import UserGroup from "./userGroup";
18
- import User from "./user";
19
- import AppList from "./appList";
20
- import VirtualApp from "./virtualApp";
21
- import Cost from "./cost";
22
- import WechatBinding from "./wechatBinding";
23
- var CompanySetting = function CompanySetting(props) {
24
- var zgText = props.zgText,
25
- isMarsUi = props.isMarsUi,
26
- showVirtualApp = props.showVirtualApp,
27
- showDataDaily = props.showDataDaily,
28
- showWeChatMenu = props.showWeChatMenu,
29
- showMarketMenu = props.showMarketMenu,
30
- ENVIRONMENT = props.ENVIRONMENT,
31
- action = props.action,
32
- settingCallback = props.settingCallback;
33
-
34
- // #todo 需要修改主应用传入参数和business-lib数据仓库
35
- var apisOkNum = 0;
36
- var _useContext = useContext(BizGlobalDataContext),
37
- currentApp = _useContext.currentApp;
38
- var _useState = useState('info'),
39
- _useState2 = _slicedToArray(_useState, 2),
40
- currentTab = _useState2[0],
41
- setCurrentTab = _useState2[1];
42
- // getCurrentUser
43
- var _useState3 = useState({}),
44
- _useState4 = _slicedToArray(_useState3, 2),
45
- settingCurrentUser = _useState4[0],
46
- setSettingCurrentUser = _useState4[1];
47
- var _useState5 = useState([]),
48
- _useState6 = _slicedToArray(_useState5, 2),
49
- dataAuth = _useState6[0],
50
- setDataAuth = _useState6[1];
51
- var _useState7 = useState(Boolean),
52
- _useState8 = _slicedToArray(_useState7, 2),
53
- isAdmin = _useState8[0],
54
- setIsAdmin = _useState8[1];
55
- var _useState9 = useState(Boolean),
56
- _useState10 = _slicedToArray(_useState9, 2),
57
- isDemoAccount = _useState10[0],
58
- setIsDemoAccount = _useState10[1];
59
- var _useState11 = useState({
60
- dataAuth: []
61
- }),
62
- _useState12 = _slicedToArray(_useState11, 2),
63
- authConfig = _useState12[0],
64
- setAuthConfig = _useState12[1];
65
- var _useState13 = useState(Number),
66
- _useState14 = _slicedToArray(_useState13, 2),
67
- id = _useState14[0],
68
- setId = _useState14[1];
69
- var _useState15 = useState(''),
70
- _useState16 = _slicedToArray(_useState15, 2),
71
- companyName = _useState16[0],
72
- setCompanyName = _useState16[1];
73
- var _useState17 = useState(Number),
74
- _useState18 = _slicedToArray(_useState17, 2),
75
- companyId = _useState18[0],
76
- setCompanyId = _useState18[1];
77
- // groupInfos
78
- var _useState19 = useState([]),
79
- _useState20 = _slicedToArray(_useState19, 2),
80
- allGroupInfos = _useState20[0],
81
- setAllGroupInfos = _useState20[1];
82
- var _useState21 = useState({}),
83
- _useState22 = _slicedToArray(_useState21, 2),
84
- groupHashList = _useState22[0],
85
- setGroupHashList = _useState22[1];
86
- // queryAppList
87
- // companyAppList:公司内所有应用,包括无权限的应用(普通应用、虚拟应用)
88
- // appList: 当前用户有权限的应用(普通应用、虚拟应用)
89
- var _useState23 = useState([]),
90
- _useState24 = _slicedToArray(_useState23, 2),
91
- companyAppList = _useState24[0],
92
- setCompanyAppList = _useState24[1];
93
- var _useState25 = useState([]),
94
- _useState26 = _slicedToArray(_useState25, 2),
95
- appList = _useState26[0],
96
- setAppList = _useState26[1];
97
- var _useState27 = useState([]),
98
- _useState28 = _slicedToArray(_useState27, 2),
99
- companyRealAppList = _useState28[0],
100
- setCompanyRealAppList = _useState28[1];
101
- // queryLeftMenus
102
- var _useState29 = useState([]),
103
- _useState30 = _slicedToArray(_useState29, 2),
104
- leftMenus = _useState30[0],
105
- setLeftMenus = _useState30[1];
106
- var _useState31 = useState({}),
107
- _useState32 = _slicedToArray(_useState31, 2),
108
- menusNameMap = _useState32[0],
109
- setMenusNameMap = _useState32[1];
110
- var _useState33 = useState(0),
111
- _useState34 = _slicedToArray(_useState33, 2),
112
- serviceType = _useState34[0],
113
- setServiceType = _useState34[1];
114
- var _useState35 = useState(0),
115
- _useState36 = _slicedToArray(_useState35, 2),
116
- pageReady = _useState36[0],
117
- setPageReady = _useState36[1];
118
- var _useState37 = useState(false),
119
- _useState38 = _slicedToArray(_useState37, 2),
120
- isShowCreateApp = _useState38[0],
121
- setIsShowCreateApp = _useState38[1];
122
- useEffect(function () {
123
- getSettingData();
124
- apisOkNum = 0;
125
- }, []);
126
- useEffect(function () {
127
- if (action == 'createApp') {
128
- setCurrentTab('appList');
129
- setIsShowCreateApp(true);
130
- } else {
131
- setCurrentTab('info');
132
- setIsShowCreateApp(false);
133
- }
134
- }, [props.action]);
135
- useEffect(function () {
136
- setCompanyRealAppList(companyAppList.filter(function (app) {
137
- return app.appType === 'real';
138
- }));
139
- }, [appList]);
140
- useEffect(function () {
141
- var list = {};
142
- var _iterator = _createForOfIteratorHelper(allGroupInfos),
143
- _step;
144
- try {
145
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
146
- var item = _step.value;
147
- list[item.id] = {
148
- groupName: item.groupName
149
- };
150
- }
151
- } catch (err) {
152
- _iterator.e(err);
153
- } finally {
154
- _iterator.f();
155
- }
156
- setGroupHashList(list);
157
- }, [allGroupInfos]);
158
- var getSettingData = function getSettingData() {
159
- request(api.user.getCurrentUser, {
160
- method: 'get'
161
- }).then(function (res) {
162
- var data = (res || {}).user || {};
163
- data.isCreator = data.id === data.userId;
164
- data.isDemoAccount = data.email === 'demo@zhugeio.com';
165
- setSettingCurrentUser(data);
166
-
167
- // 给 应用页面 传递的数据
168
- setDataAuth(data.authConfig.dataAuth);
169
- setIsAdmin(data.isAdmin);
170
- setIsDemoAccount(data.isDemoAccount);
171
- setAuthConfig(data.authConfig);
172
- setId(data.id);
173
- setCompanyId(data.companyId);
174
- setCompanyName(data.companyName);
175
- setServiceType(data.serviceType);
176
-
177
- //
178
- request(api.app.queryAppList, {
179
- method: 'get'
180
- }).then(function (res) {
181
- setCompanyAppList(res.applist);
182
- if (settingCurrentUser && authConfig && authConfig.dataAuth) {
183
- var appIds = authConfig.dataAuth.map(function (item) {
184
- return item.appId;
185
- });
186
- if (appIds.includes(0) || isAdmin) {
187
- setAppList(res.applist);
188
- } else {
189
- var result = [];
190
- res.applist.forEach(function (item) {
191
- if (appIds.includes(item.id)) {
192
- result.push(item);
193
- }
194
- });
195
- setAppList(result);
196
- }
197
- } else {
198
- setAppList(res.applist);
199
- }
200
- apisOkNum += 1;
201
- setPageReady(apisOkNum);
202
- }).catch(function (err) {
203
- notification.error({
204
- message: '信息获取失败'
205
- });
206
- });
207
- request(api.app.queryLeftMenus, {
208
- method: 'post',
209
- params: {
210
- app_id: data.id
211
- }
212
- }).then(function (res) {
213
- var menus = res.leftMenus || [];
214
- var menusNameMap = {};
215
- var formatMenus = function formatMenus(menus) {
216
- menus.forEach(function (item) {
217
- item.routeName = util.getMenuRouterByName(item.name);
218
- menusNameMap[item.name] = item;
219
- if (item.childrens) {
220
- formatMenus(item.childrens);
221
- }
222
- });
223
- };
224
- formatMenus(menus);
225
- setLeftMenus(menus);
226
- setMenusNameMap(menusNameMap);
227
- apisOkNum += 1;
228
- setPageReady(apisOkNum);
229
- }).catch(function (err) {
230
- notification.error({
231
- message: '信息获取失败'
232
- });
233
- });
234
- }).catch(function (err) {
235
- notification.error({
236
- message: '信息获取失败'
237
- });
238
- });
239
- request(api.setting.groupInfos, {
240
- method: 'get'
241
- }).then(function (res) {
242
- if (res.flag === 101) {
243
- setAllGroupInfos(res.infos.reverse());
244
- }
245
- apisOkNum += 1;
246
- setPageReady(apisOkNum);
247
- }).catch(function (err) {
248
- notification.error({
249
- message: '信息获取失败'
250
- });
251
- });
252
- };
253
- var refreshGroupList = function refreshGroupList() {
254
- request(api.setting.groupInfos, {
255
- method: 'get'
256
- }).then(function (res) {
257
- if (res.flag === 101) {
258
- setAllGroupInfos(res.infos.reverse());
259
- }
260
- }).catch(function (err) {
261
- notification.error({
262
- message: '信息获取失败'
263
- });
264
- });
265
- };
266
- var updateUserAuth = function updateUserAuth(params) {
267
- request(api.setting.updateUserAuth, {
268
- method: 'post',
269
- params: params
270
- }).then(function (res) {
271
- // if (res.flag === 101) {
272
- // }
273
- }).catch(function (err) {
274
- notification.error({
275
- message: '信息获取失败'
276
- });
277
- });
278
- };
279
- var changeCompanyNameCallback = function changeCompanyNameCallback() {
280
- // 对外提供的api, 在设置模块-》公司设置-》公司信息,修改应用名称,成功修改时调用
281
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
282
- // settingChangeCompanyNameCallback && settingChangeCompanyNameCallback();
283
- settingCallback && settingCallback('settingChangeCompanyNameCallback');
284
-
285
- // 与主应用同步信息 下面为老代码逻辑
286
- // this.$store.dispatch(actions.user.getCurrentUser)
287
- };
288
-
289
- var delAppCallback = function delAppCallback(formData, id) {
290
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,删除应用功能,成功删除时调用
291
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
292
- // settingDelAppCallback && settingDelAppCallback({formData, id});
293
- settingCallback && settingCallback('settingDelAppCallback', {
294
- formData: formData,
295
- id: id
296
- });
297
- // 刷新setting模块内的数据
298
- updateUserAuth(formData);
299
- getSettingData();
300
-
301
- // 与主应用同步信息 下面为老代码逻辑
302
- // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
303
- // await this.$store.dispatch(actions.user.getCurrentUser)
304
- // if (appId) {
305
- // this.$router.push({ params: { appId: appId } })
306
- // }
307
- // await this.$store.dispatch(actions.app.queryAppList)
308
- // if (callback) {
309
- // callback()
310
- // }
311
- };
312
-
313
- var createAppCallback = function createAppCallback(formData, id) {
314
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,创建应用功能,成功创建时调用
315
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
316
- // settingCreateAppCallback && settingCreateAppCallback({formData, id});
317
- settingCallback && settingCallback('settingCreateAppCallback', {
318
- formData: formData,
319
- id: id
320
- });
321
- // 刷新setting模块内的数据
322
- updateUserAuth(formData);
323
- getSettingData();
324
-
325
- // 与主应用同步信息 下面为老代码逻辑
326
- // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
327
- // await this.$store.dispatch(actions.user.getCurrentUser)
328
- // if (appId) {
329
- // this.$router.push({ params: { appId: appId } })
330
- // }
331
- // await this.$store.dispatch(actions.app.queryAppList)
332
- // if (callback) {
333
- // callback()
334
- // }
335
- };
336
-
337
- var gotoAppSetting = function gotoAppSetting(id) {
338
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,应用设置,点击时调用
339
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
340
- // settingGotoAppSetting && settingGotoAppSetting({id});
341
- settingCallback && settingCallback('settingGotoAppSetting', {
342
- id: id
343
- });
344
-
345
- // 与主应用同步信息 下面为老代码逻辑
346
-
347
- // this.$store.dispatch(actions.app.setCurrentApp, { appId: data.id })
348
- // this.$router.push({
349
- // name: routes.setting.app.index
350
- // })
351
- };
352
-
353
- var gotoAppPanel = function gotoAppPanel(id) {
354
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,应用名称,点击时调用
355
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
356
- // settingGotoAppPanel && settingGotoAppPanel({id});
357
- settingCallback && settingCallback('settingGotoAppPanel', {
358
- id: id
359
- });
360
-
361
- // 与主应用同步信息 下面为老代码逻辑
362
- // this.$store
363
- // .dispatch(actions.app.setCurrentApp, { appId: data.id })
364
- // .then(() => {
365
- // this.$router.push({
366
- // name: 'home'
367
- // })
368
- // })
369
- };
370
-
371
- var removeUserCallback = function removeUserCallback(delIndex) {
372
- // 对外提供的api, 在设置模块-》用户-》成员列表页面删除成员成功时调用
373
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
374
- // settingRemoveUserCallback && settingRemoveUserCallback({id});
375
- settingCallback && settingCallback('settingRemoveUserCallback', {
376
- delIndex: delIndex
377
- });
378
- refreshGroupList();
379
- // 与主应用同步信息 下面为老代码逻辑
380
- // this.$store.commit(mutations.setting.delMember, delIndex)
381
- // if (userData.authConfig.groupIds.length) {
382
- // // 如果成员有权限组 更新权限组接口
383
- // this.$store.dispatch(actions.setting.getGroupInfos, false)
384
- // }
385
- };
386
-
387
- var changeUserAuthCallback = function changeUserAuthCallback(id) {
388
- // 对外提供的api, 在设置模块-》用户-》成员列表页面编辑成员权限成功时调用
389
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
390
- // settingChangeUserAuthCallback && settingChangeUserAuthCallback({id});
391
- settingCallback && settingCallback('settingChangeUserAuthCallback', {
392
- id: id
393
- });
394
- refreshGroupList();
395
- // 与主应用同步信息 下面为老代码逻辑
396
- // let arr = []
397
- // if (this.data && this.data.id === this.currentUser.id) {
398
- // arr.push(
399
- // this.$store.dispatch(actions.user.getCurrentUser).then(() => {
400
- // this.$store.commit(mutations.app.updateAppList, {
401
- // appList: this.appList,
402
- // user: this.currentUser
403
- // })
404
- // })
405
- // )
406
- // }
407
- // Promise.all(arr).then(() => {
408
- // this.$message({
409
- // message: '保存成功',
410
- // type: 'success'
411
- // })
412
- // this.btnLoading = false
413
- // this.onCancel()
414
- // })
415
- };
416
-
417
- var createMembersCallback = function createMembersCallback(res, userConfig) {
418
- // 对外提供的api, 在设置模块-》用户-》成员列表页面 创建成员成功时调用
419
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
420
- // settingCreateMembersCallback && settingCreateMembersCallback(res);
421
- settingCallback && settingCallback('settingCreateMembersCallback', {
422
- popup: res.popup,
423
- userConfig: userConfig
424
- });
425
- refreshGroupList();
426
- // 与主应用同步信息 下面为老代码逻辑
427
- // if (res.popup) {
428
- // this.$store.commit(mutations.setting.addInviteUser, userConfig)
429
- // } else {
430
- // this.$store.dispatch(actions.setting.getGroupMembers, false)
431
- // }
432
- };
433
-
434
- var changeAdminCallback = function changeAdminCallback(res) {
435
- // 对外提供的api, 在设置模块-》用户-》成员列表页面 移交超级管理员成功时调用
436
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
437
- // settingChangeAdminCallback && settingChangeAdminCallback(res);
438
- settingCallback && settingCallback('settingChangeAdminCallback', res);
439
-
440
- // 与主应用同步信息 下面为老代码逻辑
441
- // setTimeout(() => {
442
- // window.location.href = '/'
443
- // }, 400)
444
- };
445
-
446
- var delGroupCallback = function delGroupCallback(id) {
447
- // 对外提供的api, 在设置模块-》用户组-》用户组列表页面 删除用户成功时调用
448
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
449
- // settingDelGroupCallback && settingDelGroupCallback({id});
450
- settingCallback && settingCallback('settingDelGroupCallback', {
451
- id: id
452
- });
453
- refreshGroupList();
454
-
455
- // 与主应用同步信息 下面为老代码逻辑
456
- // this.$store.commit(mutations.setting.delGroup, this.groupData.id)
457
- };
458
-
459
- var updateGroupAuthCallback = function updateGroupAuthCallback(isUser) {
460
- // 对外提供的api, 在设置模块-》用户组-》用户组列表页面 更新用户组权限成功时调用
461
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
462
- // settingUpdateGroupAuthCallback && settingUpdateGroupAuthCallback({isUser});
463
- settingCallback && settingCallback('settingUpdateGroupAuthCallback', {
464
- isUser: isUser
465
- });
466
- refreshGroupList();
467
-
468
- // 与主应用同步信息 下面为老代码逻辑
469
- // if (hasCurrentUser) {
470
- // this.$store.dispatch(actions.user.getCurrentUser).then(() => {
471
- // this.$store.commit(mutations.app.updateAppList, {
472
- // appList: this.appList,
473
- // user: this.currentUser
474
- // })
475
- // })
476
- // }
477
- };
478
-
479
- var createVirtualAppCallback = function createVirtualAppCallback(res, formData) {
480
- // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 创建成功时调用
481
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
482
- settingCallback && settingCallback('settingCreateVirtualAppCallback', {
483
- res: res,
484
- formData: formData
485
- });
486
- updateUserAuth(formData);
487
- getSettingData();
488
-
489
- // 与主应用同步信息 下面为老代码逻辑
490
- // this.$store.commit(mutations.virtualApp.addVirtualApp, res)
491
- // // 添加数据权限
492
- // let authConfig = util.clone(this.currentUser.authConfig)
493
- // if (
494
- // !(
495
- // authConfig.dataAuth.length === 1 &&
496
- // authConfig.dataAuth[0].appId === 0
497
- // )
498
- // ) {
499
- // authConfig.dataAuth.unshift({
500
- // appId: res.app_info.id,
501
- // plats: [0]
502
- // })
503
- // }
504
- // let formData = {
505
- // userId: this.currentUser.id,
506
- // authConfig: JSON.stringify(authConfig),
507
- // groupIds: this.userOfGroups.join(',')
508
- // }
509
- // this.$store.dispatch(actions.setting.updateUserAuth, formData)
510
- // this.$store.dispatch(actions.user.getCurrentUser)
511
- // // 更新应用列表数据
512
- // this.$store.dispatch(actions.app.queryAppList)
513
- };
514
-
515
- var delVirtualAppCallback = function delVirtualAppCallback(res, formData) {
516
- console.log('delVirtualAppCallback', res, formData);
517
-
518
- // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
519
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
520
- settingCallback && settingCallback('settingDelVirtualAppCallback', res);
521
- updateUserAuth(formData);
522
- getSettingData();
523
-
524
- // 与主应用同步信息 下面为老代码逻辑
525
- // this.$store.commit(mutations.virtualApp.delVirtualApp, appId)
526
- // // 更新数据权限
527
- // let authConfig = util.clone(this.currentUser.authConfig)
528
- // if (
529
- // !(
530
- // authConfig.dataAuth.length === 1 &&
531
- // authConfig.dataAuth[0].appId === 0
532
- // )
533
- // ) {
534
- // let index = authConfig.dataAuth.findIndex(
535
- // item => item.appId === appId
536
- // )
537
- // if (index > -1) {
538
- // authConfig.dataAuth.splice(index, 1)
539
- // }
540
- // }
541
- // if (this.currentApp.id === appId) {
542
- // let hasAuthApplistToDelAfter = this.hasAuthApplist.filter(
543
- // item => item.id !== appId
544
- // )
545
- // let id = hasAuthApplistToDelAfter.length ? hasAuthApplistToDelAfter[0].id : 0
546
- // this.$router.push({
547
- // params: {
548
- // appId: id
549
- // }
550
- // })
551
- // }
552
- // let formData = {
553
- // userId: this.currentUser.userId,
554
- // authConfig: JSON.stringify(authConfig),
555
- // groupIds: this.userOfGroups.join(',')
556
- // }
557
- // this.$store.dispatch(actions.setting.updateUserAuth, formData)
558
- // this.$store.dispatch(actions.user.getCurrentUser)
559
- // // 更新应用列表数据
560
- // this.$store.dispatch(actions.app.queryAppList)
561
- };
562
-
563
- var editVirtualAppCallback = function editVirtualAppCallback(id) {
564
- // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
565
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
566
- // settingUpdateGroupAuthCallback && settingUpdateGroupAuthCallback({isUser});
567
- settingCallback && settingCallback('settingEditVirtualAppCallback', {
568
- id: id
569
- });
570
- getSettingData();
571
-
572
- // 与主应用同步信息 下面为老代码逻辑
573
- // if (this.currentApp && this.currentApp.id === params.app_id) {
574
- // this.$store.dispatch(actions.biz.sys.queryEventMeta, {
575
- // appId: this.appId,
576
- // platform: this.platform,
577
- // force: true
578
- // })
579
- // }
580
- };
581
-
582
- var changeTab = function changeTab(tab) {
583
- setCurrentTab(tab);
584
- setIsShowCreateApp(false);
585
- };
586
- return /*#__PURE__*/React.createElement("div", {
587
- className: "setting setting-content company-setting"
588
- }, /*#__PURE__*/React.createElement("div", {
589
- className: "setting-title"
590
- }, /*#__PURE__*/React.createElement("span", {
591
- className: "setting-icon icon-company"
592
- }), /*#__PURE__*/React.createElement("label", null, "\u516C\u53F8\u8BBE\u7F6E")), pageReady >= 3 ? /*#__PURE__*/React.createElement("div", {
593
- className: "setting-body"
594
- }, /*#__PURE__*/React.createElement("div", {
595
- className: "setting-nav",
596
- "v-if": "!hideAllMenus"
597
- }, /*#__PURE__*/React.createElement("ul", {
598
- className: "setting-tab"
599
- }, !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
600
- style: currentTab == 'info' ? {
601
- fontWeight: 'bold',
602
- color: '#000'
603
- } : {},
604
- onClick: function onClick() {
605
- changeTab('info');
606
- }
607
- }, "\u516C\u53F8\u4FE1\u606F")) : null, !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
608
- style: currentTab == 'userGroup' ? {
609
- fontWeight: 'bold',
610
- color: '#000'
611
- } : {},
612
- onClick: function onClick() {
613
- changeTab('userGroup');
614
- }
615
- }, "\u7528\u6237\u7EC4")) : null, !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
616
- style: currentTab == 'user' ? {
617
- fontWeight: 'bold',
618
- color: '#000'
619
- } : {},
620
- onClick: function onClick() {
621
- changeTab('user');
622
- }
623
- }, "\u7528\u6237")) : null, !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
624
- style: currentTab == 'appList' ? {
625
- fontWeight: 'bold',
626
- color: '#000'
627
- } : {},
628
- onClick: function onClick() {
629
- changeTab('appList');
630
- }
631
- }, "\u5E94\u7528")) : null, showVirtualApp && !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
632
- style: currentTab == 'virtualApp' ? {
633
- fontWeight: 'bold',
634
- color: '#000'
635
- } : {},
636
- onClick: function onClick() {
637
- changeTab('virtualApp');
638
- }
639
- }, "\u865A\u62DF\u5E94\u7528")) : null, !isMarsUi ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
640
- style: currentTab == 'cost' ? {
641
- fontWeight: 'bold',
642
- color: '#000'
643
- } : {},
644
- onClick: function onClick() {
645
- changeTab('cost');
646
- }
647
- }, "\u5957\u9910")) : null, showWeChatMenu && showMarketMenu && showDataDaily && isAdmin ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
648
- style: currentTab == 'weChatBinding' ? {
649
- fontWeight: 'bold',
650
- color: '#000'
651
- } : {},
652
- onClick: function onClick() {
653
- changeTab('weChatBinding');
654
- }
655
- }, "\u5FAE\u4FE1\u8D26\u53F7\u7ED1\u5B9A")) : null)), /*#__PURE__*/React.createElement("div", {
656
- className: "setting-component"
657
- }, currentTab == 'info' ? /*#__PURE__*/React.createElement(Info, {
658
- ENVIRONMENT: ENVIRONMENT,
659
- companyId: companyId,
660
- companyName: companyName,
661
- changeCompanyNameCallback: changeCompanyNameCallback
662
- }) : currentTab == 'userGroup' ? /*#__PURE__*/React.createElement(UserGroup, {
663
- id: id,
664
- companyAppList: companyAppList,
665
- allGroupInfos: allGroupInfos,
666
- leftMenus: leftMenus,
667
- isMarsUi: isMarsUi,
668
- isAdmin: isAdmin,
669
- delGroupCallback: delGroupCallback,
670
- updateGroupAuthCallback: updateGroupAuthCallback,
671
- serviceType: serviceType
672
- }) : currentTab == 'user' ? /*#__PURE__*/React.createElement(User, {
673
- ENVIRONMENT: ENVIRONMENT,
674
- settingCurrentUser: settingCurrentUser,
675
- id: id,
676
- groupHashList: groupHashList,
677
- companyAppList: companyAppList,
678
- allGroupInfos: allGroupInfos,
679
- leftMenus: leftMenus,
680
- isMarsUi: isMarsUi,
681
- removeUserCallback: removeUserCallback,
682
- changeUserAuthCallback: changeUserAuthCallback,
683
- createMembersCallback: createMembersCallback,
684
- changeAdminCallback: changeAdminCallback,
685
- isAdmin: isAdmin,
686
- serviceType: serviceType
687
- }) : currentTab == 'appList' ? /*#__PURE__*/React.createElement(AppList, {
688
- dataAuth: dataAuth,
689
- isAdmin: isAdmin,
690
- isDemoAccount: isDemoAccount,
691
- authConfig: authConfig,
692
- id: id,
693
- allGroupInfos: allGroupInfos,
694
- isShowCreateApp: isShowCreateApp,
695
- companyRealAppList: companyRealAppList,
696
- zgText: zgText,
697
- companyId: companyId,
698
- delAppCallback: delAppCallback,
699
- createAppCallback: createAppCallback,
700
- gotoAppSetting: gotoAppSetting,
701
- gotoAppPanel: gotoAppPanel
702
- }) : currentTab == 'virtualApp' ? /*#__PURE__*/React.createElement(VirtualApp, {
703
- companyId: companyId,
704
- authConfig: authConfig,
705
- id: id,
706
- allGroupInfos: allGroupInfos,
707
- createVirtualAppCallback: createVirtualAppCallback,
708
- delVirtualAppCallback: delVirtualAppCallback,
709
- editVirtualAppCallback: editVirtualAppCallback
710
- }) : currentTab == 'cost' ? /*#__PURE__*/React.createElement(Cost, {
711
- ENVIRONMENT: ENVIRONMENT,
712
- companyAppList: companyAppList,
713
- companyId: companyId
714
- }) : currentTab == 'weChatBinding' ? /*#__PURE__*/React.createElement(WechatBinding, null) : null)) : /*#__PURE__*/React.createElement(PageLoading, {
715
- "v-else": true
716
- }));
717
- };
718
- export default CompanySetting;