tntd 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stats.json +38 -38
- package/lib/ArrayInput/icon.js +31 -27
- package/lib/ArrayInput/index.js +298 -211
- package/lib/AuthContext.js +13 -2
- package/lib/Columns/index.js +100 -71
- package/lib/DevelopmentLogin/LoginModal.js +141 -79
- package/lib/DevelopmentLogin/index.js +55 -28
- package/lib/Ellipsis/Svg/CopySVG.js +71 -23
- package/lib/Ellipsis/Svg/TickSVG.js +49 -17
- package/lib/Ellipsis/index.js +154 -148
- package/lib/Handle/index.js +109 -72
- package/lib/Icon/fonts/iconfont.js +43 -1
- package/lib/Icon/iconList.js +8 -119
- package/lib/Icon/index.js +45 -13
- package/lib/Img/Contain.js +81 -49
- package/lib/Img/Cover.js +136 -88
- package/lib/Img/index.js +89 -36
- package/lib/Layout/ActionsContext.js +11 -2
- package/lib/Layout/AppList.js +256 -262
- package/lib/Layout/Application.js +135 -119
- package/lib/Layout/Avatar.js +137 -137
- package/lib/Layout/CompatibleLanguage.js +195 -214
- package/lib/Layout/EnterpriseLayout/Avatar.js +168 -156
- package/lib/Layout/EnterpriseLayout/Language.js +100 -75
- package/lib/Layout/EnterpriseLayout/Theme.js +94 -96
- package/lib/Layout/EnterpriseLayout/index.js +45 -32
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +407 -335
- package/lib/Layout/GlobalNavigation/index.js +158 -110
- package/lib/Layout/Header.js +116 -165
- package/lib/Layout/HeaderActions.js +129 -132
- package/lib/Layout/HeaderNavs.js +113 -90
- package/lib/Layout/HeaderTabs.js +278 -312
- package/lib/Layout/Iconfont.js +15 -2
- package/lib/Layout/Language.js +102 -63
- package/lib/Layout/Layout.js +261 -272
- package/lib/Layout/Logo.js +87 -132
- package/lib/Layout/OrgAppList.js +319 -440
- package/lib/Layout/SideMenu.js +343 -429
- package/lib/Layout/Theme.js +124 -95
- package/lib/Layout/checkAuth.js +35 -21
- package/lib/Layout/createActions.js +51 -38
- package/lib/Layout/images/index.js +41 -33
- package/lib/Layout/index.js +161 -110
- package/lib/Layout/paaslayout/CompactSideMenu.js +178 -200
- package/lib/Layout/paaslayout/Header.js +90 -84
- package/lib/Layout/paaslayout/Logo.js +32 -27
- package/lib/Layout/paaslayout/SideMenu.js +174 -161
- package/lib/Layout/paaslayout/index.js +261 -240
- package/lib/Layout/storage.js +78 -20
- package/lib/Layout/utils.js +143 -93
- package/lib/LoadingButton/index.js +67 -25
- package/lib/Modal/index.js +108 -83
- package/lib/Page/Box.js +81 -56
- package/lib/Page/index.js +173 -151
- package/lib/Page/utils.js +30 -12
- package/lib/QueryForm/Field/Checkbox.js +33 -11
- package/lib/QueryForm/Field/Select.js +99 -63
- package/lib/QueryForm/Field/SelectInput.js +114 -69
- package/lib/QueryForm/Field/fieldsMap.js +52 -30
- package/lib/QueryForm/Field/index.js +158 -76
- package/lib/QueryForm/createActions.js +65 -50
- package/lib/QueryForm/index.js +383 -304
- package/lib/QueryForm/useForm.js +17 -6
- package/lib/QueryListScene/List.js +366 -290
- package/lib/QueryListScene/QueryForm.js +161 -93
- package/lib/QueryListScene/QueryListScene.js +87 -33
- package/lib/QueryListScene/Title.js +20 -10
- package/lib/QueryListScene/Toolbar.js +31 -8
- package/lib/QueryListScene/createActions.js +79 -64
- package/lib/QueryListScene/index.js +40 -23
- package/lib/QueryListScene/useActions.js +17 -6
- package/lib/Select/DropDownWrap.js +124 -60
- package/lib/Select/index.js +561 -425
- package/lib/Table/ResizableTable/index.js +121 -77
- package/lib/Table/index.js +51 -19
- package/lib/Title/index.js +52 -34
- package/lib/index.js +159 -19
- package/lib/locale.js +63 -48
- package/package.json +1 -1
|
@@ -1,121 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
width: 44px;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
require("antd/lib/popover/style");
|
|
9
|
+
|
|
10
|
+
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
11
|
+
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _lodash = require("lodash");
|
|
19
|
+
|
|
20
|
+
var _logoIcon = require("@tntx/logo-icon");
|
|
21
|
+
|
|
22
|
+
var _Iconfont = _interopRequireDefault(require("./Iconfont"));
|
|
23
|
+
|
|
24
|
+
var _images = require("./images");
|
|
25
|
+
|
|
26
|
+
var _this = void 0;
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function _templateObject4() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n background-color: #fff;\n border-radius: 4px;\n z-index: 1;\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject4 = function _templateObject4() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject3() {
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n position: relative;\n width: 88px;\n padding: 8px 0;\n cursor: pointer;\n display: inline-block;\n text-align: center;\n &:hover, &.active {\n background: #eee;\n }\n &.active:after {\n position: absolute;\n width: 0;\n height: 0;\n border-width: 5px 10px 0 0;\n border-color: #333;\n border-style: solid;\n z-index: 9;\n }\n img {\n width: 44px;\n height: 44px;\n margin-bottom: 6px;\n }\n div {\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject3 = function _templateObject3() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject2() {
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n list-style: none;\n width: 264px;\n margin: 0;\n padding: 0;\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject2 = function _templateObject2() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject() {
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n margin-left: 20px;\n font-size: 20px;\n cursor: pointer;\n .tnt-icon {\n color: #17233d99;\n .tnt-themeS1 & {\n color: rgba(255,255,255,.85);\n }\n }\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject = function _templateObject() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
79
|
+
|
|
80
|
+
var App = _styledComponents["default"].li(_templateObject());
|
|
81
|
+
|
|
82
|
+
var AppList = _styledComponents["default"].ul(_templateObject2());
|
|
83
|
+
|
|
84
|
+
var AppItem = _styledComponents["default"].li(_templateObject3());
|
|
85
|
+
|
|
86
|
+
var AppContentWrapper = _styledComponents["default"].div(_templateObject4());
|
|
87
|
+
|
|
88
|
+
var AppContent = function AppContent(props) {
|
|
89
|
+
var language = props.language,
|
|
90
|
+
apps = props.apps,
|
|
91
|
+
onChange = props.onChange;
|
|
92
|
+
|
|
93
|
+
var _useState = (0, _react.useState)(props.appKey),
|
|
94
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
95
|
+
appKey = _useState2[0],
|
|
96
|
+
setAppKey = _useState2[1];
|
|
97
|
+
|
|
98
|
+
var changeApp = function changeApp(appKey) {
|
|
99
|
+
setAppKey(appKey);
|
|
100
|
+
onChange && onChange(appKey);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort(function (a, b) {
|
|
104
|
+
return (0, _lodash.get)(_logoIcon.systemMap, "".concat(a.appKey, ".sort"), 1) - (0, _lodash.get)(_logoIcon.systemMap, "".concat(b.appKey, ".sort"), 1);
|
|
105
|
+
}).map(function (_ref) {
|
|
106
|
+
var key = _ref.appKey;
|
|
107
|
+
return React.createElement(AppItem, {
|
|
108
|
+
key: key,
|
|
109
|
+
className: (0, _classnames["default"])({
|
|
110
|
+
active: appKey === key
|
|
111
|
+
}),
|
|
112
|
+
onClick: changeApp.bind(_this, key)
|
|
113
|
+
}, React.createElement("img", {
|
|
114
|
+
src: (0, _lodash.get)(_logoIcon.systemMap, "".concat(key, ".logo"), _images.defaultLogo),
|
|
115
|
+
onError: function onError(e) {
|
|
116
|
+
e.target.onerror = null;
|
|
117
|
+
e.target.src = _images.defaultLogo;
|
|
118
|
+
}
|
|
119
|
+
}), React.createElement("div", null, (0, _lodash.get)(_logoIcon.systemMap, "".concat(key, ".").concat({
|
|
120
|
+
cn: 'name',
|
|
121
|
+
en: 'enName'
|
|
122
|
+
}[language || 'cn']), key)));
|
|
123
|
+
})));
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var _default = function _default(props) {
|
|
127
|
+
return React.createElement(App, null, React.createElement(_popover["default"], {
|
|
128
|
+
placement: "bottomRight",
|
|
129
|
+
title: null,
|
|
130
|
+
content: React.createElement(AppContent, props),
|
|
131
|
+
trigger: "click"
|
|
132
|
+
}, React.createElement(_Iconfont["default"], {
|
|
133
|
+
type: "application"
|
|
134
|
+
})));
|
|
108
135
|
};
|
|
109
136
|
|
|
110
|
-
|
|
111
|
-
<App>
|
|
112
|
-
<Popover
|
|
113
|
-
placement="bottomRight"
|
|
114
|
-
title={null}
|
|
115
|
-
content={<AppContent {...props} />}
|
|
116
|
-
trigger="click"
|
|
117
|
-
>
|
|
118
|
-
<Iconfont type="application" />
|
|
119
|
-
</Popover>
|
|
120
|
-
</App>
|
|
121
|
-
);
|
|
137
|
+
exports["default"] = _default;
|
package/lib/Layout/Avatar.js
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
import styled, { createGlobalStyle } from 'styled-components';
|
|
3
|
-
import { Popover, Button } from 'antd';
|
|
4
|
-
import deleteAllCookiesFactory from 'delete-all-cookies';
|
|
5
|
-
import { get } from 'lodash';
|
|
6
|
-
import images from './images';
|
|
7
|
-
import ActionsContext from './ActionsContext';
|
|
8
|
-
|
|
9
|
-
const Avatar = styled.li`
|
|
10
|
-
margin-right: 0;
|
|
11
|
-
font-size: 0;
|
|
12
|
-
img {
|
|
13
|
-
width: 26px;
|
|
14
|
-
height: 26px;
|
|
15
|
-
border-radius: 50%;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
.large-size & {
|
|
18
|
-
width: 32px;
|
|
19
|
-
height: 32px;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
1
|
+
"use strict";
|
|
23
2
|
|
|
24
|
-
|
|
25
|
-
.tnt-layout-personal-popover {
|
|
26
|
-
.ant-popover-inner-content {
|
|
27
|
-
padding: 0;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
31
4
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
border-radius: 4px;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
37
9
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
background-color: #f5f5f5;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
10
|
+
require("antd/lib/popover/style");
|
|
11
|
+
|
|
12
|
+
var _popover = _interopRequireDefault(require("antd/lib/popover"));
|
|
13
|
+
|
|
14
|
+
require("antd/lib/button/style");
|
|
15
|
+
|
|
16
|
+
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
17
|
+
|
|
18
|
+
var _react = require("react");
|
|
19
|
+
|
|
20
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
22
|
+
var _deleteAllCookies = _interopRequireDefault(require("delete-all-cookies"));
|
|
23
|
+
|
|
24
|
+
var _lodash = require("lodash");
|
|
25
|
+
|
|
26
|
+
var _images = _interopRequireDefault(require("./images"));
|
|
27
|
+
|
|
28
|
+
var _ActionsContext = _interopRequireDefault(require("./ActionsContext"));
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
+
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
+
|
|
36
|
+
function _templateObject3() {
|
|
37
|
+
var data = _taggedTemplateLiteral(["\n min-width: 235px;\n z-index: 1;\n background-color: #fff;\n border-radius: 4px;\n\n .isInIframe & {\n display: none;\n }\n \n .user-info-body {\n padding: 30px 20px 20px 24px;\n line-height: 16px;\n .user-info-body-username {\n margin-top: 0px;\n font-size: 16px;\n color: #333;\n font-weight: normal;\n margin-bottom: 10px;\n line-height: 16px;\n }\n .user-info-body-account {\n margin-top: 0px;\n color: #666;\n margin-bottom: 14px;\n line-height: 16px;\n }\n a {\n margin-right: 16px;\n }\n }\n .user-info-footer {\n border-top: 1px solid #ccc;\n background-color: #f5f5f5;\n padding: 8px 20px;\n text-align: right;\n .user-info-footer-signout:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, .1);\n border-color: #d9d9d9;\n color: rgba(0, 0, 0, 0.65);\n }\n }\n"]);
|
|
38
|
+
|
|
39
|
+
_templateObject3 = function _templateObject3() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _templateObject2() {
|
|
47
|
+
var data = _taggedTemplateLiteral(["\n .tnt-layout-personal-popover {\n .ant-popover-inner-content {\n padding: 0;\n }\n }\n"]);
|
|
48
|
+
|
|
49
|
+
_templateObject2 = function _templateObject2() {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _templateObject() {
|
|
57
|
+
var data = _taggedTemplateLiteral(["\n margin-right: 0;\n font-size: 0;\n img {\n width: 26px;\n height: 26px;\n border-radius: 50%;\n cursor: pointer;\n .large-size & {\n width: 32px;\n height: 32px;\n }\n }\n"]);
|
|
58
|
+
|
|
59
|
+
_templateObject = function _templateObject() {
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
67
|
+
|
|
68
|
+
var Avatar = _styledComponents["default"].li(_templateObject());
|
|
69
|
+
|
|
70
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject2());
|
|
71
|
+
|
|
72
|
+
var UserInfoWrapper = _styledComponents["default"].div(_templateObject3());
|
|
73
|
+
|
|
74
|
+
var UserInfoContent = function UserInfoContent(props) {
|
|
75
|
+
var userInfo = props.userInfo,
|
|
76
|
+
onLogout = props.onLogout,
|
|
77
|
+
_props$onChangePasswo = props.onChangePassword,
|
|
78
|
+
onChangePassword = _props$onChangePasswo === void 0 ? function () {
|
|
79
|
+
return true;
|
|
80
|
+
} : _props$onChangePasswo,
|
|
81
|
+
_props$onPersonalSett = props.onPersonalSetting,
|
|
82
|
+
onPersonalSetting = _props$onPersonalSett === void 0 ? function () {
|
|
83
|
+
return true;
|
|
84
|
+
} : _props$onPersonalSett;
|
|
85
|
+
|
|
86
|
+
var _useContext = (0, _react.useContext)(_ActionsContext["default"]),
|
|
87
|
+
getText = _useContext.getText;
|
|
88
|
+
|
|
89
|
+
return React.createElement(UserInfoWrapper, {
|
|
90
|
+
className: "user-info-setting-wrap"
|
|
91
|
+
}, React.createElement("div", {
|
|
92
|
+
className: "user-info-body"
|
|
93
|
+
}, React.createElement("p", {
|
|
94
|
+
className: "user-info-body-username"
|
|
95
|
+
}, userInfo.userName || '暂无昵称'), React.createElement("p", {
|
|
96
|
+
className: "user-info-body-account"
|
|
97
|
+
}, userInfo.account), React.createElement("a", {
|
|
98
|
+
onClick: onPersonalSetting,
|
|
99
|
+
href: "/bridge/userCenter?currentTab=1"
|
|
100
|
+
}, getText('personalSettings')), React.createElement("a", {
|
|
101
|
+
onClick: onChangePassword,
|
|
102
|
+
href: "/bridge/userCenter?currentTab=2"
|
|
103
|
+
}, getText('changePwd'))), React.createElement("div", {
|
|
104
|
+
className: "user-info-footer"
|
|
105
|
+
}, React.createElement(_button["default"], {
|
|
106
|
+
className: "user-info-footer-signout",
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
if (onLogout) {
|
|
109
|
+
onLogout();
|
|
110
|
+
(0, _deleteAllCookies["default"])(window)();
|
|
111
|
+
} else {
|
|
112
|
+
(0, _deleteAllCookies["default"])(window)();
|
|
113
|
+
window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
|
|
114
|
+
}
|
|
73
115
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const UserInfoContent = props => {
|
|
77
|
-
const { userInfo, onLogout, onChangePassword = () => true, onPersonalSetting = () => true } = props;
|
|
78
|
-
const { getText } = useContext(ActionsContext);
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<UserInfoWrapper className="user-info-setting-wrap">
|
|
82
|
-
<div className="user-info-body">
|
|
83
|
-
<p className="user-info-body-username">
|
|
84
|
-
{userInfo.userName || '暂无昵称'}
|
|
85
|
-
</p>
|
|
86
|
-
<p className="user-info-body-account">
|
|
87
|
-
{userInfo.account}
|
|
88
|
-
</p>
|
|
89
|
-
<a onClick={onPersonalSetting} href="/bridge/userCenter?currentTab=1">{getText('personalSettings')}</a>
|
|
90
|
-
<a onClick={onChangePassword} href="/bridge/userCenter?currentTab=2">{getText('changePwd')}</a>
|
|
91
|
-
</div>
|
|
92
|
-
<div className="user-info-footer">
|
|
93
|
-
<Button
|
|
94
|
-
className="user-info-footer-signout"
|
|
95
|
-
onClick={() => {
|
|
96
|
-
if (onLogout) {
|
|
97
|
-
onLogout();
|
|
98
|
-
deleteAllCookiesFactory(window)();
|
|
99
|
-
} else {
|
|
100
|
-
deleteAllCookiesFactory(window)();
|
|
101
|
-
window.location.href = `/user/login?callbackUrl=${window.encodeURI(location.href)}`;
|
|
102
|
-
}
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
<a>{getText('signOut')}</a>
|
|
106
|
-
</Button>
|
|
107
|
-
</div>
|
|
108
|
-
</UserInfoWrapper>
|
|
109
|
-
);
|
|
116
|
+
}, React.createElement("a", null, getText('signOut')))));
|
|
110
117
|
};
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/>
|
|
136
|
-
) : (
|
|
137
|
-
<img src={images.empty?.default || images.empty} />
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
</Popover>
|
|
141
|
-
<GlobalStyle />
|
|
142
|
-
</Avatar>
|
|
143
|
-
);
|
|
119
|
+
var _default = function _default(props) {
|
|
120
|
+
var _images$empty2;
|
|
121
|
+
|
|
122
|
+
var _props$userInfo = props.userInfo,
|
|
123
|
+
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo;
|
|
124
|
+
var avatar = userInfo.avatar;
|
|
125
|
+
return React.createElement(Avatar, null, React.createElement(_popover["default"], {
|
|
126
|
+
popupClassName: "tnt-layout-personal-popover",
|
|
127
|
+
placement: "bottomRight",
|
|
128
|
+
title: null,
|
|
129
|
+
content: React.createElement(UserInfoContent, props),
|
|
130
|
+
trigger: "click"
|
|
131
|
+
}, avatar ? React.createElement("img", {
|
|
132
|
+
src: avatar.indexOf('base64') > 0 ? avatar : (0, _lodash.get)(_images["default"][avatar], 'default', _images["default"][avatar]),
|
|
133
|
+
onError: function onError(e) {
|
|
134
|
+
var _images$empty;
|
|
135
|
+
|
|
136
|
+
e.target.onerror = null;
|
|
137
|
+
e.target.src = ((_images$empty = _images["default"].empty) == null ? void 0 : _images$empty["default"]) || _images["default"].empty;
|
|
138
|
+
}
|
|
139
|
+
}) : React.createElement("img", {
|
|
140
|
+
src: ((_images$empty2 = _images["default"].empty) == null ? void 0 : _images$empty2["default"]) || _images["default"].empty
|
|
141
|
+
})), React.createElement(GlobalStyle, null));
|
|
144
142
|
};
|
|
143
|
+
|
|
144
|
+
exports["default"] = _default;
|