tntd 1.4.4 → 1.4.7
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/Layout/HeaderActions.js +90 -128
- package/components/LoadingButton/index.js +11 -15
- package/components/QueryListScene/QueryForm.js +7 -4
- package/dist/stats.json +4990 -4990
- package/dist/tntd.js +1 -1
- package/es/Layout/HeaderActions.js +10 -10
- package/es/LoadingButton/index.js +20 -10
- package/es/QueryListScene/QueryForm.js +6 -3
- package/lib/ArrayInput/icon.js +27 -31
- package/lib/ArrayInput/index.js +211 -298
- package/lib/AuthContext.js +2 -13
- package/lib/Columns/index.js +71 -100
- package/lib/DevelopmentLogin/LoginModal.js +79 -141
- package/lib/DevelopmentLogin/index.js +28 -55
- package/lib/Ellipsis/Svg/CopySVG.js +23 -71
- package/lib/Ellipsis/Svg/TickSVG.js +17 -49
- package/lib/Ellipsis/index.js +148 -154
- package/lib/Handle/index.js +72 -109
- package/lib/Icon/fonts/iconfont.js +1 -43
- package/lib/Icon/iconList.js +119 -8
- package/lib/Icon/index.js +13 -45
- package/lib/Img/Contain.js +49 -81
- package/lib/Img/Cover.js +88 -136
- package/lib/Img/index.js +36 -89
- package/lib/Layout/ActionsContext.js +2 -11
- package/lib/Layout/AppList.js +262 -256
- package/lib/Layout/Application.js +119 -135
- package/lib/Layout/Avatar.js +137 -137
- package/lib/Layout/CompatibleLanguage.js +214 -195
- package/lib/Layout/EnterpriseLayout/Avatar.js +156 -168
- package/lib/Layout/EnterpriseLayout/Language.js +75 -100
- package/lib/Layout/EnterpriseLayout/Theme.js +96 -94
- package/lib/Layout/EnterpriseLayout/index.js +32 -45
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +335 -407
- package/lib/Layout/GlobalNavigation/index.js +110 -158
- package/lib/Layout/Header.js +165 -116
- package/lib/Layout/HeaderActions.js +132 -129
- package/lib/Layout/HeaderNavs.js +90 -113
- package/lib/Layout/HeaderTabs.js +312 -278
- package/lib/Layout/Iconfont.js +2 -15
- package/lib/Layout/Language.js +63 -102
- package/lib/Layout/Layout.js +272 -261
- package/lib/Layout/Logo.js +132 -87
- package/lib/Layout/OrgAppList.js +440 -319
- package/lib/Layout/SideMenu.js +429 -343
- package/lib/Layout/Theme.js +95 -124
- package/lib/Layout/checkAuth.js +21 -35
- package/lib/Layout/createActions.js +38 -51
- package/lib/Layout/images/index.js +33 -41
- package/lib/Layout/index.js +110 -161
- package/lib/Layout/paaslayout/CompactSideMenu.js +200 -178
- package/lib/Layout/paaslayout/Header.js +84 -90
- package/lib/Layout/paaslayout/Logo.js +27 -32
- package/lib/Layout/paaslayout/SideMenu.js +161 -174
- package/lib/Layout/paaslayout/index.js +240 -261
- package/lib/Layout/storage.js +20 -78
- package/lib/Layout/utils.js +93 -143
- package/lib/LoadingButton/index.js +25 -57
- package/lib/Modal/index.js +83 -108
- package/lib/Page/Box.js +56 -81
- package/lib/Page/index.js +151 -173
- package/lib/Page/utils.js +12 -30
- package/lib/QueryForm/Field/Checkbox.js +11 -33
- package/lib/QueryForm/Field/Select.js +63 -99
- package/lib/QueryForm/Field/SelectInput.js +69 -114
- package/lib/QueryForm/Field/fieldsMap.js +30 -52
- package/lib/QueryForm/Field/index.js +76 -158
- package/lib/QueryForm/createActions.js +50 -65
- package/lib/QueryForm/index.js +304 -383
- package/lib/QueryForm/useForm.js +6 -17
- package/lib/QueryListScene/List.js +290 -366
- package/lib/QueryListScene/QueryForm.js +93 -158
- package/lib/QueryListScene/QueryListScene.js +33 -87
- package/lib/QueryListScene/Title.js +10 -20
- package/lib/QueryListScene/Toolbar.js +8 -31
- package/lib/QueryListScene/createActions.js +64 -79
- package/lib/QueryListScene/index.js +23 -40
- package/lib/QueryListScene/useActions.js +6 -17
- package/lib/Select/DropDownWrap.js +60 -124
- package/lib/Select/index.js +425 -561
- package/lib/Table/ResizableTable/index.js +77 -121
- package/lib/Table/index.js +19 -51
- package/lib/Title/index.js +34 -52
- package/lib/index.js +19 -159
- package/lib/locale.js +48 -63
- package/package.json +1 -1
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
package/lib/Layout/OrgAppList.js
CHANGED
|
@@ -1,338 +1,459 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _storage = require("./storage");
|
|
29
|
-
|
|
30
|
-
var _utils = require("./utils");
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
|
-
|
|
38
|
-
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); }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
47
|
-
|
|
48
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
49
|
-
|
|
50
|
-
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; }
|
|
51
|
-
|
|
52
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
|
-
function _templateObject3() {
|
|
55
|
-
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"]);
|
|
56
|
-
|
|
57
|
-
_templateObject3 = function _templateObject3() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject2() {
|
|
65
|
-
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"]);
|
|
66
|
-
|
|
67
|
-
_templateObject2 = function _templateObject2() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _templateObject() {
|
|
75
|
-
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"]);
|
|
76
|
-
|
|
77
|
-
_templateObject = function _templateObject() {
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return data;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
85
|
-
|
|
86
|
-
var InputGroup = _input["default"].Group;
|
|
87
|
-
var TreeNode = _treeSelect["default"].TreeNode;
|
|
88
|
-
var Option = _select["default"].Option; // 机构+应用UI
|
|
89
|
-
|
|
90
|
-
var OrgAppsInputGroup = (0, _styledComponents["default"])(InputGroup)(_templateObject(), function (props) {
|
|
91
|
-
return "".concat(props.theme.blueBgColor, " !important");
|
|
92
|
-
}); // 只展示机构
|
|
93
|
-
|
|
94
|
-
var AppTreeSelect = (0, _styledComponents["default"])(_treeSelect["default"])(_templateObject2(), function (props) {
|
|
95
|
-
return "".concat(props.theme.blueBgColor, " !important");
|
|
96
|
-
});
|
|
97
|
-
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject3());
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import styled, { withTheme, createGlobalStyle } from 'styled-components';
|
|
3
|
+
import { Input, Select, TreeSelect } from 'antd';
|
|
4
|
+
import { get } from 'lodash';
|
|
5
|
+
import { getCurrentAppStore, setCurrentAppStore, getCurrentOrgStore, setCurrentOrgStore, getCurrentOrgTreeStore,setCurrentOrgTreeStore } from './storage';
|
|
6
|
+
import { traverseTree } from './utils';
|
|
7
|
+
|
|
8
|
+
const { Group:InputGroup } = Input;
|
|
9
|
+
const { TreeNode } = TreeSelect;
|
|
10
|
+
const { Option } = Select;
|
|
11
|
+
|
|
12
|
+
// 机构+应用UI
|
|
13
|
+
const OrgAppsInputGroup= styled(InputGroup)`
|
|
14
|
+
display: inline-block !important;
|
|
15
|
+
width:auto !important;
|
|
16
|
+
min-width: 260px;
|
|
17
|
+
height: 28px;
|
|
18
|
+
line-height: 28;
|
|
19
|
+
position: relative;
|
|
20
|
+
top: 50%;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
|
|
23
|
+
&.ant-input-group.ant-input-group-compact::before,
|
|
24
|
+
&.ant-input-group.ant-input-group-compact::after{
|
|
25
|
+
content:"";
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
98
28
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onAppChange = props.onAppChange,
|
|
109
|
-
headerTabs = props.headerTabs;
|
|
110
|
-
var orgListFormatData = (0, _utils.traverseTree)([orgList], function (item) {
|
|
111
|
-
item.title = item.name;
|
|
112
|
-
item.value = item.uuid;
|
|
113
|
-
item.key = item.uuid;
|
|
114
|
-
}); // 初始化数据函数
|
|
29
|
+
.ant-select-selection, .ant-select-selection__rendered {
|
|
30
|
+
line-height: 28px;
|
|
31
|
+
height: 28px;
|
|
32
|
+
}
|
|
33
|
+
.ant-select-selection--multiple {
|
|
34
|
+
padding-bottom: 0;
|
|
35
|
+
overflow: auto;
|
|
36
|
+
min-height: 28px;
|
|
37
|
+
}
|
|
115
38
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
39
|
+
.ant-select-selection {
|
|
40
|
+
.hasHeaderTabs & {
|
|
41
|
+
border-radius: 14px;
|
|
42
|
+
font-size: 12px;
|
|
43
|
+
// 删除默认黑色
|
|
44
|
+
// background: #191D29;
|
|
45
|
+
// border: 1px solid rgba(186,189,197,0.60);
|
|
46
|
+
// color: rgba(255,255,255,.8);
|
|
47
|
+
// 统一改为浅色
|
|
48
|
+
background: #fff !important;
|
|
49
|
+
border-color: #c9d2dd !important;
|
|
50
|
+
color: #8b919e !important;
|
|
51
|
+
|
|
52
|
+
.ant-select-selection__placeholder, .ant-select-search__field__placeholder{
|
|
53
|
+
color: #8B919E;
|
|
54
|
+
}
|
|
123
55
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
56
|
+
// 删除色系差异
|
|
57
|
+
// .tnt-themeS1.hasHeaderTabs & {
|
|
58
|
+
// background: #fff;
|
|
59
|
+
// border-color: #c9d2dd;
|
|
60
|
+
// color: #8b919e;
|
|
61
|
+
// }
|
|
62
|
+
|
|
63
|
+
// 删除色系差异
|
|
64
|
+
// .tnt-themeS3.hasHeaderTabs &{
|
|
65
|
+
// background: ${props => `${props.theme.blueBgColor} !important`}; //#1D4295 !important;
|
|
66
|
+
// color: rgba(255,255,255,0.8);
|
|
67
|
+
// border-color: rgba(255,255,255,0.5);
|
|
68
|
+
// }
|
|
132
69
|
}
|
|
133
70
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
} else {
|
|
142
|
-
var temp = dataList.map(function (res) {
|
|
143
|
-
return {
|
|
144
|
-
label: res.title,
|
|
145
|
-
value: res.uuid
|
|
146
|
-
};
|
|
147
|
-
});
|
|
148
|
-
(0, _storage.setCurrentOrgTreeStore)(temp);
|
|
149
|
-
return temp;
|
|
71
|
+
.ant-select-arrow {
|
|
72
|
+
.hasHeaderTabs & {
|
|
73
|
+
color: #B2BECD;
|
|
74
|
+
}
|
|
75
|
+
.tnt-themeS1 & {
|
|
76
|
+
/* color: rgba(255,255,255,.85); */
|
|
77
|
+
}
|
|
150
78
|
}
|
|
151
|
-
}; // 初始化值
|
|
152
|
-
// 机构
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var _useState = (0, _react.useState)(getInitialSelected(selectedOrgKey, (0, _storage.getCurrentOrgStore)(), orgListFormatData)),
|
|
156
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
157
|
-
selectedOrg = _useState2[0],
|
|
158
|
-
setSelectedOrg = _useState2[1]; // 机构树
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var _useState3 = (0, _react.useState)(getInitialSelectedTree((0, _storage.getCurrentOrgTreeStore)(), orgListFormatData)),
|
|
162
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
163
|
-
selectedOrgTree = _useState4[0],
|
|
164
|
-
setSelectedOrgTree = _useState4[1]; // 应用
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
var _useState5 = (0, _react.useState)(getInitialSelected(selectedAppKey, (0, _storage.getCurrentAppStore)(), orgAppList, 'default')),
|
|
168
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
169
|
-
selectedApp = _useState6[0],
|
|
170
|
-
setSelectedApp = _useState6[1]; // org变化事件
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
var changeOrg = function changeOrg() {
|
|
174
|
-
var org = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
175
|
-
setSelectedOrg(org);
|
|
176
|
-
(0, _storage.setCurrentOrgStore)({
|
|
177
|
-
name: org == null ? void 0 : org.name,
|
|
178
|
-
key: org == null ? void 0 : org.key,
|
|
179
|
-
code: org == null ? void 0 : org.code
|
|
180
|
-
});
|
|
181
|
-
onOrgChange && onOrgChange(org);
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
var changeOrgTree = function changeOrgTree() {
|
|
185
|
-
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
186
79
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return {
|
|
190
|
-
label: res.title,
|
|
191
|
-
value: res.uuid
|
|
192
|
-
};
|
|
193
|
-
});
|
|
80
|
+
.tnt-themeS1 & {
|
|
81
|
+
border-radius: 2px;
|
|
194
82
|
}
|
|
195
83
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
84
|
+
.isInIframe & {
|
|
85
|
+
margin-left: 20px;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
// 只展示机构
|
|
90
|
+
const AppTreeSelect = styled(TreeSelect)`
|
|
91
|
+
min-width: 160px;
|
|
92
|
+
height: 28px;
|
|
93
|
+
line-height: 28;
|
|
94
|
+
position: relative;
|
|
95
|
+
top: 50%;
|
|
96
|
+
transform: translateY(-50%);
|
|
97
|
+
.ant-select-selection, .ant-select-selection__rendered {
|
|
98
|
+
line-height: 28px;
|
|
99
|
+
height: 28px;
|
|
100
|
+
}
|
|
101
|
+
.ant-select-selection--multiple {
|
|
102
|
+
padding-bottom: 0;
|
|
103
|
+
overflow: auto;
|
|
104
|
+
min-height: 28px;
|
|
105
|
+
}
|
|
106
|
+
.ant-select-selection {
|
|
107
|
+
.hasHeaderTabs & {
|
|
108
|
+
border-radius: 14px;
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
// 删除默认黑色
|
|
111
|
+
// background: #191D29;
|
|
112
|
+
// border: 1px solid rgba(186,189,197,0.60);
|
|
113
|
+
// color: rgba(255,255,255,.8);
|
|
114
|
+
// 统一为浅色
|
|
115
|
+
background: #fff !important;
|
|
116
|
+
border-color: #c9d2dd !important;
|
|
117
|
+
color: #8b919e !important;
|
|
118
|
+
}
|
|
119
|
+
// 不需要区分色系
|
|
120
|
+
// .tnt-themeS1.hasHeaderTabs & {
|
|
121
|
+
// /* background: #141825; */
|
|
122
|
+
// /* color: rgba(255,255,255,.85); */
|
|
123
|
+
// background: #fff;
|
|
124
|
+
// border-color: #c9d2dd;
|
|
125
|
+
// color: #8b919e;
|
|
126
|
+
// }
|
|
127
|
+
|
|
128
|
+
// .tnt-themeS3.hasHeaderTabs &{
|
|
129
|
+
// background: ${props => `${props.theme.blueBgColor} !important`}; //#1D4295
|
|
130
|
+
// color: rgba(255,255,255,0.8);
|
|
131
|
+
// border-color: rgba(255,255,255,0.5);
|
|
132
|
+
// }
|
|
133
|
+
}
|
|
134
|
+
.ant-select-arrow {
|
|
135
|
+
.hasHeaderTabs & {
|
|
136
|
+
color: #B2BECD;
|
|
137
|
+
}
|
|
138
|
+
.tnt-themeS1 & {
|
|
139
|
+
/* color: rgba(255,255,255,.85); */
|
|
140
|
+
}
|
|
141
|
+
}
|
|
216
142
|
|
|
217
|
-
|
|
143
|
+
.tnt-themeS1 & {
|
|
144
|
+
border-radius: 2px;
|
|
145
|
+
}
|
|
218
146
|
|
|
219
|
-
|
|
220
|
-
|
|
147
|
+
.isInIframe & {
|
|
148
|
+
margin-left: 20px;
|
|
221
149
|
}
|
|
222
|
-
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
const GlobalStyle = createGlobalStyle`
|
|
153
|
+
.org-tree-select {
|
|
154
|
+
&.ant-select-tree-dropdown .ant-select-dropdown-search{
|
|
155
|
+
padding: 10px;
|
|
156
|
+
.ant-select-search__field{
|
|
157
|
+
padding: 0 7px;
|
|
158
|
+
height:28px;
|
|
159
|
+
line-height: 28px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
.ant-select-tree {
|
|
163
|
+
margin-top:0;
|
|
164
|
+
padding: 0 10px 0 4px;
|
|
165
|
+
li{
|
|
166
|
+
margin:4px 0 ;
|
|
167
|
+
.ant-select-tree-switcher{
|
|
168
|
+
height: 30px;
|
|
169
|
+
line-height: 30px;
|
|
170
|
+
float: left;
|
|
171
|
+
}
|
|
172
|
+
.ant-select-tree-node-content-wrapper{
|
|
173
|
+
height: 30px;
|
|
174
|
+
line-height:30px;
|
|
175
|
+
padding: 0;
|
|
176
|
+
border-radius: 0;
|
|
177
|
+
&.ant-select-tree-node-selected{
|
|
178
|
+
background: #E7F0FE;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
.ant-select-tree-node-content-wrapper:hover{
|
|
182
|
+
background: #E7F0FE;
|
|
183
|
+
}
|
|
184
|
+
.ant-select-tree-title{
|
|
185
|
+
font-family: PingFangSC-Regular;
|
|
186
|
+
color: #17233D;
|
|
187
|
+
padding-left: 4px;
|
|
188
|
+
padding-right: 4px;
|
|
189
|
+
display: block;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
white-space: nowrap;
|
|
192
|
+
text-overflow: ellipsis;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.org-tree-check-select {
|
|
198
|
+
.ant-select-tree {
|
|
199
|
+
margin-top:0;
|
|
200
|
+
padding: 0 10px 0 4px;
|
|
201
|
+
li{
|
|
202
|
+
margin:4px 0 ;
|
|
203
|
+
.ant-select-tree-switcher{
|
|
204
|
+
height: 30px;
|
|
205
|
+
line-height: 30px;
|
|
206
|
+
vertical-align: top;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ant-select-tree-checkbox{
|
|
210
|
+
vertical-align: super;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.ant-select-tree-node-content-wrapper{
|
|
214
|
+
height: 30px;
|
|
215
|
+
line-height:30px;
|
|
216
|
+
padding: 0;
|
|
217
|
+
border-radius: 0;
|
|
218
|
+
&.ant-select-tree-node-selected{
|
|
219
|
+
background: #E7F0FE;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
.ant-select-tree-node-content-wrapper:hover{
|
|
223
|
+
background: #E7F0FE;
|
|
224
|
+
}
|
|
225
|
+
.ant-select-tree-title{
|
|
226
|
+
font-family: PingFangSC-Regular;
|
|
227
|
+
color: #17233D;
|
|
228
|
+
padding-left: 4px;
|
|
229
|
+
padding-right: 4px;
|
|
230
|
+
display: block;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
text-overflow: ellipsis;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
export default withTheme(
|
|
241
|
+
props => {
|
|
242
|
+
const { orgAppShow, selectedOrgKey, orgList, orgTreeConfig, onOrgChange, selectedAppKey, orgAppList = [], onAppChange, headerTabs } = props;
|
|
243
|
+
const orgListFormatData = traverseTree([orgList], item => {
|
|
244
|
+
item.title = item.name;
|
|
245
|
+
item.value = item.uuid;
|
|
246
|
+
item.key = item.uuid;
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// 初始化数据函数
|
|
250
|
+
const getInitialSelected = (selectedKey, currentStore, dataList, type) => {
|
|
251
|
+
const findByKey = selectedKey => {
|
|
252
|
+
let find;
|
|
253
|
+
traverseTree(dataList, item => {
|
|
254
|
+
if (item.key === selectedKey) {
|
|
255
|
+
find = item;
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
return find;
|
|
260
|
+
};
|
|
261
|
+
const current = findByKey(selectedKey || get(currentStore, 'key'));
|
|
262
|
+
if(type){
|
|
263
|
+
return current;
|
|
264
|
+
}
|
|
265
|
+
return current || dataList[0];
|
|
266
|
+
};
|
|
267
|
+
// 初始化数据函数机构树
|
|
268
|
+
const getInitialSelectedTree = (selecteds, dataList) => {
|
|
269
|
+
if(selecteds.length){
|
|
270
|
+
return selecteds;
|
|
271
|
+
} else {
|
|
272
|
+
const temp = dataList.map(res => {
|
|
273
|
+
return {
|
|
274
|
+
label: res.title,
|
|
275
|
+
value: res.uuid
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
setCurrentOrgTreeStore(temp);
|
|
279
|
+
return temp;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
223
282
|
|
|
224
|
-
|
|
225
|
-
|
|
283
|
+
// 初始化值
|
|
284
|
+
// 机构
|
|
285
|
+
const [selectedOrg, setSelectedOrg] = useState(getInitialSelected(
|
|
286
|
+
selectedOrgKey,
|
|
287
|
+
getCurrentOrgStore(),
|
|
288
|
+
orgListFormatData,
|
|
289
|
+
));
|
|
290
|
+
|
|
291
|
+
// 机构树
|
|
292
|
+
const [selectedOrgTree, setSelectedOrgTree] = useState(getInitialSelectedTree(
|
|
293
|
+
getCurrentOrgTreeStore(),
|
|
294
|
+
orgListFormatData
|
|
295
|
+
));
|
|
296
|
+
|
|
297
|
+
// 应用
|
|
298
|
+
const [selectedApp, setSelectedApp] = useState(getInitialSelected(
|
|
299
|
+
selectedAppKey,
|
|
300
|
+
getCurrentAppStore(),
|
|
301
|
+
orgAppList,
|
|
302
|
+
'default'
|
|
303
|
+
));
|
|
304
|
+
|
|
305
|
+
// org变化事件
|
|
306
|
+
const changeOrg = (org={}) => {
|
|
307
|
+
setSelectedOrg(org);
|
|
308
|
+
setCurrentOrgStore({
|
|
309
|
+
name: org?.name,
|
|
310
|
+
key: org?.key,
|
|
311
|
+
code: org?.code
|
|
312
|
+
});
|
|
313
|
+
onOrgChange && onOrgChange(org);
|
|
314
|
+
};
|
|
226
315
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
316
|
+
const changeOrgTree = (val = []) => {
|
|
317
|
+
if (!val.length){
|
|
318
|
+
val = orgListFormatData.map(res => {
|
|
319
|
+
return {
|
|
320
|
+
label: res.title,
|
|
321
|
+
value: res.uuid
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
setSelectedOrgTree(val);
|
|
326
|
+
setCurrentOrgTreeStore(val);
|
|
327
|
+
onOrgChange && onOrgChange(val);
|
|
328
|
+
};
|
|
239
329
|
|
|
240
|
-
|
|
241
|
-
|
|
330
|
+
// app变化事件
|
|
331
|
+
const changeApp = app => {
|
|
332
|
+
setSelectedApp(app);
|
|
333
|
+
setCurrentAppStore(app);
|
|
334
|
+
onAppChange && onAppChange(app);
|
|
335
|
+
};
|
|
242
336
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
337
|
+
useEffect(() => {
|
|
338
|
+
// 监听org机构
|
|
339
|
+
const newOrg = getInitialSelected(
|
|
340
|
+
selectedOrgKey,
|
|
341
|
+
getCurrentOrgStore(),
|
|
342
|
+
orgListFormatData
|
|
343
|
+
);
|
|
344
|
+
if (newOrg?.key !== selectedOrg?.key) {
|
|
345
|
+
changeOrg(newOrg);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// 监听应用
|
|
349
|
+
const newApp = getInitialSelected(
|
|
350
|
+
selectedAppKey,
|
|
351
|
+
getCurrentAppStore(),
|
|
352
|
+
orgAppList
|
|
353
|
+
);
|
|
354
|
+
if (newApp?.key !== selectedApp?.key) {
|
|
355
|
+
changeApp(newApp);
|
|
356
|
+
}
|
|
357
|
+
}, [orgList, selectedOrgKey, selectedAppKey, orgAppList]);
|
|
358
|
+
|
|
359
|
+
// 如果是多签页的模式 则居右对齐
|
|
360
|
+
let [treeSelectPosition,selectPosition] = [{},{}];
|
|
361
|
+
if(headerTabs){
|
|
362
|
+
treeSelectPosition = {
|
|
363
|
+
dropdownPopupAlign:{
|
|
364
|
+
points: ['tr', 'br']
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
selectPosition = {
|
|
369
|
+
dropdownAlign:{
|
|
370
|
+
points: ['tr', 'br']
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
};
|
|
269
374
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
375
|
+
let orgTreeConfigProp = {};
|
|
376
|
+
if (orgTreeConfig) {
|
|
377
|
+
|
|
378
|
+
orgTreeConfigProp = {
|
|
379
|
+
dropdownClassName: 'org-tree-check-select',
|
|
380
|
+
treeCheckable: true,
|
|
381
|
+
treeCheckStrictly: true,
|
|
382
|
+
onChange: (val) => {
|
|
383
|
+
changeOrgTree(val);
|
|
384
|
+
},
|
|
385
|
+
value: selectedOrgTree,
|
|
386
|
+
...orgTreeConfig
|
|
387
|
+
};
|
|
388
|
+
} else {
|
|
389
|
+
orgTreeConfigProp = {
|
|
390
|
+
dropdownClassName: 'org-tree-select',
|
|
391
|
+
onChange: orgKey => {
|
|
392
|
+
let findItem;
|
|
393
|
+
traverseTree(orgListFormatData, node => {
|
|
394
|
+
if (node.key === orgKey) {
|
|
395
|
+
findItem = node;
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
changeOrg(findItem);
|
|
400
|
+
},
|
|
401
|
+
value: get(selectedOrg, 'key')
|
|
402
|
+
};
|
|
403
|
+
}
|
|
291
404
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
405
|
+
if(!orgAppShow){
|
|
406
|
+
return (
|
|
407
|
+
<>
|
|
408
|
+
<AppTreeSelect
|
|
409
|
+
placeholder="选择机构"
|
|
410
|
+
searchPlaceholder="机构名称"
|
|
411
|
+
treeNodeFilterProp="title"
|
|
412
|
+
showSearch
|
|
413
|
+
treeData={orgListFormatData}
|
|
414
|
+
treeDefaultExpandAll
|
|
415
|
+
{...treeSelectPosition}
|
|
416
|
+
style={{ width: 160, height: 28, lineHeight: 28 }}
|
|
417
|
+
dropdownStyle={{ maxHeight: 300, overflow: 'auto', width: 320 }}
|
|
418
|
+
{...orgTreeConfigProp}
|
|
419
|
+
/>
|
|
420
|
+
<GlobalStyle />
|
|
421
|
+
</>
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
return (
|
|
425
|
+
<OrgAppsInputGroup compact>
|
|
426
|
+
<TreeSelect
|
|
427
|
+
placeholder="选择机构"
|
|
428
|
+
searchPlaceholder="机构名称"
|
|
429
|
+
treeNodeFilterProp="title"
|
|
430
|
+
showSearch
|
|
431
|
+
treeData={orgListFormatData}
|
|
432
|
+
treeDefaultExpandAll
|
|
433
|
+
style={{ width: 130, height: 28, lineHeight: 28 }}
|
|
434
|
+
dropdownStyle={{ maxHeight: 300, overflow: 'auto', width: 320 }}
|
|
435
|
+
{...orgTreeConfigProp}
|
|
436
|
+
/>
|
|
437
|
+
<GlobalStyle />
|
|
438
|
+
<Select
|
|
439
|
+
placeholder="请选择"
|
|
440
|
+
showSearch
|
|
441
|
+
optionFilterProp="children"
|
|
442
|
+
onChange={appKey => {
|
|
443
|
+
changeApp(orgAppList.find(({ key }) => key === appKey));
|
|
444
|
+
}}
|
|
445
|
+
value={get(selectedApp, 'key')}
|
|
446
|
+
style={{ width: 130, height: 28, lineHeight: 28 }}
|
|
447
|
+
>
|
|
448
|
+
{
|
|
449
|
+
orgAppList.map(({ key, name }) => (
|
|
450
|
+
<Option key={key} value={key} title={name}>
|
|
451
|
+
{name}
|
|
452
|
+
</Option>
|
|
453
|
+
))
|
|
454
|
+
}
|
|
455
|
+
</Select>
|
|
456
|
+
</OrgAppsInputGroup>
|
|
457
|
+
);
|
|
326
458
|
}
|
|
327
|
-
|
|
328
|
-
var key = _ref2.key,
|
|
329
|
-
name = _ref2.name;
|
|
330
|
-
return React.createElement(Option, {
|
|
331
|
-
key: key,
|
|
332
|
-
value: key,
|
|
333
|
-
title: name
|
|
334
|
-
}, name);
|
|
335
|
-
})));
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
exports["default"] = _default;
|
|
459
|
+
);
|