tntd 1.4.19 → 1.4.20

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 (170) hide show
  1. package/components/Layout/Avatar.js +4 -4
  2. package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
  3. package/components/Layout/EnterpriseLayout/Language.js +5 -3
  4. package/components/Layout/EnterpriseLayout/Theme.js +6 -7
  5. package/components/Layout/EnterpriseLayout/index.js +1 -1
  6. package/components/Layout/HeaderActions.js +13 -10
  7. package/components/Layout/HeaderTabs.js +13 -14
  8. package/components/Layout/Layout.js +2 -0
  9. package/components/Layout/index.js +2 -1
  10. package/components/Layout/storage.js +12 -2
  11. package/components/Page/index.js +2 -2
  12. package/components/locale.js +7 -2
  13. package/dist/1.tntd.js +1 -12
  14. package/dist/stats.json +28424 -27998
  15. package/dist/tntd.css +1 -1
  16. package/dist/tntd.js +13 -7
  17. package/es/ArrayInput/icon.js +5 -5
  18. package/es/ArrayInput/index.js +76 -108
  19. package/es/AuthContext.js +1 -1
  20. package/es/Columns/index.js +31 -38
  21. package/es/DevelopmentLogin/LoginModal.js +32 -45
  22. package/es/DevelopmentLogin/index.js +13 -17
  23. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  24. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  25. package/es/Ellipsis/index.js +58 -69
  26. package/es/Handle/index.js +25 -35
  27. package/es/Icon/fonts/iconfont.js +7 -12
  28. package/es/Icon/index.js +10 -13
  29. package/es/Img/Contain.js +24 -29
  30. package/es/Img/Cover.js +40 -54
  31. package/es/Img/index.js +36 -45
  32. package/es/Layout/ActionsContext.js +3 -2
  33. package/es/Layout/AppList.js +37 -92
  34. package/es/Layout/Application.js +26 -72
  35. package/es/Layout/Avatar.js +32 -69
  36. package/es/Layout/CompatibleLanguage.js +39 -94
  37. package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
  38. package/es/Layout/EnterpriseLayout/Language.js +19 -34
  39. package/es/Layout/EnterpriseLayout/Theme.js +23 -37
  40. package/es/Layout/EnterpriseLayout/index.js +14 -16
  41. package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
  42. package/es/Layout/GlobalNavigation/index.js +20 -54
  43. package/es/Layout/Header.js +25 -46
  44. package/es/Layout/HeaderActions.js +52 -63
  45. package/es/Layout/HeaderNavs.js +20 -47
  46. package/es/Layout/HeaderTabs.js +61 -115
  47. package/es/Layout/Iconfont.js +1 -1
  48. package/es/Layout/Language.js +14 -32
  49. package/es/Layout/Layout.js +88 -108
  50. package/es/Layout/Logo.js +16 -32
  51. package/es/Layout/OrgAppList.js +62 -107
  52. package/es/Layout/SideMenu.js +63 -124
  53. package/es/Layout/Theme.js +23 -61
  54. package/es/Layout/index.js +29 -36
  55. package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
  56. package/es/Layout/paaslayout/Header.js +22 -45
  57. package/es/Layout/paaslayout/Logo.js +3 -13
  58. package/es/Layout/paaslayout/SideMenu.js +39 -78
  59. package/es/Layout/paaslayout/index.js +75 -102
  60. package/es/Layout/storage.js +26 -9
  61. package/es/LoadingButton/index.js +15 -24
  62. package/es/Modal/index.js +38 -46
  63. package/es/Page/Box.js +34 -41
  64. package/es/Page/index.js +54 -68
  65. package/es/Page/utils.js +0 -5
  66. package/es/QueryForm/Field/Checkbox.js +5 -9
  67. package/es/QueryForm/Field/Select.js +31 -41
  68. package/es/QueryForm/Field/SelectInput.js +26 -41
  69. package/es/QueryForm/Field/fieldsMap.js +0 -1
  70. package/es/QueryForm/Field/index.js +41 -71
  71. package/es/QueryForm/createActions.js +6 -7
  72. package/es/QueryForm/index.js +76 -135
  73. package/es/QueryListScene/List.js +74 -128
  74. package/es/QueryListScene/QueryForm.js +46 -81
  75. package/es/QueryListScene/QueryListScene.js +25 -40
  76. package/es/QueryListScene/Title.js +3 -3
  77. package/es/QueryListScene/Toolbar.js +11 -12
  78. package/es/Select/DropDownWrap.js +29 -50
  79. package/es/Select/index.js +135 -231
  80. package/es/Table/ResizableTable/index.js +26 -40
  81. package/es/Table/index.js +18 -16
  82. package/es/Title/index.js +21 -23
  83. package/es/locale.js +9 -7
  84. package/es/utils/checkAuth.js +3 -5
  85. package/es/utils/findMenuInfoByPath.js +0 -4
  86. package/es/utils/index.js +12 -23
  87. package/lib/ArrayInput/icon.js +6 -6
  88. package/lib/ArrayInput/index.js +78 -127
  89. package/lib/AuthContext.js +1 -4
  90. package/lib/Columns/index.js +31 -47
  91. package/lib/DevelopmentLogin/LoginModal.js +32 -58
  92. package/lib/DevelopmentLogin/index.js +16 -27
  93. package/lib/Ellipsis/Svg/CopySVG.js +13 -15
  94. package/lib/Ellipsis/Svg/TickSVG.js +8 -10
  95. package/lib/Ellipsis/index.js +57 -80
  96. package/lib/Handle/index.js +25 -47
  97. package/lib/Icon/fonts/iconfont.js +7 -12
  98. package/lib/Icon/index.js +11 -20
  99. package/lib/Img/Contain.js +24 -34
  100. package/lib/Img/Cover.js +42 -65
  101. package/lib/Img/index.js +36 -51
  102. package/lib/Layout/ActionsContext.js +1 -4
  103. package/lib/Layout/AppList.js +40 -118
  104. package/lib/Layout/Application.js +26 -86
  105. package/lib/Layout/Avatar.js +35 -89
  106. package/lib/Layout/CompatibleLanguage.js +39 -110
  107. package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
  108. package/lib/Layout/EnterpriseLayout/Language.js +21 -49
  109. package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
  110. package/lib/Layout/EnterpriseLayout/index.js +14 -23
  111. package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
  112. package/lib/Layout/GlobalNavigation/index.js +23 -74
  113. package/lib/Layout/Header.js +28 -63
  114. package/lib/Layout/HeaderActions.js +48 -74
  115. package/lib/Layout/HeaderNavs.js +23 -61
  116. package/lib/Layout/HeaderTabs.js +58 -126
  117. package/lib/Layout/Iconfont.js +1 -5
  118. package/lib/Layout/Language.js +17 -48
  119. package/lib/Layout/Layout.js +90 -128
  120. package/lib/Layout/Logo.js +19 -43
  121. package/lib/Layout/OrgAppList.js +64 -127
  122. package/lib/Layout/SideMenu.js +65 -143
  123. package/lib/Layout/Theme.js +23 -73
  124. package/lib/Layout/createActions.js +0 -5
  125. package/lib/Layout/images/index.js +0 -28
  126. package/lib/Layout/index.js +33 -57
  127. package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
  128. package/lib/Layout/paaslayout/Header.js +22 -55
  129. package/lib/Layout/paaslayout/Logo.js +3 -19
  130. package/lib/Layout/paaslayout/SideMenu.js +39 -87
  131. package/lib/Layout/paaslayout/index.js +77 -122
  132. package/lib/Layout/storage.js +29 -35
  133. package/lib/LoadingButton/index.js +15 -29
  134. package/lib/Modal/index.js +38 -53
  135. package/lib/Page/Box.js +34 -45
  136. package/lib/Page/index.js +54 -78
  137. package/lib/Page/utils.js +1 -9
  138. package/lib/QueryForm/Field/Checkbox.js +5 -13
  139. package/lib/QueryForm/Field/Select.js +33 -53
  140. package/lib/QueryForm/Field/SelectInput.js +28 -56
  141. package/lib/QueryForm/Field/fieldsMap.js +1 -15
  142. package/lib/QueryForm/Field/index.js +43 -81
  143. package/lib/QueryForm/createActions.js +6 -12
  144. package/lib/QueryForm/index.js +78 -157
  145. package/lib/QueryForm/useForm.js +0 -5
  146. package/lib/QueryListScene/List.js +76 -140
  147. package/lib/QueryListScene/QueryForm.js +46 -86
  148. package/lib/QueryListScene/QueryListScene.js +25 -46
  149. package/lib/QueryListScene/Title.js +3 -7
  150. package/lib/QueryListScene/Toolbar.js +11 -16
  151. package/lib/QueryListScene/createActions.js +0 -5
  152. package/lib/QueryListScene/index.js +0 -10
  153. package/lib/QueryListScene/useActions.js +0 -5
  154. package/lib/Select/DropDownWrap.js +31 -56
  155. package/lib/Select/index.js +135 -241
  156. package/lib/Table/ResizableTable/index.js +26 -48
  157. package/lib/Table/index.js +17 -28
  158. package/lib/Title/index.js +21 -28
  159. package/lib/index.js +35 -56
  160. package/lib/locale.js +11 -12
  161. package/lib/utils/checkAuth.js +4 -9
  162. package/lib/utils/findMenuInfoByPath.js +1 -8
  163. package/lib/utils/index.js +15 -42
  164. package/package.json +2 -2
  165. package/es/Layout/checkAuth.js +0 -29
  166. package/es/Layout/utils.js +0 -136
  167. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  168. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
  169. package/lib/Layout/checkAuth.js +0 -39
  170. package/lib/Layout/utils.js +0 -166
@@ -1,91 +1,60 @@
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); }
1
2
  import "antd/lib/tree-select/style";
2
3
  import _TreeSelect from "antd/lib/tree-select";
3
4
  import "antd/lib/select/style";
4
5
  import _Select from "antd/lib/select";
5
6
  import "antd/lib/input/style";
6
7
  import _Input from "antd/lib/input";
7
-
8
- 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); }
9
-
10
- 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; }
11
-
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
13
-
14
- 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; }
15
-
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
17
-
18
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
19
-
20
- 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; }
21
-
8
+ var _templateObject, _templateObject2, _templateObject3;
9
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
10
+ 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; }
11
+ 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; }
12
+ 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; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ 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); }
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ 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."); }
17
+ 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); }
18
+ 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; }
19
+ 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; } }
22
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
- function _templateObject3() {
25
- var data = _taggedTemplateLiteral(["\n .org-tree-select {\n &.ant-select-tree-dropdown .ant-select-dropdown-search{\n padding: 10px;\n .ant-select-search__field{\n padding: 0 7px;\n height:28px;\n line-height: 28px;\n }\n }\n .ant-select-tree {\n margin-top:0;\n padding: 0 10px 0 4px;\n li{\n margin:4px 0 ;\n .ant-select-tree-switcher{\n height: 30px;\n line-height: 30px;\n float: left;\n }\n .ant-select-tree-node-content-wrapper{\n height: 30px;\n line-height:30px;\n padding: 0;\n border-radius: 0;\n &.ant-select-tree-node-selected{\n background: #E7F0FE;\n }\n }\n .ant-select-tree-node-content-wrapper:hover{\n background: #E7F0FE;\n }\n .ant-select-tree-title{\n font-family: PingFangSC-Regular;\n color: #17233D;\n padding-left: 4px;\n padding-right: 4px;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n }\n }\n .org-tree-check-select {\n .ant-select-tree {\n margin-top:0;\n padding: 0 10px 0 4px;\n li{\n margin:4px 0 ;\n .ant-select-tree-switcher{\n height: 30px;\n line-height: 30px;\n vertical-align: top;\n }\n\n .ant-select-tree-checkbox{\n vertical-align: super;\n }\n \n .ant-select-tree-node-content-wrapper{\n height: 30px;\n line-height:30px;\n padding: 0;\n border-radius: 0;\n &.ant-select-tree-node-selected{\n background: #E7F0FE;\n }\n }\n .ant-select-tree-node-content-wrapper:hover{\n background: #E7F0FE;\n }\n .ant-select-tree-title{\n font-family: PingFangSC-Regular;\n color: #17233D;\n padding-left: 4px;\n padding-right: 4px;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n }\n }\n"]);
26
-
27
- _templateObject3 = function _templateObject3() {
28
- return data;
29
- };
30
-
31
- return data;
32
- }
33
-
34
- function _templateObject2() {
35
- var data = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n .ant-select-selection--multiple {\n padding-bottom: 0;\n overflow: auto;\n min-height: 28px;\n }\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u5220\u9664\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u4E0D\u9700\u8981\u533A\u5206\u8272\u7CFB\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
36
-
37
- _templateObject2 = function _templateObject2() {
38
- return data;
39
- };
40
-
41
- return data;
42
- }
43
-
44
- function _templateObject() {
45
- var data = _taggedTemplateLiteral(["\n display: inline-block !important;\n width:auto !important;\n min-width: 260px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n\n &.ant-input-group.ant-input-group-compact::before,\n &.ant-input-group.ant-input-group-compact::after{\n content:\"\";\n display: none;\n }\n\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n .ant-select-selection--multiple {\n padding-bottom: 0;\n overflow: auto;\n min-height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u5220\u9664\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u6539\u4E3A\u6D45\u8272\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n\n .ant-select-selection__placeholder, .ant-select-search__field__placeholder{\n color: #8B919E;\n }\n }\n // \u5220\u9664\u8272\u7CFB\u5DEE\u5F02\n // .tnt-themeS1.hasHeaderTabs & {\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // \u5220\u9664\u8272\u7CFB\u5DEE\u5F02\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"]);
46
-
47
- _templateObject = function _templateObject() {
48
- return data;
49
- };
50
-
51
- return data;
52
- }
53
-
54
21
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
55
-
56
22
  import { useState, useEffect } from 'react';
57
23
  import styled, { withTheme, createGlobalStyle } from 'styled-components';
58
24
  import { get } from 'lodash';
59
25
  import { getCurrentAppStore, setCurrentAppStore, getCurrentOrgStore, setCurrentOrgStore, getCurrentOrgTreeStore, setCurrentOrgTreeStore } from './storage';
60
26
  import { traverseTree } from '../utils';
61
27
  var InputGroup = _Input.Group;
62
- var Option = _Select.Option; // 机构+应用UI
28
+ var Option = _Select.Option;
63
29
 
64
- var OrgAppsInputGroup = styled(InputGroup)(_templateObject(), function (props) {
30
+ // 机构+应用UI
31
+ var OrgAppsInputGroup = styled(InputGroup)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block !important;\n width:auto !important;\n min-width: 260px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n\n &.ant-input-group.ant-input-group-compact::before,\n &.ant-input-group.ant-input-group-compact::after{\n content:\"\";\n display: none;\n }\n\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n .ant-select-selection--multiple {\n padding-bottom: 0;\n overflow: auto;\n min-height: 28px;\n }\n\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u5220\u9664\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u6539\u4E3A\u6D45\u8272\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n\n .ant-select-selection__placeholder, .ant-select-search__field__placeholder{\n color: #8B919E;\n }\n }\n // \u5220\u9664\u8272\u7CFB\u5DEE\u5F02\n // .tnt-themeS1.hasHeaderTabs & {\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // \u5220\u9664\u8272\u7CFB\u5DEE\u5F02\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295 !important;\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"])), function (props) {
65
32
  return "".concat(props.theme.blueBgColor, " !important");
66
- }); // 只展示机构
33
+ });
67
34
 
68
- var AppTreeSelect = styled(_TreeSelect)(_templateObject2(), function (props) {
35
+ // 只展示机构
36
+ var AppTreeSelect = styled(_TreeSelect)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 160px;\n height: 28px;\n line-height: 28;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n .ant-select-selection, .ant-select-selection__rendered {\n line-height: 28px;\n height: 28px;\n }\n .ant-select-selection--multiple {\n padding-bottom: 0;\n overflow: auto;\n min-height: 28px;\n }\n .ant-select-selection {\n .hasHeaderTabs & {\n border-radius: 14px;\n font-size: 12px;\n // \u5220\u9664\u9ED8\u8BA4\u9ED1\u8272\n // background: #191D29;\n // border: 1px solid rgba(186,189,197,0.60);\n // color: rgba(255,255,255,.8);\n // \u7EDF\u4E00\u4E3A\u6D45\u8272\n background: #fff !important;\n border-color: #c9d2dd !important;\n color: #8b919e !important;\n }\n // \u4E0D\u9700\u8981\u533A\u5206\u8272\u7CFB\n // .tnt-themeS1.hasHeaderTabs & {\n // /* background: #141825; */\n // /* color: rgba(255,255,255,.85); */\n // background: #fff;\n // border-color: #c9d2dd;\n // color: #8b919e;\n // }\n\n // .tnt-themeS3.hasHeaderTabs &{\n // background: ", "; //#1D4295\n // color: rgba(255,255,255,0.8);\n // border-color: rgba(255,255,255,0.5);\n // }\n }\n .ant-select-arrow {\n .hasHeaderTabs & {\n color: #B2BECD;\n }\n .tnt-themeS1 & {\n /* color: rgba(255,255,255,.85); */\n }\n }\n\n .tnt-themeS1 & {\n border-radius: 2px;\n }\n\n .isInIframe & {\n margin-left: 20px;\n }\n"])), function (props) {
69
37
  return "".concat(props.theme.blueBgColor, " !important");
70
38
  });
71
- var GlobalStyle = createGlobalStyle(_templateObject3());
39
+ var GlobalStyle = createGlobalStyle(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .org-tree-select {\n &.ant-select-tree-dropdown .ant-select-dropdown-search{\n padding: 10px;\n .ant-select-search__field{\n padding: 0 7px;\n height:28px;\n line-height: 28px;\n }\n }\n .ant-select-tree {\n margin-top:0;\n padding: 0 10px 0 4px;\n li{\n margin:4px 0 ;\n .ant-select-tree-switcher{\n height: 30px;\n line-height: 30px;\n float: left;\n }\n .ant-select-tree-node-content-wrapper{\n height: 30px;\n line-height:30px;\n padding: 0;\n border-radius: 0;\n &.ant-select-tree-node-selected{\n background: #E7F0FE;\n }\n }\n .ant-select-tree-node-content-wrapper:hover{\n background: #E7F0FE;\n }\n .ant-select-tree-title{\n font-family: PingFangSC-Regular;\n color: #17233D;\n padding-left: 4px;\n padding-right: 4px;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n }\n }\n .org-tree-check-select {\n .ant-select-tree {\n margin-top:0;\n padding: 0 10px 0 4px;\n li{\n margin:4px 0 ;\n .ant-select-tree-switcher{\n height: 30px;\n line-height: 30px;\n vertical-align: top;\n }\n\n .ant-select-tree-checkbox{\n vertical-align: super;\n }\n \n .ant-select-tree-node-content-wrapper{\n height: 30px;\n line-height:30px;\n padding: 0;\n border-radius: 0;\n &.ant-select-tree-node-selected{\n background: #E7F0FE;\n }\n }\n .ant-select-tree-node-content-wrapper:hover{\n background: #E7F0FE;\n }\n .ant-select-tree-title{\n font-family: PingFangSC-Regular;\n color: #17233D;\n padding-left: 4px;\n padding-right: 4px;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n }\n }\n"])));
72
40
  export default withTheme(function (props) {
73
41
  var orgAppShow = props.orgAppShow,
74
- selectedOrgKey = props.selectedOrgKey,
75
- orgList = props.orgList,
76
- orgTreeConfig = props.orgTreeConfig,
77
- onOrgChange = props.onOrgChange,
78
- selectedAppKey = props.selectedAppKey,
79
- _props$orgAppList = props.orgAppList,
80
- orgAppList = _props$orgAppList === void 0 ? [] : _props$orgAppList,
81
- onAppChange = props.onAppChange,
82
- headerTabs = props.headerTabs;
42
+ selectedOrgKey = props.selectedOrgKey,
43
+ orgList = props.orgList,
44
+ orgTreeConfig = props.orgTreeConfig,
45
+ onOrgChange = props.onOrgChange,
46
+ selectedAppKey = props.selectedAppKey,
47
+ _props$orgAppList = props.orgAppList,
48
+ orgAppList = _props$orgAppList === void 0 ? [] : _props$orgAppList,
49
+ onAppChange = props.onAppChange,
50
+ headerTabs = props.headerTabs;
83
51
  var orgListFormatData = traverseTree([orgList], function (item) {
84
52
  item.title = item.name;
85
53
  item.value = item.uuid;
86
54
  item.key = item.uuid;
87
- }); // 初始化数据函数
55
+ });
88
56
 
57
+ // 初始化数据函数
89
58
  var getInitialSelected = function getInitialSelected(selectedKey, currentStore, dataList, type) {
90
59
  var findByKey = function findByKey(selectedKey) {
91
60
  var find;
@@ -97,17 +66,13 @@ export default withTheme(function (props) {
97
66
  });
98
67
  return find;
99
68
  };
100
-
101
69
  var current = findByKey(selectedKey || get(currentStore, 'key'));
102
-
103
70
  if (type) {
104
71
  return current;
105
72
  }
106
-
107
73
  return current || dataList[0];
108
- }; // 初始化数据函数机构树
109
-
110
-
74
+ };
75
+ // 初始化数据函数机构树
111
76
  var getInitialSelectedTree = function getInitialSelectedTree(selecteds, dataList) {
112
77
  if (selecteds.length) {
113
78
  return selecteds;
@@ -121,28 +86,28 @@ export default withTheme(function (props) {
121
86
  setCurrentOrgTreeStore(temp);
122
87
  return temp;
123
88
  }
124
- }; // 初始化值
125
- // 机构
126
-
89
+ };
127
90
 
91
+ // 初始化值
92
+ // 机构
128
93
  var _useState = useState(getInitialSelected(selectedOrgKey, getCurrentOrgStore(), orgListFormatData)),
129
- _useState2 = _slicedToArray(_useState, 2),
130
- selectedOrg = _useState2[0],
131
- setSelectedOrg = _useState2[1]; // 机构树
132
-
94
+ _useState2 = _slicedToArray(_useState, 2),
95
+ selectedOrg = _useState2[0],
96
+ setSelectedOrg = _useState2[1];
133
97
 
98
+ // 机构树
134
99
  var _useState3 = useState(getInitialSelectedTree(getCurrentOrgTreeStore(), orgListFormatData)),
135
- _useState4 = _slicedToArray(_useState3, 2),
136
- selectedOrgTree = _useState4[0],
137
- setSelectedOrgTree = _useState4[1]; // 应用
138
-
100
+ _useState4 = _slicedToArray(_useState3, 2),
101
+ selectedOrgTree = _useState4[0],
102
+ setSelectedOrgTree = _useState4[1];
139
103
 
104
+ // 应用
140
105
  var _useState5 = useState(getInitialSelected(selectedAppKey, getCurrentAppStore(), orgAppList, 'default')),
141
- _useState6 = _slicedToArray(_useState5, 2),
142
- selectedApp = _useState6[0],
143
- setSelectedApp = _useState6[1]; // org变化事件
144
-
106
+ _useState6 = _slicedToArray(_useState5, 2),
107
+ selectedApp = _useState6[0],
108
+ setSelectedApp = _useState6[1];
145
109
 
110
+ // org变化事件
146
111
  var changeOrg = function changeOrg() {
147
112
  var org = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
148
113
  setSelectedOrg(org);
@@ -153,10 +118,8 @@ export default withTheme(function (props) {
153
118
  });
154
119
  onOrgChange && onOrgChange(org);
155
120
  };
156
-
157
121
  var changeOrgTree = function changeOrgTree() {
158
122
  var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
159
-
160
123
  if (!val.length) {
161
124
  val = orgListFormatData.map(function (res) {
162
125
  return {
@@ -165,38 +128,34 @@ export default withTheme(function (props) {
165
128
  };
166
129
  });
167
130
  }
168
-
169
131
  setSelectedOrgTree(val);
170
132
  setCurrentOrgTreeStore(val);
171
133
  onOrgChange && onOrgChange(val);
172
- }; // app变化事件
173
-
134
+ };
174
135
 
136
+ // app变化事件
175
137
  var changeApp = function changeApp(app) {
176
138
  setSelectedApp(app);
177
139
  setCurrentAppStore(app);
178
140
  onAppChange && onAppChange(app);
179
141
  };
180
-
181
142
  useEffect(function () {
182
143
  // 监听org机构
183
144
  var newOrg = getInitialSelected(selectedOrgKey, getCurrentOrgStore(), orgListFormatData);
184
-
185
145
  if ((newOrg == null ? void 0 : newOrg.key) !== (selectedOrg == null ? void 0 : selectedOrg.key)) {
186
146
  changeOrg(newOrg);
187
- } // 监听应用
188
-
147
+ }
189
148
 
149
+ // 监听应用
190
150
  var newApp = getInitialSelected(selectedAppKey, getCurrentAppStore(), orgAppList);
191
-
192
151
  if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
193
152
  changeApp(newApp);
194
153
  }
195
- }, [orgList, selectedOrgKey, selectedAppKey, orgAppList]); // 如果是多签页的模式 则居右对齐
154
+ }, [orgList, selectedOrgKey, selectedAppKey, orgAppList]);
196
155
 
156
+ // 如果是多签页的模式 则居右对齐
197
157
  var treeSelectPosition = {},
198
- selectPosition = {};
199
-
158
+ selectPosition = {};
200
159
  if (headerTabs) {
201
160
  treeSelectPosition = {
202
161
  dropdownPopupAlign: {
@@ -209,10 +168,8 @@ export default withTheme(function (props) {
209
168
  }
210
169
  };
211
170
  }
212
-
213
171
  ;
214
172
  var orgTreeConfigProp = {};
215
-
216
173
  if (orgTreeConfig) {
217
174
  orgTreeConfigProp = _objectSpread({
218
175
  dropdownClassName: 'org-tree-check-select',
@@ -239,9 +196,8 @@ export default withTheme(function (props) {
239
196
  value: get(selectedOrg, 'key')
240
197
  };
241
198
  }
242
-
243
199
  if (!orgAppShow) {
244
- return React.createElement(React.Fragment, null, React.createElement(AppTreeSelect, _extends({
200
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppTreeSelect, _extends({
245
201
  placeholder: "\u9009\u62E9\u673A\u6784",
246
202
  searchPlaceholder: "\u673A\u6784\u540D\u79F0",
247
203
  treeNodeFilterProp: "title",
@@ -259,12 +215,11 @@ export default withTheme(function (props) {
259
215
  overflow: 'auto',
260
216
  width: 320
261
217
  }
262
- }, orgTreeConfigProp)), React.createElement(GlobalStyle, null));
218
+ }, orgTreeConfigProp)), /*#__PURE__*/React.createElement(GlobalStyle, null));
263
219
  }
264
-
265
- return React.createElement(OrgAppsInputGroup, {
220
+ return /*#__PURE__*/React.createElement(OrgAppsInputGroup, {
266
221
  compact: true
267
- }, React.createElement(_TreeSelect, _extends({
222
+ }, /*#__PURE__*/React.createElement(_TreeSelect, _extends({
268
223
  placeholder: "\u9009\u62E9\u673A\u6784",
269
224
  searchPlaceholder: "\u673A\u6784\u540D\u79F0",
270
225
  treeNodeFilterProp: "title",
@@ -281,7 +236,7 @@ export default withTheme(function (props) {
281
236
  overflow: 'auto',
282
237
  width: 320
283
238
  }
284
- }, orgTreeConfigProp)), React.createElement(GlobalStyle, null), React.createElement(_Select, {
239
+ }, orgTreeConfigProp)), /*#__PURE__*/React.createElement(GlobalStyle, null), /*#__PURE__*/React.createElement(_Select, {
285
240
  placeholder: "\u8BF7\u9009\u62E9",
286
241
  showSearch: true,
287
242
  optionFilterProp: "children",
@@ -299,8 +254,8 @@ export default withTheme(function (props) {
299
254
  }
300
255
  }, orgAppList.map(function (_ref2) {
301
256
  var key = _ref2.key,
302
- name = _ref2.name;
303
- return React.createElement(Option, {
257
+ name = _ref2.name;
258
+ return /*#__PURE__*/React.createElement(Option, {
304
259
  key: key,
305
260
  value: key,
306
261
  title: name