@zgfe/business-lib 1.1.22 → 1.1.24

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 (129) hide show
  1. package/es/addToPanel/components/addPanel.js +8 -21
  2. package/es/addToPanel/components/radioGroup.js +1 -3
  3. package/es/addToPanel/components/styleList.js +5 -22
  4. package/es/addToPanel/demo/edit.js +5 -12
  5. package/es/addToPanel/demo/index.js +5 -12
  6. package/es/addToPanel/index.js +21 -58
  7. package/es/addToScene/addGroup.js +0 -4
  8. package/es/addToScene/demo/index.js +5 -12
  9. package/es/addToScene/index.js +13 -40
  10. package/es/assets/demo/index.d.ts +3 -1
  11. package/es/assets/demo/index.js +0 -2
  12. package/es/assets/demo/input.js +5 -12
  13. package/es/assets/iconfont/iconfont.js +10 -17
  14. package/es/assets/styles/resetAntd.less +5 -0
  15. package/es/assets/theme.js +0 -1
  16. package/es/attrConditions/components/operateList.js +10 -27
  17. package/es/attrConditions/components/stringList.js +68 -97
  18. package/es/attrConditions/components/valuesList.js +14 -40
  19. package/es/attrConditions/demo/group.js +11 -23
  20. package/es/attrConditions/demo/index.js +17 -26
  21. package/es/attrConditions/group.js +17 -48
  22. package/es/attrConditions/index.js +22 -49
  23. package/es/attrConditions/types.js +0 -1
  24. package/es/attributeSelector/demo/disable.js +8 -16
  25. package/es/attributeSelector/demo/index.js +8 -17
  26. package/es/attributeSelector/index.js +22 -45
  27. package/es/attributeSelector/listPanel.js +18 -46
  28. package/es/attributeSelector/option.js +3 -13
  29. package/es/attributeSelector/types.js +0 -5
  30. package/es/attributeSelector/util.js +0 -3
  31. package/es/chart/demo/index.js +5 -14
  32. package/es/chart/index.js +30 -44
  33. package/es/chart/util/chartOptionConfig.d.ts +3 -3
  34. package/es/chart/util/chartOptionConfig.js +13 -37
  35. package/es/chart/util/data/china.js +1 -4
  36. package/es/chart/util/formatData.d.ts +2 -2
  37. package/es/chart/util/formatData.js +0 -5
  38. package/es/chart/util/formatOption.js +0 -13
  39. package/es/chart/util/mapUtil.js +5 -26
  40. package/es/config.js +0 -2
  41. package/es/cycleTime/demo/disable.js +0 -1
  42. package/es/cycleTime/index.js +19 -46
  43. package/es/cycleTime/month.js +8 -27
  44. package/es/datePicker/datePicker.js +5 -23
  45. package/es/datePicker/demo/customType.js +13 -22
  46. package/es/datePicker/demo/day.js +13 -22
  47. package/es/datePicker/demo/index.js +12 -21
  48. package/es/datePicker/index.js +18 -41
  49. package/es/datePicker/utils.js +0 -7
  50. package/es/demoWrapper/content.js +31 -56
  51. package/es/demoWrapper/head.js +9 -23
  52. package/es/demoWrapper/index.js +14 -30
  53. package/es/dialog/demo/index.js +5 -12
  54. package/es/dialog/index.js +4 -6
  55. package/es/dnd/demo/data.js +19 -28
  56. package/es/dnd/demo/handle.js +19 -28
  57. package/es/dnd/index.js +21 -45
  58. package/es/dnd/item.js +10 -30
  59. package/es/eventSelector/demo/index.js +12 -23
  60. package/es/eventSelector/index.js +14 -42
  61. package/es/eventSelector/listPanel.js +26 -60
  62. package/es/eventSelector/option.js +6 -11
  63. package/es/icon/iconFont.js +7 -13
  64. package/es/layout/analysisLayout/demo/index.js +0 -6
  65. package/es/layout/analysisLayout/index.d.ts +1 -1
  66. package/es/layout/analysisLayout/index.js +16 -34
  67. package/es/layout/detail/index.js +1 -3
  68. package/es/loginForm/index.js +7 -18
  69. package/es/searchInput/index.js +2 -7
  70. package/es/select/demo/children.js +8 -16
  71. package/es/select/demo/customLabel.js +0 -2
  72. package/es/select/demo/group.js +8 -17
  73. package/es/select/demo/index.js +11 -19
  74. package/es/select/demo/loading.js +8 -18
  75. package/es/select/demo/multiple.js +8 -16
  76. package/es/select/handle.js +14 -34
  77. package/es/select/index.js +22 -58
  78. package/es/select/option.js +10 -26
  79. package/es/select/overlay.js +25 -55
  80. package/es/table/demo/data/table.js +0 -2
  81. package/es/table/demo/index.js +13 -39
  82. package/es/table/demo/index2.js +5 -15
  83. package/es/table/demo/index3.js +7 -28
  84. package/es/table/index.js +14 -33
  85. package/es/targetConditionGroup/components/targetDimension.js +12 -37
  86. package/es/targetConditionGroup/demo/group.js +21 -36
  87. package/es/targetConditionGroup/demo/index.js +5 -13
  88. package/es/targetConditionGroup/index.js +31 -82
  89. package/es/targetSelector/demo/index.js +15 -28
  90. package/es/targetSelector/editBox.js +5 -20
  91. package/es/targetSelector/index.js +15 -36
  92. package/es/targetSelector/optionIcon.js +1 -5
  93. package/es/targetSelector/optionMenu.js +0 -3
  94. package/es/userCondition/conditionTypeList.js +7 -12
  95. package/es/userCondition/conditionWrap.js +0 -2
  96. package/es/userCondition/conditions/cdpCondition.js +51 -97
  97. package/es/userCondition/conditions/eventCondition.js +6 -16
  98. package/es/userCondition/conditions/periodCondition.d.ts +1 -1
  99. package/es/userCondition/conditions/periodCondition.js +8 -26
  100. package/es/userCondition/conditions/propCondition.js +29 -61
  101. package/es/userCondition/conditions/runTimesCondition.js +5 -10
  102. package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
  103. package/es/userCondition/conditions/tagsCondition.js +15 -33
  104. package/es/userCondition/conditions/textDesc.js +16 -67
  105. package/es/userCondition/demo/index.js +11 -21
  106. package/es/userCondition/index.js +51 -91
  107. package/es/userCondition/orConditions.js +11 -48
  108. package/es/userCondition/relationLabel.js +1 -4
  109. package/es/userCondition/types.d.ts +2 -2
  110. package/es/userCondition/types.js +0 -1
  111. package/es/userCondition/util.js +4 -13
  112. package/es/userGroup/demo/group.js +14 -23
  113. package/es/userGroup/demo/index.js +5 -15
  114. package/es/userGroup/index.js +12 -30
  115. package/es/userTagsSelector/cascaderOverlay.js +19 -51
  116. package/es/userTagsSelector/components/search/index.js +0 -2
  117. package/es/userTagsSelector/demo/index.js +0 -3
  118. package/es/userTagsSelector/groups/groupOption.js +6 -8
  119. package/es/userTagsSelector/groups/index.js +15 -30
  120. package/es/userTagsSelector/index.js +17 -35
  121. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
  122. package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
  123. package/es/userTagsSelector/util.js +0 -2
  124. package/es/utils/ajax.js +45 -71
  125. package/es/utils/base64.js +3 -22
  126. package/es/utils/type.d.ts +1 -1
  127. package/es/utils/type.js +4 -7
  128. package/es/utils/util.js +1 -17
  129. package/package.json +12 -15
@@ -1,21 +1,15 @@
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); }
1
2
  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; }
2
-
3
3
  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; }
4
-
5
- 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; }
6
-
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
-
9
8
  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."); }
10
-
11
9
  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); }
12
-
13
- 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; }
14
-
15
- 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; }
16
-
10
+ 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; }
11
+ 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; } }
17
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
-
19
13
  import _ from 'lodash';
20
14
  import React, { useContext, useMemo } from 'react';
21
15
  import { BizUserConditionContext, classPrefix } from '..';
@@ -23,63 +17,48 @@ import BizGlobalDataContext from '../../context';
23
17
  import { findEvent, findPropAndEnv, buildSelectLayer } from '../util';
24
18
  import { durationHandler, operatorMap } from './constants';
25
19
  import './styles/textDesc.less';
26
-
27
20
  var Text = function Text(props) {
28
21
  var _useContext = useContext(BizUserConditionContext),
29
- userPropsMap = _useContext.userPropsMap;
30
-
22
+ userPropsMap = _useContext.userPropsMap;
31
23
  var condition = props.condition,
32
- showOrDesc = props.showOrDesc;
33
-
24
+ showOrDesc = props.showOrDesc;
34
25
  var _useContext2 = useContext(BizGlobalDataContext),
35
- eventGroupList = _useContext2.eventGroupList,
36
- userPropList = _useContext2.userPropList,
37
- eventEnvList = _useContext2.eventEnvList;
38
-
26
+ eventGroupList = _useContext2.eventGroupList,
27
+ userPropList = _useContext2.userPropList,
28
+ eventEnvList = _useContext2.eventEnvList;
39
29
  var _useContext3 = useContext(BizUserConditionContext),
40
- userTagsData = _useContext3.userTagsData;
41
-
30
+ userTagsData = _useContext3.userTagsData;
42
31
  function render() {
43
32
  if (condition.labels) {
44
33
  return renderTags(condition);
45
34
  }
46
-
47
35
  if (condition.dataset) {
48
36
  return renderCdp(condition);
49
37
  }
50
-
51
38
  var data = condition;
52
-
53
39
  if (String(data.eventId) === '-4') {
54
40
  return renderPeriod({
55
41
  before: '活跃于'
56
42
  }, data.runPeriod);
57
43
  }
58
-
59
44
  if (String(data.eventId) === '-3') {
60
45
  return renderPeriod({
61
46
  before: '新增于'
62
47
  }, data.runPeriod);
63
48
  }
64
-
65
49
  if (data.eventId === undefined) {
66
50
  return renderProps(data.attrs[0], 'user');
67
51
  }
68
-
69
52
  if (data.eventId) {
70
53
  return renderEvent(data);
71
54
  }
72
55
  }
73
-
74
56
  function renderPeriod(label, period, isEvent) {
75
57
  var _label$after;
76
-
77
58
  if (period.operator === 'unlimited_time') {
78
59
  return /*#__PURE__*/React.createElement("span", null, "\u5728\u4EFB\u610F\u65F6\u95F4\u5185");
79
60
  }
80
-
81
61
  var valuesDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, period.values[0]), /*#__PURE__*/React.createElement("span", null, (_label$after = label.after) !== null && _label$after !== void 0 ? _label$after : '天'));
82
-
83
62
  if (period.operator === 'absolute') {
84
63
  valuesDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
85
64
  className: "".concat(classPrefix, "-text-desc-value")
@@ -87,7 +66,6 @@ var Text = function Text(props) {
87
66
  className: "".concat(classPrefix, "-text-desc-value")
88
67
  }, period.values[1]));
89
68
  }
90
-
91
69
  return /*#__PURE__*/React.createElement("span", {
92
70
  style: !isEvent ? {
93
71
  backgroundColor: '#effcff',
@@ -97,13 +75,10 @@ var Text = function Text(props) {
97
75
  className: "label"
98
76
  }, label.before), period.operator === 'relative' ? /*#__PURE__*/React.createElement("span", null, "\u6700\u8FD1") : null, valuesDom);
99
77
  }
100
-
101
78
  function renderProps(attr, type) {
102
79
  var data = null;
103
-
104
80
  if (type === 'user') {
105
81
  var _data;
106
-
107
82
  data = findPropAndEnv(attr.attrName, userPropList !== null && userPropList !== void 0 ? userPropList : []);
108
83
  return /*#__PURE__*/React.createElement("span", {
109
84
  style: {
@@ -115,21 +90,17 @@ var Text = function Text(props) {
115
90
  }, (_data = data) === null || _data === void 0 ? void 0 : _data.label), renderPropValues(attr));
116
91
  }
117
92
  }
118
-
119
93
  function renderEvent(condition) {
120
94
  var event = findEvent(condition.eventId, eventGroupList !== null && eventGroupList !== void 0 ? eventGroupList : []);
121
95
  if (!event) return null;
122
96
  var periodLabel = {};
123
-
124
97
  if (condition.runPeriod.operator === 'join_time') {
125
98
  periodLabel.before = '在新增后';
126
99
  periodLabel.after = '天内';
127
100
  }
128
-
129
101
  if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
130
102
  periodLabel.before = '在';
131
103
  }
132
-
133
104
  var period = renderPeriod(periodLabel, condition.runPeriod, true);
134
105
  var runtimes = renderRuntimes(condition.runTimes);
135
106
  var attrs = renderAttrs(event, condition.attrs);
@@ -142,7 +113,6 @@ var Text = function Text(props) {
142
113
  className: "".concat(classPrefix, "-text-desc-value")
143
114
  }, event.alias || event.name), attrs, runtimes);
144
115
  }
145
-
146
116
  function renderAttrs(event, attrs) {
147
117
  var attrsDom = [];
148
118
  attrs.forEach(function (attr, i) {
@@ -150,14 +120,12 @@ var Text = function Text(props) {
150
120
  return item.id === attr.attrId;
151
121
  });
152
122
  var label = '';
153
-
154
123
  if (index >= 0) {
155
124
  label = event === null || event === void 0 ? void 0 : event.attrList[index].label;
156
125
  } else if (eventEnvList) {
157
126
  var env = findPropAndEnv(attr.attrName, eventEnvList);
158
127
  label = env ? env.label : '';
159
128
  }
160
-
161
129
  if (label) {
162
130
  var dom = /*#__PURE__*/React.createElement("span", {
163
131
  key: i
@@ -168,7 +136,6 @@ var Text = function Text(props) {
168
136
  if (!attrsDom.length) return null;
169
137
  return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), attrsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
170
138
  }
171
-
172
139
  function renderRuntimes(runTimes) {
173
140
  return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
174
141
  className: "".concat(classPrefix, "-text-desc-value")
@@ -178,7 +145,6 @@ var Text = function Text(props) {
178
145
  className: "".concat(classPrefix, "-text-desc-value")
179
146
  }, runTimes.values[0]));
180
147
  }
181
-
182
148
  function renderTags(condition) {
183
149
  var labels = condition.labels;
184
150
  return /*#__PURE__*/React.createElement("span", {
@@ -194,11 +160,9 @@ var Text = function Text(props) {
194
160
  if (_.isNumber(value)) {
195
161
  return null;
196
162
  }
197
-
198
163
  var _value$split = value.split(':'),
199
- _value$split2 = _slicedToArray(_value$split, 2),
200
- layerId = _value$split2[1];
201
-
164
+ _value$split2 = _slicedToArray(_value$split, 2),
165
+ layerId = _value$split2[1];
202
166
  var tag = findTag(Number(layerId));
203
167
  return /*#__PURE__*/React.createElement("span", {
204
168
  key: layerId
@@ -209,7 +173,6 @@ var Text = function Text(props) {
209
173
  }, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, tag && tag[1].labelName + ':' + tag[2].layerLabelName));
210
174
  }), /*#__PURE__*/React.createElement("span", null, ")")));
211
175
  }
212
-
213
176
  function renderCdp(condition) {
214
177
  var dataset = condition.dataset;
215
178
  return /*#__PURE__*/React.createElement("span", {
@@ -220,19 +183,16 @@ var Text = function Text(props) {
220
183
  }, dataset.map(function (value) {
221
184
  if (!value) return null;
222
185
  var operator = value.operator,
223
- _value$params = value.params,
224
- params = _value$params === void 0 ? [] : _value$params;
186
+ _value$params = value.params,
187
+ params = _value$params === void 0 ? [] : _value$params;
225
188
  var valuesDom = '';
226
-
227
189
  var numOperatorMap = _objectSpread(_objectSpread({}, operatorMap), {}, {
228
190
  'not equal': '≠'
229
191
  });
230
-
231
192
  if (value.webType === 'date') {
232
193
  if (operator === 'relative') {
233
194
  valuesDom = "\u4E3A\u6700\u8FD1".concat(params[0], "\u5929");
234
195
  }
235
-
236
196
  if (operator === 'absolute') {
237
197
  valuesDom = "\u4E3A".concat(params[0], "\u5230").concat(params[1]);
238
198
  }
@@ -240,19 +200,16 @@ var Text = function Text(props) {
240
200
  if (operator) {
241
201
  var operateTxt = numOperatorMap[operator];
242
202
  valuesDom = operateTxt;
243
-
244
203
  if (params && params[0]) {
245
204
  valuesDom += params[0];
246
205
  }
247
206
  }
248
207
  }
249
-
250
208
  return /*#__PURE__*/React.createElement("span", {
251
209
  key: Math.random()
252
210
  }, "".concat(value.datasetName, "\u4E2D").concat(value.fieldName).concat(valuesDom));
253
211
  }));
254
212
  }
255
-
256
213
  function renderPropValues(attr) {
257
214
  if (attr.attrType === 'cont-date') {
258
215
  return renderDateValues(attr.operator, attr.params);
@@ -262,7 +219,6 @@ var Text = function Text(props) {
262
219
  return renderStringValues(attr);
263
220
  }
264
221
  }
265
-
266
222
  function renderStringValues(attr) {
267
223
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
268
224
  className: "".concat(classPrefix, "-text-desc-operator")
@@ -274,30 +230,24 @@ var Text = function Text(props) {
274
230
  }, i > 0 ? /*#__PURE__*/React.createElement("span", null, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, param));
275
231
  })));
276
232
  }
277
-
278
233
  function renderNumValues(attr) {
279
234
  var numOperatorMap = _objectSpread(_objectSpread({}, operatorMap), {}, {
280
235
  'not equal': '≠'
281
236
  });
282
-
283
237
  if (userPropsMap[attr.attrName] && userPropsMap[attr.attrName].subtype === 2) {
284
238
  var handler = durationHandler[attr.params[1]];
285
239
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, numOperatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", null, handler.format(attr.params[0])), /*#__PURE__*/React.createElement("span", null, handler.unit));
286
240
  }
287
-
288
241
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, operatorMap[attr.operator]), /*#__PURE__*/React.createElement("span", null, attr.params[0]));
289
242
  }
290
-
291
243
  function renderDateValues(operator, params) {
292
244
  if (operator === 'relative') {
293
245
  return /*#__PURE__*/React.createElement("span", null, "\u4E3A\u6700\u8FD1".concat(params[0], "\u5929"));
294
246
  }
295
-
296
247
  if (operator === 'absolute') {
297
248
  return /*#__PURE__*/React.createElement("span", null, "\u4E3A".concat(params[0], "\u5230").concat(params[1]));
298
249
  }
299
250
  }
300
-
301
251
  var findTag = useMemo(function () {
302
252
  return buildSelectLayer(userTagsData);
303
253
  }, [userTagsData]);
@@ -307,5 +257,4 @@ var Text = function Text(props) {
307
257
  className: "".concat(classPrefix, "-text-desc-or")
308
258
  }, "\u6216\u8005") : null, render());
309
259
  };
310
-
311
260
  export default Text;
@@ -1,15 +1,9 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  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
-
5
3
  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); }
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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useEffect, useMemo, useState } from 'react';
14
8
  import eventData from '../../mock/event';
15
9
  import envData from '../../mock/env';
@@ -20,18 +14,16 @@ import '@zgfe/business-lib/es/assets/iconfont/iconfont.css';
20
14
  var getTagList = Promise.resolve(tagList);
21
15
  export default (function () {
22
16
  var _useState = useState({
23
- eventGroupList: [],
24
- userPropList: [],
25
- eventEnvList: []
26
- }),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- setStore = _useState2[1];
29
-
17
+ eventGroupList: [],
18
+ userPropList: [],
19
+ eventEnvList: []
20
+ }),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ setStore = _useState2[1];
30
23
  var _useState3 = useState([]),
31
- _useState4 = _slicedToArray(_useState3, 2),
32
- userTagsData = _useState4[0],
33
- setUserTagsData = _useState4[1];
34
-
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ userTagsData = _useState4[0],
26
+ setUserTagsData = _useState4[1];
35
27
  var newStore = convertAttributeData({
36
28
  eventList: eventData,
37
29
  userPropList: userData,
@@ -48,11 +40,9 @@ export default (function () {
48
40
  var defaultValue = useMemo(function () {
49
41
  return conditions;
50
42
  }, [conditions]);
51
-
52
43
  function onChange(value) {
53
44
  console.log('change:', JSON.parse(JSON.stringify(value)));
54
45
  }
55
-
56
46
  var descDom = /*#__PURE__*/React.createElement(BizUserCondition, {
57
47
  defaultValue: defaultValue,
58
48
  onChange: onChange,
@@ -1,25 +1,14 @@
1
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
-
3
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
-
5
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."); }
6
-
7
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
-
13
7
  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
8
  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; }
18
-
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
-
9
+ 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; }
10
+ 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; } }
21
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
-
23
12
  import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
24
13
  import ConditionTypeList from './conditionTypeList';
25
14
  import RelationLabel from './relationLabel';
@@ -43,76 +32,63 @@ export var BizUserConditionContext = /*#__PURE__*/createContext({
43
32
  datasetList: []
44
33
  });
45
34
  export var classPrefix = 'biz-user-condition';
46
-
47
35
  var BizUserCondition = function BizUserCondition(props) {
48
36
  var _useContext = useContext(BizGlobalDataContext),
49
- eventEnvList = _useContext.eventEnvList,
50
- userPropList = _useContext.userPropList,
51
- menuNameMap = _useContext.menuNameMap,
52
- currentApp = _useContext.currentApp;
53
-
37
+ eventEnvList = _useContext.eventEnvList,
38
+ userPropList = _useContext.userPropList,
39
+ menuNameMap = _useContext.menuNameMap,
40
+ currentApp = _useContext.currentApp;
54
41
  var andConditionNum = props.andConditionNum,
55
- defaultValue = props.defaultValue,
56
- openTagCondition = props.openTagCondition,
57
- openCdpCondition = props.openCdpCondition,
58
- userTagsData = props.userTagsData,
59
- cdpTip = props.cdpTip;
60
-
42
+ defaultValue = props.defaultValue,
43
+ openTagCondition = props.openTagCondition,
44
+ openCdpCondition = props.openCdpCondition,
45
+ userTagsData = props.userTagsData,
46
+ cdpTip = props.cdpTip;
61
47
  var _useState = useState([]),
62
- _useState2 = _slicedToArray(_useState, 2),
63
- showList = _useState2[0],
64
- setShowList = _useState2[1];
65
-
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ showList = _useState2[0],
50
+ setShowList = _useState2[1];
66
51
  var _useState3 = useState([]),
67
- _useState4 = _slicedToArray(_useState3, 2),
68
- dataList = _useState4[0],
69
- setDataList = _useState4[1];
70
-
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ dataList = _useState4[0],
54
+ setDataList = _useState4[1];
71
55
  var _useState5 = useState(function () {
72
- var list = [];
73
-
74
- if (defaultValue) {
75
- var showTag = openTagCondition && (!menuNameMap || menuNameMap['userTags']);
76
- var showCdp = openCdpCondition && (!menuNameMap || menuNameMap['dataset']);
77
- var flag = false;
78
- defaultValue.forEach(function (item) {
79
- var showItem = _toConsumableArray(item);
80
-
81
- if (!(showTag && showCdp)) {
82
- item.forEach(function (data, index) {
83
- if (data.dataset && !showCdp || data.labels && !showTag) {
84
- showItem.splice(index, 1);
85
- flag = true;
86
- }
87
- });
88
- }
89
-
90
- if (showItem.length > 0) {
91
- list.push(showItem);
56
+ var list = [];
57
+ if (defaultValue) {
58
+ var showTag = openTagCondition && (!menuNameMap || menuNameMap['userTags']);
59
+ var showCdp = openCdpCondition && (!menuNameMap || menuNameMap['dataset']);
60
+ var flag = false;
61
+ defaultValue.forEach(function (item) {
62
+ var showItem = _toConsumableArray(item);
63
+ if (!(showTag && showCdp)) {
64
+ item.forEach(function (data, index) {
65
+ if (data.dataset && !showCdp || data.labels && !showTag) {
66
+ showItem.splice(index, 1);
67
+ flag = true;
68
+ }
69
+ });
70
+ }
71
+ if (showItem.length > 0) {
72
+ list.push(showItem);
73
+ }
74
+ });
75
+ if (flag) {
76
+ props.onChange(list);
92
77
  }
93
- });
94
-
95
- if (flag) {
96
- props.onChange(list);
97
78
  }
98
- }
99
-
100
- return list;
101
- }),
102
- _useState6 = _slicedToArray(_useState5, 2),
103
- value = _useState6[0],
104
- setValue = _useState6[1];
105
-
79
+ return list;
80
+ }),
81
+ _useState6 = _slicedToArray(_useState5, 2),
82
+ value = _useState6[0],
83
+ setValue = _useState6[1];
106
84
  var _useState7 = useState(true),
107
- _useState8 = _slicedToArray(_useState7, 2),
108
- loading = _useState8[0],
109
- setLoading = _useState8[1];
110
-
85
+ _useState8 = _slicedToArray(_useState7, 2),
86
+ loading = _useState8[0],
87
+ setLoading = _useState8[1];
111
88
  var _useState9 = useState([]),
112
- _useState10 = _slicedToArray(_useState9, 2),
113
- dataset = _useState10[0],
114
- setDataset = _useState10[1];
115
-
89
+ _useState10 = _slicedToArray(_useState9, 2),
90
+ dataset = _useState10[0],
91
+ setDataset = _useState10[1];
116
92
  var envNameList = useMemo(function () {
117
93
  return eventEnvList ? eventEnvList.map(function (env) {
118
94
  return env.name;
@@ -127,7 +103,6 @@ var BizUserCondition = function BizUserCondition(props) {
127
103
  }, [userPropList]);
128
104
  useEffect(function () {
129
105
  initShowList();
130
-
131
106
  if (props.openCdpCondition && (!menuNameMap || menuNameMap['dataset'])) {
132
107
  getDatasetList();
133
108
  } else {
@@ -136,21 +111,16 @@ var BizUserCondition = function BizUserCondition(props) {
136
111
  }, []);
137
112
  var haveCdpValues = useMemo(function () {
138
113
  var flag = false;
139
-
140
114
  var _iterator = _createForOfIteratorHelper(value),
141
- _step;
142
-
115
+ _step;
143
116
  try {
144
117
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
145
118
  var condition = _step.value;
146
-
147
119
  var _iterator2 = _createForOfIteratorHelper(condition),
148
- _step2;
149
-
120
+ _step2;
150
121
  try {
151
122
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
152
123
  var item = _step2.value;
153
-
154
124
  if (item.dataset) {
155
125
  flag = true;
156
126
  break;
@@ -167,10 +137,8 @@ var BizUserCondition = function BizUserCondition(props) {
167
137
  } finally {
168
138
  _iterator.f();
169
139
  }
170
-
171
140
  return flag;
172
141
  }, [value]);
173
-
174
142
  function initShowList() {
175
143
  var showList = [];
176
144
  value.forEach(function (item) {
@@ -182,7 +150,6 @@ var BizUserCondition = function BizUserCondition(props) {
182
150
  setShowList(showList);
183
151
  setDataList(showList);
184
152
  }
185
-
186
153
  function onAdd(type) {
187
154
  var condition = buildCondition(type);
188
155
  var newValue = [].concat(_toConsumableArray(value), [[condition]]);
@@ -195,7 +162,6 @@ var BizUserCondition = function BizUserCondition(props) {
195
162
  setDataList([].concat(_toConsumableArray(dataList), [newData]));
196
163
  props.onChange(newValue);
197
164
  }
198
-
199
165
  function _onChange(id, newData) {
200
166
  var newValue = [];
201
167
  var newDataList = [];
@@ -213,7 +179,6 @@ var BizUserCondition = function BizUserCondition(props) {
213
179
  newDataList.push(item);
214
180
  }
215
181
  });
216
-
217
182
  if (newData.length === 0) {
218
183
  var index = showList.findIndex(function (item) {
219
184
  return item.id === id;
@@ -221,12 +186,10 @@ var BizUserCondition = function BizUserCondition(props) {
221
186
  showList.splice(index, 1);
222
187
  setShowList(_toConsumableArray(showList));
223
188
  }
224
-
225
189
  setValue(newValue);
226
190
  setDataList(newDataList);
227
191
  props.onChange && props.onChange(newValue);
228
192
  }
229
-
230
193
  function getDatasetList() {
231
194
  request(Apis.queryDatasetList, {
232
195
  method: 'post',
@@ -243,11 +206,9 @@ var BizUserCondition = function BizUserCondition(props) {
243
206
  setLoading(false);
244
207
  });
245
208
  }
246
-
247
209
  if (loading) {
248
210
  return /*#__PURE__*/React.createElement(Spin, null);
249
211
  }
250
-
251
212
  return /*#__PURE__*/React.createElement(BizUserConditionContext.Provider, {
252
213
  value: {
253
214
  orConditionNum: props.orConditionNum || 2,
@@ -289,7 +250,6 @@ var BizUserCondition = function BizUserCondition(props) {
289
250
  type: "tishiicon"
290
251
  }), "\u660E\u7EC6\u8868\u4E2D\u9700\u5B58\u5728\u300Capp_user_id\u300D\u6761\u4EF6\u65B9\u53EF\u751F\u6548\u3002") : null));
291
252
  };
292
-
293
253
  BizUserCondition.defaultProps = {
294
254
  andConditionNum: 5,
295
255
  textMode: false,