@zgfe/business-lib 1.1.29-visual.8 → 1.1.29
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/es/addToPanel/components/addPanel.js +21 -8
- package/es/addToPanel/components/radioGroup.js +3 -1
- package/es/addToPanel/components/styleList.js +22 -5
- package/es/addToPanel/demo/edit.js +12 -5
- package/es/addToPanel/demo/index.js +12 -5
- package/es/addToPanel/index.js +58 -21
- package/es/addToScene/addGroup.js +4 -0
- package/es/addToScene/demo/index.js +12 -5
- package/es/addToScene/index.js +40 -13
- package/es/assets/demo/index.js +2 -0
- package/es/assets/demo/input.js +12 -5
- package/es/assets/iconfont/iconfont.js +17 -10
- package/es/assets/theme.js +1 -0
- package/es/attrConditions/components/operateList.js +27 -10
- package/es/attrConditions/components/stringList.js +97 -68
- package/es/attrConditions/components/valuesList.js +40 -14
- package/es/attrConditions/demo/group.js +23 -11
- package/es/attrConditions/demo/index.js +26 -17
- package/es/attrConditions/group.js +48 -17
- package/es/attrConditions/index.js +49 -22
- package/es/attrConditions/types.js +1 -0
- package/es/attributeSelector/demo/disable.js +16 -8
- package/es/attributeSelector/demo/index.js +17 -8
- package/es/attributeSelector/index.js +45 -22
- package/es/attributeSelector/listPanel.js +46 -18
- package/es/attributeSelector/option.js +13 -3
- package/es/attributeSelector/types.js +5 -0
- package/es/attributeSelector/util.js +3 -0
- package/es/chart/demo/index.js +14 -5
- package/es/chart/index.js +44 -30
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +37 -13
- package/es/chart/util/data/china.js +4 -1
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +5 -0
- package/es/chart/util/formatOption.js +13 -0
- package/es/chart/util/mapUtil.js +26 -5
- package/es/config.js +2 -0
- package/es/constants/apis.d.ts +0 -1
- package/es/constants/apis.js +1 -2
- package/es/cycleTime/demo/disable.js +1 -0
- package/es/cycleTime/index.js +46 -19
- package/es/cycleTime/month.js +27 -8
- package/es/datePicker/datePicker.js +23 -5
- package/es/datePicker/demo/customType.js +22 -13
- package/es/datePicker/demo/day.js +22 -13
- package/es/datePicker/demo/index.js +21 -12
- package/es/datePicker/index.js +41 -18
- package/es/datePicker/utils.js +7 -0
- package/es/demoWrapper/content.d.ts +1 -2
- package/es/demoWrapper/content.js +64 -42
- package/es/demoWrapper/demo/index.js +4 -5
- package/es/demoWrapper/head.d.ts +1 -3
- package/es/demoWrapper/head.js +27 -25
- package/es/demoWrapper/index.js +36 -28
- package/es/dialog/demo/index.js +12 -5
- package/es/dialog/index.js +6 -4
- package/es/dnd/demo/data.js +28 -19
- package/es/dnd/demo/handle.js +28 -19
- package/es/dnd/index.js +45 -21
- package/es/dnd/item.js +30 -10
- package/es/eventSelector/demo/index.js +23 -12
- package/es/eventSelector/index.js +42 -14
- package/es/eventSelector/listPanel.js +73 -31
- package/es/eventSelector/option.js +11 -6
- package/es/icon/iconFont.js +13 -7
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/layout/analysisLayout/demo/index.js +6 -0
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +34 -16
- package/es/layout/detail/index.js +3 -1
- package/es/loginForm/index.js +18 -7
- package/es/searchInput/index.js +7 -2
- package/es/select/demo/children.js +16 -8
- package/es/select/demo/customLabel.js +2 -0
- package/es/select/demo/group.js +17 -8
- package/es/select/demo/index.js +19 -11
- package/es/select/demo/loading.js +18 -8
- package/es/select/demo/multiple.js +16 -8
- package/es/select/handle.js +34 -14
- package/es/select/index.js +59 -22
- package/es/select/option.js +30 -10
- package/es/select/overlay.js +62 -25
- package/es/table/demo/data/table.js +2 -0
- package/es/table/demo/index.js +39 -13
- package/es/table/demo/index2.js +15 -5
- package/es/table/demo/index3.js +28 -7
- package/es/table/index.js +33 -14
- package/es/targetConditionGroup/components/targetDimension.js +38 -12
- package/es/targetConditionGroup/demo/group.js +36 -21
- package/es/targetConditionGroup/demo/index.js +13 -5
- package/es/targetConditionGroup/index.js +84 -31
- package/es/targetSelector/demo/index.js +28 -15
- package/es/targetSelector/editBox.js +20 -5
- package/es/targetSelector/index.js +36 -15
- package/es/targetSelector/optionIcon.js +5 -1
- package/es/targetSelector/optionMenu.js +3 -0
- package/es/userCondition/conditionTypeList.js +12 -7
- package/es/userCondition/conditionWrap.js +2 -0
- package/es/userCondition/conditions/cdpCondition.js +97 -51
- package/es/userCondition/conditions/eventCondition.js +16 -6
- package/es/userCondition/conditions/periodCondition.js +26 -8
- package/es/userCondition/conditions/propCondition.js +61 -29
- package/es/userCondition/conditions/runTimesCondition.js +10 -5
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +33 -15
- package/es/userCondition/conditions/textDesc.js +67 -16
- package/es/userCondition/demo/index.js +21 -11
- package/es/userCondition/index.js +91 -51
- package/es/userCondition/orConditions.js +48 -11
- package/es/userCondition/relationLabel.js +4 -1
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.js +13 -4
- package/es/userGroup/demo/group.js +23 -14
- package/es/userGroup/demo/index.js +15 -5
- package/es/userGroup/index.js +30 -12
- package/es/userTagsSelector/cascaderOverlay.js +51 -19
- package/es/userTagsSelector/components/search/index.js +2 -0
- package/es/userTagsSelector/demo/index.js +3 -0
- package/es/userTagsSelector/groups/groupOption.js +8 -6
- package/es/userTagsSelector/groups/index.js +30 -15
- package/es/userTagsSelector/index.js +35 -17
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
- package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
- package/es/userTagsSelector/util.js +2 -0
- package/es/utils/ajax.js +71 -45
- package/es/utils/base64.js +22 -3
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +7 -4
- package/es/utils/util.js +16 -0
- package/package.json +2 -2
- package/es/socket/demo/demo.d.ts +0 -2
- package/es/socket/demo/demo.js +0 -139
- package/es/socket/demo/index.less +0 -27
- package/es/socket/index.d.ts +0 -31
- package/es/socket/index.js +0 -284
- package/es/socket/types.d.ts +0 -37
- package/es/socket/types.js +0 -26
package/es/dnd/item.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useRef, useState } from 'react';
|
|
8
14
|
import { classPrefix } from '.';
|
|
9
15
|
var preMouse = {
|
|
@@ -16,22 +22,28 @@ var style = {
|
|
|
16
22
|
left: 0,
|
|
17
23
|
pointerEvents: 'inherit'
|
|
18
24
|
};
|
|
25
|
+
|
|
19
26
|
var BizDndItem = function BizDndItem(props) {
|
|
20
27
|
var className = props.className,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
render = props.render,
|
|
29
|
+
data = props.data,
|
|
30
|
+
draddingClassName = props.draddingClassName;
|
|
31
|
+
|
|
24
32
|
var _useState = useState(false),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
isDragging = _useState2[0],
|
|
35
|
+
setIsDragging = _useState2[1];
|
|
36
|
+
|
|
28
37
|
var ref = useRef();
|
|
38
|
+
|
|
29
39
|
function onMousedown(e) {
|
|
30
40
|
var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
top = _e$currentTarget$getB.top,
|
|
42
|
+
left = _e$currentTarget$getB.left;
|
|
43
|
+
|
|
33
44
|
window.addEventListener('mousemove', onMouseMove);
|
|
34
45
|
window.addEventListener('mouseup', onMouseUp);
|
|
46
|
+
|
|
35
47
|
if (ref.current) {
|
|
36
48
|
var computedStyle = window.getComputedStyle(ref.current);
|
|
37
49
|
style = {
|
|
@@ -50,6 +62,7 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
50
62
|
setIsDragging(true);
|
|
51
63
|
}
|
|
52
64
|
}
|
|
65
|
+
|
|
53
66
|
function onMouseMove(e) {
|
|
54
67
|
var computedStyle = window.getComputedStyle(ref.current);
|
|
55
68
|
style.position = 'fixed';
|
|
@@ -65,6 +78,7 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
65
78
|
};
|
|
66
79
|
if (props.onDragging) props.onDragging(data);
|
|
67
80
|
}
|
|
81
|
+
|
|
68
82
|
function onMouseUp() {
|
|
69
83
|
setIsDragging(false);
|
|
70
84
|
window.removeEventListener('mousemove', onMouseMove);
|
|
@@ -80,6 +94,7 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
80
94
|
setStyle();
|
|
81
95
|
if (props.onDropEnd) props.onDropEnd(data);
|
|
82
96
|
}
|
|
97
|
+
|
|
83
98
|
function setStyle() {
|
|
84
99
|
if (ref.current) {
|
|
85
100
|
ref.current.style.position = style.position;
|
|
@@ -89,10 +104,12 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
89
104
|
ref.current.style.width = style.width;
|
|
90
105
|
}
|
|
91
106
|
}
|
|
107
|
+
|
|
92
108
|
if (props.data.isTemp) return /*#__PURE__*/React.createElement("div", {
|
|
93
109
|
className: "".concat(classPrefix, "-item ").concat(className),
|
|
94
110
|
ref: ref
|
|
95
111
|
});
|
|
112
|
+
|
|
96
113
|
if (props.data.disabled) {
|
|
97
114
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
115
|
className: "".concat(classPrefix, "-item disable ").concat(className),
|
|
@@ -102,6 +119,7 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
102
119
|
}
|
|
103
120
|
}, render(data, props.index));
|
|
104
121
|
}
|
|
122
|
+
|
|
105
123
|
if (props.handle) {
|
|
106
124
|
var handle = /*#__PURE__*/React.createElement("span", {
|
|
107
125
|
className: "".concat(classPrefix, "-handle ").concat(props.handleClassName),
|
|
@@ -115,6 +133,7 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
115
133
|
ref: ref
|
|
116
134
|
}, render(data, props.index, handle));
|
|
117
135
|
}
|
|
136
|
+
|
|
118
137
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
138
|
className: "".concat(classPrefix, "-item ").concat(className, " ").concat(isDragging ? draddingClassName : ''),
|
|
120
139
|
onMouseDown: onMousedown,
|
|
@@ -124,4 +143,5 @@ var BizDndItem = function BizDndItem(props) {
|
|
|
124
143
|
ref: ref
|
|
125
144
|
}, render(data, props.index));
|
|
126
145
|
};
|
|
146
|
+
|
|
127
147
|
export default BizDndItem;
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import { BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
9
15
|
import eventData from '../../mock/event';
|
|
16
|
+
|
|
10
17
|
var EventDemo = function EventDemo() {
|
|
11
18
|
var store = convertAttributeData({
|
|
12
19
|
eventList: eventData
|
|
13
20
|
});
|
|
21
|
+
|
|
14
22
|
var _useState = useState({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
group: {
|
|
24
|
+
id: 4201
|
|
25
|
+
},
|
|
26
|
+
event: {
|
|
27
|
+
id: 24143017
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
value = _useState2[0],
|
|
32
|
+
setValue = _useState2[1];
|
|
33
|
+
|
|
25
34
|
var onChange = function onChange(data) {
|
|
26
35
|
setValue(data);
|
|
27
36
|
};
|
|
37
|
+
|
|
28
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
29
39
|
style: {
|
|
30
40
|
height: '500px',
|
|
@@ -44,6 +54,7 @@ var EventDemo = function EventDemo() {
|
|
|
44
54
|
onChange: onChange
|
|
45
55
|
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
|
|
46
56
|
};
|
|
57
|
+
|
|
47
58
|
export default (function () {
|
|
48
59
|
return /*#__PURE__*/React.createElement(EventDemo, null);
|
|
49
60
|
});
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { Dropdown } from 'antd';
|
|
8
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
9
15
|
import SelectHandle from '../select/handle';
|
|
@@ -11,23 +17,28 @@ import BizGlobalDataContext from '../context';
|
|
|
11
17
|
import EventListPanel from './listPanel';
|
|
12
18
|
import './styles/index.less';
|
|
13
19
|
export var classPrefix = 'biz-event-select';
|
|
20
|
+
|
|
14
21
|
var BizEventSelector = function BizEventSelector(props) {
|
|
15
22
|
var alias = props.alias,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
placeholder = props.placeholder,
|
|
24
|
+
showAllEvent = props.showAllEvent,
|
|
25
|
+
border = props.border,
|
|
26
|
+
theme = props.theme,
|
|
27
|
+
defaultSelectAble = props.defaultSelectAble;
|
|
28
|
+
|
|
21
29
|
var _useState = useState(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
currentValue = _useState2[0],
|
|
32
|
+
setCurrentValue = _useState2[1];
|
|
33
|
+
|
|
25
34
|
var _useState3 = useState(false),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
visible = _useState4[0],
|
|
37
|
+
setVisible = _useState4[1];
|
|
38
|
+
|
|
29
39
|
var _useContext = useContext(BizGlobalDataContext),
|
|
30
|
-
|
|
40
|
+
eventGroupList = _useContext.eventGroupList;
|
|
41
|
+
|
|
31
42
|
var selectId = (Math.random() + 10).toString();
|
|
32
43
|
useEffect(function () {
|
|
33
44
|
if (!props.defaultValue) return;
|
|
@@ -39,9 +50,12 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
39
50
|
var data = getValue(props.value);
|
|
40
51
|
setCurrentValue(data);
|
|
41
52
|
}, [props.value]);
|
|
53
|
+
|
|
42
54
|
var getValue = function getValue(param) {
|
|
43
55
|
var _param$group, _param$event;
|
|
56
|
+
|
|
44
57
|
var res = {};
|
|
58
|
+
|
|
45
59
|
if (!((_param$group = param.group) === null || _param$group === void 0 ? void 0 : _param$group.id)) {
|
|
46
60
|
res.group = {
|
|
47
61
|
id: 0,
|
|
@@ -55,6 +69,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
55
69
|
}()
|
|
56
70
|
};
|
|
57
71
|
}
|
|
72
|
+
|
|
58
73
|
if (((_param$event = param.event) === null || _param$event === void 0 ? void 0 : _param$event.id) === -100) {
|
|
59
74
|
res.event = {
|
|
60
75
|
id: -100,
|
|
@@ -62,41 +77,53 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
62
77
|
attrList: []
|
|
63
78
|
};
|
|
64
79
|
}
|
|
80
|
+
|
|
65
81
|
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
|
|
66
82
|
var _param$group2;
|
|
83
|
+
|
|
67
84
|
if (group.id === ((_param$group2 = param.group) === null || _param$group2 === void 0 ? void 0 : _param$group2.id)) res.group = group;
|
|
68
85
|
group.eventList.forEach(function (event) {
|
|
69
86
|
var _param$event2;
|
|
87
|
+
|
|
70
88
|
if (event.id === ((_param$event2 = param.event) === null || _param$event2 === void 0 ? void 0 : _param$event2.id)) res.event = event;
|
|
71
89
|
});
|
|
72
90
|
});
|
|
73
91
|
return res;
|
|
74
92
|
};
|
|
93
|
+
|
|
75
94
|
var getLabel = function getLabel() {
|
|
76
95
|
var label = '';
|
|
77
96
|
if (!(currentValue === null || currentValue === void 0 ? void 0 : currentValue.event)) return label;
|
|
78
97
|
var name = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.alias) || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.name);
|
|
98
|
+
|
|
79
99
|
if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.id) === -100) {
|
|
80
100
|
var _currentValue$group;
|
|
101
|
+
|
|
81
102
|
label = "".concat((currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$group = currentValue.group) === null || _currentValue$group === void 0 ? void 0 : _currentValue$group.name) || '所有分组', "/").concat(name);
|
|
82
103
|
} else {
|
|
83
104
|
label = name;
|
|
84
105
|
}
|
|
106
|
+
|
|
85
107
|
if (alias && alias !== name) {
|
|
86
108
|
label += "(".concat(alias, ")");
|
|
87
109
|
}
|
|
110
|
+
|
|
88
111
|
return label;
|
|
89
112
|
};
|
|
113
|
+
|
|
90
114
|
var onChange = function onChange(value, isOverview) {
|
|
91
115
|
if (!defaultSelectAble && !isOverview) {
|
|
92
116
|
setVisible(false);
|
|
93
117
|
}
|
|
118
|
+
|
|
94
119
|
setCurrentValue(value);
|
|
95
120
|
props.onChange && props.onChange(value);
|
|
96
121
|
};
|
|
122
|
+
|
|
97
123
|
var onVisibleChange = function onVisibleChange(flag) {
|
|
98
124
|
setVisible(flag);
|
|
99
125
|
};
|
|
126
|
+
|
|
100
127
|
return /*#__PURE__*/React.createElement("div", {
|
|
101
128
|
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
102
129
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
@@ -128,6 +155,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
128
155
|
size: props.size
|
|
129
156
|
}))));
|
|
130
157
|
};
|
|
158
|
+
|
|
131
159
|
BizEventSelector.defaultProps = {
|
|
132
160
|
showAllEvent: true,
|
|
133
161
|
defaultSelectAble: true,
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
2
3
|
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."); }
|
|
4
|
+
|
|
3
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
|
|
4
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
|
|
5
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
6
11
|
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."); }
|
|
12
|
+
|
|
7
13
|
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); }
|
|
8
|
-
|
|
9
|
-
function
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
10
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
11
21
|
import { Skeleton } from 'antd';
|
|
12
22
|
import _ from 'lodash';
|
|
13
23
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -17,31 +27,39 @@ import { BizGlobalDataContext } from '..';
|
|
|
17
27
|
import { ShowStatus } from '../attributeSelector/types';
|
|
18
28
|
import BizSearchInput from '../searchInput';
|
|
19
29
|
import EventListOption from './option';
|
|
30
|
+
|
|
20
31
|
var EventListPanel = function EventListPanel(props) {
|
|
21
32
|
var showOverview = props.showOverview,
|
|
22
|
-
|
|
33
|
+
defaultSelectAble = props.defaultSelectAble;
|
|
34
|
+
|
|
23
35
|
var _useState = useState(''),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
searchValue = _useState2[0],
|
|
38
|
+
setSearchValue = _useState2[1];
|
|
39
|
+
|
|
27
40
|
var _useContext = useContext(BizGlobalDataContext),
|
|
28
|
-
|
|
41
|
+
eventGroupList = _useContext.eventGroupList;
|
|
42
|
+
|
|
29
43
|
var _useState3 = useState(eventGroupList || []),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
+
groupList = _useState4[0],
|
|
46
|
+
setGroupList = _useState4[1];
|
|
47
|
+
|
|
33
48
|
var _useState5 = useState(),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
+
currentGroup = _useState6[0],
|
|
51
|
+
setCurrentGroup = _useState6[1];
|
|
52
|
+
|
|
37
53
|
var _useState7 = useState([]),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
55
|
+
searchEventList = _useState8[0],
|
|
56
|
+
setSearchEventList = _useState8[1];
|
|
57
|
+
|
|
41
58
|
var _useState9 = useState(),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
60
|
+
currentValue = _useState10[0],
|
|
61
|
+
setCurrentValue = _useState10[1];
|
|
62
|
+
|
|
45
63
|
var scrollableId = 'scrollableDiv' + Math.random();
|
|
46
64
|
var overviewData = {
|
|
47
65
|
id: -100,
|
|
@@ -64,6 +82,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
64
82
|
} else {
|
|
65
83
|
list.push(item);
|
|
66
84
|
}
|
|
85
|
+
|
|
67
86
|
listObj[item.id] = 1;
|
|
68
87
|
}
|
|
69
88
|
});
|
|
@@ -92,19 +111,25 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
92
111
|
return list;
|
|
93
112
|
});
|
|
94
113
|
}, [searchValue, currentGroup, showOverview]);
|
|
114
|
+
|
|
95
115
|
function onClickEvent(e) {
|
|
96
116
|
var resVal = _.cloneDeep(currentValue) || {};
|
|
97
117
|
resVal.event = e;
|
|
118
|
+
|
|
98
119
|
if (e.id === -100) {
|
|
99
120
|
resVal.group = currentGroup;
|
|
100
121
|
}
|
|
122
|
+
|
|
101
123
|
setCurrentValue(resVal);
|
|
102
124
|
if (props.onChange) props.onChange(resVal);
|
|
103
125
|
}
|
|
126
|
+
|
|
104
127
|
function onClickGroup(g) {
|
|
105
128
|
var _currentValue$event;
|
|
129
|
+
|
|
106
130
|
setCurrentGroup(g);
|
|
107
131
|
var isOverview = (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event = currentValue.event) === null || _currentValue$event === void 0 ? void 0 : _currentValue$event.id) === -100;
|
|
132
|
+
|
|
108
133
|
if (defaultSelectAble || isOverview) {
|
|
109
134
|
var resVal = _.cloneDeep(currentValue) || {};
|
|
110
135
|
resVal.group = g;
|
|
@@ -113,6 +138,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
113
138
|
if (props.onChange) props.onChange(resVal, isOverview);
|
|
114
139
|
}
|
|
115
140
|
}
|
|
141
|
+
|
|
116
142
|
if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
|
|
117
143
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
144
|
className: "".concat(classPrefix, "-nodata-panel")
|
|
@@ -120,6 +146,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
120
146
|
className: "".concat(classPrefix, "-nodata")
|
|
121
147
|
}, "\u6682\u65E0\u6570\u636E"));
|
|
122
148
|
}
|
|
149
|
+
|
|
123
150
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
151
|
className: "".concat(classPrefix, "-list-panel")
|
|
125
152
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -155,29 +182,43 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
155
182
|
onClick: onClickEvent
|
|
156
183
|
}))));
|
|
157
184
|
};
|
|
185
|
+
|
|
158
186
|
var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
159
187
|
var scrollableTarget = _ref.scrollableTarget,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
188
|
+
searchEventList = _ref.searchEventList,
|
|
189
|
+
searchValue = _ref.searchValue,
|
|
190
|
+
currentGroup = _ref.currentGroup,
|
|
191
|
+
currentValue = _ref.currentValue,
|
|
192
|
+
onClick = _ref.onClick;
|
|
193
|
+
|
|
165
194
|
var _useState11 = useState([]),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
195
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
196
|
+
showList = _useState12[0],
|
|
197
|
+
setShowList = _useState12[1];
|
|
198
|
+
|
|
199
|
+
var _useState13 = useState([]),
|
|
200
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
201
|
+
canShowList = _useState14[0],
|
|
202
|
+
setCanShowList = _useState14[1];
|
|
203
|
+
|
|
169
204
|
useEffect(function () {
|
|
170
|
-
|
|
205
|
+
var data = searchEventList.filter(function (item) {
|
|
206
|
+
return item.eventHidden !== ShowStatus.hidden;
|
|
207
|
+
});
|
|
208
|
+
setCanShowList(data);
|
|
209
|
+
setShowList(data.slice(0, 10));
|
|
171
210
|
}, [searchEventList]);
|
|
211
|
+
|
|
172
212
|
var loadMoreData = function loadMoreData() {
|
|
173
|
-
var moreData =
|
|
213
|
+
var moreData = canShowList.slice(showList.length, showList.length + 10);
|
|
174
214
|
setShowList(function (list) {
|
|
175
215
|
return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
|
|
176
216
|
});
|
|
177
217
|
};
|
|
218
|
+
|
|
178
219
|
return /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
179
220
|
dataLength: showList.length,
|
|
180
|
-
hasMore: showList.length <
|
|
221
|
+
hasMore: showList.length < canShowList.length,
|
|
181
222
|
loader: /*#__PURE__*/React.createElement(Skeleton, {
|
|
182
223
|
paragraph: {
|
|
183
224
|
rows: 1
|
|
@@ -190,7 +231,7 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
190
231
|
key: Math.random()
|
|
191
232
|
}, showList.map(function (e) {
|
|
192
233
|
var _currentValue$event2;
|
|
193
|
-
|
|
234
|
+
|
|
194
235
|
return /*#__PURE__*/React.createElement(EventListOption, {
|
|
195
236
|
label: e.alias || e.name,
|
|
196
237
|
key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
|
|
@@ -204,4 +245,5 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
204
245
|
});
|
|
205
246
|
}));
|
|
206
247
|
};
|
|
248
|
+
|
|
207
249
|
export default EventListPanel;
|
|
@@ -3,17 +3,20 @@ import React from 'react';
|
|
|
3
3
|
import { classPrefix } from '.';
|
|
4
4
|
import IconFont from '../icon/iconFont';
|
|
5
5
|
import { util } from '../utils';
|
|
6
|
+
|
|
6
7
|
var EventListOption = function EventListOption(props) {
|
|
7
8
|
var showCount = props.showCount,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
count = props.count,
|
|
10
|
+
label = props.label,
|
|
11
|
+
checked = props.checked,
|
|
12
|
+
highlight = props.highlight,
|
|
13
|
+
onClick = props.onClick,
|
|
14
|
+
data = props.data;
|
|
15
|
+
|
|
14
16
|
var _onClick = function _onClick() {
|
|
15
17
|
if (onClick) onClick(data);
|
|
16
18
|
};
|
|
19
|
+
|
|
17
20
|
function getLabel(label) {
|
|
18
21
|
if (!highlight || !highlight.enable || !highlight.text) return label;
|
|
19
22
|
var text = highlight.text;
|
|
@@ -27,6 +30,7 @@ var EventListOption = function EventListOption(props) {
|
|
|
27
30
|
}, text);
|
|
28
31
|
});
|
|
29
32
|
}
|
|
33
|
+
|
|
30
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
35
|
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
|
|
32
36
|
onClick: _onClick
|
|
@@ -41,4 +45,5 @@ var EventListOption = function EventListOption(props) {
|
|
|
41
45
|
count: count
|
|
42
46
|
}));
|
|
43
47
|
};
|
|
48
|
+
|
|
44
49
|
export default EventListOption;
|
package/es/icon/iconFont.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
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
|
var _excluded = ["className", "type", "family"];
|
|
2
|
+
|
|
3
3
|
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; }
|
|
4
|
+
|
|
4
5
|
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; }
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
8
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
|
|
9
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
|
|
10
13
|
import React, { useMemo } from 'react';
|
|
14
|
+
|
|
11
15
|
var IconFont = function IconFont(props) {
|
|
12
16
|
var className = props.className,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
type = props.type,
|
|
18
|
+
family = props.family,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
|
|
16
21
|
var iconClassName = useMemo(function () {
|
|
17
22
|
return "".concat(family, " ").concat(className, " ").concat(type);
|
|
18
23
|
}, [className, type]);
|
|
@@ -23,6 +28,7 @@ var IconFont = function IconFont(props) {
|
|
|
23
28
|
}
|
|
24
29
|
}, rest));
|
|
25
30
|
};
|
|
31
|
+
|
|
26
32
|
IconFont.defaultProps = {
|
|
27
33
|
className: '',
|
|
28
34
|
family: 'bsicon'
|
package/es/index.d.ts
CHANGED
|
@@ -28,8 +28,7 @@ import BizDnd from './dnd';
|
|
|
28
28
|
import BizDetailLayout from './layout/detail';
|
|
29
29
|
import BizLoginForm from './loginForm';
|
|
30
30
|
import DemoWrapper from './demoWrapper';
|
|
31
|
-
|
|
32
|
-
export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
31
|
+
export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
33
32
|
export type { UserGroupTypes } from './userGroup/types';
|
|
34
33
|
export type { BizSelectTypes } from './select/types';
|
|
35
34
|
export type { AttributeSelect } from './attributeSelector/types';
|
package/es/index.js
CHANGED
|
@@ -27,5 +27,4 @@ import BizDnd from './dnd';
|
|
|
27
27
|
import BizDetailLayout from './layout/detail';
|
|
28
28
|
import BizLoginForm from './loginForm';
|
|
29
29
|
import DemoWrapper from './demoWrapper';
|
|
30
|
-
|
|
31
|
-
export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
|
|
30
|
+
export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
|