@zgfe/business-lib 1.1.28 → 1.1.29-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/es/addToPanel/components/addPanel.js +21 -8
  2. package/es/addToPanel/components/radioGroup.js +3 -1
  3. package/es/addToPanel/components/styleList.js +22 -5
  4. package/es/addToPanel/demo/edit.js +12 -5
  5. package/es/addToPanel/demo/index.js +12 -5
  6. package/es/addToPanel/index.js +58 -21
  7. package/es/addToScene/addGroup.js +4 -0
  8. package/es/addToScene/demo/index.js +12 -5
  9. package/es/addToScene/index.js +40 -13
  10. package/es/assets/demo/index.js +2 -0
  11. package/es/assets/demo/input.js +12 -5
  12. package/es/assets/iconfont/iconfont.js +17 -10
  13. package/es/assets/theme.js +1 -0
  14. package/es/attrConditions/components/operateList.js +27 -10
  15. package/es/attrConditions/components/stringList.js +97 -68
  16. package/es/attrConditions/components/valuesList.js +40 -14
  17. package/es/attrConditions/demo/group.js +23 -11
  18. package/es/attrConditions/demo/index.js +26 -17
  19. package/es/attrConditions/group.js +48 -17
  20. package/es/attrConditions/index.js +49 -22
  21. package/es/attrConditions/types.js +1 -0
  22. package/es/attributeSelector/demo/disable.js +16 -8
  23. package/es/attributeSelector/demo/index.js +17 -8
  24. package/es/attributeSelector/index.js +45 -22
  25. package/es/attributeSelector/listPanel.js +46 -18
  26. package/es/attributeSelector/option.js +13 -3
  27. package/es/attributeSelector/types.d.ts +1 -0
  28. package/es/attributeSelector/types.js +5 -0
  29. package/es/attributeSelector/util.js +3 -0
  30. package/es/chart/demo/index.js +14 -5
  31. package/es/chart/index.js +44 -30
  32. package/es/chart/util/chartOptionConfig.d.ts +3 -3
  33. package/es/chart/util/chartOptionConfig.js +37 -13
  34. package/es/chart/util/data/china.js +4 -1
  35. package/es/chart/util/formatData.d.ts +2 -2
  36. package/es/chart/util/formatData.js +5 -0
  37. package/es/chart/util/formatOption.js +13 -0
  38. package/es/chart/util/mapUtil.js +26 -5
  39. package/es/config.js +2 -0
  40. package/es/constants/common.d.ts +10 -0
  41. package/es/constants/common.js +30 -0
  42. package/es/cycleTime/demo/disable.js +1 -0
  43. package/es/cycleTime/index.js +46 -19
  44. package/es/cycleTime/month.js +27 -8
  45. package/es/datePicker/datePicker.js +23 -5
  46. package/es/datePicker/demo/customType.js +22 -13
  47. package/es/datePicker/demo/day.js +22 -13
  48. package/es/datePicker/demo/index.js +21 -12
  49. package/es/datePicker/index.js +41 -18
  50. package/es/datePicker/utils.js +7 -0
  51. package/es/demoWrapper/content.js +56 -31
  52. package/es/demoWrapper/head.js +23 -9
  53. package/es/demoWrapper/index.js +30 -14
  54. package/es/dialog/demo/index.js +12 -5
  55. package/es/dialog/index.js +6 -4
  56. package/es/dnd/demo/data.js +28 -19
  57. package/es/dnd/demo/handle.js +28 -19
  58. package/es/dnd/index.js +45 -21
  59. package/es/dnd/item.js +30 -10
  60. package/es/eventSelector/demo/index.js +24 -12
  61. package/es/eventSelector/index.js +47 -16
  62. package/es/eventSelector/listPanel.js +64 -29
  63. package/es/eventSelector/option.js +11 -6
  64. package/es/eventSelector/types.d.ts +2 -0
  65. package/es/icon/iconFont.js +13 -7
  66. package/es/layout/analysisLayout/demo/index.js +6 -0
  67. package/es/layout/analysisLayout/index.d.ts +1 -1
  68. package/es/layout/analysisLayout/index.js +34 -16
  69. package/es/layout/detail/index.js +3 -1
  70. package/es/loginForm/index.js +18 -7
  71. package/es/searchInput/index.js +7 -2
  72. package/es/select/demo/children.js +16 -8
  73. package/es/select/demo/customLabel.js +2 -0
  74. package/es/select/demo/group.js +17 -8
  75. package/es/select/demo/index.js +19 -11
  76. package/es/select/demo/loading.js +18 -8
  77. package/es/select/demo/multiple.js +16 -8
  78. package/es/select/handle.js +34 -14
  79. package/es/select/index.js +59 -22
  80. package/es/select/option.js +30 -10
  81. package/es/select/overlay.js +62 -25
  82. package/es/table/demo/data/table.js +2 -0
  83. package/es/table/demo/index.js +39 -13
  84. package/es/table/demo/index2.js +15 -5
  85. package/es/table/demo/index3.js +28 -7
  86. package/es/table/index.js +33 -14
  87. package/es/targetConditionGroup/components/targetDimension.js +38 -12
  88. package/es/targetConditionGroup/demo/group.js +36 -21
  89. package/es/targetConditionGroup/demo/index.js +15 -6
  90. package/es/targetConditionGroup/index.js +97 -43
  91. package/es/targetConditionGroup/types.d.ts +1 -0
  92. package/es/targetSelector/demo/index.js +28 -15
  93. package/es/targetSelector/editBox.js +20 -5
  94. package/es/targetSelector/index.js +36 -15
  95. package/es/targetSelector/optionIcon.js +5 -1
  96. package/es/targetSelector/optionMenu.js +3 -0
  97. package/es/userCondition/conditionTypeList.js +12 -7
  98. package/es/userCondition/conditionWrap.js +2 -0
  99. package/es/userCondition/conditions/cdpCondition.js +97 -51
  100. package/es/userCondition/conditions/eventCondition.js +16 -6
  101. package/es/userCondition/conditions/periodCondition.js +26 -8
  102. package/es/userCondition/conditions/propCondition.js +61 -29
  103. package/es/userCondition/conditions/runTimesCondition.js +10 -5
  104. package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
  105. package/es/userCondition/conditions/tagsCondition.js +33 -15
  106. package/es/userCondition/conditions/textDesc.js +67 -16
  107. package/es/userCondition/demo/index.js +21 -11
  108. package/es/userCondition/index.js +91 -51
  109. package/es/userCondition/orConditions.js +48 -11
  110. package/es/userCondition/relationLabel.js +4 -1
  111. package/es/userCondition/types.d.ts +1 -1
  112. package/es/userCondition/types.js +1 -0
  113. package/es/userCondition/util.js +13 -4
  114. package/es/userGroup/demo/group.js +23 -14
  115. package/es/userGroup/demo/index.js +15 -5
  116. package/es/userGroup/index.js +30 -12
  117. package/es/userTagsSelector/cascaderOverlay.js +51 -19
  118. package/es/userTagsSelector/components/search/index.js +2 -0
  119. package/es/userTagsSelector/demo/index.js +3 -0
  120. package/es/userTagsSelector/groups/groupOption.js +8 -6
  121. package/es/userTagsSelector/groups/index.js +30 -15
  122. package/es/userTagsSelector/index.js +35 -17
  123. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
  124. package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
  125. package/es/userTagsSelector/util.js +2 -0
  126. package/es/utils/ajax.js +71 -45
  127. package/es/utils/base64.js +22 -3
  128. package/es/utils/type.d.ts +1 -1
  129. package/es/utils/type.js +7 -4
  130. package/es/utils/util.js +16 -0
  131. package/package.json +2 -2
@@ -1,33 +1,45 @@
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
- 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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
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';
10
16
  import BizGlobalDataContext from '../context';
11
17
  import EventListPanel from './listPanel';
12
18
  import './styles/index.less';
19
+ import { BuiltinIndicators } from '../constants/common';
13
20
  export var classPrefix = 'biz-event-select';
21
+
14
22
  var BizEventSelector = function BizEventSelector(props) {
15
23
  var alias = props.alias,
16
- placeholder = props.placeholder,
17
- showAllEvent = props.showAllEvent,
18
- border = props.border,
19
- theme = props.theme,
20
- defaultSelectAble = props.defaultSelectAble;
24
+ placeholder = props.placeholder,
25
+ showAllEvent = props.showAllEvent,
26
+ border = props.border,
27
+ theme = props.theme,
28
+ defaultSelectAble = props.defaultSelectAble;
29
+
21
30
  var _useState = useState(),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- currentValue = _useState2[0],
24
- setCurrentValue = _useState2[1];
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ currentValue = _useState2[0],
33
+ setCurrentValue = _useState2[1];
34
+
25
35
  var _useState3 = useState(false),
26
- _useState4 = _slicedToArray(_useState3, 2),
27
- visible = _useState4[0],
28
- setVisible = _useState4[1];
36
+ _useState4 = _slicedToArray(_useState3, 2),
37
+ visible = _useState4[0],
38
+ setVisible = _useState4[1];
39
+
29
40
  var _useContext = useContext(BizGlobalDataContext),
30
- eventGroupList = _useContext.eventGroupList;
41
+ eventGroupList = _useContext.eventGroupList;
42
+
31
43
  var selectId = (Math.random() + 10).toString();
32
44
  useEffect(function () {
33
45
  if (!props.defaultValue) return;
@@ -39,22 +51,27 @@ var BizEventSelector = function BizEventSelector(props) {
39
51
  var data = getValue(props.value);
40
52
  setCurrentValue(data);
41
53
  }, [props.value]);
54
+
42
55
  var getValue = function getValue(param) {
43
56
  var _param$group, _param$event;
57
+
44
58
  var res = {};
59
+ var allEvents = props.showBuiltInTarget ? eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.concat(BuiltinIndicators) : eventGroupList;
60
+
45
61
  if (!((_param$group = param.group) === null || _param$group === void 0 ? void 0 : _param$group.id)) {
46
62
  res.group = {
47
63
  id: 0,
48
64
  name: '所有分组',
49
65
  eventList: function () {
50
66
  var list = [];
51
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
67
+ allEvents === null || allEvents === void 0 ? void 0 : allEvents.forEach(function (group) {
52
68
  list = list.concat(group.eventList);
53
69
  });
54
70
  return list;
55
71
  }()
56
72
  };
57
73
  }
74
+
58
75
  if (((_param$event = param.event) === null || _param$event === void 0 ? void 0 : _param$event.id) === -100) {
59
76
  res.event = {
60
77
  id: -100,
@@ -62,41 +79,53 @@ var BizEventSelector = function BizEventSelector(props) {
62
79
  attrList: []
63
80
  };
64
81
  }
65
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
82
+
83
+ allEvents === null || allEvents === void 0 ? void 0 : allEvents.forEach(function (group) {
66
84
  var _param$group2;
85
+
67
86
  if (group.id === ((_param$group2 = param.group) === null || _param$group2 === void 0 ? void 0 : _param$group2.id)) res.group = group;
68
87
  group.eventList.forEach(function (event) {
69
88
  var _param$event2;
89
+
70
90
  if (event.id === ((_param$event2 = param.event) === null || _param$event2 === void 0 ? void 0 : _param$event2.id)) res.event = event;
71
91
  });
72
92
  });
73
93
  return res;
74
94
  };
95
+
75
96
  var getLabel = function getLabel() {
76
97
  var label = '';
77
98
  if (!(currentValue === null || currentValue === void 0 ? void 0 : currentValue.event)) return label;
78
99
  var name = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.alias) || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.name);
100
+
79
101
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.id) === -100) {
80
102
  var _currentValue$group;
103
+
81
104
  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
105
  } else {
83
106
  label = name;
84
107
  }
108
+
85
109
  if (alias && alias !== name) {
86
110
  label += "(".concat(alias, ")");
87
111
  }
112
+
88
113
  return label;
89
114
  };
115
+
90
116
  var onChange = function onChange(value, isOverview) {
91
117
  if (!defaultSelectAble && !isOverview) {
92
118
  setVisible(false);
93
119
  }
120
+
94
121
  setCurrentValue(value);
95
122
  props.onChange && props.onChange(value);
96
123
  };
124
+
97
125
  var onVisibleChange = function onVisibleChange(flag) {
98
126
  setVisible(flag);
99
127
  };
128
+
100
129
  return /*#__PURE__*/React.createElement("div", {
101
130
  className: [classPrefix, border ? 'border' : ''].join(' ')
102
131
  }, /*#__PURE__*/React.createElement(Dropdown, {
@@ -104,6 +133,7 @@ var BizEventSelector = function BizEventSelector(props) {
104
133
  value: currentValue,
105
134
  onChange: onChange,
106
135
  showOverview: showAllEvent,
136
+ showBuiltInTarget: props.showBuiltInTarget,
107
137
  defaultSelectAble: defaultSelectAble
108
138
  }),
109
139
  trigger: ['click'],
@@ -128,6 +158,7 @@ var BizEventSelector = function BizEventSelector(props) {
128
158
  size: props.size
129
159
  }))));
130
160
  };
161
+
131
162
  BizEventSelector.defaultProps = {
132
163
  showAllEvent: true,
133
164
  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
- 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; }
9
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
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';
@@ -15,33 +25,42 @@ import InfiniteScroll from 'react-infinite-scroll-component';
15
25
  import { classPrefix } from '.';
16
26
  import { BizGlobalDataContext } from '..';
17
27
  import { ShowStatus } from '../attributeSelector/types';
28
+ import { BuiltinIndicators } from '../constants/common';
18
29
  import BizSearchInput from '../searchInput';
19
30
  import EventListOption from './option';
31
+
20
32
  var EventListPanel = function EventListPanel(props) {
21
33
  var showOverview = props.showOverview,
22
- defaultSelectAble = props.defaultSelectAble;
34
+ defaultSelectAble = props.defaultSelectAble;
35
+
23
36
  var _useState = useState(''),
24
- _useState2 = _slicedToArray(_useState, 2),
25
- searchValue = _useState2[0],
26
- setSearchValue = _useState2[1];
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ searchValue = _useState2[0],
39
+ setSearchValue = _useState2[1];
40
+
27
41
  var _useContext = useContext(BizGlobalDataContext),
28
- eventGroupList = _useContext.eventGroupList;
42
+ eventGroupList = _useContext.eventGroupList;
43
+
29
44
  var _useState3 = useState(eventGroupList || []),
30
- _useState4 = _slicedToArray(_useState3, 2),
31
- groupList = _useState4[0],
32
- setGroupList = _useState4[1];
45
+ _useState4 = _slicedToArray(_useState3, 2),
46
+ groupList = _useState4[0],
47
+ setGroupList = _useState4[1];
48
+
33
49
  var _useState5 = useState(),
34
- _useState6 = _slicedToArray(_useState5, 2),
35
- currentGroup = _useState6[0],
36
- setCurrentGroup = _useState6[1];
50
+ _useState6 = _slicedToArray(_useState5, 2),
51
+ currentGroup = _useState6[0],
52
+ setCurrentGroup = _useState6[1];
53
+
37
54
  var _useState7 = useState([]),
38
- _useState8 = _slicedToArray(_useState7, 2),
39
- searchEventList = _useState8[0],
40
- setSearchEventList = _useState8[1];
55
+ _useState8 = _slicedToArray(_useState7, 2),
56
+ searchEventList = _useState8[0],
57
+ setSearchEventList = _useState8[1];
58
+
41
59
  var _useState9 = useState(),
42
- _useState10 = _slicedToArray(_useState9, 2),
43
- currentValue = _useState10[0],
44
- setCurrentValue = _useState10[1];
60
+ _useState10 = _slicedToArray(_useState9, 2),
61
+ currentValue = _useState10[0],
62
+ setCurrentValue = _useState10[1];
63
+
45
64
  var scrollableId = 'scrollableDiv' + Math.random();
46
65
  var overviewData = {
47
66
  id: -100,
@@ -64,17 +83,18 @@ var EventListPanel = function EventListPanel(props) {
64
83
  } else {
65
84
  list.push(item);
66
85
  }
86
+
67
87
  listObj[item.id] = 1;
68
88
  }
69
89
  });
70
90
  });
71
- list = [].concat(markList, _toConsumableArray(list));
91
+ list = props.showBuiltInTarget ? [].concat(_toConsumableArray(BuiltinIndicators.eventList), markList, _toConsumableArray(list)) : [].concat(markList, _toConsumableArray(list));
72
92
  return list;
73
93
  }(),
74
94
  name: '所有分组'
75
95
  };
76
96
  setGroupList(function (list) {
77
- return [group].concat(_toConsumableArray(list));
97
+ return props.showBuiltInTarget ? [group, BuiltinIndicators].concat(_toConsumableArray(list)) : [group].concat(_toConsumableArray(list));
78
98
  });
79
99
  setCurrentGroup(group);
80
100
  }, []);
@@ -92,19 +112,25 @@ var EventListPanel = function EventListPanel(props) {
92
112
  return list;
93
113
  });
94
114
  }, [searchValue, currentGroup, showOverview]);
115
+
95
116
  function onClickEvent(e) {
96
117
  var resVal = _.cloneDeep(currentValue) || {};
97
118
  resVal.event = e;
119
+
98
120
  if (e.id === -100) {
99
121
  resVal.group = currentGroup;
100
122
  }
123
+
101
124
  setCurrentValue(resVal);
102
125
  if (props.onChange) props.onChange(resVal);
103
126
  }
127
+
104
128
  function onClickGroup(g) {
105
129
  var _currentValue$event;
130
+
106
131
  setCurrentGroup(g);
107
132
  var isOverview = (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event = currentValue.event) === null || _currentValue$event === void 0 ? void 0 : _currentValue$event.id) === -100;
133
+
108
134
  if (defaultSelectAble || isOverview) {
109
135
  var resVal = _.cloneDeep(currentValue) || {};
110
136
  resVal.group = g;
@@ -113,6 +139,7 @@ var EventListPanel = function EventListPanel(props) {
113
139
  if (props.onChange) props.onChange(resVal, isOverview);
114
140
  }
115
141
  }
142
+
116
143
  if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
117
144
  return /*#__PURE__*/React.createElement("div", {
118
145
  className: "".concat(classPrefix, "-nodata-panel")
@@ -120,6 +147,7 @@ var EventListPanel = function EventListPanel(props) {
120
147
  className: "".concat(classPrefix, "-nodata")
121
148
  }, "\u6682\u65E0\u6570\u636E"));
122
149
  }
150
+
123
151
  return /*#__PURE__*/React.createElement("div", {
124
152
  className: "".concat(classPrefix, "-list-panel")
125
153
  }, /*#__PURE__*/React.createElement("div", {
@@ -155,26 +183,31 @@ var EventListPanel = function EventListPanel(props) {
155
183
  onClick: onClickEvent
156
184
  }))));
157
185
  };
186
+
158
187
  var InfiniteScrollList = function InfiniteScrollList(_ref) {
159
188
  var scrollableTarget = _ref.scrollableTarget,
160
- searchEventList = _ref.searchEventList,
161
- searchValue = _ref.searchValue,
162
- currentGroup = _ref.currentGroup,
163
- currentValue = _ref.currentValue,
164
- onClick = _ref.onClick;
189
+ searchEventList = _ref.searchEventList,
190
+ searchValue = _ref.searchValue,
191
+ currentGroup = _ref.currentGroup,
192
+ currentValue = _ref.currentValue,
193
+ onClick = _ref.onClick;
194
+
165
195
  var _useState11 = useState([]),
166
- _useState12 = _slicedToArray(_useState11, 2),
167
- showList = _useState12[0],
168
- setShowList = _useState12[1];
196
+ _useState12 = _slicedToArray(_useState11, 2),
197
+ showList = _useState12[0],
198
+ setShowList = _useState12[1];
199
+
169
200
  useEffect(function () {
170
201
  setShowList(searchEventList.slice(0, 10));
171
202
  }, [searchEventList]);
203
+
172
204
  var loadMoreData = function loadMoreData() {
173
205
  var moreData = searchEventList.slice(showList.length, showList.length + 10);
174
206
  setShowList(function (list) {
175
207
  return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
176
208
  });
177
209
  };
210
+
178
211
  return /*#__PURE__*/React.createElement(InfiniteScroll, {
179
212
  dataLength: showList.length,
180
213
  hasMore: showList.length < searchEventList.length,
@@ -190,6 +223,7 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
190
223
  key: Math.random()
191
224
  }, showList.map(function (e) {
192
225
  var _currentValue$event2;
226
+
193
227
  if (e.eventHidden === ShowStatus.hidden) return null;
194
228
  return /*#__PURE__*/React.createElement(EventListOption, {
195
229
  label: e.alias || e.name,
@@ -204,4 +238,5 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
204
238
  });
205
239
  }));
206
240
  };
241
+
207
242
  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
- count = props.count,
9
- label = props.label,
10
- checked = props.checked,
11
- highlight = props.highlight,
12
- onClick = props.onClick,
13
- data = props.data;
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;
@@ -23,6 +23,7 @@ export declare namespace EventSelectTypes {
23
23
  showAllEvent?: boolean;
24
24
  defaultSelectAble?: boolean;
25
25
  popupContainer?: boolean;
26
+ showBuiltInTarget?: boolean;
26
27
  onVisibleChange?: (visible: boolean) => void;
27
28
  border?: boolean;
28
29
  theme?: string;
@@ -33,6 +34,7 @@ export declare namespace EventSelectTypes {
33
34
  interface DropdownProps {
34
35
  value?: Value;
35
36
  showOverview?: boolean;
37
+ showBuiltInTarget?: boolean;
36
38
  defaultSelectAble?: boolean;
37
39
  onChange?: (value: Value, isOverview?: boolean) => void;
38
40
  }
@@ -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
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
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
- type = props.type,
14
- family = props.family,
15
- rest = _objectWithoutProperties(props, _excluded);
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'
@@ -3,6 +3,7 @@ import { BizAnalysisLayout } from '@zgfe/business-lib';
3
3
  import { Button } from 'antd';
4
4
  import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
5
5
  import './index.less';
6
+
6
7
  var LeftContent = function LeftContent() {
7
8
  return /*#__PURE__*/React.createElement("div", {
8
9
  className: "left-content"
@@ -10,9 +11,11 @@ var LeftContent = function LeftContent() {
10
11
  type: "primary"
11
12
  }, "\u6309\u94AE"));
12
13
  };
14
+
13
15
  var Footer = function Footer() {
14
16
  return /*#__PURE__*/React.createElement("div", null, "@footer");
15
17
  };
18
+
16
19
  var RightContent = function RightContent() {
17
20
  return /*#__PURE__*/React.createElement("div", {
18
21
  style: {
@@ -20,9 +23,11 @@ var RightContent = function RightContent() {
20
23
  }
21
24
  }, /*#__PURE__*/React.createElement("h1", null, "right"));
22
25
  };
26
+
23
27
  var onCollapse = function onCollapse(flag) {
24
28
  console.log('是否收起', flag);
25
29
  };
30
+
26
31
  var LayoutDemo = function LayoutDemo() {
27
32
  return /*#__PURE__*/React.createElement("div", {
28
33
  className: "root"
@@ -32,6 +37,7 @@ var LayoutDemo = function LayoutDemo() {
32
37
  onCollapse: onCollapse
33
38
  }, /*#__PURE__*/React.createElement(RightContent, null)));
34
39
  };
40
+
35
41
  export default (function () {
36
42
  return /*#__PURE__*/React.createElement(LayoutDemo, null);
37
43
  });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- type AnalysisLayoutProps = {
3
+ declare type AnalysisLayoutProps = {
4
4
  children?: React.ReactNode;
5
5
  leftPanel?: React.ReactNode;
6
6
  leftHandle?: React.ReactNode;
@@ -1,31 +1,41 @@
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
- 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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
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, { useEffect, useState } from 'react';
8
14
  import IconFont from '../../icon/iconFont';
9
15
  import './index.less';
10
16
  import { Tooltip } from 'antd';
17
+
11
18
  var BizAnalysisLayout = function BizAnalysisLayout(props) {
12
19
  var children = props.children,
13
- leftPanel = props.leftPanel,
14
- leftHandle = props.leftHandle,
15
- _props$isFixed = props.isFixed,
16
- isFixed = _props$isFixed === void 0 ? false : _props$isFixed,
17
- defaultLeftWidth = props.defaultLeftWidth,
18
- minWidthOfLeft = props.minWidthOfLeft,
19
- maxWidthOfLeft = props.maxWidthOfLeft,
20
- className = props.className;
20
+ leftPanel = props.leftPanel,
21
+ leftHandle = props.leftHandle,
22
+ _props$isFixed = props.isFixed,
23
+ isFixed = _props$isFixed === void 0 ? false : _props$isFixed,
24
+ defaultLeftWidth = props.defaultLeftWidth,
25
+ minWidthOfLeft = props.minWidthOfLeft,
26
+ maxWidthOfLeft = props.maxWidthOfLeft,
27
+ className = props.className;
28
+
21
29
  var _useState = useState(defaultLeftWidth),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- width = _useState2[0],
24
- setWidth = _useState2[1];
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ width = _useState2[0],
32
+ setWidth = _useState2[1];
33
+
25
34
  var _useState3 = useState(true),
26
- _useState4 = _slicedToArray(_useState3, 2),
27
- showLeft = _useState4[0],
28
- setShowLeft = _useState4[1];
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ showLeft = _useState4[0],
37
+ setShowLeft = _useState4[1];
38
+
29
39
  var initX = 0;
30
40
  var isDrag = false;
31
41
  useEffect(function () {
@@ -33,6 +43,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
33
43
  document.removeEventListener('mouseup', onMouseUp);
34
44
  };
35
45
  }, []);
46
+
36
47
  var onMouseDown = function onMouseDown(e) {
37
48
  var target = e.target || e.srcElement;
38
49
  initX = e.clientX - target.offsetLeft;
@@ -40,9 +51,11 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
40
51
  document.addEventListener('mousemove', onMouseMove);
41
52
  document.addEventListener('mouseup', onMouseUp);
42
53
  };
54
+
43
55
  var onMouseMove = function onMouseMove(e) {
44
56
  if (isDrag) {
45
57
  var x = e.clientX - initX;
58
+
46
59
  if (x < minWidthOfLeft) {
47
60
  if (x < 250) {
48
61
  setShowLeft(false);
@@ -52,14 +65,17 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
52
65
  x = minWidthOfLeft || 320;
53
66
  }
54
67
  }
68
+
55
69
  if (x > maxWidthOfLeft) x = maxWidthOfLeft || 580;
56
70
  setWidth(x);
57
71
  }
58
72
  };
73
+
59
74
  var onMouseUp = function onMouseUp() {
60
75
  isDrag = false;
61
76
  document.removeEventListener('mousemove', onMouseMove);
62
77
  };
78
+
63
79
  function onCollapse() {
64
80
  if (props.onCollapse) props.onCollapse(showLeft);
65
81
  setShowLeft(function (show) {
@@ -67,6 +83,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
67
83
  return !show;
68
84
  });
69
85
  }
86
+
70
87
  return /*#__PURE__*/React.createElement("div", {
71
88
  className: "biz-layout-container ".concat(className)
72
89
  }, /*#__PURE__*/React.createElement("div", {
@@ -119,6 +136,7 @@ var BizAnalysisLayout = function BizAnalysisLayout(props) {
119
136
  }
120
137
  }, children));
121
138
  };
139
+
122
140
  BizAnalysisLayout.defaultProps = {
123
141
  defaultLeftWidth: 320,
124
142
  minWidthOfLeft: 320,
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { IconFont } from '../..';
3
3
  import './index.less';
4
+
4
5
  var BizDetailLayout = function BizDetailLayout(props) {
5
6
  var width = props.width,
6
- className = props.className;
7
+ className = props.className;
7
8
  var classPrefix = 'biz-detail';
8
9
  return /*#__PURE__*/React.createElement("div", {
9
10
  className: "".concat(classPrefix, " ").concat(className),
@@ -20,4 +21,5 @@ var BizDetailLayout = function BizDetailLayout(props) {
20
21
  className: "".concat(classPrefix, "-content")
21
22
  }, props.children));
22
23
  };
24
+
23
25
  export default BizDetailLayout;