tntd 1.4.19 → 1.4.21

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 (44) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/Layout/Avatar.js +4 -4
  4. package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
  5. package/components/Layout/EnterpriseLayout/Language.js +5 -3
  6. package/components/Layout/EnterpriseLayout/Theme.js +6 -7
  7. package/components/Layout/EnterpriseLayout/index.js +1 -1
  8. package/components/Layout/HeaderActions.js +13 -10
  9. package/components/Layout/HeaderTabs.js +13 -14
  10. package/components/Layout/Layout.js +2 -0
  11. package/components/Layout/index.js +2 -1
  12. package/components/Layout/storage.js +12 -2
  13. package/components/Page/index.js +2 -2
  14. package/components/locale.js +15 -4
  15. package/dist/1.tntd.js +1 -12
  16. package/dist/stats.json +5247 -5069
  17. package/dist/tntd.js +14 -3
  18. package/es/Handle/README.md +0 -20
  19. package/es/Handle/index.js +38 -13
  20. package/es/Layout/Avatar.js +4 -4
  21. package/es/Layout/EnterpriseLayout/Avatar.js +16 -8
  22. package/es/Layout/EnterpriseLayout/Language.js +6 -3
  23. package/es/Layout/EnterpriseLayout/Theme.js +10 -6
  24. package/es/Layout/HeaderActions.js +15 -12
  25. package/es/Layout/HeaderTabs.js +13 -14
  26. package/es/Layout/Layout.js +3 -1
  27. package/es/Layout/index.js +3 -2
  28. package/es/Layout/storage.js +19 -3
  29. package/es/Page/index.js +3 -2
  30. package/es/locale.js +14 -4
  31. package/lib/Handle/README.md +0 -20
  32. package/lib/Handle/index.js +39 -13
  33. package/lib/Layout/Avatar.js +5 -5
  34. package/lib/Layout/EnterpriseLayout/Avatar.js +19 -9
  35. package/lib/Layout/EnterpriseLayout/Language.js +5 -2
  36. package/lib/Layout/EnterpriseLayout/Theme.js +9 -5
  37. package/lib/Layout/HeaderActions.js +8 -5
  38. package/lib/Layout/HeaderTabs.js +8 -9
  39. package/lib/Layout/Layout.js +3 -1
  40. package/lib/Layout/index.js +3 -2
  41. package/lib/Layout/storage.js +28 -5
  42. package/lib/Page/index.js +3 -2
  43. package/lib/locale.js +18 -4
  44. package/package.json +1 -1
@@ -54,26 +54,6 @@ const Demo = props => {
54
54
  <a>查看</a>
55
55
  <a>编辑</a>
56
56
  <a>测试</a>
57
- {
58
- false &&
59
- <a>导入</a>
60
- }
61
- <a>导出</a>
62
- <Popconfirm
63
- title="Are you sure delete this task?"
64
- onConfirm={void 0}
65
- onCancel={void 0}
66
- okText="Yes"
67
- cancelText="No"
68
- onClick={e => e.stopPropagation()}
69
- getPopupContainer={trigger => trigger.parentNode}
70
- trigger="hover"
71
- overlayStyle={{
72
- width: 300
73
- }}
74
- >
75
- <a>Delete</a>
76
- </Popconfirm>
77
57
  </Handle>
78
58
  )
79
59
  }
@@ -12,11 +12,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
12
12
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
13
13
 
14
14
  import { Fragment } from 'react';
15
+ import { getText, getLanguage } from '../locale';
15
16
  import Icon from '../Icon';
16
17
  import './index.less';
17
18
  var clsPrefix = 'tnt-more-menus';
18
19
  export default (function (props) {
19
- var _lastChildPart2, _lastChildPart3;
20
+ var _lastChildPart2;
20
21
 
21
22
  var _ref = props || {},
22
23
  _ref$children = _ref.children,
@@ -24,11 +25,17 @@ export default (function (props) {
24
25
  type = _ref.type,
25
26
  _ref$num = _ref.num,
26
27
  num = _ref$num === void 0 ? 3 : _ref$num,
27
- lang = _ref.lang,
28
28
  _ref$divider = _ref.divider,
29
29
  divider = _ref$divider === void 0 ? true : _ref$divider,
30
30
  lessOneMoreFit = _ref.lessOneMoreFit,
31
- rest = _objectWithoutProperties(_ref, ["children", "type", "num", "lang", "divider", "lessOneMoreFit"]);
31
+ rest = _objectWithoutProperties(_ref, ["children", "type", "num", "divider", "lessOneMoreFit"]);
32
+
33
+ var _ref2 = props || {},
34
+ lang = _ref2.lang;
35
+
36
+ if (!lang) {
37
+ lang = getLanguage();
38
+ }
32
39
 
33
40
  var newChildren = [];
34
41
 
@@ -66,25 +73,43 @@ export default (function (props) {
66
73
  });
67
74
  }
68
75
 
69
- var menu = React.createElement(_Menu, {
70
- className: "org-pop-opera-btn"
71
- }, (_lastChildPart2 = lastChildPart) == null ? void 0 : _lastChildPart2.map(function (child, i) {
72
- return React.createElement(_Menu.Item, {
73
- key: i
74
- }, child);
75
- }));
76
+ var menu = function menu(childArr) {
77
+ return React.createElement(_Menu, {
78
+ className: "org-pop-opera-btn"
79
+ }, childArr == null ? void 0 : childArr.map(function (child, i) {
80
+ return React.createElement(_Menu.Item, {
81
+ key: i
82
+ }, child);
83
+ }));
84
+ };
85
+
86
+ if (lang === 'en') {
87
+ return React.createElement(_Dropdown, {
88
+ overlay: menu(newChildren || []),
89
+ arrow: true
90
+ }, type === 'icon' ? React.createElement(Icon, {
91
+ type: "more"
92
+ }) : React.createElement("a", {
93
+ className: "ant-dropdown-more"
94
+ }, getText('handleMore', lang), React.createElement("i", {
95
+ className: "".concat(clsPrefix, "-dropdown-icon")
96
+ }, React.createElement(Icon, {
97
+ type: "down"
98
+ }))));
99
+ }
100
+
76
101
  return React.createElement("div", _extends({
77
102
  onClick: function onClick(e) {
78
103
  e.stopPropagation();
79
104
  }
80
- }, rest), preChildPart, ((_lastChildPart3 = lastChildPart) == null ? void 0 : _lastChildPart3.length) > 0 && React.createElement(_Dropdown, {
81
- overlay: menu,
105
+ }, rest), preChildPart, !!((_lastChildPart2 = lastChildPart) == null ? void 0 : _lastChildPart2.length) && React.createElement(_Dropdown, {
106
+ overlay: menu(lastChildPart || []),
82
107
  arrow: true
83
108
  }, type === 'icon' ? React.createElement(Icon, {
84
109
  type: "more"
85
110
  }) : React.createElement("a", {
86
111
  className: "ant-dropdown-more"
87
- }, lang === 'en' ? 'More' : '更多', React.createElement("i", {
112
+ }, getText('handleMore', lang), React.createElement("i", {
88
113
  className: "".concat(clsPrefix, "-dropdown-icon")
89
114
  }, React.createElement(Icon, {
90
115
  type: "down"
@@ -37,10 +37,10 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
37
37
 
38
38
  import { useContext } from 'react';
39
39
  import styled, { createGlobalStyle } from 'styled-components';
40
- import deleteAllCookiesFactory from 'delete-all-cookies';
41
40
  import { get } from 'lodash';
42
41
  import images from './images';
43
42
  import ActionsContext from './ActionsContext';
43
+ import { clearLoginCookie } from './storage';
44
44
  var Avatar = styled.li(_templateObject());
45
45
  var GlobalStyle = createGlobalStyle(_templateObject2());
46
46
  var UserInfoWrapper = styled.div(_templateObject3());
@@ -66,7 +66,7 @@ var UserInfoContent = function UserInfoContent(props) {
66
66
  className: "user-info-body"
67
67
  }, React.createElement("p", {
68
68
  className: "user-info-body-username"
69
- }, userInfo.userName || '暂无昵称'), React.createElement("p", {
69
+ }, userInfo.userName || getText('nameNull')), React.createElement("p", {
70
70
  className: "user-info-body-account"
71
71
  }, userInfo.account), React.createElement("a", {
72
72
  onClick: onPersonalSetting,
@@ -81,9 +81,9 @@ var UserInfoContent = function UserInfoContent(props) {
81
81
  onClick: function onClick() {
82
82
  if (onLogout) {
83
83
  onLogout();
84
- deleteAllCookiesFactory(window)();
84
+ clearLoginCookie();
85
85
  } else {
86
- deleteAllCookiesFactory(window)();
86
+ clearLoginCookie();
87
87
  window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
88
88
  }
89
89
  }
@@ -37,12 +37,14 @@ function _templateObject() {
37
37
 
38
38
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
39
39
 
40
+ import { useContext } from 'react';
40
41
  import styled, { createGlobalStyle } from 'styled-components';
41
- import deleteAllCookiesFactory from 'delete-all-cookies';
42
42
  import { get } from 'lodash';
43
43
  import images from '../images';
44
+ import ActionsContext from '../ActionsContext';
44
45
  import Language from './Language';
45
46
  import Theme from './Theme';
47
+ import { getLanguageStore, clearLoginCookie } from '../storage';
46
48
  var Avatar = styled.li(_templateObject());
47
49
  var GlobalStyle = createGlobalStyle(_templateObject2());
48
50
  var UserInfoWrapper = styled.div(_templateObject3(), function (props) {
@@ -71,6 +73,9 @@ var UserInfoContent = function UserInfoContent(props) {
71
73
  onLanguageChange = props.onLanguageChange,
72
74
  onThemeChange = props.onThemeChange;
73
75
 
76
+ var _useContext = useContext(ActionsContext),
77
+ getText = _useContext.getText;
78
+
74
79
  var _ref = config || {},
75
80
  _ref$language = _ref.language,
76
81
  language = _ref$language === void 0 ? true : _ref$language;
@@ -81,7 +86,7 @@ var UserInfoContent = function UserInfoContent(props) {
81
86
  className: "user-info-body"
82
87
  }, React.createElement("li", {
83
88
  className: "user-info-body-username"
84
- }, userInfo.userName || '暂无昵称', React.createElement("span", {
89
+ }, userInfo.userName || getText('nameNull'), React.createElement("span", {
85
90
  className: "user-info-body-account"
86
91
  }, userInfo.account)), language && React.createElement(Language, {
87
92
  language: userInfo.lang,
@@ -97,25 +102,28 @@ var UserInfoContent = function UserInfoContent(props) {
97
102
  }, React.createElement("a", {
98
103
  onClick: onPersonalSetting,
99
104
  href: "/bridge/userCenter?currentTab=1"
100
- }, "\u4E2A\u4EBA\u8BBE\u7F6E"), React.createElement(_Divider, {
105
+ }, getText('personalSettings')), React.createElement(_Divider, {
101
106
  type: "vertical"
102
107
  }), React.createElement("a", {
103
108
  onClick: onChangePassword,
104
- href: "/bridge/userCenter?currentTab=2"
105
- }, "\u4FEE\u6539\u5BC6\u7801"), React.createElement(_Divider, {
109
+ href: "/bridge/userCenter?currentTab=2",
110
+ style: getLanguageStore() === 'en' ? {
111
+ flex: 2
112
+ } : {}
113
+ }, getText('changePwd')), React.createElement(_Divider, {
106
114
  type: "vertical"
107
115
  }), React.createElement("a", {
108
116
  className: "user-info-footer-signout",
109
117
  onClick: function onClick() {
110
118
  if (onLogout) {
111
119
  onLogout();
112
- deleteAllCookiesFactory(window)();
120
+ clearLoginCookie();
113
121
  } else {
114
- deleteAllCookiesFactory(window)();
122
+ clearLoginCookie();
115
123
  window.location.href = "/user/login?callbackUrl=".concat(window.encodeURI(location.href));
116
124
  }
117
125
  }
118
- }, "\u9000\u51FA\u767B\u5F55")));
126
+ }, getText('signOut'))));
119
127
  };
120
128
 
121
129
  export default (function (props) {
@@ -18,7 +18,7 @@ function _templateObject() {
18
18
 
19
19
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
20
20
 
21
- import { useState } from 'react';
21
+ import { useState, useMemo } from 'react';
22
22
  import styled, { withTheme } from 'styled-components';
23
23
  import { get } from 'lodash';
24
24
  import Iconfont from '../Iconfont';
@@ -73,9 +73,12 @@ export default withTheme(function (props) {
73
73
  onChange && onChange(lang);
74
74
  };
75
75
 
76
+ var otherLanguage = useMemo(function () {
77
+ return language === 'cn' ? 'en' : 'cn';
78
+ }, [language]);
76
79
  return React.createElement(Language, {
77
80
  onClick: switchLanguage
78
81
  }, React.createElement(Iconfont, {
79
- type: "flag-".concat(language)
80
- }), React.createElement("span", null, get(languagesMap[language], 'name')));
82
+ type: "flag-".concat(otherLanguage)
83
+ }), React.createElement("span", null, get(languagesMap[otherLanguage], 'name')));
81
84
  });
@@ -26,17 +26,20 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
26
26
  import { useState } from 'react';
27
27
  import styled from 'styled-components';
28
28
  import Iconfont from '../Iconfont';
29
- import { setThemeStore, getThemeStore } from '../storage';
29
+ import { setThemeStore, getThemeStore, getLanguageStore } from '../storage';
30
30
  var Theme = styled.li(_templateObject());
31
31
  var themes = [{
32
32
  value: 'themeS3',
33
- label: '科技蓝'
33
+ label: '科技蓝',
34
+ enLabel: 'Blue'
34
35
  }, {
35
36
  value: 'themeS2',
36
- label: '暗夜黑'
37
+ label: '暗夜黑',
38
+ enLabel: 'Black'
37
39
  }, {
38
40
  value: 'themeS1',
39
- label: '极致白'
41
+ label: '极致白',
42
+ enLabel: 'White'
40
43
  }];
41
44
  export default (function (props) {
42
45
  var onChange = props.onChange;
@@ -66,11 +69,12 @@ export default (function (props) {
66
69
  className: "user-info-body-theme-row"
67
70
  }, themes.map(function (_ref2) {
68
71
  var value = _ref2.value,
69
- label = _ref2.label;
72
+ label = _ref2.label,
73
+ enLabel = _ref2.enLabel;
70
74
  return React.createElement("div", {
71
75
  className: value,
72
76
  onClick: changeTheme.bind(_this, value)
73
- }, label, theme === value && React.createElement("span", {
77
+ }, getLanguageStore() === 'en' ? enLabel : label, theme === value && React.createElement("span", {
74
78
  className: "icon-checked-wrap"
75
79
  }));
76
80
  })));
@@ -17,20 +17,21 @@ function _templateObject() {
17
17
 
18
18
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
19
19
 
20
- import styled, { withTheme } from "styled-components";
21
- import GlobalNavigation from "./GlobalNavigation";
22
- import Language from "./Language";
23
- import Theme from "./Theme";
24
- import LanguageTheme from "./CompatibleLanguage";
25
- import Application from "./Application";
26
- import Avatar from "./Avatar";
20
+ import styled, { withTheme } from 'styled-components';
21
+ import GlobalNavigation from './GlobalNavigation';
22
+ import Language from './Language';
23
+ import Theme from './Theme';
24
+ import LanguageTheme from './CompatibleLanguage';
25
+ import Application from './Application';
26
+ import Avatar from './Avatar';
27
27
  var Actions = styled.ul(_templateObject(), function (props) {
28
28
  return "".concat(props.theme.headerHeight, "px");
29
29
  }, function (props) {
30
30
  return "".concat(props.theme.headerActionsColor);
31
31
  });
32
32
  export default withTheme(function (props) {
33
- var _props$config = props.config;
33
+ var type = props.type,
34
+ _props$config = props.config;
34
35
  _props$config = _props$config === void 0 ? {} : _props$config;
35
36
 
36
37
  var _props$config$theme = _props$config.theme,
@@ -54,18 +55,19 @@ export default withTheme(function (props) {
54
55
  onThemeChange = props.onThemeChange,
55
56
  onApplicationChange = props.onApplicationChange,
56
57
  onAppChange = props.onAppChange,
58
+ onOrgChange = props.onOrgChange,
57
59
  onCollapseChange = props.onCollapseChange,
58
60
  onPersonalSetting = props.onPersonalSetting,
59
61
  onChangePassword = props.onChangePassword,
60
62
  onLogout = props.onLogout,
61
63
  onLogoClick = props.onLogoClick,
62
64
  AvatarCustom = props.AvatarCustom,
63
- rest = _objectWithoutProperties(props, ["config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
65
+ rest = _objectWithoutProperties(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onOrgChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
64
66
 
65
67
  return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(GlobalNavigation, {
66
68
  headerRef: headerRef,
67
69
  menus: menus
68
- }), !compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
70
+ }), type !== 'enterprise' && (!compatible ? React.createElement(React.Fragment, null, language && React.createElement(Language, {
69
71
  language: userInfo.lang,
70
72
  onChange: onLanguageChange
71
73
  }), theme && React.createElement(Theme, {
@@ -77,7 +79,7 @@ export default withTheme(function (props) {
77
79
  theme: userInfo.theme,
78
80
  onLanguageChange: onLanguageChange,
79
81
  onThemeChange: onThemeChange
80
- }), application && React.createElement(Application, {
82
+ })), application && React.createElement(Application, {
81
83
  language: userInfo.lang,
82
84
  apps: apps,
83
85
  onChange: onApplicationChange
@@ -92,7 +94,8 @@ export default withTheme(function (props) {
92
94
  config: {
93
95
  theme: theme,
94
96
  language: language
95
- }
97
+ },
98
+ onLanguageChange: onLanguageChange
96
99
  }) : React.createElement(Avatar, {
97
100
  userInfo: userInfo,
98
101
  onPersonalSetting: onPersonalSetting,
@@ -46,17 +46,17 @@ function _templateObject() {
46
46
 
47
47
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
48
48
 
49
- import { useState, useEffect, useRef } from "react";
50
- import styled, { withTheme } from "styled-components";
51
- import cn from "classnames";
52
- import { get } from "lodash";
53
- import Icon from "../Icon";
49
+ import { useState, useEffect, useRef } from 'react';
50
+ import styled, { withTheme } from 'styled-components';
51
+ import cn from 'classnames';
52
+ import { get } from 'lodash';
53
+ import Icon from '../Icon';
54
54
  var TabsContainer = styled.div(_templateObject(), function (props) {
55
55
  return "".concat(props.theme.blueBgColor);
56
56
  });
57
57
  var Tabs = styled.ul(_templateObject2());
58
58
  var TabItem = styled.li(_templateObject3(), function (props) {
59
- return props.theme.size === "large" ? "46px" : "36px";
59
+ return props.theme.size === 'large' ? '46px' : '36px';
60
60
  }, function (props) {
61
61
  return props.theme.headerActionsColor;
62
62
  }, function (props) {
@@ -80,7 +80,7 @@ export var HeaderTabs = withTheme(function (_ref) {
80
80
  language = _ref.language,
81
81
  props = _objectWithoutProperties(_ref, ["theme", "className", "tabs", "onTabChange", "onTabSelect", "onTabClose", "appListVisible", "orgListVisible", "orgAppListVisible", "language"]);
82
82
 
83
- var _useState = useState(props.selectedKey || get(tabs, "0.key")),
83
+ var _useState = useState(props.selectedKey || get(tabs, '0.key')),
84
84
  _useState2 = _slicedToArray(_useState, 2),
85
85
  selectedKey = _useState2[0],
86
86
  setSelectedKey = _useState2[1];
@@ -144,7 +144,7 @@ export var HeaderTabs = withTheme(function (_ref) {
144
144
  var tabsDom = getTabsDom();
145
145
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
146
146
  var parentWidth = parentBBox.width - 32;
147
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
147
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
148
148
  var index = Math.ceil(x / 130);
149
149
  var trueX = index * 130;
150
150
  var newX = Math.min(0, -(trueX - parentWidth));
@@ -161,7 +161,7 @@ export var HeaderTabs = withTheme(function (_ref) {
161
161
  var parentBBox = tabsDom.parentNode.getBoundingClientRect();
162
162
  var parentWidth = parentBBox.width - 32;
163
163
  var width = tabItems.length * 130;
164
- var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ""));
164
+ var x = Math.abs(+tabsDom.style.transform.replace(/[^\d.-]/g, ''));
165
165
  var index = Math.floor(x / 130);
166
166
  var trueX = index * 130;
167
167
  var newX = Math.max(-(width - parentWidth), -(trueX + parentWidth));
@@ -180,7 +180,7 @@ export var HeaderTabs = withTheme(function (_ref) {
180
180
  }));
181
181
  if (index === -1) return;
182
182
  var tabsDom = getTabsDom();
183
- var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, "");
183
+ var x = -+tabsDom.style.transform.replace(/[^\d.-]/g, '');
184
184
  var bbox = {
185
185
  left: index * 130,
186
186
  right: (index + 1) * 130
@@ -211,8 +211,7 @@ export var HeaderTabs = withTheme(function (_ref) {
211
211
  };
212
212
 
213
213
  useEffect(function () {
214
- setSelectedKey(props.selectedKey || get(tabs, "0.key")); // const t = [{'code':'tagdata','enName':'tagdata','icon':'layer-color','menuName':'打标数据管理打标数据管理打标数据管理','path':'/orion/tag/datalist','key':'tagdata','name':'打标数据管理打标数据管理打标数据管理'},{'code':'taglist','enName':'taglist','icon':'home','menuName':'标签管理','path':'http://baidu.com/orion/tag/list','key':'taglist','name':'标签管理'},{'code':'relation1','enName':'dadicasesearch1','icon':'home','menuName':'案件检索1','path':'/orion/case/relation1','key':'relation1','name':'案件检索1'},{'code':'dadicasesearch-0','enName':'dadicasesearch','icon':'home','menuName':'案件检索-0','path':'/orion/case/relation0','key':'dadicasesearch-0','name':'案件检索-0'},{'code':'dadicasesearch-1','enName':'dadicasesearch','icon':'home','menuName':'案件检索-1','path':'/orion/case/relation1','key':'dadicasesearch-1','name':'案件检索-1'},{'code':'dadicasesearch-2','enName':'dadicasesearch','icon':'home','menuName':'案件检索-2','path':'/orion/case/relation2','key':'dadicasesearch-2','name':'案件检索-2'},{'code':'dadicasesearch-3','enName':'dadicasesearch','icon':'home','menuName':'案件检索-3','path':'/orion/case/relation3','key':'dadicasesearch-3','name':'案件检索-3'},{'code':'dadicasesearch-4','enName':'dadicasesearch','icon':'home','menuName':'案件检索-4','path':'/orion/case/relation4','key':'dadicasesearch-4','name':'案件检索-4'},{'code':'dadicasesearch-5','enName':'dadicasesearch','icon':'home','menuName':'案件检索-5','path':'/orion/case/relation5','key':'dadicasesearch-5','name':'案件检索-5'},{'code':'dadicasesearch-6','enName':'dadicasesearch','icon':'home','menuName':'案件检索-6','path':'/orion/case/relation6','key':'dadicasesearch-6','name':'案件检索-6'},{'code':'dadicasesearch-7','enName':'dadicasesearch','icon':'home','menuName':'案件检索-7','path':'/orion/case/relation7','key':'dadicasesearch-7','name':'案件检索-7'},{'code':'dadicasesearch-8','enName':'dadicasesearch','icon':'home','menuName':'案件检索-8','path':'/orion/case/relation8','key':'dadicasesearch-8','name':'案件检索-8'}] ;
215
-
214
+ setSelectedKey(props.selectedKey || get(tabs, '0.key'));
216
215
  setTabItems(tabs);
217
216
  }, [tabs, props.selectedKey]);
218
217
  useEffect(function () {}, [props.orgAppListVisible]);
@@ -224,7 +223,7 @@ export var HeaderTabs = withTheme(function (_ref) {
224
223
  translateTabsDom(tabItems, selectedKey);
225
224
  }, [tabItems, selectedKey, appListVisible, orgListVisible, orgAppListVisible]);
226
225
  return React.createElement(TabsContainer, _extends({}, props, {
227
- className: cn("tnt-layout-header-tabs", _defineProperty({}, className, className))
226
+ className: cn('tnt-layout-header-tabs', _defineProperty({}, className, className))
228
227
  }), React.createElement(Tabs, {
229
228
  className: "tnt-layout-header-tabs-content",
230
229
  ref: tabsRef
@@ -249,7 +248,7 @@ export var HeaderTabs = withTheme(function (_ref) {
249
248
  }, {
250
249
  cn: tab.name,
251
250
  en: tab.enName || tab.name
252
- }[language || "cn"]), tab.closable !== false && tabItems.length > 1 && React.createElement(Icon, {
251
+ }[language || 'cn']), tab.closable !== false && tabItems.length > 1 && React.createElement(Icon, {
253
252
  type: "close",
254
253
  onClick: closeTabHandle.bind(null, tab, index)
255
254
  }));
@@ -44,7 +44,8 @@ var TNTLayout = styled(_Layout)(_templateObject(), function (props) {
44
44
  return props.theme.lightBgColor;
45
45
  });
46
46
  export default withTheme(function (props) {
47
- var logo = props.logo,
47
+ var type = props.type,
48
+ logo = props.logo,
48
49
  name = props.name,
49
50
  enName = props.enName,
50
51
  selectedOrgKey = props.selectedOrgKey,
@@ -198,6 +199,7 @@ export default withTheme(function (props) {
198
199
  }, React.createElement(Icon, {
199
200
  type: "menu-".concat(collapsed ? 'unfold' : 'fold')
200
201
  }))), React.createElement(Content, null, React.createElement(Header, {
202
+ type: type,
201
203
  userInfo: userInfo,
202
204
  config: config,
203
205
  collapsed: collapsed,
@@ -71,7 +71,7 @@ var TNTLayout = function TNTLayout(_ref) {
71
71
 
72
72
  var onLanguageChange = function onLanguageChange(language) {
73
73
  actionsContextValue.setLanguage(language);
74
- props == null ? void 0 : props.onLanguageChange(language);
74
+ props.onLanguageChange && props.onLanguageChange(language);
75
75
  }; // layout上的指定的属性优先级会高于extendMap中的属性
76
76
 
77
77
 
@@ -103,7 +103,8 @@ var TNTLayout = function TNTLayout(_ref) {
103
103
  extraHeaderActions: extraHeaderActions,
104
104
  isInIframe: isInIframe,
105
105
  userInfo: userInfo,
106
- onLanguageChange: onLanguageChange
106
+ onLanguageChange: onLanguageChange,
107
+ type: type
107
108
  })), (!type || !['paas', 'enterprise'].includes(type)) && React.createElement(Layout, _extends({
108
109
  menuAlignMode: menuAlignMode,
109
110
  config: config
@@ -4,7 +4,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
+ import Cookies from 'universal-cookie';
7
8
  import { safeParseJSON } from '../utils';
9
+ var cookies = new Cookies();
8
10
  export var getSideMenuStore = function getSideMenuStore() {
9
11
  return safeParseJSON(localStorage.getItem('sideMenu'), {});
10
12
  };
@@ -32,16 +34,30 @@ export var setCurrentOrgTreeStore = function setCurrentOrgTreeStore() {
32
34
  };
33
35
  export var getCurrentOrgTreeStore = function getCurrentOrgTreeStore() {
34
36
  return safeParseJSON(localStorage.getItem('currentOrgTree'), []);
35
- };
37
+ }; // export const setLanguageStore = lang => localStorage.setItem('lang', lang);
38
+ // export const getLanguageStore = () => localStorage.getItem('lang');
39
+
36
40
  export var setLanguageStore = function setLanguageStore(lang) {
37
- return localStorage.setItem('lang', lang);
41
+ return cookies.set('lang', lang, {
42
+ path: '/'
43
+ });
38
44
  };
39
45
  export var getLanguageStore = function getLanguageStore() {
40
- return localStorage.getItem('lang');
46
+ return cookies.get('lang', {
47
+ path: '/'
48
+ });
41
49
  };
42
50
  export var setThemeStore = function setThemeStore(theme) {
43
51
  return localStorage.setItem('theme', theme);
44
52
  };
45
53
  export var getThemeStore = function getThemeStore() {
46
54
  return localStorage.getItem('theme');
55
+ };
56
+ export var clearLoginCookie = function clearLoginCookie() {
57
+ cookies.remove('_td_token_', {
58
+ path: '/'
59
+ });
60
+ cookies.remove('_uid_', {
61
+ path: '/'
62
+ });
47
63
  };
package/es/Page/index.js CHANGED
@@ -118,9 +118,10 @@ var PageLayout = function PageLayout(_ref) {
118
118
  }
119
119
  }, React.createElement(Icon, {
120
120
  type: "left"
121
- }), React.createElement("span", null, goBackText ? goBackText : '返回')), title), [center, extra].map(function (item) {
121
+ }), React.createElement("span", null, goBackText ? goBackText : '返回')), title), [center, extra].map(function (item, i) {
122
122
  return React.createElement("div", {
123
- className: "".concat(clsPrefix, "-header-section")
123
+ className: "".concat(clsPrefix, "-header-section"),
124
+ key: i
124
125
  }, item);
125
126
  })), React.createElement("div", {
126
127
  className: "".concat(clsPrefix, "-content"),
package/es/locale.js CHANGED
@@ -1,3 +1,5 @@
1
+ import Cookies from 'universal-cookie';
2
+ var cookies = new Cookies();
1
3
  export var zh_CN = {
2
4
  globalNavigation: '全局导航',
3
5
  menuSearch: '菜单搜索',
@@ -10,9 +12,12 @@ export var zh_CN = {
10
12
  // QueryListScene
11
13
  totalRecords: '共%s条记录',
12
14
  // user popover
15
+ nameNull: '暂无昵称',
13
16
  personalSettings: '个人设置',
14
17
  changePwd: '修改密码',
15
- signOut: '退出'
18
+ signOut: '退出',
19
+ // Handle
20
+ handleMore: '更多'
16
21
  };
17
22
  export var en_US = {
18
23
  globalNavigation: 'Global Navigation',
@@ -26,9 +31,12 @@ export var en_US = {
26
31
  // QueryListScene
27
32
  totalRecords: 'Total of %s records',
28
33
  // user popover
29
- personalSettings: 'Personal settings',
34
+ nameNull: 'No nickname yet',
35
+ personalSettings: 'Setting',
30
36
  changePwd: 'Change password',
31
- signOut: 'Sign out'
37
+ signOut: 'Sign out',
38
+ // Handle
39
+ handleMore: 'More'
32
40
  };
33
41
  export var getText = function getText(key) {
34
42
  var _ref;
@@ -52,7 +60,9 @@ export var getText = function getText(key) {
52
60
  return text;
53
61
  };
54
62
  export var getLanguage = function getLanguage() {
55
- return localStorage.getItem('lang') || 'cn';
63
+ return cookies.get('lang', {
64
+ path: '/'
65
+ }) || 'cn';
56
66
  };
57
67
  export default {
58
68
  en_US: en_US,
@@ -54,26 +54,6 @@ const Demo = props => {
54
54
  <a>查看</a>
55
55
  <a>编辑</a>
56
56
  <a>测试</a>
57
- {
58
- false &&
59
- <a>导入</a>
60
- }
61
- <a>导出</a>
62
- <Popconfirm
63
- title="Are you sure delete this task?"
64
- onConfirm={void 0}
65
- onCancel={void 0}
66
- okText="Yes"
67
- cancelText="No"
68
- onClick={e => e.stopPropagation()}
69
- getPopupContainer={trigger => trigger.parentNode}
70
- trigger="hover"
71
- overlayStyle={{
72
- width: 300
73
- }}
74
- >
75
- <a>Delete</a>
76
- </Popconfirm>
77
57
  </Handle>
78
58
  )
79
59
  }