@cloud-app-dev/vidc 2.0.0-alpha.11 → 2.0.0-alpha.15
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/.umirc.ts +1 -1
- package/es/AppRedirect/index.js +7 -11
- package/es/AppRoute/index.d.ts +3 -7
- package/es/AppRoute/index.js +45 -41
- package/es/AppRoute/interface.d.ts +2 -12
- package/es/AutoExit/index.js +12 -10
- package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
- package/es/{ContentBox → Box}/index.css +0 -0
- package/es/{ContentBox → Box}/index.d.ts +3 -3
- package/es/{ContentBox → Box}/index.js +5 -5
- package/es/CheckGroupFixed/index.js +4 -2
- package/es/Config/interface.d.ts +3 -1
- package/es/DeviceSelect/TreeType.d.ts +6 -0
- package/es/DeviceSelect/TreeType.js +36 -0
- package/es/DeviceSelect/demo.js +2 -2
- package/es/DeviceSelect/index.css +6 -1
- package/es/DeviceSelect/index.d.ts +5 -0
- package/es/DeviceSelect/index.js +22 -54
- package/es/IconFont/index.d.ts +0 -1
- package/es/IconFont/index.js +12 -13
- package/es/InitialRequest/utils.js +8 -9
- package/es/Input/index.js +3 -2
- package/es/List/CheckExt.d.ts +3 -5
- package/es/List/CheckExt.js +21 -13
- package/es/{AppRoute → List/DeviceList}/index.css +0 -0
- package/es/List/DeviceList/index.d.ts +11 -0
- package/es/{DeviceList → List/DeviceList}/index.js +6 -18
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
- package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
- package/es/List/DynamicDeviceList/index.d.ts +11 -0
- package/es/List/DynamicDeviceList/index.js +205 -0
- package/es/List/DynamicDeviceList/interface.d.ts +37 -0
- package/es/List/DynamicDeviceList/utils.d.ts +16 -0
- package/es/List/DynamicDeviceList/utils.js +61 -0
- package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
- package/es/List/DynamicGridList/Demo.js +70 -0
- package/es/List/DynamicGridList/index.d.ts +26 -0
- package/es/List/DynamicGridList/index.js +73 -0
- package/es/List/GridList/Demo.d.ts +2 -0
- package/es/List/GridList/Demo.js +91 -0
- package/es/List/GridList/hook.d.ts +13 -0
- package/es/List/GridList/hook.js +301 -0
- package/es/List/GridList/index.css +7 -0
- package/es/List/GridList/index.d.ts +15 -0
- package/es/List/GridList/index.js +47 -0
- package/es/List/GridList/interface.d.ts +59 -0
- package/es/List/GridList/utils.d.ts +9 -0
- package/es/List/GridList/utils.js +43 -0
- package/es/List/ListExt/index.css +3 -0
- package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
- package/es/{ListExt → List/ListExt}/index.js +3 -3
- package/es/List/VList/index.css +6 -0
- package/es/List/VList/index.d.ts +18 -0
- package/es/List/VList/index.js +51 -0
- package/es/List/VList/utils.d.ts +14 -0
- package/es/{VList → List/VList}/utils.js +0 -0
- package/es/List/index.css +11 -12
- package/es/List/index.d.ts +5 -70
- package/es/List/index.js +32 -25
- package/es/List/interface.d.ts +87 -0
- package/es/List/renderItem.d.ts +1 -1
- package/es/List/renderItem.js +13 -10
- package/es/LoaderApp/index.js +4 -2
- package/es/LoaderScript/utils.js +60 -37
- package/es/Service/http.d.ts +1 -1
- package/es/Service/http.js +2 -8
- package/es/TableLayout/index.d.ts +3 -0
- package/es/TableLayout/index.js +14 -45
- package/es/{TreeTitle → Title}/index.css +5 -5
- package/es/{TreeTitle → Title}/index.d.ts +2 -2
- package/es/{TreeTitle → Title}/index.js +7 -4
- package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
- package/es/Tree/BaseTree/demo.js +69 -0
- package/es/Tree/BaseTree/index.css +64 -0
- package/es/Tree/BaseTree/index.d.ts +24 -0
- package/es/Tree/BaseTree/index.js +83 -0
- package/es/Tree/demo.js +19 -56
- package/es/Tree/index.css +29 -55
- package/es/Tree/index.d.ts +19 -20
- package/es/Tree/index.js +185 -70
- package/es/UserSelect/index.js +6 -4
- package/es/WorkerFlow/Form/Condition.js +2 -4
- package/es/WorkerFlow/Form/FormAuth.js +2 -2
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/UserSelectModalContent.js +2 -2
- package/es/WorkerFlow/Form/UserSet.js +2 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
- package/es/WorkerFlow/index.css +9 -3
- package/es/WorkerFlow/index.js +3 -2
- package/es/index.d.ts +3 -11
- package/es/index.js +3 -11
- package/es/useDrawer/index.d.ts +1 -1
- package/es/useDrawer/index.js +2 -1
- package/es/useModal/index.d.ts +1 -1
- package/es/useModal/index.js +2 -1
- package/es/{IconFont → useNavigate}/index.css +0 -0
- package/es/useNavigate/index.d.ts +4 -0
- package/es/useNavigate/index.js +14 -0
- package/es/utils.d.ts +9 -0
- package/es/utils.js +36 -1
- package/package.json +4 -8
- package/es/AppRoute/Render.d.ts +0 -23
- package/es/AppRoute/Render.js +0 -111
- package/es/AppRoute/Rendered.d.ts +0 -4
- package/es/AppRoute/Rendered.js +0 -11
- package/es/AppRoute/utils.d.ts +0 -1
- package/es/AppRoute/utils.js +0 -28
- package/es/DeviceList/index.css +0 -32
- package/es/DeviceList/index.d.ts +0 -14
- package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
- package/es/DynamicDeviceList/CheckExt.js +0 -36
- package/es/DynamicDeviceList/Demo.js +0 -17
- package/es/DynamicDeviceList/index.d.ts +0 -35
- package/es/DynamicDeviceList/index.js +0 -224
- package/es/DynamicDeviceList/utils.d.ts +0 -2
- package/es/DynamicDeviceList/utils.js +0 -15
- package/es/DynamicList/index.css +0 -7
- package/es/DynamicList/index.d.ts +0 -31
- package/es/DynamicList/index.js +0 -132
- package/es/List/utils.d.ts +0 -5
- package/es/List/utils.js +0 -18
- package/es/ListExt/index.css +0 -9
- package/es/ScrollList/index.css +0 -73
- package/es/ScrollList/index.d.ts +0 -24
- package/es/ScrollList/index.js +0 -262
- package/es/ScrollList/utils.js +0 -84
- package/es/TreeMode/demo.js +0 -32
- package/es/TreeMode/index.css +0 -38
- package/es/TreeMode/index.d.ts +0 -23
- package/es/TreeMode/index.js +0 -201
- package/es/VList/index.css +0 -4
- package/es/VList/index.d.ts +0 -16
- package/es/VList/index.js +0 -56
- package/es/VList/utils.d.ts +0 -10
- package/es/useChangeEffect/index.d.ts +0 -3
- package/es/useChangeEffect/index.js +0 -32
- package/es/useHistory/index.css +0 -0
- package/es/useHistory/index.d.ts +0 -3
- package/es/useHistory/index.js +0 -14
package/es/Tree/index.css
CHANGED
|
@@ -1,64 +1,38 @@
|
|
|
1
|
-
.bc-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.bc-type-tree-layout {
|
|
2
|
+
height: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border: 1px solid var(--bd-color);
|
|
6
|
+
margin-left: -1px;
|
|
4
7
|
}
|
|
5
|
-
.bc-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
left: 8px;
|
|
9
|
-
z-index: 2;
|
|
10
|
-
margin-right: 5px;
|
|
11
|
-
}
|
|
12
|
-
.bc-base-tree-component .cloudapp-tree-title {
|
|
13
|
-
font-size: var(--fs-small);
|
|
14
|
-
flex: 1 1;
|
|
15
|
-
}
|
|
16
|
-
.bc-base-tree-component .cloudapp-tree-treenode {
|
|
17
|
-
width: 100%;
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
font-size: var(--fs-small);
|
|
20
|
-
min-width: max-content;
|
|
21
|
-
position: relative;
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
width: calc(100% - 32px);
|
|
8
|
+
.bc-type-tree-layout .lm-c-tree-title-part {
|
|
9
|
+
border-bottom: 1px solid var(--bd-color);
|
|
10
|
+
background-color: var(--form-bg-light);
|
|
24
11
|
}
|
|
25
|
-
.bc-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
position: relative;
|
|
29
|
-
display: inline-flex;
|
|
30
|
-
width: calc(100% - 32px);
|
|
12
|
+
.bc-type-tree-layout > .cloudapp-c-base-tree-component {
|
|
13
|
+
flex: 1;
|
|
14
|
+
overflow: auto;
|
|
31
15
|
}
|
|
32
|
-
.bc-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
color: var(--primary);
|
|
36
|
-
position: relative;
|
|
16
|
+
.bc-type-tree-layout .cloudapp-tree {
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: auto;
|
|
37
19
|
}
|
|
38
|
-
.bc-
|
|
39
|
-
|
|
40
|
-
content: '';
|
|
41
|
-
width: 100%;
|
|
42
|
-
bottom: 0;
|
|
43
|
-
left: 0;
|
|
44
|
-
position: absolute;
|
|
45
|
-
border-bottom: 1px solid var(--primary);
|
|
20
|
+
.bc-type-tree-layout .anticon {
|
|
21
|
+
font-size: var(--fs);
|
|
46
22
|
}
|
|
47
|
-
.bc-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.bc-base-tree-component .cloudapp-tree-treenode span.cloudapp-tree-node-content-wrapper.cloudapp-tree-node-selected .cloudapp-tree-iconEle {
|
|
51
|
-
color: var(--primary);
|
|
23
|
+
.bc-type-tree-layout .cloudapp-tree-title {
|
|
24
|
+
font-size: var(--fs-small);
|
|
25
|
+
flex: 1;
|
|
52
26
|
}
|
|
53
|
-
.bc-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
color: var(--primary);
|
|
27
|
+
.bc-type-tree-layout .cloudapp-tree-title > span {
|
|
28
|
+
min-width: 100%;
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
justify-content: space-between;
|
|
58
31
|
}
|
|
59
|
-
.bc-
|
|
60
|
-
|
|
61
|
-
.bc-base-tree-component .cloudapp-tree-treenode-switcher-open .cloudapp-tree-iconEle,
|
|
62
|
-
.bc-base-tree-component .cloudapp-tree-treenode-switcher-close .cloudapp-tree-iconEle {
|
|
32
|
+
.bc-type-tree-layout .cloudapp-tree-title > span .anticon {
|
|
33
|
+
font-size: 16px;
|
|
63
34
|
color: var(--icon);
|
|
35
|
+
padding-right: 6px;
|
|
36
|
+
position: relative;
|
|
37
|
+
top: 1px;
|
|
64
38
|
}
|
package/es/Tree/index.d.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tree 基础组件支持各种自定义其他tree可用过它来拓展
|
|
3
|
-
*/
|
|
4
1
|
import React from 'react';
|
|
5
|
-
import {
|
|
2
|
+
import { BaseTreeProps } from './BaseTree';
|
|
6
3
|
import './index.less';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
interface IBsTreeProps extends BaseTreeProps {
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
inputPlaceholder?: string;
|
|
7
|
+
renderHeader?: () => JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* @description 需要默认选中时触发 事件
|
|
10
|
+
*/
|
|
11
|
+
onDefailtSelect?: (id?: string) => void;
|
|
12
|
+
mode?: 'Bz' | 'Custom' | 'Place' | 'Org';
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
declare function TreeMode({ title, className, renderHeader, inputPlaceholder, treeNodeProps, onDefailtSelect, mode, showIcon, ...props }: IBsTreeProps): JSX.Element;
|
|
15
|
+
declare namespace TreeMode {
|
|
16
|
+
var defaultProps: {
|
|
17
|
+
mode: string;
|
|
18
|
+
className: string;
|
|
19
|
+
treeNodeProps: {};
|
|
20
|
+
showIcon: boolean;
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
export default BTree;
|
|
23
|
+
export default TreeMode;
|
package/es/Tree/index.js
CHANGED
|
@@ -1,83 +1,198 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
|
|
13
|
+
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."); }
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
7
18
|
|
|
8
|
-
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }
|
|
20
|
+
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
|
|
23
|
+
import { __rest } from "tslib";
|
|
24
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
25
|
+
import api from '../Api';
|
|
26
|
+
import Title from '../Title';
|
|
27
|
+
import { getParentListById, getPlaceCodesWithParent } from '../utils';
|
|
9
28
|
import IconFont from '../IconFont';
|
|
10
|
-
import
|
|
29
|
+
import useHttp from '../useHttp';
|
|
30
|
+
import Tree from './BaseTree';
|
|
11
31
|
import "./index.css";
|
|
32
|
+
var defaultList = [];
|
|
12
33
|
|
|
13
|
-
function
|
|
14
|
-
var
|
|
34
|
+
function TreeMode(_a) {
|
|
35
|
+
var title = _a.title,
|
|
15
36
|
className = _a.className,
|
|
16
|
-
|
|
37
|
+
renderHeader = _a.renderHeader,
|
|
38
|
+
inputPlaceholder = _a.inputPlaceholder,
|
|
17
39
|
treeNodeProps = _a.treeNodeProps,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
onDefailtSelect = _a.onDefailtSelect,
|
|
41
|
+
mode = _a.mode,
|
|
42
|
+
showIcon = _a.showIcon,
|
|
43
|
+
props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode", "showIcon"]);
|
|
44
|
+
|
|
45
|
+
var _useState = useState({
|
|
46
|
+
keyword: undefined,
|
|
47
|
+
expandedKeys: undefined,
|
|
48
|
+
focusKey: Date.now()
|
|
49
|
+
}),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
state = _useState2[0],
|
|
52
|
+
setState = _useState2[1];
|
|
53
|
+
/**
|
|
54
|
+
* @description 根据mode获取树的数据
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var _useHttp = useHttp(['TreeMode', mode], function (_ref) {
|
|
59
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
60
|
+
_ = _ref2[0],
|
|
61
|
+
mode = _ref2[1];
|
|
62
|
+
|
|
63
|
+
return mode === 'Bz' ? api.getDeviceBzTree() : mode === 'Custom' ? api.getCustomDeviceGroup() : mode === 'Org' ? api.getOrgs() : api.getPlacesByHasDevice();
|
|
64
|
+
}),
|
|
65
|
+
_useHttp$data = _useHttp.data,
|
|
66
|
+
list = _useHttp$data === void 0 ? defaultList : _useHttp$data;
|
|
67
|
+
|
|
68
|
+
var treeData = useMemo(function () {
|
|
69
|
+
return mode === 'Place' ? _treeHelper.computPlaceTree(list) : _treeHelper.computTreeList(list);
|
|
70
|
+
}, [list, mode]);
|
|
71
|
+
/**
|
|
72
|
+
* @description 实现关键字展开节点
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
useEffect(function () {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
|
|
78
|
+
var keys = [];
|
|
79
|
+
var defaultKeys = mode === 'Place' ? [] : ((_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id) ? [(_b = treeData[0]) === null || _b === void 0 ? void 0 : _b.id] : [];
|
|
80
|
+
|
|
81
|
+
if (!state.keyword) {
|
|
82
|
+
setState(function (old) {
|
|
83
|
+
return Object.assign(Object.assign({}, old), {
|
|
84
|
+
expandedKeys: defaultKeys,
|
|
85
|
+
focusKey: Date.now()
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
switch (mode) {
|
|
92
|
+
case 'Place':
|
|
93
|
+
var places = list.filter(function (v) {
|
|
94
|
+
return v.areaName.includes(state.keyword);
|
|
95
|
+
});
|
|
96
|
+
places.forEach(function (v) {
|
|
97
|
+
var codes = getPlaceCodesWithParent(v.areaCode, list);
|
|
98
|
+
keys = [].concat(keys, codes);
|
|
99
|
+
});
|
|
100
|
+
break;
|
|
101
|
+
|
|
102
|
+
case 'Bz':
|
|
103
|
+
case 'Custom':
|
|
104
|
+
var trees = list.filter(function (v) {
|
|
105
|
+
return v.groupName.includes(state.keyword);
|
|
106
|
+
});
|
|
107
|
+
trees.forEach(function (v) {
|
|
108
|
+
var ids = getParentListById(v.id, list).map(function (v) {
|
|
109
|
+
return v.id;
|
|
110
|
+
});
|
|
111
|
+
keys = [].concat(keys, ids);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
case 'Org':
|
|
115
|
+
var orgs = list.filter(function (v) {
|
|
116
|
+
return v.organizationName.includes(state.keyword);
|
|
117
|
+
});
|
|
118
|
+
orgs.forEach(function (v) {
|
|
119
|
+
var ids = getParentListById(v.id, list).map(function (v) {
|
|
120
|
+
return v.id;
|
|
121
|
+
});
|
|
122
|
+
keys = [].concat(keys, ids);
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var expandedKeys = _toConsumableArray(new Set(_toConsumableArray(keys)));
|
|
128
|
+
|
|
129
|
+
setState(function (old) {
|
|
130
|
+
var _a;
|
|
131
|
+
|
|
132
|
+
return Object.assign(Object.assign({}, old), {
|
|
133
|
+
expandedKeys: expandedKeys.length > 0 ? expandedKeys : [(_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id],
|
|
134
|
+
focusKey: Date.now()
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}, [state.keyword, list, treeData, mode]);
|
|
138
|
+
var treeKey = useMemo(function () {
|
|
139
|
+
return mode === 'Place' ? 'areaCode' : 'id';
|
|
140
|
+
}, [mode]);
|
|
141
|
+
var treeName = useMemo(function () {
|
|
142
|
+
return mode === 'Place' ? 'areaName' : mode === 'Org' ? 'organizationName' : 'groupName';
|
|
143
|
+
}, [mode]);
|
|
144
|
+
/**
|
|
145
|
+
* @description 触发默认选中节点事件
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
useEffect(function () {
|
|
149
|
+
var id = treeData[0] ? treeData[0][treeKey] : undefined;
|
|
150
|
+
id && onDefailtSelect && onDefailtSelect(id);
|
|
151
|
+
}, [treeData, treeKey]);
|
|
152
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
153
|
+
className: "bc-type-tree-layout ".concat(className)
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
155
|
+
title: title,
|
|
156
|
+
value: state.keyword,
|
|
157
|
+
inputPlaceholder: inputPlaceholder,
|
|
158
|
+
onChange: function onChange(val) {
|
|
159
|
+
return setState(function (old) {
|
|
160
|
+
return Object.assign(Object.assign({}, old), {
|
|
161
|
+
keyword: val
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(Tree, Object.assign({}, props, {
|
|
56
166
|
treeData: treeData,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
167
|
+
key: state.focusKey,
|
|
168
|
+
showIcon: showIcon,
|
|
169
|
+
onExpand: function onExpand(keys) {
|
|
170
|
+
return setState(function (old) {
|
|
171
|
+
return Object.assign(Object.assign({}, old), {
|
|
172
|
+
expandedKeys: keys
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
expandedKeys: state.expandedKeys,
|
|
177
|
+
defaultExpandedKeys: treeData[0] ? [treeData[0].id] : undefined,
|
|
178
|
+
treeNodeProps: {
|
|
179
|
+
keyword: state.keyword,
|
|
180
|
+
suffix: treeNodeProps === null || treeNodeProps === void 0 ? void 0 : treeNodeProps.suffix,
|
|
181
|
+
nameKey: treeName,
|
|
182
|
+
key: treeKey
|
|
60
183
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className: "tree-item-title"
|
|
66
|
-
}, /*#__PURE__*/React.createElement("span", null, showIcon && icon && icon(node), prefix && prefix(node), /*#__PURE__*/React.createElement(HightLevel, {
|
|
67
|
-
keyword: keyword,
|
|
68
|
-
name: node[nameKey]
|
|
69
|
-
})), suffix && suffix(node));
|
|
184
|
+
icon: function icon(node) {
|
|
185
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
186
|
+
type: "".concat(treeData.length === 1 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' ? node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Bar_Add' : 'icon-S_Photo_ListTree')
|
|
187
|
+
});
|
|
70
188
|
}
|
|
71
|
-
}
|
|
189
|
+
})));
|
|
72
190
|
}
|
|
73
191
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
treeData: [],
|
|
192
|
+
TreeMode.defaultProps = {
|
|
193
|
+
mode: 'Bz',
|
|
77
194
|
className: '',
|
|
78
|
-
treeNodeProps: {
|
|
79
|
-
|
|
80
|
-
key: 'id'
|
|
81
|
-
}
|
|
195
|
+
treeNodeProps: {},
|
|
196
|
+
showIcon: true
|
|
82
197
|
};
|
|
83
|
-
export default
|
|
198
|
+
export default TreeMode;
|
package/es/UserSelect/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
1
2
|
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
2
3
|
|
|
3
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -22,15 +23,14 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
22
23
|
|
|
23
24
|
import React, { useCallback, useMemo, useState, useImperativeHandle } from 'react';
|
|
24
25
|
import api from '../Api';
|
|
25
|
-
import TreeMode from '../
|
|
26
|
+
import TreeMode from '../Tree';
|
|
26
27
|
import uniq from 'lodash-es/uniq';
|
|
27
28
|
import intersectionWith from 'lodash-es/intersectionWith';
|
|
28
29
|
import uniqBy from 'lodash-es/uniqBy';
|
|
29
30
|
import differenceWith from 'lodash-es/differenceWith';
|
|
30
31
|
import IconFont from '../IconFont';
|
|
31
|
-
import useChangeEffect from '../useChangeEffect';
|
|
32
32
|
import useHttp from '../useHttp';
|
|
33
|
-
import ListExt from '../ListExt';
|
|
33
|
+
import ListExt from '../List/ListExt';
|
|
34
34
|
import "./index.css";
|
|
35
35
|
|
|
36
36
|
function UserSelect(_ref, ref) {
|
|
@@ -117,11 +117,13 @@ function UserSelect(_ref, ref) {
|
|
|
117
117
|
})
|
|
118
118
|
};
|
|
119
119
|
}, [state.selectUsers, state.selectIds]);
|
|
120
|
-
|
|
120
|
+
|
|
121
|
+
_useUpdateEffect(function () {
|
|
121
122
|
return onChange && onChange(state.selectUsers.filter(function (v) {
|
|
122
123
|
return state.selectIds.includes(v.id);
|
|
123
124
|
}));
|
|
124
125
|
}, [state.selectUsers, state.selectIds]);
|
|
126
|
+
|
|
125
127
|
var renderList1 = useMemo(function () {
|
|
126
128
|
return userList.filter(function (v) {
|
|
127
129
|
return !state.keyword1 || v.realName.includes(state.keyword1);
|
|
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
|
|
18
18
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
19
|
-
import
|
|
19
|
+
import Box from '../../Box';
|
|
20
20
|
import IconFont from '../../IconFont';
|
|
21
21
|
import RefModal from '../../RefModal';
|
|
22
22
|
|
|
@@ -29,8 +29,6 @@ function ConditionForm(_ref) {
|
|
|
29
29
|
|
|
30
30
|
var _a, _b;
|
|
31
31
|
|
|
32
|
-
console.log(item, useConditionFields);
|
|
33
|
-
|
|
34
32
|
var _useState = useState({
|
|
35
33
|
field: (item === null || item === void 0 ? void 0 : item.conditionList) ? (_a = item.conditionList[0]) === null || _a === void 0 ? void 0 : _a.field : '',
|
|
36
34
|
value: (item === null || item === void 0 ? void 0 : item.conditionList) ? (_b = item === null || item === void 0 ? void 0 : item.conditionList[0]) === null || _b === void 0 ? void 0 : _b.value : ''
|
|
@@ -129,7 +127,7 @@ function ConditionForm(_ref) {
|
|
|
129
127
|
});
|
|
130
128
|
}
|
|
131
129
|
}, [state.field, state.value, formItem, options]);
|
|
132
|
-
return /*#__PURE__*/React.createElement(
|
|
130
|
+
return /*#__PURE__*/React.createElement(Box.InfoBox, {
|
|
133
131
|
title: "\u8BBE\u7F6E\u6761\u4EF6",
|
|
134
132
|
contentStyle: {
|
|
135
133
|
padding: 20
|
|
@@ -24,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
24
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
25
|
|
|
26
26
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
27
|
-
import
|
|
27
|
+
import Box from '../../Box';
|
|
28
28
|
import cloneDeep from 'lodash-es/cloneDeep';
|
|
29
29
|
|
|
30
30
|
function FormAuth(_ref) {
|
|
@@ -56,7 +56,7 @@ function FormAuth(_ref) {
|
|
|
56
56
|
form: state.form
|
|
57
57
|
});
|
|
58
58
|
}, [state.form]);
|
|
59
|
-
return /*#__PURE__*/React.createElement(
|
|
59
|
+
return /*#__PURE__*/React.createElement(Box.InfoBox, {
|
|
60
60
|
className: "user-form-auth-layout",
|
|
61
61
|
title: "\u8868\u5355\u64CD\u4F5C\u6743\u9650"
|
|
62
62
|
}, /*#__PURE__*/React.createElement(_Table, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "antd/lib/checkbox/style";
|
|
2
2
|
import _Checkbox from "antd/lib/checkbox";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import Title from '../../Title';
|
|
5
5
|
|
|
6
6
|
function GroupList(_ref) {
|
|
7
7
|
var list = _ref.list,
|
|
@@ -11,7 +11,7 @@ function GroupList(_ref) {
|
|
|
11
11
|
title = _ref.title;
|
|
12
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
13
13
|
className: "lm-c-check-list-wrapper vidc-list-component post-group-list"
|
|
14
|
-
}, /*#__PURE__*/React.createElement(
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
15
15
|
titleExt: false,
|
|
16
16
|
title: title,
|
|
17
17
|
inputPlaceholder: "\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0",
|
|
@@ -22,7 +22,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
22
22
|
|
|
23
23
|
import React, { useCallback, useMemo, useState, useImperativeHandle } from 'react';
|
|
24
24
|
import api from '../../Api';
|
|
25
|
-
import TreeMode from '../../
|
|
25
|
+
import TreeMode from '../../Tree';
|
|
26
26
|
import uniq from 'lodash-es/uniq';
|
|
27
27
|
import intersectionWith from 'lodash-es/intersectionWith';
|
|
28
28
|
import useHttp from '../../useHttp';
|
|
@@ -20,8 +20,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
20
20
|
|
|
21
21
|
import React, { useCallback, useMemo, useState, forwardRef, useImperativeHandle } from 'react';
|
|
22
22
|
import api from '../../Api';
|
|
23
|
-
import TreeMode from '../../
|
|
24
|
-
import List from '../../ListExt';
|
|
23
|
+
import TreeMode from '../../Tree';
|
|
24
|
+
import List from '../../List/ListExt';
|
|
25
25
|
import uniq from 'lodash-es/uniq';
|
|
26
26
|
import intersectionWith from 'lodash-es/intersectionWith';
|
|
27
27
|
import uniqBy from 'lodash-es/uniqBy';
|
|
@@ -24,7 +24,7 @@ import UserAndGroupSelect from './UserAndGroupSelect';
|
|
|
24
24
|
import GroupSelect from './GroupSelect';
|
|
25
25
|
import EmptyUserSet from './EmptyUserSet';
|
|
26
26
|
import LevelGroupSelect from './LevelGroupSelect';
|
|
27
|
-
import
|
|
27
|
+
import Box from '../../Box';
|
|
28
28
|
var contentMap = {
|
|
29
29
|
1: UserSelectType1,
|
|
30
30
|
2: UserSelectType2,
|
|
@@ -89,7 +89,7 @@ function UserSet(_ref) {
|
|
|
89
89
|
useEffect(function () {
|
|
90
90
|
return onChange(data);
|
|
91
91
|
}, [data]);
|
|
92
|
-
return /*#__PURE__*/React.createElement(
|
|
92
|
+
return /*#__PURE__*/React.createElement(Box.InfoBox, {
|
|
93
93
|
title: "\u8BBE\u7F6E\u4EBA\u5458"
|
|
94
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
95
95
|
className: "user-select-type-wrapper"
|