@zgfe/modules-settings 1.1.9-alpha.1 → 1.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/demo.d.ts +2 -2
- package/es/components/demo.js +5 -9
- package/es/components/settingTabs/index.less +7 -0
- package/es/constants/icons/demo.css +0 -0
- package/es/constants/icons/demo_index.html +0 -0
- package/es/constants/icons/iconfont.css +0 -0
- package/es/constants/icons/iconfont.js +0 -0
- package/es/constants/icons/iconfont.json +0 -0
- package/es/constants/icons/iconfont.ttf +0 -0
- package/es/constants/icons/iconfont.woff +0 -0
- package/es/constants/icons/iconfont.woff2 +0 -0
- package/es/modules/appSettings/demo/index.d.ts +1 -0
- package/es/modules/appSettings/demo/index.js +12 -0
- package/es/modules/appSettings/member/index.js +34 -62
- package/es/modules/appSettings/member/index.less +18 -0
- package/es/modules/appSettings/member/modal.d.ts +13 -0
- package/es/modules/appSettings/member/modal.js +67 -0
- package/es/modules/companySetting/cost/index.less +0 -0
- package/es/modules/companySetting/edit/authConfig.js +20 -23
- package/es/modules/companySetting/edit/authConfigCEP.js +5 -7
- package/es/modules/companySetting/index.js +3 -3
- package/es/modules/companySetting/user/index.less +1 -2
- package/es/modules/companySetting/userGroup/authConfigDetail.js +2 -5
- package/es/modules/companySetting/wechatBinding/index.less +0 -0
- package/es/utils/functionalPermissions.d.ts +5 -2
- package/es/utils/functionalPermissions.js +4 -7
- package/es/utils/util.js +1 -2
- package/package.json +3 -3
- package/es/modules/companySetting/demo.d.ts +0 -3
- package/es/modules/companySetting/demo.js +0 -21
package/es/components/demo.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import 'antd/dist/antd.less';
|
|
3
3
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
4
4
|
import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
|
|
5
|
-
declare const
|
|
5
|
+
declare const DemoWrapper2: React.FC<{
|
|
6
6
|
children?: any;
|
|
7
7
|
}>;
|
|
8
|
-
export default
|
|
8
|
+
export default DemoWrapper2;
|
package/es/components/demo.js
CHANGED
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import 'antd/dist/antd.less';
|
|
3
3
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
4
4
|
import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
|
|
5
|
-
import {
|
|
5
|
+
import { DemoWrapper } from '@zgfe/business-lib';
|
|
6
6
|
import { ConfigProvider } from 'antd';
|
|
7
7
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
8
|
-
var
|
|
8
|
+
var DemoWrapper2 = function DemoWrapper2(props) {
|
|
9
9
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
10
10
|
locale: zhCN
|
|
11
11
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -14,12 +14,8 @@ var DemoWrapper = function DemoWrapper(props) {
|
|
|
14
14
|
padding: '24px',
|
|
15
15
|
height: 800
|
|
16
16
|
}
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
18
|
-
|
|
19
|
-
currentApp: {
|
|
20
|
-
appId: 184
|
|
21
|
-
}
|
|
22
|
-
}
|
|
17
|
+
}, /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
18
|
+
needMeta: true
|
|
23
19
|
}, props.children)));
|
|
24
20
|
};
|
|
25
|
-
export default
|
|
21
|
+
export default DemoWrapper2;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// import React from 'react';
|
|
4
|
+
// import { AppSettings } from '@zgfe/modules-settings';
|
|
5
|
+
// import DemoWrapper from '../../../components/demo';
|
|
6
|
+
// export default () => {
|
|
7
|
+
// return (
|
|
8
|
+
// <DemoWrapper>
|
|
9
|
+
// <AppSettings />
|
|
10
|
+
// </DemoWrapper>
|
|
11
|
+
// );
|
|
12
|
+
// };
|
|
@@ -5,18 +5,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useEffect, useContext } from 'react';
|
|
8
|
-
import { Table, Popover
|
|
8
|
+
import { Table, Popover } from 'antd';
|
|
9
9
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
10
10
|
import request from '../../../utils/ajax';
|
|
11
11
|
import apis from '../../../constants/api';
|
|
12
12
|
import { useState } from 'react';
|
|
13
|
-
import
|
|
13
|
+
import util from '../../../utils/util';
|
|
14
14
|
import { EyeOutlined } from '@ant-design/icons';
|
|
15
|
+
import SetingModal from './modal';
|
|
15
16
|
var AppMember = function AppMember() {
|
|
16
17
|
var _useContext = useContext(BizGlobalDataContext),
|
|
17
18
|
currentApp = _useContext.currentApp,
|
|
18
|
-
currentUser = _useContext.currentUser
|
|
19
|
-
getMenuRouterByName = _useContext.getMenuRouterByName;
|
|
19
|
+
currentUser = _useContext.currentUser;
|
|
20
20
|
var _useState = useState([]),
|
|
21
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
22
|
memberList = _useState2[0],
|
|
@@ -41,6 +41,21 @@ var AppMember = function AppMember() {
|
|
|
41
41
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
42
42
|
isMarsUi = _useState12[0],
|
|
43
43
|
setIsMarsUi = _useState12[1];
|
|
44
|
+
var _useState13 = useState(false),
|
|
45
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
46
|
+
isModalOpen = _useState14[0],
|
|
47
|
+
setIsModalOpen = _useState14[1];
|
|
48
|
+
var _useState15 = useState({}),
|
|
49
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
50
|
+
modalData = _useState16[0],
|
|
51
|
+
setModalData = _useState16[1];
|
|
52
|
+
var setingModalhandle = function setingModalhandle(data, dealArr) {
|
|
53
|
+
setModalData({
|
|
54
|
+
data: data,
|
|
55
|
+
dealArr: dealArr
|
|
56
|
+
});
|
|
57
|
+
setIsModalOpen(true);
|
|
58
|
+
};
|
|
44
59
|
var columns = [{
|
|
45
60
|
title: '账号',
|
|
46
61
|
dataIndex: 'email'
|
|
@@ -68,61 +83,10 @@ var AppMember = function AppMember() {
|
|
|
68
83
|
});
|
|
69
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
70
85
|
className: "operating"
|
|
71
|
-
}, /*#__PURE__*/React.createElement(
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
76
|
-
tab: "\u4E2A\u4EBA\u6743\u9650",
|
|
77
|
-
key: "1",
|
|
78
|
-
style: {
|
|
79
|
-
width: 300
|
|
80
|
-
}
|
|
81
|
-
}, /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
82
|
-
authConfig: data.authConfig.defaultAuth,
|
|
83
|
-
companyAppList: companyAppList,
|
|
84
|
-
leftMenus: leftMenus,
|
|
85
|
-
isMarsUi: isMarsUi,
|
|
86
|
-
id: data.id,
|
|
87
|
-
type: 1,
|
|
88
|
-
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
89
|
-
})), /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
90
|
-
tab: "\u6240\u5C5E\u7528\u6237\u7EC4\u6743\u9650",
|
|
91
|
-
key: "2",
|
|
92
|
-
style: {
|
|
93
|
-
width: 300
|
|
94
|
-
}
|
|
95
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
96
|
-
className: "group-auth-list"
|
|
97
|
-
}, dealArr.length ? /*#__PURE__*/React.createElement("div", null, dealArr.map(function (item) {
|
|
98
|
-
return /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
99
|
-
key: item.id,
|
|
100
|
-
authConfig: item.authConfig,
|
|
101
|
-
leftMenus: leftMenus,
|
|
102
|
-
isMarsUi: isMarsUi,
|
|
103
|
-
companyAppList: companyAppList,
|
|
104
|
-
name: item === null || item === void 0 ? void 0 : item.groupName,
|
|
105
|
-
groupId: item.id,
|
|
106
|
-
type: 2,
|
|
107
|
-
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
108
|
-
});
|
|
109
|
-
})) : /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
110
|
-
authConfig: {
|
|
111
|
-
dataAuth: [],
|
|
112
|
-
funAuth: []
|
|
113
|
-
},
|
|
114
|
-
leftMenus: leftMenus,
|
|
115
|
-
isMarsUi: isMarsUi,
|
|
116
|
-
companyAppList: companyAppList,
|
|
117
|
-
name: '',
|
|
118
|
-
type: 2,
|
|
119
|
-
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
120
|
-
}))));
|
|
121
|
-
},
|
|
122
|
-
style: {
|
|
123
|
-
width: 255
|
|
124
|
-
},
|
|
125
|
-
trigger: "click"
|
|
86
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
87
|
+
onClick: function onClick() {
|
|
88
|
+
return setingModalhandle(data, dealArr);
|
|
89
|
+
}
|
|
126
90
|
}, /*#__PURE__*/React.createElement(EyeOutlined, {
|
|
127
91
|
style: {
|
|
128
92
|
color: 'rgba(0, 0, 0, 0.85)'
|
|
@@ -177,7 +141,7 @@ var AppMember = function AppMember() {
|
|
|
177
141
|
var menus = (res === null || res === void 0 ? void 0 : res.leftMenus) || [];
|
|
178
142
|
var formatMenus = function formatMenus(menus) {
|
|
179
143
|
menus.forEach(function (item) {
|
|
180
|
-
item.routeName = getMenuRouterByName(item.name);
|
|
144
|
+
item.routeName = util.getMenuRouterByName(item.name);
|
|
181
145
|
if (item.childrens) {
|
|
182
146
|
formatMenus(item.childrens);
|
|
183
147
|
}
|
|
@@ -223,10 +187,18 @@ var AppMember = function AppMember() {
|
|
|
223
187
|
// const groupAuthConfig = (ids: number[]) => {
|
|
224
188
|
// return groupInfoList.filter((item: IGroupInfo) => ids.includes(item.id));
|
|
225
189
|
// };
|
|
226
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
190
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, {
|
|
227
191
|
size: "middle",
|
|
228
192
|
columns: columns,
|
|
229
193
|
dataSource: memberList
|
|
230
|
-
})
|
|
194
|
+
}), isModalOpen && /*#__PURE__*/React.createElement(SetingModal, {
|
|
195
|
+
isModalOpen: isModalOpen,
|
|
196
|
+
setIsModalOpen: setIsModalOpen,
|
|
197
|
+
companyAppList: companyAppList,
|
|
198
|
+
leftMenus: leftMenus,
|
|
199
|
+
isMarsUi: isMarsUi,
|
|
200
|
+
data: modalData.data,
|
|
201
|
+
dealArr: modalData.dealArr
|
|
202
|
+
}));
|
|
231
203
|
};
|
|
232
204
|
export default AppMember;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.seting-modal-box {
|
|
2
|
+
.ant-modal-header {
|
|
3
|
+
padding: 24px 24px 8px 24px !important;
|
|
4
|
+
font-size: 24px;
|
|
5
|
+
}
|
|
6
|
+
.ant-modal-body {
|
|
7
|
+
height: 620px;
|
|
8
|
+
padding: 0px 24px !important;
|
|
9
|
+
}
|
|
10
|
+
.ant-modal-footer {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
.ant-modal-close-x {
|
|
14
|
+
margin: 10px 10px 0 0;
|
|
15
|
+
color: #242541;
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { AppListItem, LeftMenusItem } from '../../../types';
|
|
4
|
+
declare const SetingModal: React.FC<{
|
|
5
|
+
isModalOpen: boolean;
|
|
6
|
+
setIsModalOpen: Function;
|
|
7
|
+
data: any;
|
|
8
|
+
companyAppList: AppListItem[];
|
|
9
|
+
leftMenus: LeftMenusItem[];
|
|
10
|
+
isMarsUi: boolean;
|
|
11
|
+
dealArr: any;
|
|
12
|
+
}>;
|
|
13
|
+
export default SetingModal;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { Tabs, Modal } from 'antd';
|
|
3
|
+
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
4
|
+
import AuthConfigDetail from '../../companySetting/userGroup/authConfigDetail';
|
|
5
|
+
import './index.less';
|
|
6
|
+
var SetingModal = function SetingModal(props) {
|
|
7
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
8
|
+
currentUser = _useContext.currentUser;
|
|
9
|
+
var isModalOpen = props.isModalOpen,
|
|
10
|
+
setIsModalOpen = props.setIsModalOpen,
|
|
11
|
+
data = props.data,
|
|
12
|
+
companyAppList = props.companyAppList,
|
|
13
|
+
leftMenus = props.leftMenus,
|
|
14
|
+
isMarsUi = props.isMarsUi,
|
|
15
|
+
dealArr = props.dealArr;
|
|
16
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
17
|
+
className: "seting-modal-box",
|
|
18
|
+
title: "\u6743\u9650\u4FE1\u606F",
|
|
19
|
+
visible: isModalOpen,
|
|
20
|
+
onCancel: function onCancel() {
|
|
21
|
+
return setIsModalOpen(false);
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
24
|
+
defaultActiveKey: "1",
|
|
25
|
+
className: "appSettings-Tabs"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
27
|
+
tab: "\u4E2A\u4EBA\u6743\u9650",
|
|
28
|
+
key: "1"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
30
|
+
authConfig: data.authConfig.defaultAuth,
|
|
31
|
+
companyAppList: companyAppList,
|
|
32
|
+
leftMenus: leftMenus,
|
|
33
|
+
isMarsUi: isMarsUi,
|
|
34
|
+
id: data.id,
|
|
35
|
+
type: 1,
|
|
36
|
+
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
37
|
+
})), /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
38
|
+
tab: "\u6240\u5C5E\u7528\u6237\u7EC4\u6743\u9650",
|
|
39
|
+
key: "2"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "group-auth-list"
|
|
42
|
+
}, dealArr.length ? /*#__PURE__*/React.createElement("div", null, dealArr.map(function (item) {
|
|
43
|
+
return /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
44
|
+
key: item.id,
|
|
45
|
+
authConfig: item.authConfig,
|
|
46
|
+
leftMenus: leftMenus,
|
|
47
|
+
isMarsUi: isMarsUi,
|
|
48
|
+
companyAppList: companyAppList,
|
|
49
|
+
name: item === null || item === void 0 ? void 0 : item.groupName,
|
|
50
|
+
groupId: item.id,
|
|
51
|
+
type: 2,
|
|
52
|
+
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
53
|
+
});
|
|
54
|
+
})) : /*#__PURE__*/React.createElement(AuthConfigDetail, {
|
|
55
|
+
authConfig: {
|
|
56
|
+
dataAuth: [],
|
|
57
|
+
funAuth: []
|
|
58
|
+
},
|
|
59
|
+
leftMenus: leftMenus,
|
|
60
|
+
isMarsUi: isMarsUi,
|
|
61
|
+
companyAppList: companyAppList,
|
|
62
|
+
name: '',
|
|
63
|
+
type: 2,
|
|
64
|
+
serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
|
|
65
|
+
})))));
|
|
66
|
+
};
|
|
67
|
+
export default SetingModal;
|
|
File without changes
|
|
@@ -4,19 +4,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
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
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect, useState, forwardRef, useImperativeHandle
|
|
7
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
|
|
8
8
|
import './styles/authConfig.less';
|
|
9
9
|
import constants from './../../../utils/constants';
|
|
10
|
+
import funPermissions from './../../../utils/functionalPermissions';
|
|
10
11
|
import AuthGroup from './authGroup';
|
|
11
|
-
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
12
12
|
var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
13
|
var config = props.config,
|
|
14
14
|
appList = props.appList,
|
|
15
15
|
isMarsUi = props.isMarsUi,
|
|
16
16
|
leftMenus = props.leftMenus;
|
|
17
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
18
|
-
menusName = _useContext.menusName,
|
|
19
|
-
funPermissions = _useContext.funPermissions;
|
|
20
17
|
var _useState = useState({}),
|
|
21
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
19
|
dataPermissions = _useState2[0],
|
|
@@ -62,7 +59,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
62
59
|
console.log('functionalPermissions');
|
|
63
60
|
if (functionalPermissions.checked) {
|
|
64
61
|
funAuth.push({
|
|
65
|
-
resource: funPermissions.all.key,
|
|
62
|
+
resource: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
|
|
66
63
|
opts: [constants.functionOpts.all]
|
|
67
64
|
});
|
|
68
65
|
functionalPermissions.children && functionalPermissions.children.forEach(function (item) {
|
|
@@ -204,7 +201,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
204
201
|
console.log(map);
|
|
205
202
|
// 顶部菜单功能权限
|
|
206
203
|
var loopFormatTopMenu = function loopFormatTopMenu(topMenu, checkAll) {
|
|
207
|
-
var menuFunPerConstants = funPermissions[topMenu.name];
|
|
204
|
+
var menuFunPerConstants = funPermissions[isMarsUi ? 'mars' : 'standard'][topMenu.name];
|
|
208
205
|
// 菜单不在权限配置中
|
|
209
206
|
if (!menuFunPerConstants) {
|
|
210
207
|
return null;
|
|
@@ -241,7 +238,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
241
238
|
indeterminate: !(checkState || !childrenCheckArr.length && !indeterminateArr.length),
|
|
242
239
|
children: childrens
|
|
243
240
|
};
|
|
244
|
-
if (topMenu.name ===
|
|
241
|
+
if (topMenu.name === constants.menusName.market) {
|
|
245
242
|
formatMenu.radio = true;
|
|
246
243
|
formatMenu.children = [{
|
|
247
244
|
describe: '管理员角色',
|
|
@@ -262,7 +259,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
262
259
|
return formatMenu;
|
|
263
260
|
};
|
|
264
261
|
var menuFun = [];
|
|
265
|
-
var isAll = !!map[funPermissions.all.key];
|
|
262
|
+
var isAll = !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key];
|
|
266
263
|
console.log('dskfhk', leftMenus);
|
|
267
264
|
leftMenus.forEach(function (menu) {
|
|
268
265
|
var topMenuFun = loopFormatTopMenu(menu, isAll);
|
|
@@ -273,29 +270,29 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
273
270
|
menuFun.push(topMenuFun);
|
|
274
271
|
}
|
|
275
272
|
});
|
|
276
|
-
var settingIsAll = !!map[funPermissions.setting.default.key];
|
|
273
|
+
var settingIsAll = !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key];
|
|
277
274
|
menuFun.push({
|
|
278
|
-
describe: funPermissions.setting.default.describe,
|
|
279
|
-
key: funPermissions.setting.default.key,
|
|
280
|
-
checked: isAll || !!map[funPermissions.setting.default.key],
|
|
275
|
+
describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.describe,
|
|
276
|
+
key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key,
|
|
277
|
+
checked: isAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key],
|
|
281
278
|
indeterminate: false,
|
|
282
279
|
disable: false,
|
|
283
280
|
supportVirtualApp: true,
|
|
284
281
|
children: [{
|
|
285
|
-
// ...funPermissions.setting.company,
|
|
286
|
-
describe: funPermissions.setting.company.describe,
|
|
287
|
-
key: funPermissions.setting.company.key,
|
|
282
|
+
// ...funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company,
|
|
283
|
+
describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.describe,
|
|
284
|
+
key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.key,
|
|
288
285
|
disable: false,
|
|
289
286
|
supportVirtualApp: true,
|
|
290
|
-
checked: isAll || settingIsAll || !!map[funPermissions.setting.company.key],
|
|
287
|
+
checked: isAll || settingIsAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.key],
|
|
291
288
|
children: []
|
|
292
289
|
}, {
|
|
293
|
-
// ...funPermissions.setting.app,
|
|
294
|
-
describe: funPermissions.setting.app.describe,
|
|
295
|
-
key: funPermissions.setting.app.key,
|
|
290
|
+
// ...funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app,
|
|
291
|
+
describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.describe,
|
|
292
|
+
key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.key,
|
|
296
293
|
disable: false,
|
|
297
294
|
supportVirtualApp: true,
|
|
298
|
-
checked: isAll || settingIsAll || !!map[funPermissions.setting.app.key],
|
|
295
|
+
checked: isAll || settingIsAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.key],
|
|
299
296
|
children: []
|
|
300
297
|
}]
|
|
301
298
|
});
|
|
@@ -308,8 +305,8 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
308
305
|
console.log(menuFun);
|
|
309
306
|
setFunctionalPermissions({
|
|
310
307
|
describe: '功能权限',
|
|
311
|
-
key: funPermissions.all.key,
|
|
312
|
-
// checked: !!map[funPermissions.all.key],
|
|
308
|
+
key: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
|
|
309
|
+
// checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
|
|
313
310
|
checked: checkedArr.length === menuFun.length,
|
|
314
311
|
disable: false,
|
|
315
312
|
supportVirtualApp: true,
|
|
@@ -10,16 +10,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { useEffect, useState, forwardRef, useImperativeHandle
|
|
13
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
|
|
14
14
|
import './styles/authConfig.less';
|
|
15
15
|
import constants from './../../../utils/constants';
|
|
16
|
+
import funPermissions from './../../../utils/functionalPermissions';
|
|
16
17
|
import AuthGroup from './authGroup';
|
|
17
|
-
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
18
18
|
var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
19
|
var isMarsUi = props.isMarsUi,
|
|
20
20
|
CEPData = props.CEPData;
|
|
21
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
22
|
-
funPermissions = _useContext.funPermissions;
|
|
23
21
|
var _useState = useState({}),
|
|
24
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
23
|
dataPermissions = _useState2[0],
|
|
@@ -171,8 +169,8 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
171
169
|
});
|
|
172
170
|
setFunctionalPermissions({
|
|
173
171
|
describe: '功能权限',
|
|
174
|
-
key: funPermissions.all.key,
|
|
175
|
-
// checked: !!map[funPermissions.all.key],
|
|
172
|
+
key: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
|
|
173
|
+
// checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
|
|
176
174
|
checked: checkedFunArr.length === dealFunConfigList.length,
|
|
177
175
|
disable: false,
|
|
178
176
|
supportVirtualApp: true,
|
|
@@ -189,7 +187,7 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
189
187
|
setDataPermissions({
|
|
190
188
|
key: 1,
|
|
191
189
|
describe: '数据权限',
|
|
192
|
-
// checked: !!map[funPermissions.all.key],
|
|
190
|
+
// checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
|
|
193
191
|
checked: checkedAppArr.length === dealAppConfigList.length,
|
|
194
192
|
indeterminate: !(checkedAppArr.length === dealAppConfigList.length || !checkedAppArr.length && !indeterminateAppArr.length),
|
|
195
193
|
children: dealAppConfigList
|
|
@@ -13,6 +13,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
13
13
|
import './index.less';
|
|
14
14
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
15
15
|
import request from './../../utils/ajax';
|
|
16
|
+
import util from './../../utils/util';
|
|
16
17
|
import api from './../../constants/api';
|
|
17
18
|
import PageLoading from '../../components/pageLoading';
|
|
18
19
|
import { notification } from 'antd';
|
|
@@ -32,8 +33,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
32
33
|
// #todo 需要修改主应用传入参数和business-lib数据仓库
|
|
33
34
|
var apisOkNum = 0;
|
|
34
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
35
|
-
envs = _useContext.envs
|
|
36
|
-
getMenuRouterByName = _useContext.getMenuRouterByName;
|
|
36
|
+
envs = _useContext.envs;
|
|
37
37
|
var _ref = envs || {},
|
|
38
38
|
zgText = _ref.zgText,
|
|
39
39
|
isMarsUi = _ref.isMarsUi,
|
|
@@ -216,7 +216,7 @@ var CompanySetting = function CompanySetting(props) {
|
|
|
216
216
|
var menusNameMap = {};
|
|
217
217
|
var formatMenus = function formatMenus(menus) {
|
|
218
218
|
menus.forEach(function (item) {
|
|
219
|
-
item.routeName = getMenuRouterByName(item.name);
|
|
219
|
+
item.routeName = util.getMenuRouterByName(item.name);
|
|
220
220
|
menusNameMap[item.name] = item;
|
|
221
221
|
if (item.childrens) {
|
|
222
222
|
formatMenus(item.childrens);
|
|
@@ -11,14 +11,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
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; }
|
|
12
12
|
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; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
import React, {
|
|
14
|
+
import React, { useEffect, useState } from 'react';
|
|
15
15
|
import './style/authConfigDetail.less';
|
|
16
16
|
import constants from './../../../utils/constants';
|
|
17
17
|
import functionalPermissions from './../../../utils/functionalPermissions';
|
|
18
18
|
import { notification } from 'antd';
|
|
19
19
|
import request from './../../../utils/ajax';
|
|
20
20
|
import apis from './../../../constants/api';
|
|
21
|
-
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
22
21
|
// const { TextArea } = Input;
|
|
23
22
|
var authConfigDetail = function authConfigDetail(props) {
|
|
24
23
|
var name = props.name,
|
|
@@ -30,8 +29,6 @@ var authConfigDetail = function authConfigDetail(props) {
|
|
|
30
29
|
groupId = props.groupId,
|
|
31
30
|
type = props.type,
|
|
32
31
|
serviceType = props.serviceType;
|
|
33
|
-
var _useContext = useContext(BizGlobalDataContext),
|
|
34
|
-
menusName = _useContext.menusName;
|
|
35
32
|
var _useState = useState([]),
|
|
36
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
34
|
dataAuth = _useState2[0],
|
|
@@ -157,7 +154,7 @@ var authConfigDetail = function authConfigDetail(props) {
|
|
|
157
154
|
});
|
|
158
155
|
}
|
|
159
156
|
// 智能触达
|
|
160
|
-
if (topMenu.name ===
|
|
157
|
+
if (topMenu.name === constants.menusName.market) {
|
|
161
158
|
childrenArr = [{
|
|
162
159
|
name: {
|
|
163
160
|
describe: '管理员角色',
|
|
File without changes
|
|
@@ -163,9 +163,6 @@ var standard = _objectSpread({
|
|
|
163
163
|
userPortrait: {
|
|
164
164
|
key: '/user/userPortrait'
|
|
165
165
|
},
|
|
166
|
-
userJourney: {
|
|
167
|
-
key: '/cxp/userJourney'
|
|
168
|
-
},
|
|
169
166
|
userTags: {
|
|
170
167
|
key: '/user/userTags'
|
|
171
168
|
},
|
|
@@ -322,9 +319,6 @@ var mars = {
|
|
|
322
319
|
userPortrait: {
|
|
323
320
|
key: '/analysis/user/userPortrait'
|
|
324
321
|
},
|
|
325
|
-
userJourney: {
|
|
326
|
-
key: '/cxp/userJourney'
|
|
327
|
-
},
|
|
328
322
|
custom: {
|
|
329
323
|
key: '/analysis/custom'
|
|
330
324
|
},
|
|
@@ -430,4 +424,7 @@ var mars = {
|
|
|
430
424
|
}
|
|
431
425
|
}
|
|
432
426
|
};
|
|
433
|
-
export default
|
|
427
|
+
export default {
|
|
428
|
+
mars: mars,
|
|
429
|
+
standard: standard
|
|
430
|
+
};
|
package/es/utils/util.js
CHANGED
|
@@ -641,8 +641,7 @@ var util = {
|
|
|
641
641
|
adChannel: 'router-dataAccess-advanced',
|
|
642
642
|
debug: 'router-dataAccess-debug',
|
|
643
643
|
dataset: 'router-cdp-dataset',
|
|
644
|
-
idmapping: 'router-idMapping-list'
|
|
645
|
-
userJourney: 'router-appUserJourney'
|
|
644
|
+
idmapping: 'router-idMapping-list'
|
|
646
645
|
};
|
|
647
646
|
return hash[name] ? hash[name] : 'router-' + name;
|
|
648
647
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.2",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/lodash": "^4.14.182",
|
|
39
39
|
"@umijs/fabric": "^2.8.1",
|
|
40
40
|
"@umijs/test": "^3.0.5",
|
|
41
|
-
"@zgfe/business-lib": "1.1.
|
|
41
|
+
"@zgfe/business-lib": "^1.1.40",
|
|
42
42
|
"@zgfe/modules-demo-manage": "^1.0.1",
|
|
43
43
|
"antd": "4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"umi-request": "^1.4.0",
|
|
52
52
|
"yorkie": "^2.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "d769d11e21ed8a30ce32c030b2876440d99d10db",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BizGlobalDataContext, DemoWrapper } from '@zgfe/business-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import funPermissions from '../../utils/functionalPermissions';
|
|
4
|
-
import constants from '../../utils/constants';
|
|
5
|
-
import util from '../../utils/util';
|
|
6
|
-
import { CompanySetting } from '../..';
|
|
7
|
-
export default (function () {
|
|
8
|
-
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
9
|
-
needMeta: true
|
|
10
|
-
}, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
11
|
-
value: {
|
|
12
|
-
funPermissions: funPermissions,
|
|
13
|
-
menusName: constants.menusName,
|
|
14
|
-
getMenuRouterByName: util.getMenuRouterByName
|
|
15
|
-
}
|
|
16
|
-
}, /*#__PURE__*/React.createElement(CompanySetting, {
|
|
17
|
-
showWeChatMenu: true,
|
|
18
|
-
showMarketMenu: true,
|
|
19
|
-
action: ''
|
|
20
|
-
})));
|
|
21
|
-
});
|