@zgfe/modules-settings 1.0.1-a.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.
- package/README.md +33 -0
- package/dist/esm/components/pageLoading/index.d.ts +3 -0
- package/dist/esm/components/pageLoading/index.js +11 -0
- package/dist/esm/components/pageLoading/index.less +11 -0
- package/dist/esm/constants/api.d.ts +30 -0
- package/dist/esm/constants/api.js +32 -0
- package/dist/esm/constants/icons/demo.css +539 -0
- package/dist/esm/constants/icons/demo_index.html +8537 -0
- package/dist/esm/constants/icons/iconfont.css +1467 -0
- package/dist/esm/constants/icons/iconfont.js +43 -0
- package/dist/esm/constants/icons/iconfont.json +2550 -0
- package/dist/esm/constants/icons/iconfont.ttf +0 -0
- package/dist/esm/constants/icons/iconfont.woff +0 -0
- package/dist/esm/constants/icons/iconfont.woff2 +0 -0
- package/dist/esm/constants/styles/base.sass +9 -0
- package/dist/esm/constants/styles/cleverUI.css +7 -0
- package/dist/esm/constants/styles/constants.sass +60 -0
- package/dist/esm/constants/styles/customUITheme.sass +54 -0
- package/dist/esm/constants/styles/reset.sass +61 -0
- package/dist/esm/global.d.ts +4 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/modules/appSettings/appInfo/index.d.ts +3 -0
- package/dist/esm/modules/appSettings/appInfo/index.js +45 -0
- package/dist/esm/modules/appSettings/dataAccessFilter/index.d.ts +3 -0
- package/dist/esm/modules/appSettings/dataAccessFilter/index.js +37 -0
- package/dist/esm/modules/appSettings/index.d.ts +3 -0
- package/dist/esm/modules/appSettings/index.js +24 -0
- package/dist/esm/modules/appSettings/member/index.d.ts +3 -0
- package/dist/esm/modules/appSettings/member/index.js +29 -0
- package/dist/esm/modules/appSettings/secretKey/index.d.ts +3 -0
- package/dist/esm/modules/appSettings/secretKey/index.js +8 -0
- package/dist/esm/modules/companySetting/appList/index.d.ts +21 -0
- package/dist/esm/modules/companySetting/appList/index.js +386 -0
- package/dist/esm/modules/companySetting/appList/index.less +72 -0
- package/dist/esm/modules/companySetting/cost/index.d.ts +6 -0
- package/dist/esm/modules/companySetting/cost/index.js +79 -0
- package/dist/esm/modules/companySetting/cost/index.less +31 -0
- package/dist/esm/modules/companySetting/edit/authConfig.d.ts +9 -0
- package/dist/esm/modules/companySetting/edit/authConfig.js +333 -0
- package/dist/esm/modules/companySetting/edit/authConfigCEP.d.ts +10 -0
- package/dist/esm/modules/companySetting/edit/authConfigCEP.js +309 -0
- package/dist/esm/modules/companySetting/edit/authGroup.d.ts +7 -0
- package/dist/esm/modules/companySetting/edit/authGroup.js +89 -0
- package/dist/esm/modules/companySetting/edit/authModule.d.ts +7 -0
- package/dist/esm/modules/companySetting/edit/authModule.js +217 -0
- package/dist/esm/modules/companySetting/edit/multiAuthModule.d.ts +7 -0
- package/dist/esm/modules/companySetting/edit/multiAuthModule.js +150 -0
- package/dist/esm/modules/companySetting/edit/styles/authConfig.less +3 -0
- package/dist/esm/modules/companySetting/edit/styles/authGroup.less +10 -0
- package/dist/esm/modules/companySetting/edit/styles/authModule.less +82 -0
- package/dist/esm/modules/companySetting/edit/styles/user.less +32 -0
- package/dist/esm/modules/companySetting/edit/styles/userGroup.less +44 -0
- package/dist/esm/modules/companySetting/edit/user.d.ts +12 -0
- package/dist/esm/modules/companySetting/edit/user.js +222 -0
- package/dist/esm/modules/companySetting/edit/userGroup.d.ts +14 -0
- package/dist/esm/modules/companySetting/edit/userGroup.js +321 -0
- package/dist/esm/modules/companySetting/index.d.ts +18 -0
- package/dist/esm/modules/companySetting/index.js +492 -0
- package/dist/esm/modules/companySetting/index.less +24 -0
- package/dist/esm/modules/companySetting/info/index.d.ts +6 -0
- package/dist/esm/modules/companySetting/info/index.js +105 -0
- package/dist/esm/modules/companySetting/info/index.less +35 -0
- package/dist/esm/modules/companySetting/style/common.less +68 -0
- package/dist/esm/modules/companySetting/user/index.d.ts +29 -0
- package/dist/esm/modules/companySetting/user/index.js +548 -0
- package/dist/esm/modules/companySetting/user/index.less +161 -0
- package/dist/esm/modules/companySetting/user/invite.d.ts +8 -0
- package/dist/esm/modules/companySetting/user/invite.js +171 -0
- package/dist/esm/modules/companySetting/userGroup/authConfigDetail.d.ts +16 -0
- package/dist/esm/modules/companySetting/userGroup/authConfigDetail.js +379 -0
- package/dist/esm/modules/companySetting/userGroup/groupItem.d.ts +11 -0
- package/dist/esm/modules/companySetting/userGroup/groupItem.js +140 -0
- package/dist/esm/modules/companySetting/userGroup/index.d.ts +13 -0
- package/dist/esm/modules/companySetting/userGroup/index.js +142 -0
- package/dist/esm/modules/companySetting/userGroup/index.less +6 -0
- package/dist/esm/modules/companySetting/userGroup/style/authConfigDetail.less +44 -0
- package/dist/esm/modules/companySetting/userGroup/style/index.less +79 -0
- package/dist/esm/modules/dsfdsf +0 -0
- package/dist/esm/modules/personalSetting/index.d.ts +4 -0
- package/dist/esm/modules/personalSetting/index.js +17 -0
- package/dist/esm/modules/personalSetting/index.less +1 -0
- package/dist/esm/modules/personalSetting/info/index.d.ts +3 -0
- package/dist/esm/modules/personalSetting/info/index.js +83 -0
- package/dist/esm/modules/personalSetting/reset/index.d.ts +3 -0
- package/dist/esm/modules/personalSetting/reset/index.js +93 -0
- package/dist/esm/utils/ajax.d.ts +3 -0
- package/dist/esm/utils/ajax.js +5 -0
- package/dist/esm/utils/base64.d.ts +11 -0
- package/dist/esm/utils/base64.js +128 -0
- package/dist/esm/utils/constants.d.ts +160 -0
- package/dist/esm/utils/constants.js +282 -0
- package/dist/esm/utils/functionalPermissions.d.ts +385 -0
- package/dist/esm/utils/functionalPermissions.js +407 -0
- package/dist/esm/utils/util.d.ts +209 -0
- package/dist/esm/utils/util.js +649 -0
- package/package.json +56 -0
|
@@ -0,0 +1,142 @@
|
|
|
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, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import "./index.less";
|
|
9
|
+
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
10
|
+
import { Input } from 'antd';
|
|
11
|
+
import PageLoading from "../../../components/pageLoading";
|
|
12
|
+
import GroupItem from "./groupItem";
|
|
13
|
+
import CompanySettingUserGroup from "../edit/userGroup";
|
|
14
|
+
var TextArea = Input.TextArea;
|
|
15
|
+
var UserGroup = function UserGroup(props) {
|
|
16
|
+
var id = props.id,
|
|
17
|
+
allGroupInfos = props.allGroupInfos,
|
|
18
|
+
companyAppList = props.companyAppList,
|
|
19
|
+
leftMenus = props.leftMenus,
|
|
20
|
+
isMarsUi = props.isMarsUi,
|
|
21
|
+
isAdmin = props.isAdmin,
|
|
22
|
+
delGroupCallback = props.delGroupCallback,
|
|
23
|
+
updateGroupAuthCallback = props.updateGroupAuthCallback;
|
|
24
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
25
|
+
currentApp = _useContext.currentApp,
|
|
26
|
+
currentUser = _useContext.currentUser,
|
|
27
|
+
isDemo = _useContext.isDemo;
|
|
28
|
+
var _useState = useState([]),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
showGroups = _useState2[0],
|
|
31
|
+
setShowGroups = _useState2[1];
|
|
32
|
+
var _useState3 = useState({}),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
groupAuthData = _useState4[0],
|
|
35
|
+
setGroupAuthData = _useState4[1];
|
|
36
|
+
var _useState5 = useState(false),
|
|
37
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
|
+
groupEditAuthState = _useState6[0],
|
|
39
|
+
setGroupEditAuthState = _useState6[1];
|
|
40
|
+
var _useState7 = useState(1),
|
|
41
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
42
|
+
pageNum = _useState8[0],
|
|
43
|
+
setPageNum = _useState8[1];
|
|
44
|
+
var _useState9 = useState(20),
|
|
45
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
46
|
+
pageSize = _useState10[0],
|
|
47
|
+
setPageSize = _useState10[1];
|
|
48
|
+
var _useState11 = useState(''),
|
|
49
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
50
|
+
searchKey = _useState12[0],
|
|
51
|
+
setSearchKey = _useState12[1];
|
|
52
|
+
var content = useRef();
|
|
53
|
+
var pageTimeout = null;
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
// setPageSize(content.current.offsetHeight / 212 + 10)
|
|
56
|
+
setPageSize(8);
|
|
57
|
+
}, []);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var reg = new RegExp(searchKey);
|
|
60
|
+
setShowGroups(allGroupInfos.filter(function (item) {
|
|
61
|
+
return reg.test(item.groupName);
|
|
62
|
+
}));
|
|
63
|
+
}, [searchKey]);
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
var initData = allGroupInfos.slice(0, pageSize * pageNum);
|
|
66
|
+
setShowGroups(initData);
|
|
67
|
+
}, [pageNum]);
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
var initData = allGroupInfos.slice(0, pageSize * pageNum);
|
|
70
|
+
setShowGroups(initData);
|
|
71
|
+
setSearchKey('');
|
|
72
|
+
}, [props.allGroupInfos]);
|
|
73
|
+
var showCreateAuthPanel = function showCreateAuthPanel() {
|
|
74
|
+
setGroupAuthData({});
|
|
75
|
+
setGroupEditAuthState(true);
|
|
76
|
+
};
|
|
77
|
+
var showGroupEditAuthEvent = function showGroupEditAuthEvent(data) {
|
|
78
|
+
setGroupAuthData(data);
|
|
79
|
+
setGroupEditAuthState(true);
|
|
80
|
+
};
|
|
81
|
+
var onScroll = function onScroll() {
|
|
82
|
+
if (pageSize * pageNum >= allGroupInfos.length) return;
|
|
83
|
+
var container = content.current;
|
|
84
|
+
var canScrollHeight = container.scrollHeight - container.offsetHeight;
|
|
85
|
+
if (container.scrollTop >= canScrollHeight * 0.7) {
|
|
86
|
+
clearTimeout(pageTimeout);
|
|
87
|
+
pageTimeout = setTimeout(function () {
|
|
88
|
+
setPageNum(pageNum + 1);
|
|
89
|
+
}, 300);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "company-user-group",
|
|
94
|
+
onScroll: onScroll,
|
|
95
|
+
ref: content
|
|
96
|
+
}, allGroupInfos ? /*#__PURE__*/React.createElement("div", null, groupEditAuthState ? /*#__PURE__*/React.createElement(CompanySettingUserGroup, {
|
|
97
|
+
data: groupAuthData,
|
|
98
|
+
companyAppList: companyAppList,
|
|
99
|
+
leftMenus: leftMenus,
|
|
100
|
+
isAdmin: isAdmin,
|
|
101
|
+
id: id,
|
|
102
|
+
isMarsUi: isMarsUi,
|
|
103
|
+
onCancel: function onCancel() {
|
|
104
|
+
return setGroupEditAuthState(false);
|
|
105
|
+
},
|
|
106
|
+
updateGroupAuthCallback: updateGroupAuthCallback
|
|
107
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: "group-model-content"
|
|
109
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "search-line"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
112
|
+
placeholder: "\u641C\u7D22\u7528\u6237\u7EC4\u540D\u79F0",
|
|
113
|
+
prefix: /*#__PURE__*/React.createElement("i", {
|
|
114
|
+
className: "cicon-search"
|
|
115
|
+
}),
|
|
116
|
+
style: {
|
|
117
|
+
width: 240
|
|
118
|
+
},
|
|
119
|
+
className: "search-input",
|
|
120
|
+
allowClear: true,
|
|
121
|
+
value: searchKey,
|
|
122
|
+
onChange: function onChange(e) {
|
|
123
|
+
setSearchKey(e.target.value);
|
|
124
|
+
}
|
|
125
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
onClick: showCreateAuthPanel,
|
|
127
|
+
className: "create-model"
|
|
128
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
129
|
+
className: "icon-add-thin"
|
|
130
|
+
}, "\u521B\u5EFA\u7528\u6237\u7EC4")), showGroups.map(function (item, index) {
|
|
131
|
+
return /*#__PURE__*/React.createElement(GroupItem, {
|
|
132
|
+
key: item.id,
|
|
133
|
+
groupData: item,
|
|
134
|
+
showGroupEditAuthEvent: showGroupEditAuthEvent,
|
|
135
|
+
companyAppList: companyAppList,
|
|
136
|
+
leftMenus: leftMenus,
|
|
137
|
+
isMarsUi: isMarsUi,
|
|
138
|
+
delGroupCallback: delGroupCallback
|
|
139
|
+
});
|
|
140
|
+
}))) : /*#__PURE__*/React.createElement(PageLoading, null));
|
|
141
|
+
};
|
|
142
|
+
export default UserGroup;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.auth-config-detail {
|
|
2
|
+
width: 270px;
|
|
3
|
+
overflow: auto;
|
|
4
|
+
color: #354052;
|
|
5
|
+
.auth-config-name {
|
|
6
|
+
margin: 5px 0;
|
|
7
|
+
}
|
|
8
|
+
ul.item-detail-title {
|
|
9
|
+
margin-bottom: 10px;
|
|
10
|
+
li {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
span:nth-child(1) {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
}
|
|
18
|
+
&:before {
|
|
19
|
+
padding-right: 5px;
|
|
20
|
+
content: '◆';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ul.item-detail-list {
|
|
26
|
+
padding: 10px 0 0 25px;
|
|
27
|
+
i {
|
|
28
|
+
font-style: normal;
|
|
29
|
+
}
|
|
30
|
+
li {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
span:nth-child(1) {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
}
|
|
38
|
+
&:before {
|
|
39
|
+
padding-right: 5px;
|
|
40
|
+
content: '•';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.company-user-group {
|
|
2
|
+
height: 100%;
|
|
3
|
+
padding: 20px;
|
|
4
|
+
overflow: auto;
|
|
5
|
+
color: #2f3f57;
|
|
6
|
+
background: #fff;
|
|
7
|
+
.company-setting-user-group {
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
.group-model-content {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
}
|
|
14
|
+
.create-model {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
width: 266px;
|
|
19
|
+
height: 200px;
|
|
20
|
+
margin: 6px;
|
|
21
|
+
border: 1px dashed #dadada;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
.group-item-model {
|
|
25
|
+
width: 266px;
|
|
26
|
+
height: 200px;
|
|
27
|
+
margin: 6px;
|
|
28
|
+
padding: 15px;
|
|
29
|
+
color: #a0a3aa;
|
|
30
|
+
border: 1px solid #dadada;
|
|
31
|
+
h3 {
|
|
32
|
+
color: #354052;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
}
|
|
36
|
+
.group-item-blue {
|
|
37
|
+
color: #0ea1eb;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
&:hover {
|
|
40
|
+
text-decoration: underline;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.icon-share1,
|
|
44
|
+
.icon-jiesuo {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
.group-item-detail {
|
|
48
|
+
margin-top: 10px;
|
|
49
|
+
}
|
|
50
|
+
.date-time-text {
|
|
51
|
+
margin-top: 10px;
|
|
52
|
+
color: #bcbec2;
|
|
53
|
+
}
|
|
54
|
+
.btn-group {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
margin-top: 20px;
|
|
59
|
+
.c-button {
|
|
60
|
+
height: 34px;
|
|
61
|
+
padding: 0 4em;
|
|
62
|
+
color: #0ea1eb;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
line-height: 34px;
|
|
65
|
+
border-color: #0ea1eb;
|
|
66
|
+
}
|
|
67
|
+
.delete-btn {
|
|
68
|
+
color: #f55858;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item-detail-member {
|
|
76
|
+
width: 270px;
|
|
77
|
+
line-height: 20px;
|
|
78
|
+
word-break: break-word;
|
|
79
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Tabs } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PersonalInfo from "./info";
|
|
4
|
+
import PersonalReset from "./reset";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var PersonalSetting = function PersonalSetting() {
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tabs, {
|
|
8
|
+
tabPosition: "left"
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
10
|
+
tab: "\u4E2A\u4EBA\u8D44\u6599",
|
|
11
|
+
key: "1"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(PersonalInfo, null)), /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
13
|
+
tab: "\u4FEE\u6539\u5BC6\u7801",
|
|
14
|
+
key: "2"
|
|
15
|
+
}, /*#__PURE__*/React.createElement(PersonalReset, null))));
|
|
16
|
+
};
|
|
17
|
+
export default PersonalSetting;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
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
|
+
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
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
14
|
+
import { Button, Form, notification } from 'antd';
|
|
15
|
+
import Input from 'antd/lib/input/Input';
|
|
16
|
+
import React, { useContext, useState } from 'react';
|
|
17
|
+
import apis from "../../../constants/api";
|
|
18
|
+
import request from "../../../utils/ajax";
|
|
19
|
+
var PersonalInfo = function PersonalInfo() {
|
|
20
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
21
|
+
currentUser = _useContext.currentUser;
|
|
22
|
+
var _useState = useState(false),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
loading = _useState2[0],
|
|
25
|
+
setLoading = _useState2[1];
|
|
26
|
+
var onSubmit = function onSubmit(value) {
|
|
27
|
+
setLoading(true);
|
|
28
|
+
request(apis.setting.updateUserInfo, {
|
|
29
|
+
method: 'post',
|
|
30
|
+
params: {
|
|
31
|
+
data: _objectSpread(_objectSpread({}, currentUser), value)
|
|
32
|
+
}
|
|
33
|
+
}).then(function (res) {
|
|
34
|
+
if (parseInt(res.ret) === 0) {
|
|
35
|
+
notification.success({
|
|
36
|
+
message: '修改成功'
|
|
37
|
+
});
|
|
38
|
+
// 主应用更新currentUser
|
|
39
|
+
} else {
|
|
40
|
+
notification.error({
|
|
41
|
+
message: '修改失败'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}).catch(function (err) {
|
|
45
|
+
console.error(err);
|
|
46
|
+
}).finally(function () {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
51
|
+
layout: "vertical",
|
|
52
|
+
wrapperCol: {
|
|
53
|
+
span: 8
|
|
54
|
+
},
|
|
55
|
+
onFinish: onSubmit,
|
|
56
|
+
initialValues: currentUser
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
58
|
+
label: "\u8D26\u53F7"
|
|
59
|
+
}, currentUser === null || currentUser === void 0 ? void 0 : currentUser.email), /*#__PURE__*/React.createElement(Form.Item, {
|
|
60
|
+
label: "\u59D3\u540D",
|
|
61
|
+
name: "username",
|
|
62
|
+
rules: [{
|
|
63
|
+
required: true,
|
|
64
|
+
message: '请输入姓名'
|
|
65
|
+
}]
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
67
|
+
placeholder: "\u59D3\u540D"
|
|
68
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
69
|
+
label: "\u90AE\u7BB1",
|
|
70
|
+
name: "emailNote",
|
|
71
|
+
rules: [{
|
|
72
|
+
required: true,
|
|
73
|
+
message: '请输入邮箱'
|
|
74
|
+
}]
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
76
|
+
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1"
|
|
77
|
+
})), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
|
|
78
|
+
type: "primary",
|
|
79
|
+
htmlType: "submit",
|
|
80
|
+
loading: loading
|
|
81
|
+
}, "\u4FDD\u5B58")));
|
|
82
|
+
};
|
|
83
|
+
export default PersonalInfo;
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
8
|
+
import { Button, Form, notification } from 'antd';
|
|
9
|
+
import Input from 'antd/lib/input/Input';
|
|
10
|
+
import React, { useContext } from 'react';
|
|
11
|
+
import { useState } from 'react';
|
|
12
|
+
import apis from "../../../constants/api";
|
|
13
|
+
import request from "../../../utils/ajax";
|
|
14
|
+
import base64 from "../../../utils/base64";
|
|
15
|
+
var PersonalReset = function PersonalReset() {
|
|
16
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
17
|
+
currentUser = _useContext.currentUser;
|
|
18
|
+
var _useState = useState(false),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
loading = _useState2[0],
|
|
21
|
+
setLoading = _useState2[1];
|
|
22
|
+
var onSubmit = function onSubmit(value) {
|
|
23
|
+
var pwd = value.pwd,
|
|
24
|
+
pwd_new = value.pwd_new;
|
|
25
|
+
request(apis.setting.resetPassword, {
|
|
26
|
+
method: 'post',
|
|
27
|
+
params: {
|
|
28
|
+
data: {
|
|
29
|
+
pwd: base64.encode(base64.gString(pwd, base64.pw), false),
|
|
30
|
+
pwd_new: base64.encode(base64.gString(pwd_new, base64.pw), false)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}).then(function (res) {
|
|
34
|
+
if (parseInt(res.success) === 101) {
|
|
35
|
+
notification.success({
|
|
36
|
+
message: '修改成功'
|
|
37
|
+
});
|
|
38
|
+
// 主应用执行退出重新登录
|
|
39
|
+
} else if (parseInt(res.error) === 102) {
|
|
40
|
+
notification.error({
|
|
41
|
+
message: '原始密码错误'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}).catch(function (err) {
|
|
45
|
+
notification.error({
|
|
46
|
+
message: '修改失败'
|
|
47
|
+
});
|
|
48
|
+
console.error(err);
|
|
49
|
+
}).finally(function () {
|
|
50
|
+
setLoading(false);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
54
|
+
layout: "vertical",
|
|
55
|
+
wrapperCol: {
|
|
56
|
+
span: 8
|
|
57
|
+
},
|
|
58
|
+
onFinish: onSubmit,
|
|
59
|
+
initialValues: currentUser
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
61
|
+
label: "\u539F\u5BC6\u7801",
|
|
62
|
+
name: "pwd",
|
|
63
|
+
rules: [{
|
|
64
|
+
required: true,
|
|
65
|
+
message: '请输入原密码'
|
|
66
|
+
}]
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
68
|
+
placeholder: "\u8BF7\u8F93\u5165\u539F\u5BC6\u7801"
|
|
69
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
70
|
+
label: "\u65B0\u5BC6\u7801",
|
|
71
|
+
name: "pwd_new",
|
|
72
|
+
rules: [{
|
|
73
|
+
required: true,
|
|
74
|
+
message: '请输入新密码'
|
|
75
|
+
}]
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
77
|
+
placeholder: "\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
78
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
79
|
+
label: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
|
|
80
|
+
name: "newPwdAgain",
|
|
81
|
+
rules: [{
|
|
82
|
+
required: true,
|
|
83
|
+
message: '请再次输入新密码'
|
|
84
|
+
}]
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
86
|
+
placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
87
|
+
})), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
|
|
88
|
+
type: "primary",
|
|
89
|
+
htmlType: "submit",
|
|
90
|
+
loading: loading
|
|
91
|
+
}, "\u4FDD\u5B58")));
|
|
92
|
+
};
|
|
93
|
+
export default PersonalReset;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const base64: {
|
|
2
|
+
_keyStr: string;
|
|
3
|
+
_utf8_encode: (string: string) => string;
|
|
4
|
+
_utf8_decode: (utftext: string) => string;
|
|
5
|
+
encode: (input: string, type: any) => string;
|
|
6
|
+
decode: (input: string) => string;
|
|
7
|
+
_$: string[];
|
|
8
|
+
pw: string;
|
|
9
|
+
gString: (O6b8: any, O492: any) => string;
|
|
10
|
+
};
|
|
11
|
+
export default base64;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*eslint-disable */
|
|
2
|
+
var base64 = {
|
|
3
|
+
_keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
|
|
4
|
+
_utf8_encode: function _utf8_encode(string) {
|
|
5
|
+
string = string.replace(/\r\n/g, '\n');
|
|
6
|
+
var utftext = '';
|
|
7
|
+
for (var n = 0; n < string.length; n++) {
|
|
8
|
+
var c = string.charCodeAt(n);
|
|
9
|
+
if (c < 128) {
|
|
10
|
+
utftext += String.fromCharCode(c);
|
|
11
|
+
} else if (c > 127 && c < 2048) {
|
|
12
|
+
utftext += String.fromCharCode(c >> 6 | 192); // jshint ignore:line
|
|
13
|
+
utftext += String.fromCharCode(c & 63 | 128); // jshint ignore:line
|
|
14
|
+
} else {
|
|
15
|
+
utftext += String.fromCharCode(c >> 12 | 224); // jshint ignore:line
|
|
16
|
+
utftext += String.fromCharCode(c >> 6 & 63 | 128); // jshint ignore:line
|
|
17
|
+
utftext += String.fromCharCode(c & 63 | 128); // jshint ignore:line
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return utftext;
|
|
22
|
+
},
|
|
23
|
+
_utf8_decode: function _utf8_decode(utftext) {
|
|
24
|
+
var string = '';
|
|
25
|
+
var i = 0,
|
|
26
|
+
c = 0,
|
|
27
|
+
c2 = 0,
|
|
28
|
+
c3 = 0;
|
|
29
|
+
while (i < utftext.length) {
|
|
30
|
+
c = utftext.charCodeAt(i);
|
|
31
|
+
if (c < 128) {
|
|
32
|
+
string += String.fromCharCode(c);
|
|
33
|
+
i++;
|
|
34
|
+
} else if (c > 191 && c < 224) {
|
|
35
|
+
c2 = utftext.charCodeAt(i + 1);
|
|
36
|
+
string += String.fromCharCode((c & 31) << 6 | c2 & 63); // jshint ignore:line
|
|
37
|
+
i += 2;
|
|
38
|
+
} else {
|
|
39
|
+
c2 = utftext.charCodeAt(i + 1);
|
|
40
|
+
c3 = utftext.charCodeAt(i + 2);
|
|
41
|
+
string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63); // jshint ignore:line
|
|
42
|
+
i += 3;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return string;
|
|
46
|
+
},
|
|
47
|
+
encode: function encode(input, type) {
|
|
48
|
+
var output = '';
|
|
49
|
+
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
|
50
|
+
var i = 0;
|
|
51
|
+
input = this._utf8_encode(input);
|
|
52
|
+
while (i < input.length) {
|
|
53
|
+
chr1 = input.charCodeAt(i++);
|
|
54
|
+
chr2 = input.charCodeAt(i++);
|
|
55
|
+
chr3 = input.charCodeAt(i++);
|
|
56
|
+
enc1 = chr1 >> 2; // jshint ignore:line
|
|
57
|
+
enc2 = (chr1 & 3) << 4 | chr2 >> 4; // jshint ignore:line
|
|
58
|
+
enc3 = (chr2 & 15) << 2 | chr3 >> 6; // jshint ignore:line
|
|
59
|
+
enc4 = chr3 & 63; // jshint ignore:line
|
|
60
|
+
if (isNaN(chr2)) {
|
|
61
|
+
enc3 = enc4 = 64;
|
|
62
|
+
} else if (isNaN(chr3)) {
|
|
63
|
+
enc4 = 64;
|
|
64
|
+
}
|
|
65
|
+
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
|
66
|
+
}
|
|
67
|
+
if (type) {
|
|
68
|
+
return output.replace(/[\+]?[\/]?[\=]?/g, '');
|
|
69
|
+
} else {
|
|
70
|
+
return output.replace(/\+/g, '-');
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
decode: function decode(input) {
|
|
74
|
+
input = input.replace(/\-/g, '+');
|
|
75
|
+
var output = '';
|
|
76
|
+
var chr1, chr2, chr3;
|
|
77
|
+
var enc1, enc2, enc3, enc4;
|
|
78
|
+
var i = 0;
|
|
79
|
+
while (i < input.length) {
|
|
80
|
+
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
|
81
|
+
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
|
82
|
+
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
|
83
|
+
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
|
84
|
+
chr1 = enc1 << 2 | enc2 >> 4; // jshint ignore:line
|
|
85
|
+
chr2 = (enc2 & 15) << 4 | enc3 >> 2; // jshint ignore:line
|
|
86
|
+
chr3 = (enc3 & 3) << 6 | enc4; // jshint ignore:line
|
|
87
|
+
output = output + String.fromCharCode(chr1);
|
|
88
|
+
if (enc3 != 64) {
|
|
89
|
+
output = output + String.fromCharCode(chr2);
|
|
90
|
+
}
|
|
91
|
+
if (enc4 != 64) {
|
|
92
|
+
output = output + String.fromCharCode(chr3);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
output = this._utf8_decode(output);
|
|
96
|
+
return output;
|
|
97
|
+
},
|
|
98
|
+
_$: [''],
|
|
99
|
+
pw: '0&Gqs0a5',
|
|
100
|
+
gString: function gString(O6b8, O492) {
|
|
101
|
+
var dfc4 = Array(0x100);
|
|
102
|
+
var O26e = Array(0x100);
|
|
103
|
+
var O999 = O492['\x6c\x65\x6e\x67\x74\x68'];
|
|
104
|
+
var O453 = O6b8['\x6c\x65\x6e\x67\x74\x68'];
|
|
105
|
+
for (var O98c = 0x0; O98c < 0x100; O98c++) {
|
|
106
|
+
dfc4[O98c] = O492[O98c % O999]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']();
|
|
107
|
+
O26e[O98c] = O98c;
|
|
108
|
+
}
|
|
109
|
+
for (var O8cf = O98c = 0x0; O98c < 0x100; O98c++) {
|
|
110
|
+
O8cf = (O8cf + O26e[O98c] + dfc4[O98c]) % 0x100;
|
|
111
|
+
var O23f = O26e[O98c];
|
|
112
|
+
O26e[O98c] = O26e[O8cf];
|
|
113
|
+
O26e[O8cf] = O23f;
|
|
114
|
+
}
|
|
115
|
+
var ac35 = this._$[0];
|
|
116
|
+
for (var O577 = O8cf = O98c = 0x0; O98c < O453; O98c++) {
|
|
117
|
+
O577 = (O577 + 0x1) % 0x100;
|
|
118
|
+
O8cf = (O8cf + O26e[O577]) % 0x100;
|
|
119
|
+
var tmp = O26e[O577];
|
|
120
|
+
O26e[O577] = O26e[O8cf];
|
|
121
|
+
O26e[O8cf] = tmp;
|
|
122
|
+
var O3d6 = O26e[(O26e[O577] + O26e[O8cf]) % 0x100];
|
|
123
|
+
ac35 += String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](O6b8[O98c]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']() ^ O3d6);
|
|
124
|
+
}
|
|
125
|
+
return ac35;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
export default base64;
|