tntd 1.4.23 → 1.4.26
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/babel.config.js +22 -21
- package/components/QueryForm/Field/SelectInput.js +1 -0
- package/dist/stats.json +5057 -5057
- package/dist/tntd.js +1 -1
- package/es/ArrayInput/icon.js +11 -3
- package/es/ArrayInput/index.js +67 -57
- package/es/AuthContext.js +13 -3
- package/es/Columns/index.js +24 -12
- package/es/DevelopmentLogin/LoginModal.js +29 -22
- package/es/DevelopmentLogin/index.js +29 -13
- package/es/Ellipsis/Svg/CopySVG.js +11 -2
- package/es/Ellipsis/Svg/TickSVG.js +11 -2
- package/es/Ellipsis/index.js +33 -25
- package/es/Handle/README.md +20 -0
- package/es/Handle/index.js +46 -29
- package/es/Icon/fonts/iconfont.js +2 -0
- package/es/Icon/iconList.js +8 -1
- package/es/Icon/index.js +25 -5
- package/es/Img/Contain.js +21 -8
- package/es/Img/Cover.js +29 -11
- package/es/Img/index.js +22 -8
- package/es/Layout/ActionsContext.js +12 -2
- package/es/Layout/AppList.js +58 -42
- package/es/Layout/Application.js +44 -24
- package/es/Layout/Avatar.js +45 -23
- package/es/Layout/CompatibleLanguage.js +51 -29
- package/es/Layout/EnterpriseLayout/Avatar.js +54 -32
- package/es/Layout/EnterpriseLayout/Language.js +39 -15
- package/es/Layout/EnterpriseLayout/Theme.js +31 -15
- package/es/Layout/EnterpriseLayout/index.js +24 -9
- package/es/Layout/GlobalNavigation/NavigationPopup.js +53 -29
- package/es/Layout/GlobalNavigation/index.js +51 -23
- package/es/Layout/Header.js +40 -19
- package/es/Layout/HeaderActions.js +43 -19
- package/es/Layout/HeaderNavs.js +35 -12
- package/es/Layout/HeaderTabs.js +50 -25
- package/es/Layout/Iconfont.js +16 -4
- package/es/Layout/Language.js +38 -14
- package/es/Layout/Layout.js +58 -32
- package/es/Layout/Logo.js +26 -12
- package/es/Layout/OrgAppList.js +52 -36
- package/es/Layout/SideMenu.js +57 -32
- package/es/Layout/Theme.js +39 -21
- package/es/Layout/createActions.js +19 -6
- package/es/Layout/images/index.js +95 -58
- package/es/Layout/index.js +70 -28
- package/es/Layout/paaslayout/CompactSideMenu.js +35 -17
- package/es/Layout/paaslayout/Header.js +31 -17
- package/es/Layout/paaslayout/Logo.js +19 -9
- package/es/Layout/paaslayout/SideMenu.js +29 -12
- package/es/Layout/paaslayout/index.js +58 -32
- package/es/Layout/storage.js +71 -21
- package/es/LoadingButton/index.js +17 -8
- package/es/Modal/index.js +29 -16
- package/es/Page/Box.js +18 -8
- package/es/Page/index.js +47 -29
- package/es/Page/utils.js +12 -1
- package/es/QueryForm/Field/Checkbox.js +13 -5
- package/es/QueryForm/Field/Select.js +28 -12
- package/es/QueryForm/Field/SelectInput.js +35 -19
- package/es/QueryForm/Field/fieldsMap.js +36 -23
- package/es/QueryForm/Field/index.js +25 -12
- package/es/QueryForm/createActions.js +20 -7
- package/es/QueryForm/index.js +66 -50
- package/es/QueryForm/useForm.js +16 -4
- package/es/QueryListScene/List.js +43 -30
- package/es/QueryListScene/QueryForm.js +21 -9
- package/es/QueryListScene/QueryListScene.js +29 -16
- package/es/QueryListScene/Title.js +17 -5
- package/es/QueryListScene/Toolbar.js +16 -4
- package/es/QueryListScene/createActions.js +26 -13
- package/es/QueryListScene/index.js +40 -19
- package/es/QueryListScene/useActions.js +16 -4
- package/es/Select/DropDownWrap.js +18 -6
- package/es/Select/index.js +28 -15
- package/es/Table/ResizableTable/index.js +32 -18
- package/es/Table/index.js +30 -11
- package/es/Title/index.js +18 -5
- package/es/index.js +193 -20
- package/es/locale.js +27 -8
- package/es/utils/checkAuth.js +15 -4
- package/es/utils/findMenuInfoByPath.js +16 -5
- package/es/utils/index.js +70 -10
- package/lib/ArrayInput/index.js +12 -28
- package/lib/Columns/index.js +4 -10
- package/lib/DevelopmentLogin/LoginModal.js +9 -23
- package/lib/Ellipsis/index.js +4 -10
- package/lib/Handle/README.md +20 -0
- package/lib/Handle/index.js +9 -19
- package/lib/Layout/AppList.js +12 -30
- package/lib/Layout/Application.js +3 -5
- package/lib/Layout/Avatar.js +6 -12
- package/lib/Layout/CompatibleLanguage.js +3 -5
- package/lib/Layout/EnterpriseLayout/Avatar.js +8 -18
- package/lib/Layout/EnterpriseLayout/Theme.js +3 -5
- package/lib/Layout/HeaderActions.js +5 -7
- package/lib/Layout/Layout.js +7 -9
- package/lib/Layout/OrgAppList.js +7 -19
- package/lib/Layout/SideMenu.js +7 -9
- package/lib/Layout/Theme.js +3 -5
- package/lib/Layout/paaslayout/index.js +8 -10
- package/lib/LoadingButton/index.js +2 -6
- package/lib/Modal/index.js +3 -5
- package/lib/Page/Box.js +3 -5
- package/lib/QueryForm/Field/Checkbox.js +2 -6
- package/lib/QueryForm/Field/Select.js +4 -8
- package/lib/QueryForm/Field/SelectInput.js +7 -14
- package/lib/QueryForm/Field/fieldsMap.js +8 -18
- package/lib/QueryForm/Field/index.js +3 -7
- package/lib/QueryForm/index.js +13 -27
- package/lib/QueryListScene/List.js +5 -7
- package/lib/Select/index.js +8 -14
- package/lib/Table/ResizableTable/index.js +3 -5
- package/lib/Table/index.js +5 -7
- package/package.json +1 -1
- package/es/Layout/checkAuth.js +0 -29
- package/es/Layout/utils.js +0 -136
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
- package/lib/Layout/checkAuth.js +0 -39
- package/lib/Layout/utils.js +0 -166
package/lib/Select/index.js
CHANGED
|
@@ -5,24 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
require("antd/lib/empty/style");
|
|
9
|
-
|
|
10
|
-
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
11
|
-
|
|
12
|
-
require("antd/lib/select/style");
|
|
13
|
-
|
|
14
|
-
var _select = _interopRequireDefault(require("antd/lib/select"));
|
|
15
|
-
|
|
16
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
9
|
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
|
|
18
12
|
var _DropDownWrap = _interopRequireDefault(require("./DropDownWrap"));
|
|
19
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
20
16
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
17
|
|
|
22
18
|
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; }
|
|
23
19
|
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
21
|
|
|
28
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -66,7 +60,7 @@ var ARROW_CODE = {
|
|
|
66
60
|
38: 'up'
|
|
67
61
|
};
|
|
68
62
|
var DROPDOWN_HEIGHT = 224;
|
|
69
|
-
var Option =
|
|
63
|
+
var Option = _antd.Select.Option;
|
|
70
64
|
|
|
71
65
|
var SuperSelect =
|
|
72
66
|
/*#__PURE__*/
|
|
@@ -592,7 +586,7 @@ function (_PureComponent) {
|
|
|
592
586
|
}
|
|
593
587
|
|
|
594
588
|
optionLabelProp = optionLabelProp || 'children';
|
|
595
|
-
return _react["default"].createElement(
|
|
589
|
+
return _react["default"].createElement(_antd.Select, _extends({}, _props, {
|
|
596
590
|
id: this.id,
|
|
597
591
|
onSearch: this.onSearch,
|
|
598
592
|
onChange: this.onChange,
|
|
@@ -610,8 +604,8 @@ function (_PureComponent) {
|
|
|
610
604
|
style: {
|
|
611
605
|
padding: '5px 12px'
|
|
612
606
|
}
|
|
613
|
-
}, _react["default"].createElement(
|
|
614
|
-
image:
|
|
607
|
+
}, _react["default"].createElement(_antd.Empty, {
|
|
608
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
|
|
615
609
|
}));
|
|
616
610
|
}
|
|
617
611
|
|
|
@@ -5,16 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
require("antd/lib/table/style");
|
|
9
|
-
|
|
10
|
-
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
11
|
-
|
|
12
8
|
var _react = require("react");
|
|
13
9
|
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
11
|
|
|
16
12
|
var _lodash = require("lodash");
|
|
17
13
|
|
|
14
|
+
var _antd = require("antd");
|
|
15
|
+
|
|
18
16
|
var _reactResizable = require("react-resizable");
|
|
19
17
|
|
|
20
18
|
require("./index.less");
|
|
@@ -111,7 +109,7 @@ var _default = (0, _react.forwardRef)(function (props, ref) {
|
|
|
111
109
|
(0, _react.useEffect)(function () {
|
|
112
110
|
dataRef.current.columns = columns;
|
|
113
111
|
}, [columns]);
|
|
114
|
-
return React.createElement(
|
|
112
|
+
return React.createElement(_antd.Table, _extends({}, props, {
|
|
115
113
|
className: (0, _classnames["default"])('tnt-resizable-table', _defineProperty({}, props.className, props.className)),
|
|
116
114
|
components: {
|
|
117
115
|
header: {
|
package/lib/Table/index.js
CHANGED
|
@@ -7,22 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
require("antd/lib/table/style");
|
|
11
|
-
|
|
12
|
-
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
11
|
|
|
16
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
13
|
|
|
14
|
+
var _antd = require("antd");
|
|
15
|
+
|
|
18
16
|
var _ResizableTable = _interopRequireDefault(require("./ResizableTable"));
|
|
19
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
20
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
24
|
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; }
|
|
27
25
|
|
|
28
26
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -46,7 +44,7 @@ var _default = (0, _react.forwardRef)(function (_ref, ref) {
|
|
|
46
44
|
);
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
return _react["default"].createElement(
|
|
47
|
+
return _react["default"].createElement(_antd.Table, _extends({
|
|
50
48
|
className: (0, _classnames["default"])('tnt-table', _defineProperty({}, props.className, props.className))
|
|
51
49
|
}, props, {
|
|
52
50
|
ref: ref
|
package/package.json
CHANGED
package/es/Layout/checkAuth.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { get } from 'lodash';
|
|
2
|
-
export default (function (menus) {
|
|
3
|
-
var getAuthMap = function getAuthMap() {
|
|
4
|
-
var menus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
5
|
-
var authMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6
|
-
return menus.reduce(function (acc, _ref) {
|
|
7
|
-
var code = _ref.code,
|
|
8
|
-
groupName = _ref.groupName,
|
|
9
|
-
functionList = _ref.functionList,
|
|
10
|
-
children = _ref.children;
|
|
11
|
-
|
|
12
|
-
if (groupName) {
|
|
13
|
-
return getAuthMap(children, acc);
|
|
14
|
-
} else {
|
|
15
|
-
acc[code] = acc[code] || {};
|
|
16
|
-
acc[code] = (functionList || []).reduce(function (acc, curFunc) {
|
|
17
|
-
acc[curFunc.code] = curFunc.hasPermission;
|
|
18
|
-
return acc;
|
|
19
|
-
}, acc[code]);
|
|
20
|
-
return acc;
|
|
21
|
-
}
|
|
22
|
-
}, authMap);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var authMap = getAuthMap(menus);
|
|
26
|
-
return function (menuCode, funCode) {
|
|
27
|
-
return !!get(authMap, "".concat(menuCode).concat(funCode ? ".".concat(funCode) : ''));
|
|
28
|
-
};
|
|
29
|
-
});
|
package/es/Layout/utils.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
4
|
-
|
|
5
|
-
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
8
|
-
|
|
9
|
-
export var isGroupMenu = function isGroupMenu(menu) {
|
|
10
|
-
return (menu == null ? void 0 : menu.children) && !(menu == null ? void 0 : menu.path);
|
|
11
|
-
};
|
|
12
|
-
export var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
|
|
13
|
-
var menus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
14
|
-
var subMenu;
|
|
15
|
-
var menu;
|
|
16
|
-
var parentMenus = [];
|
|
17
|
-
|
|
18
|
-
if (selectedKey) {
|
|
19
|
-
traverseTree(menus, function (node, pnode, pnodes) {
|
|
20
|
-
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
21
|
-
subMenu = node;
|
|
22
|
-
menu = pnode;
|
|
23
|
-
parentMenus = pnodes;
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
// 默认找到第一个菜单项
|
|
29
|
-
traverseTree(menus, function (node, pnode, pnodes) {
|
|
30
|
-
if (!isGroupMenu(node)) {
|
|
31
|
-
subMenu = node;
|
|
32
|
-
menu = pnode;
|
|
33
|
-
parentMenus = pnodes;
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
subMenu: subMenu,
|
|
41
|
-
menu: menu,
|
|
42
|
-
parentMenus: parentMenus
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
|
|
46
|
-
var menu;
|
|
47
|
-
var subMenu;
|
|
48
|
-
var matchedSubMenu;
|
|
49
|
-
var parentMenus;
|
|
50
|
-
|
|
51
|
-
if (path) {
|
|
52
|
-
traverseTree(menuTree, function (menu, pnode, pnodes) {
|
|
53
|
-
if (!isGroupMenu(menu)) {
|
|
54
|
-
var _menu;
|
|
55
|
-
|
|
56
|
-
if (((_menu = menu) == null ? void 0 : _menu.path) === path) {
|
|
57
|
-
subMenu = menu;
|
|
58
|
-
menu = pnode;
|
|
59
|
-
parentMenus = pnodes;
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
|
|
64
|
-
matchedSubMenu = menu;
|
|
65
|
-
menu = pnode;
|
|
66
|
-
parentMenus = pnodes;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
subMenu: subMenu,
|
|
72
|
-
matchedSubMenu: matchedSubMenu,
|
|
73
|
-
menu: menu,
|
|
74
|
-
parentMenus: parentMenus
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
subMenu: subMenu,
|
|
80
|
-
menu: menu,
|
|
81
|
-
parentMenus: parentMenus
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export var hasLevel3 = function hasLevel3(menus) {
|
|
85
|
-
return menus == null ? void 0 : menus.some(function (menu) {
|
|
86
|
-
var _menu$children;
|
|
87
|
-
|
|
88
|
-
return menu == null ? void 0 : (_menu$children = menu.children) == null ? void 0 : _menu$children.some(function (item) {
|
|
89
|
-
var _item$children;
|
|
90
|
-
|
|
91
|
-
return item == null ? void 0 : (_item$children = item.children) == null ? void 0 : _item$children.length;
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
export var isNewTabMenu = function isNewTabMenu(menu) {
|
|
96
|
-
var _ref = menu || {},
|
|
97
|
-
target = _ref.target,
|
|
98
|
-
path = _ref.path;
|
|
99
|
-
|
|
100
|
-
return target === '_blank' || /^http/i.test(path) && /blankType=newTarget/.test(path);
|
|
101
|
-
};
|
|
102
|
-
export var openInNewTab = function openInNewTab(path) {
|
|
103
|
-
window.open(path, '_blank');
|
|
104
|
-
};
|
|
105
|
-
export var traverseTree = function traverseTree(treeData, callback, pnode) {
|
|
106
|
-
var pnodes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
107
|
-
(treeData || []).every(function (node, index) {
|
|
108
|
-
var result;
|
|
109
|
-
|
|
110
|
-
if (callback) {
|
|
111
|
-
result = callback(node, pnode, (pnodes == null ? void 0 : pnodes.length) ? pnodes : [pnode].filter(function (item) {
|
|
112
|
-
return !!item;
|
|
113
|
-
}), index);
|
|
114
|
-
} // 回调函数返回false则终止遍历
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (result !== false) {
|
|
118
|
-
node && traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return result !== false;
|
|
122
|
-
});
|
|
123
|
-
return treeData;
|
|
124
|
-
};
|
|
125
|
-
export var safeParseJSON = function safeParseJSON(str, defaultObj) {
|
|
126
|
-
var result;
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
result = JSON.parse(str);
|
|
130
|
-
} catch (err) {
|
|
131
|
-
console.warn('json parse error:', err);
|
|
132
|
-
result = typeof defaultObj === 'undefined' ? str : defaultObj;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return result || defaultObj;
|
|
136
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
15
|
-
|
|
16
|
-
var _AppList = _interopRequireDefault(require("../AppList"));
|
|
17
|
-
|
|
18
|
-
var _OrgAppList = _interopRequireDefault(require("../OrgAppList"));
|
|
19
|
-
|
|
20
|
-
var _HeaderActions = _interopRequireDefault(require("./HeaderActions"));
|
|
21
|
-
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
-
|
|
30
|
-
function _templateObject2() {
|
|
31
|
-
var data = _taggedTemplateLiteral(["\n flex: 1;\n .isInIframe & {\n display: none;\n }\n"]);
|
|
32
|
-
|
|
33
|
-
_templateObject2 = function _templateObject2() {
|
|
34
|
-
return data;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _templateObject() {
|
|
41
|
-
var data = _taggedTemplateLiteral(["\n position: relative;\n z-index: 201;\n height: ", ";\n display: flex;\n color: rgba(255,255,255,.85);\n background: #fff;\n\n .hasHeaderTabs & {\n background: #191D29;\n .tnt-layout-header-content {\n display: none;\n }\n }\n\n .tnt-themeS3.hasHeaderTabs &{\n background: ", "; //#1D4295 !important;\n }\n\n .isInIframe.noAppList &,\n .isEmptyLayout & {\n display: none;\n }\n .tnt-themeS1 & {\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.15);\n }\n .tnt-themeS1.compatible & {\n /* background: #323b4a; */\n }\n padding-right: 20px;\n background: #FFFFFF;\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n .compatible & {\n box-shadow: 0 1px 10px 0 rgba(0,0,0,0.10);\n }\n transition: box-shadow .2s cubic-bezier(.4,0,.2,1), -webkit-box-shadow .2s cubic-bezier(.4,0,.2,1);\n\n .sidebar-collapsed-controller {\n text-align: center;\n width: ", ";\n line-height: ", ";\n height: ", ";\n cursor: pointer;\n color: ", ";\n margin-right: 10px;\n\n & > .tnt-icon {\n font-size: 16px;\n .large-size & {\n font-size: 20px;\n }\n }\n\n i {\n position: relative;\n top: -1px;\n vertical-align: sub;\n }\n\n &:hover {\n background-color: rgba(0,0,0,.06);\n }\n\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n color: ", ";\n }\n .large-size & {\n font-size: 18px;\n }\n .isInIframe & {\n display: none;\n }\n }\n"]);
|
|
42
|
-
|
|
43
|
-
_templateObject = function _templateObject() {
|
|
44
|
-
return data;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
51
|
-
|
|
52
|
-
var Header = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
53
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return "".concat(props.theme.blueBgColor, " !important");
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
62
|
-
}, function (props) {
|
|
63
|
-
return "".concat(props.theme.primaryTextColor);
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return "".concat(props.theme.primaryTextColor);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
var Content = _styledComponents["default"].div(_templateObject2());
|
|
69
|
-
|
|
70
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
71
|
-
var collapsed = props.collapsed,
|
|
72
|
-
_props$collapseIconPl = props.collapseIconPlacement,
|
|
73
|
-
collapseIconPlacement = _props$collapseIconPl === void 0 ? 'right' : _props$collapseIconPl,
|
|
74
|
-
selectedAppKey = props.selectedAppKey,
|
|
75
|
-
appList = props.appList,
|
|
76
|
-
orgAppShow = props.orgAppShow,
|
|
77
|
-
orgAppList = props.orgAppList,
|
|
78
|
-
selectedOrgKey = props.selectedOrgKey,
|
|
79
|
-
orgList = props.orgList,
|
|
80
|
-
headerTabs = props.headerTabs,
|
|
81
|
-
onAppChange = props.onAppChange,
|
|
82
|
-
onOrgChange = props.onOrgChange,
|
|
83
|
-
onCollapseChange = props.onCollapseChange,
|
|
84
|
-
extraActions = props.extraActions;
|
|
85
|
-
var headerRef = (0, _react.useRef)();
|
|
86
|
-
return React.createElement(Header, {
|
|
87
|
-
className: "tnt-layout-header",
|
|
88
|
-
ref: headerRef
|
|
89
|
-
}, collapseIconPlacement === 'right' && React.createElement("div", {
|
|
90
|
-
className: "sidebar-collapsed-controller",
|
|
91
|
-
onClick: onCollapseChange
|
|
92
|
-
}, React.createElement(_Icon["default"], {
|
|
93
|
-
type: "menu-".concat(collapsed ? 'unfold' : 'fold')
|
|
94
|
-
})), headerTabs, orgList && React.createElement(_OrgAppList["default"], {
|
|
95
|
-
orgAppShow: orgAppShow,
|
|
96
|
-
selectedOrgKey: selectedOrgKey,
|
|
97
|
-
orgList: orgList,
|
|
98
|
-
onOrgChange: onOrgChange,
|
|
99
|
-
selectedAppKey: selectedAppKey,
|
|
100
|
-
orgAppList: orgAppList,
|
|
101
|
-
onAppChange: onAppChange
|
|
102
|
-
}), appList && !orgList && React.createElement(_AppList["default"], {
|
|
103
|
-
items: appList,
|
|
104
|
-
selectedKey: selectedAppKey,
|
|
105
|
-
onChange: onAppChange
|
|
106
|
-
}), React.createElement(Content, {
|
|
107
|
-
className: "tnt-layout-header-content"
|
|
108
|
-
}, props.children), React.createElement(_HeaderActions["default"], _extends({}, props, {
|
|
109
|
-
headerRef: headerRef
|
|
110
|
-
}), extraActions));
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
exports["default"] = _default;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/lib/divider/style");
|
|
11
|
-
|
|
12
|
-
var _divider = _interopRequireDefault(require("antd/lib/divider"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _GlobalNavigation = _interopRequireDefault(require("../GlobalNavigation"));
|
|
17
|
-
|
|
18
|
-
var _Application = _interopRequireDefault(require("../Application"));
|
|
19
|
-
|
|
20
|
-
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
21
|
-
|
|
22
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _templateObject() {
|
|
33
|
-
var data = _taggedTemplateLiteral(["\n list-style: none;\n display: inline-block;\n line-height: ", ";\n margin: 0 0 0 20px;\n .hasHeaderTabs & {\n margin: 0;\n }\n padding: 0;\n white-space: nowrap;\n\n .isInIframe & {\n display: none;\n }\n\n & > li {\n height: 100%;\n display: inline-block;\n vertical-align: top;\n cursor: pointer;\n font-size: 20px;\n margin: 0 7.5px;\n color: ", ";\n .large-size & {\n margin: 0 10px;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n &:last-of-type {\n margin-right: 0;\n }\n .hasHeaderTabs:not(.tnt-themeS1) & {\n color: rgba(255,255,255,.8);\n }\n }\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject = function _templateObject() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
|
-
|
|
44
|
-
var Actions = _styledComponents["default"].ul(_templateObject(), function (props) {
|
|
45
|
-
return "".concat(props.theme.headerHeight, "px");
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return "".concat(props.theme.headerActionsColor);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
var _default = (0, _styledComponents.withTheme)(function (props) {
|
|
51
|
-
var _props$config = props.config;
|
|
52
|
-
_props$config = _props$config === void 0 ? {} : _props$config;
|
|
53
|
-
|
|
54
|
-
var _props$config$theme = _props$config.theme,
|
|
55
|
-
theme = _props$config$theme === void 0 ? true : _props$config$theme,
|
|
56
|
-
_props$config$avatar = _props$config.avatar,
|
|
57
|
-
avatar = _props$config$avatar === void 0 ? true : _props$config$avatar,
|
|
58
|
-
_props$config$languag = _props$config.language,
|
|
59
|
-
language = _props$config$languag === void 0 ? true : _props$config$languag,
|
|
60
|
-
_props$config$applica = _props$config.application,
|
|
61
|
-
application = _props$config$applica === void 0 ? false : _props$config$applica,
|
|
62
|
-
_props$config$globalN = _props$config.globalNavigation,
|
|
63
|
-
globalNavigation = _props$config$globalN === void 0 ? false : _props$config$globalN,
|
|
64
|
-
compatible = props.theme.compatible,
|
|
65
|
-
_props$userInfo = props.userInfo,
|
|
66
|
-
userInfo = _props$userInfo === void 0 ? {} : _props$userInfo,
|
|
67
|
-
menus = props.menus,
|
|
68
|
-
apps = props.apps,
|
|
69
|
-
extraActions = props.extraActions,
|
|
70
|
-
headerRef = props.headerRef,
|
|
71
|
-
onLanguageChange = props.onLanguageChange,
|
|
72
|
-
onThemeChange = props.onThemeChange,
|
|
73
|
-
onApplicationChange = props.onApplicationChange,
|
|
74
|
-
onAppChange = props.onAppChange,
|
|
75
|
-
onCollapseChange = props.onCollapseChange,
|
|
76
|
-
onPersonalSetting = props.onPersonalSetting,
|
|
77
|
-
onChangePassword = props.onChangePassword,
|
|
78
|
-
onLogout = props.onLogout,
|
|
79
|
-
onLogoClick = props.onLogoClick,
|
|
80
|
-
rest = _objectWithoutProperties(props, ["config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick"]);
|
|
81
|
-
|
|
82
|
-
return React.createElement(Actions, rest, extraActions, globalNavigation && React.createElement(_GlobalNavigation["default"], {
|
|
83
|
-
headerRef: headerRef,
|
|
84
|
-
menus: menus
|
|
85
|
-
}), application && React.createElement(_Application["default"], {
|
|
86
|
-
language: userInfo.lang,
|
|
87
|
-
apps: apps,
|
|
88
|
-
onChange: onApplicationChange
|
|
89
|
-
}), avatar && React.createElement(React.Fragment, null, React.createElement(_divider["default"], {
|
|
90
|
-
type: "vertical"
|
|
91
|
-
}), React.createElement(_Avatar["default"], {
|
|
92
|
-
userInfo: userInfo,
|
|
93
|
-
onThemeChange: onThemeChange,
|
|
94
|
-
onPersonalSetting: onPersonalSetting,
|
|
95
|
-
onChangePassword: onChangePassword,
|
|
96
|
-
onLogout: onLogout,
|
|
97
|
-
config: {
|
|
98
|
-
theme: theme,
|
|
99
|
-
language: language
|
|
100
|
-
}
|
|
101
|
-
})));
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
exports["default"] = _default;
|
package/lib/Layout/checkAuth.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
|
|
10
|
-
var _default = function _default(menus) {
|
|
11
|
-
var getAuthMap = function getAuthMap() {
|
|
12
|
-
var menus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13
|
-
var authMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
-
return menus.reduce(function (acc, _ref) {
|
|
15
|
-
var code = _ref.code,
|
|
16
|
-
groupName = _ref.groupName,
|
|
17
|
-
functionList = _ref.functionList,
|
|
18
|
-
children = _ref.children;
|
|
19
|
-
|
|
20
|
-
if (groupName) {
|
|
21
|
-
return getAuthMap(children, acc);
|
|
22
|
-
} else {
|
|
23
|
-
acc[code] = acc[code] || {};
|
|
24
|
-
acc[code] = (functionList || []).reduce(function (acc, curFunc) {
|
|
25
|
-
acc[curFunc.code] = curFunc.hasPermission;
|
|
26
|
-
return acc;
|
|
27
|
-
}, acc[code]);
|
|
28
|
-
return acc;
|
|
29
|
-
}
|
|
30
|
-
}, authMap);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var authMap = getAuthMap(menus);
|
|
34
|
-
return function (menuCode, funCode) {
|
|
35
|
-
return !!(0, _lodash.get)(authMap, "".concat(menuCode).concat(funCode ? ".".concat(funCode) : ''));
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports["default"] = _default;
|