tntd 1.4.20 → 1.4.22
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/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/es/Layout/OrgAppList.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
function _extends() { _extends = Object.assign
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
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
|
-
|
|
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
|
|
71
|
+
var GlobalStyle = createGlobalStyle(_templateObject3());
|
|
40
72
|
export default withTheme(function (props) {
|
|
41
73
|
var orgAppShow = props.orgAppShow,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
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
|
|
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)),
|
|
262
|
+
}, orgTreeConfigProp)), React.createElement(GlobalStyle, null));
|
|
219
263
|
}
|
|
220
|
-
|
|
264
|
+
|
|
265
|
+
return React.createElement(OrgAppsInputGroup, {
|
|
221
266
|
compact: true
|
|
222
|
-
},
|
|
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)),
|
|
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
|
-
|
|
258
|
-
return
|
|
302
|
+
name = _ref2.name;
|
|
303
|
+
return React.createElement(Option, {
|
|
259
304
|
key: key,
|
|
260
305
|
value: key,
|
|
261
306
|
title: name
|