tntd 1.4.20 → 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 (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +23819 -24067
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +13 -8
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +108 -76
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +38 -31
  12. package/es/DevelopmentLogin/LoginModal.js +45 -32
  13. package/es/DevelopmentLogin/index.js +17 -13
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +69 -58
  17. package/es/Handle/README.md +0 -20
  18. package/es/Handle/index.js +67 -32
  19. package/es/Icon/fonts/iconfont.js +12 -7
  20. package/es/Icon/index.js +13 -10
  21. package/es/Img/Contain.js +29 -24
  22. package/es/Img/Cover.js +54 -40
  23. package/es/Img/index.js +45 -36
  24. package/es/Layout/ActionsContext.js +2 -3
  25. package/es/Layout/AppList.js +92 -37
  26. package/es/Layout/Application.js +72 -26
  27. package/es/Layout/Avatar.js +66 -29
  28. package/es/Layout/CompatibleLanguage.js +94 -39
  29. package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
  30. package/es/Layout/EnterpriseLayout/Language.js +32 -14
  31. package/es/Layout/EnterpriseLayout/Theme.js +34 -16
  32. package/es/Layout/EnterpriseLayout/index.js +16 -14
  33. package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
  34. package/es/Layout/GlobalNavigation/index.js +54 -20
  35. package/es/Layout/Header.js +46 -25
  36. package/es/Layout/HeaderActions.js +56 -42
  37. package/es/Layout/HeaderNavs.js +47 -20
  38. package/es/Layout/HeaderTabs.js +102 -49
  39. package/es/Layout/Iconfont.js +1 -1
  40. package/es/Layout/Language.js +32 -14
  41. package/es/Layout/Layout.js +108 -86
  42. package/es/Layout/Logo.js +32 -16
  43. package/es/Layout/OrgAppList.js +107 -62
  44. package/es/Layout/SideMenu.js +124 -63
  45. package/es/Layout/Theme.js +61 -23
  46. package/es/Layout/checkAuth.js +29 -0
  47. package/es/Layout/index.js +34 -26
  48. package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
  49. package/es/Layout/paaslayout/Header.js +45 -22
  50. package/es/Layout/paaslayout/Logo.js +13 -3
  51. package/es/Layout/paaslayout/SideMenu.js +78 -39
  52. package/es/Layout/paaslayout/index.js +102 -75
  53. package/es/Layout/storage.js +9 -10
  54. package/es/Layout/utils.js +136 -0
  55. package/es/LoadingButton/index.js +24 -15
  56. package/es/Modal/index.js +46 -38
  57. package/es/Page/Box.js +41 -34
  58. package/es/Page/index.js +67 -52
  59. package/es/Page/utils.js +5 -0
  60. package/es/QueryForm/Field/Checkbox.js +9 -5
  61. package/es/QueryForm/Field/Select.js +41 -31
  62. package/es/QueryForm/Field/SelectInput.js +41 -26
  63. package/es/QueryForm/Field/fieldsMap.js +1 -0
  64. package/es/QueryForm/Field/index.js +71 -41
  65. package/es/QueryForm/createActions.js +7 -6
  66. package/es/QueryForm/index.js +135 -76
  67. package/es/QueryListScene/List.js +128 -74
  68. package/es/QueryListScene/QueryForm.js +81 -46
  69. package/es/QueryListScene/QueryListScene.js +40 -25
  70. package/es/QueryListScene/Title.js +3 -3
  71. package/es/QueryListScene/Toolbar.js +12 -11
  72. package/es/Select/DropDownWrap.js +50 -29
  73. package/es/Select/index.js +231 -135
  74. package/es/Table/ResizableTable/index.js +40 -26
  75. package/es/Table/index.js +16 -18
  76. package/es/Title/index.js +23 -21
  77. package/es/locale.js +11 -3
  78. package/es/utils/checkAuth.js +5 -3
  79. package/es/utils/findMenuInfoByPath.js +4 -0
  80. package/es/utils/index.js +23 -12
  81. package/lib/ArrayInput/icon.js +6 -6
  82. package/lib/ArrayInput/index.js +127 -78
  83. package/lib/AuthContext.js +4 -1
  84. package/lib/Columns/index.js +47 -31
  85. package/lib/DevelopmentLogin/LoginModal.js +58 -32
  86. package/lib/DevelopmentLogin/index.js +27 -16
  87. package/lib/Ellipsis/Svg/CopySVG.js +15 -13
  88. package/lib/Ellipsis/Svg/TickSVG.js +10 -8
  89. package/lib/Ellipsis/index.js +80 -57
  90. package/lib/Handle/README.md +0 -20
  91. package/lib/Handle/index.js +80 -32
  92. package/lib/Icon/fonts/iconfont.js +12 -7
  93. package/lib/Icon/index.js +20 -11
  94. package/lib/Img/Contain.js +34 -24
  95. package/lib/Img/Cover.js +65 -42
  96. package/lib/Img/index.js +51 -36
  97. package/lib/Layout/ActionsContext.js +4 -1
  98. package/lib/Layout/AppList.js +118 -40
  99. package/lib/Layout/Application.js +86 -26
  100. package/lib/Layout/Avatar.js +86 -32
  101. package/lib/Layout/CompatibleLanguage.js +110 -39
  102. package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
  103. package/lib/Layout/EnterpriseLayout/Header.js +113 -0
  104. package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
  105. package/lib/Layout/EnterpriseLayout/Language.js +48 -17
  106. package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
  107. package/lib/Layout/EnterpriseLayout/index.js +23 -14
  108. package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
  109. package/lib/Layout/GlobalNavigation/index.js +74 -23
  110. package/lib/Layout/Header.js +63 -28
  111. package/lib/Layout/HeaderActions.js +74 -45
  112. package/lib/Layout/HeaderNavs.js +61 -23
  113. package/lib/Layout/HeaderTabs.js +118 -51
  114. package/lib/Layout/Iconfont.js +5 -1
  115. package/lib/Layout/Language.js +48 -17
  116. package/lib/Layout/Layout.js +128 -88
  117. package/lib/Layout/Logo.js +43 -19
  118. package/lib/Layout/OrgAppList.js +127 -64
  119. package/lib/Layout/SideMenu.js +143 -65
  120. package/lib/Layout/Theme.js +73 -23
  121. package/lib/Layout/checkAuth.js +39 -0
  122. package/lib/Layout/createActions.js +5 -0
  123. package/lib/Layout/images/index.js +28 -0
  124. package/lib/Layout/index.js +55 -30
  125. package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
  126. package/lib/Layout/paaslayout/Header.js +55 -22
  127. package/lib/Layout/paaslayout/Logo.js +19 -3
  128. package/lib/Layout/paaslayout/SideMenu.js +87 -39
  129. package/lib/Layout/paaslayout/index.js +122 -77
  130. package/lib/Layout/storage.js +40 -11
  131. package/lib/Layout/utils.js +166 -0
  132. package/lib/LoadingButton/index.js +29 -15
  133. package/lib/Modal/index.js +53 -38
  134. package/lib/Page/Box.js +45 -34
  135. package/lib/Page/index.js +77 -52
  136. package/lib/Page/utils.js +9 -1
  137. package/lib/QueryForm/Field/Checkbox.js +13 -5
  138. package/lib/QueryForm/Field/Select.js +53 -33
  139. package/lib/QueryForm/Field/SelectInput.js +56 -28
  140. package/lib/QueryForm/Field/fieldsMap.js +15 -1
  141. package/lib/QueryForm/Field/index.js +81 -43
  142. package/lib/QueryForm/createActions.js +12 -6
  143. package/lib/QueryForm/index.js +157 -78
  144. package/lib/QueryForm/useForm.js +5 -0
  145. package/lib/QueryListScene/List.js +140 -76
  146. package/lib/QueryListScene/QueryForm.js +86 -46
  147. package/lib/QueryListScene/QueryListScene.js +46 -25
  148. package/lib/QueryListScene/Title.js +7 -3
  149. package/lib/QueryListScene/Toolbar.js +16 -11
  150. package/lib/QueryListScene/createActions.js +5 -0
  151. package/lib/QueryListScene/index.js +10 -0
  152. package/lib/QueryListScene/useActions.js +5 -0
  153. package/lib/Select/DropDownWrap.js +56 -31
  154. package/lib/Select/index.js +241 -135
  155. package/lib/Table/ResizableTable/index.js +48 -26
  156. package/lib/Table/index.js +28 -17
  157. package/lib/Title/index.js +28 -21
  158. package/lib/index.js +56 -35
  159. package/lib/locale.js +19 -4
  160. package/lib/utils/checkAuth.js +9 -4
  161. package/lib/utils/findMenuInfoByPath.js +8 -1
  162. package/lib/utils/index.js +42 -15
  163. package/package.json +2 -2
@@ -1,60 +1,91 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
1
  import "antd/lib/tree-select/style";
3
2
  import _TreeSelect from "antd/lib/tree-select";
4
3
  import "antd/lib/select/style";
5
4
  import _Select from "antd/lib/select";
6
5
  import "antd/lib/input/style";
7
6
  import _Input from "antd/lib/input";
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; } }
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
+
20
22
  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
+
21
54
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
55
+
22
56
  import { useState, useEffect } from 'react';
23
57
  import styled, { withTheme, createGlobalStyle } from 'styled-components';
24
58
  import { get } from 'lodash';
25
59
  import { getCurrentAppStore, setCurrentAppStore, getCurrentOrgStore, setCurrentOrgStore, getCurrentOrgTreeStore, setCurrentOrgTreeStore } from './storage';
26
60
  import { traverseTree } from '../utils';
27
61
  var InputGroup = _Input.Group;
28
- var Option = _Select.Option;
62
+ var Option = _Select.Option; // 机构+应用UI
29
63
 
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) {
64
+ var OrgAppsInputGroup = styled(InputGroup)(_templateObject(), function (props) {
32
65
  return "".concat(props.theme.blueBgColor, " !important");
33
- });
66
+ }); // 只展示机构
34
67
 
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) {
68
+ var AppTreeSelect = styled(_TreeSelect)(_templateObject2(), function (props) {
37
69
  return "".concat(props.theme.blueBgColor, " !important");
38
70
  });
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"])));
71
+ var GlobalStyle = createGlobalStyle(_templateObject3());
40
72
  export default withTheme(function (props) {
41
73
  var orgAppShow = props.orgAppShow,
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;
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;
51
83
  var orgListFormatData = traverseTree([orgList], function (item) {
52
84
  item.title = item.name;
53
85
  item.value = item.uuid;
54
86
  item.key = item.uuid;
55
- });
87
+ }); // 初始化数据函数
56
88
 
57
- // 初始化数据函数
58
89
  var getInitialSelected = function getInitialSelected(selectedKey, currentStore, dataList, type) {
59
90
  var findByKey = function findByKey(selectedKey) {
60
91
  var find;
@@ -66,13 +97,17 @@ export default withTheme(function (props) {
66
97
  });
67
98
  return find;
68
99
  };
100
+
69
101
  var current = findByKey(selectedKey || get(currentStore, 'key'));
102
+
70
103
  if (type) {
71
104
  return current;
72
105
  }
106
+
73
107
  return current || dataList[0];
74
- };
75
- // 初始化数据函数机构树
108
+ }; // 初始化数据函数机构树
109
+
110
+
76
111
  var getInitialSelectedTree = function getInitialSelectedTree(selecteds, dataList) {
77
112
  if (selecteds.length) {
78
113
  return selecteds;
@@ -86,28 +121,28 @@ export default withTheme(function (props) {
86
121
  setCurrentOrgTreeStore(temp);
87
122
  return temp;
88
123
  }
89
- };
90
-
91
- // 初始化值
124
+ }; // 初始化值
92
125
  // 机构
126
+
127
+
93
128
  var _useState = useState(getInitialSelected(selectedOrgKey, getCurrentOrgStore(), orgListFormatData)),
94
- _useState2 = _slicedToArray(_useState, 2),
95
- selectedOrg = _useState2[0],
96
- setSelectedOrg = _useState2[1];
129
+ _useState2 = _slicedToArray(_useState, 2),
130
+ selectedOrg = _useState2[0],
131
+ setSelectedOrg = _useState2[1]; // 机构树
132
+
97
133
 
98
- // 机构树
99
134
  var _useState3 = useState(getInitialSelectedTree(getCurrentOrgTreeStore(), orgListFormatData)),
100
- _useState4 = _slicedToArray(_useState3, 2),
101
- selectedOrgTree = _useState4[0],
102
- setSelectedOrgTree = _useState4[1];
135
+ _useState4 = _slicedToArray(_useState3, 2),
136
+ selectedOrgTree = _useState4[0],
137
+ setSelectedOrgTree = _useState4[1]; // 应用
138
+
103
139
 
104
- // 应用
105
140
  var _useState5 = useState(getInitialSelected(selectedAppKey, getCurrentAppStore(), orgAppList, 'default')),
106
- _useState6 = _slicedToArray(_useState5, 2),
107
- selectedApp = _useState6[0],
108
- setSelectedApp = _useState6[1];
141
+ _useState6 = _slicedToArray(_useState5, 2),
142
+ selectedApp = _useState6[0],
143
+ setSelectedApp = _useState6[1]; // org变化事件
144
+
109
145
 
110
- // org变化事件
111
146
  var changeOrg = function changeOrg() {
112
147
  var org = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
113
148
  setSelectedOrg(org);
@@ -118,8 +153,10 @@ export default withTheme(function (props) {
118
153
  });
119
154
  onOrgChange && onOrgChange(org);
120
155
  };
156
+
121
157
  var changeOrgTree = function changeOrgTree() {
122
158
  var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
159
+
123
160
  if (!val.length) {
124
161
  val = orgListFormatData.map(function (res) {
125
162
  return {
@@ -128,34 +165,38 @@ export default withTheme(function (props) {
128
165
  };
129
166
  });
130
167
  }
168
+
131
169
  setSelectedOrgTree(val);
132
170
  setCurrentOrgTreeStore(val);
133
171
  onOrgChange && onOrgChange(val);
134
- };
172
+ }; // app变化事件
173
+
135
174
 
136
- // app变化事件
137
175
  var changeApp = function changeApp(app) {
138
176
  setSelectedApp(app);
139
177
  setCurrentAppStore(app);
140
178
  onAppChange && onAppChange(app);
141
179
  };
180
+
142
181
  useEffect(function () {
143
182
  // 监听org机构
144
183
  var newOrg = getInitialSelected(selectedOrgKey, getCurrentOrgStore(), orgListFormatData);
184
+
145
185
  if ((newOrg == null ? void 0 : newOrg.key) !== (selectedOrg == null ? void 0 : selectedOrg.key)) {
146
186
  changeOrg(newOrg);
147
- }
187
+ } // 监听应用
188
+
148
189
 
149
- // 监听应用
150
190
  var newApp = getInitialSelected(selectedAppKey, getCurrentAppStore(), orgAppList);
191
+
151
192
  if ((newApp == null ? void 0 : newApp.key) !== (selectedApp == null ? void 0 : selectedApp.key)) {
152
193
  changeApp(newApp);
153
194
  }
154
- }, [orgList, selectedOrgKey, selectedAppKey, orgAppList]);
195
+ }, [orgList, selectedOrgKey, selectedAppKey, orgAppList]); // 如果是多签页的模式 则居右对齐
155
196
 
156
- // 如果是多签页的模式 则居右对齐
157
197
  var treeSelectPosition = {},
158
- selectPosition = {};
198
+ selectPosition = {};
199
+
159
200
  if (headerTabs) {
160
201
  treeSelectPosition = {
161
202
  dropdownPopupAlign: {
@@ -168,8 +209,10 @@ export default withTheme(function (props) {
168
209
  }
169
210
  };
170
211
  }
212
+
171
213
  ;
172
214
  var orgTreeConfigProp = {};
215
+
173
216
  if (orgTreeConfig) {
174
217
  orgTreeConfigProp = _objectSpread({
175
218
  dropdownClassName: 'org-tree-check-select',
@@ -196,8 +239,9 @@ export default withTheme(function (props) {
196
239
  value: get(selectedOrg, 'key')
197
240
  };
198
241
  }
242
+
199
243
  if (!orgAppShow) {
200
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppTreeSelect, _extends({
244
+ return React.createElement(React.Fragment, null, React.createElement(AppTreeSelect, _extends({
201
245
  placeholder: "\u9009\u62E9\u673A\u6784",
202
246
  searchPlaceholder: "\u673A\u6784\u540D\u79F0",
203
247
  treeNodeFilterProp: "title",
@@ -215,11 +259,12 @@ export default withTheme(function (props) {
215
259
  overflow: 'auto',
216
260
  width: 320
217
261
  }
218
- }, orgTreeConfigProp)), /*#__PURE__*/React.createElement(GlobalStyle, null));
262
+ }, orgTreeConfigProp)), React.createElement(GlobalStyle, null));
219
263
  }
220
- return /*#__PURE__*/React.createElement(OrgAppsInputGroup, {
264
+
265
+ return React.createElement(OrgAppsInputGroup, {
221
266
  compact: true
222
- }, /*#__PURE__*/React.createElement(_TreeSelect, _extends({
267
+ }, React.createElement(_TreeSelect, _extends({
223
268
  placeholder: "\u9009\u62E9\u673A\u6784",
224
269
  searchPlaceholder: "\u673A\u6784\u540D\u79F0",
225
270
  treeNodeFilterProp: "title",
@@ -236,7 +281,7 @@ export default withTheme(function (props) {
236
281
  overflow: 'auto',
237
282
  width: 320
238
283
  }
239
- }, orgTreeConfigProp)), /*#__PURE__*/React.createElement(GlobalStyle, null), /*#__PURE__*/React.createElement(_Select, {
284
+ }, orgTreeConfigProp)), React.createElement(GlobalStyle, null), React.createElement(_Select, {
240
285
  placeholder: "\u8BF7\u9009\u62E9",
241
286
  showSearch: true,
242
287
  optionFilterProp: "children",
@@ -254,8 +299,8 @@ export default withTheme(function (props) {
254
299
  }
255
300
  }, orgAppList.map(function (_ref2) {
256
301
  var key = _ref2.key,
257
- name = _ref2.name;
258
- return /*#__PURE__*/React.createElement(Option, {
302
+ name = _ref2.name;
303
+ return React.createElement(Option, {
259
304
  key: key,
260
305
  value: key,
261
306
  title: name