@zgfe/business-lib 1.0.25-layers.5 → 1.0.25-userGroupFix.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 (33) hide show
  1. package/es/cycleTime/index.d.ts +0 -1
  2. package/es/cycleTime/index.js +5 -11
  3. package/es/cycleTime/month.d.ts +0 -1
  4. package/es/cycleTime/month.js +3 -6
  5. package/es/cycleTime/styles/month.less +0 -12
  6. package/es/select/demo/multiple.js +2 -3
  7. package/es/select/handle.js +3 -4
  8. package/es/select/styles/handle.less +27 -36
  9. package/es/userCondition/conditions/styles/eventCondition.less +1 -1
  10. package/es/userCondition/conditions/styles/tagsCondition.less +1 -1
  11. package/es/userCondition/conditions/tagsCondition.js +13 -26
  12. package/es/userCondition/conditions/textDesc.js +8 -29
  13. package/es/userCondition/demo/index.js +228 -5
  14. package/es/userCondition/types.d.ts +3 -21
  15. package/es/userCondition/util.d.ts +1 -23
  16. package/es/userCondition/util.js +5 -39
  17. package/es/userTagsSelector/cascaderOverlay.js +42 -132
  18. package/es/userTagsSelector/demo/index.js +5 -12
  19. package/es/userTagsSelector/groups/groupOption.js +2 -3
  20. package/es/userTagsSelector/groups/index.js +11 -18
  21. package/es/userTagsSelector/groups/styles/option.less +1 -6
  22. package/es/userTagsSelector/index.js +3 -17
  23. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +1 -2
  24. package/es/userTagsSelector/multipleCheckPanel/index.js +16 -7
  25. package/es/userTagsSelector/styles/cascaderOverlay.less +4 -9
  26. package/es/userTagsSelector/types.d.ts +10 -1
  27. package/es/userTagsSelector/util.d.ts +1 -1
  28. package/es/userTagsSelector/util.js +2 -6
  29. package/package.json +2 -2
  30. package/es/cycleTime/demo/disable.d.ts +0 -2
  31. package/es/cycleTime/demo/disable.js +0 -17
  32. package/es/userCondition/demo/mockData.d.ts +0 -85
  33. package/es/userCondition/demo/mockData.js +0 -546
@@ -17,6 +17,5 @@ declare const BizCycleTime: React.FC<{
17
17
  placeholder?: string;
18
18
  onChange?: (val: Value) => void;
19
19
  size?: SizeType;
20
- disable?: boolean;
21
20
  }>;
22
21
  export default BizCycleTime;
@@ -26,8 +26,7 @@ export var CycleTimeUnit;
26
26
 
27
27
  var BizCycleTime = function BizCycleTime(props) {
28
28
  var multiple = props.multiple,
29
- size = props.size,
30
- disable = props.disable;
29
+ size = props.size;
31
30
  var classPrefix = 'biz-cycle-time';
32
31
  var unitList = [{
33
32
  label: '每日',
@@ -158,7 +157,6 @@ var BizCycleTime = function BizCycleTime(props) {
158
157
  className: "".concat(classPrefix, "-unit"),
159
158
  defaultValue: unit,
160
159
  size: size,
161
- disable: disable,
162
160
  onChange: function onChange(v) {
163
161
  setDay([]);
164
162
  setTime(undefined);
@@ -171,8 +169,7 @@ var BizCycleTime = function BizCycleTime(props) {
171
169
  defaultValue: time ? moment(time, 'hh:mm:ss') : undefined,
172
170
  onChange: function onChange(time) {
173
171
  setTime(time === null || time === void 0 ? void 0 : time.format('hh:mm:ss'));
174
- },
175
- disabled: disable
172
+ }
176
173
  }), unit.value === CycleTimeUnit.week && /*#__PURE__*/React.createElement(BizSelect, {
177
174
  options: days,
178
175
  labelField: "label",
@@ -184,19 +181,16 @@ var BizCycleTime = function BizCycleTime(props) {
184
181
  placeholder: props.placeholder,
185
182
  onChange: function onChange(v) {
186
183
  setDay(v);
187
- },
188
- disable: disable
184
+ }
189
185
  }), unit.value === CycleTimeUnit.month && /*#__PURE__*/React.createElement(MonthDay, {
190
186
  placeholder: props.placeholder,
191
187
  defaultValue: day,
192
- onChange: setDayList,
193
- disable: disable
188
+ onChange: setDayList
194
189
  }));
195
190
  };
196
191
 
197
192
  BizCycleTime.defaultProps = {
198
193
  multiple: false,
199
- size: 'middle',
200
- disable: false
194
+ size: 'middle'
201
195
  };
202
196
  export default BizCycleTime;
@@ -8,6 +8,5 @@ declare const MonthDay: React.FC<{
8
8
  defaultValue?: BaseOption<number>[];
9
9
  placeholder?: string;
10
10
  onChange?: (days: BaseOption<number>[]) => void;
11
- disable?: boolean;
12
11
  }>;
13
12
  export default MonthDay;
@@ -18,7 +18,6 @@ import _ from 'lodash';
18
18
 
19
19
  var MonthDay = function MonthDay(props) {
20
20
  var classPrefix = 'biz-month-day';
21
- var disable = props.disable;
22
21
 
23
22
  var _useState = useState([]),
24
23
  _useState2 = _slicedToArray(_useState, 2),
@@ -86,7 +85,6 @@ var MonthDay = function MonthDay(props) {
86
85
  }
87
86
 
88
87
  return /*#__PURE__*/React.createElement(Dropdown, {
89
- disabled: disable,
90
88
  overlay: /*#__PURE__*/React.createElement("div", {
91
89
  className: "".concat(classPrefix, "-overlay")
92
90
  }, dayList.map(function (item) {
@@ -106,7 +104,7 @@ var MonthDay = function MonthDay(props) {
106
104
  }, /*#__PURE__*/React.createElement("div", {
107
105
  className: "".concat(classPrefix, "-wrapper")
108
106
  }, /*#__PURE__*/React.createElement("div", {
109
- className: "".concat(classPrefix, "-handle ").concat(props.size, " ").concat(!chosenDayList.length ? "holder" : '', " ").concat(disable ? 'disable' : '')
107
+ className: "".concat(classPrefix, "-handle ").concat(props.size, " ").concat(!chosenDayList.length ? "holder" : '')
110
108
  }, /*#__PURE__*/React.createElement("div", {
111
109
  className: "".concat(classPrefix, "-val")
112
110
  }, chosenDayList.map(function (item) {
@@ -114,7 +112,7 @@ var MonthDay = function MonthDay(props) {
114
112
  closable: true,
115
113
  key: item.value,
116
114
  onClose: function onClose() {
117
- !disable && onDelMonthDay(item);
115
+ onDelMonthDay(item);
118
116
  }
119
117
  }, item.label);
120
118
  }), !chosenDayList.length && /*#__PURE__*/React.createElement("span", {
@@ -125,7 +123,6 @@ var MonthDay = function MonthDay(props) {
125
123
  };
126
124
 
127
125
  MonthDay.defaultProps = {
128
- size: 'middle',
129
- disable: false
126
+ size: 'middle'
130
127
  };
131
128
  export default MonthDay;
@@ -47,18 +47,6 @@
47
47
  &.ant-dropdown-open > .biz-month-day-handle {
48
48
  .__default-focused();
49
49
  }
50
- .biz-month-day-handle {
51
- &.disable {
52
- cursor: not-allowed !important;
53
- .ant-tag {
54
- color: @disabled-color;
55
- .anticon-close {
56
- color: @disabled-color;
57
- cursor: not-allowed;
58
- }
59
- }
60
- }
61
- }
62
50
  }
63
51
  &-overlay {
64
52
  .__select-panel();
@@ -40,7 +40,7 @@ var stringOperate = [{
40
40
  name: '是空值',
41
41
  value: 'is null'
42
42
  }, {
43
- name: '不是空值',
43
+ name: '不是空值aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
44
44
  value: 'is not null'
45
45
  }];
46
46
  var disabledList = [{
@@ -80,7 +80,6 @@ export default (function () {
80
80
  disableItemList: disabledList,
81
81
  multiple: true,
82
82
  enableCreate: true,
83
- value: data,
84
- disable: true
83
+ value: data
85
84
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u503C\u662F\uFF1A", JSON.stringify(data)));
86
85
  });
@@ -22,8 +22,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
22
22
  labelField = props.labelField,
23
23
  keyField = props.keyField,
24
24
  border = props.border,
25
- showSelectIcon = props.showSelectIcon,
26
- disable = props.disable;
25
+ showSelectIcon = props.showSelectIcon;
27
26
  var classPrefix = 'biz-select-handle';
28
27
 
29
28
  var _useState = useState(false),
@@ -111,9 +110,9 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
111
110
  color: "#fff"
112
111
  }, /*#__PURE__*/React.createElement(Tag, {
113
112
  closable: true,
114
- className: "".concat(classPrefix, "-tag ").concat(disable ? 'disable' : ''),
113
+ id: "".concat(classPrefix, "-tag"),
115
114
  onClose: function onClose() {
116
- !disable && onDelete(item);
115
+ onDelete(item);
117
116
  }
118
117
  }, /*#__PURE__*/React.createElement("div", {
119
118
  className: "".concat(classPrefix, "-tag-label")
@@ -56,42 +56,6 @@
56
56
  height: auto;
57
57
  min-height: @height-base;
58
58
  }
59
- .biz-select-handle-tag {
60
- display: flex;
61
- align-items: center;
62
- margin: 2px 4px 2px 0;
63
- padding: 0 4px;
64
- padding-top: 1px;
65
- padding-bottom: 1px;
66
- background: none;
67
- border-color: #cacdd4;
68
- border-radius: @border-radius-small;
69
- &-label {
70
- min-width: 0;
71
- max-width: 100px;
72
- overflow: hidden;
73
- text-overflow: ellipsis;
74
- }
75
- &:not(.disable) {
76
- &:hover {
77
- .__default-hover();
78
- .anticon {
79
- color: @primary-color;
80
- }
81
- }
82
- }
83
- &.disable {
84
- &:hover {
85
- cursor: not-allowed;
86
- .anticon-close {
87
- cursor: not-allowed;
88
- }
89
- }
90
- .biz-select-handle-tag-label {
91
- color: @disabled-color !important;
92
- }
93
- }
94
- }
95
59
  }
96
60
 
97
61
  &-search.ant-input {
@@ -126,6 +90,33 @@
126
90
  width: 14px;
127
91
  margin-left: 5px;
128
92
  }
93
+ &-input {
94
+ display: flex;
95
+ #biz-select-handle-tag {
96
+ display: flex;
97
+ align-items: center;
98
+ margin: 2px 4px 2px 0;
99
+ padding: 0 4px;
100
+ padding-top: 1px;
101
+ padding-bottom: 1px;
102
+ background: none;
103
+ border-color: #cacdd4;
104
+ border-radius: @border-radius-small;
105
+ &-label {
106
+ min-width: 0;
107
+ max-width: 100px;
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ }
111
+ &:hover {
112
+ .__default-hover();
113
+
114
+ .anticon {
115
+ color: @primary-color;
116
+ }
117
+ }
118
+ }
119
+ }
129
120
 
130
121
  &-tooltip {
131
122
  .ant-tooltip-inner {
@@ -42,7 +42,7 @@
42
42
  display: flex;
43
43
  align-items: center;
44
44
  min-width: 28px;
45
- height: 34px;
45
+ height: 42px;
46
46
  margin-right: @margin-xs;
47
47
  }
48
48
  &-runtimes {
@@ -8,7 +8,7 @@
8
8
  margin-left: @margin-xs;
9
9
  }
10
10
  &-label {
11
- line-height: 32px;
11
+ line-height: 40px;
12
12
  }
13
13
  &-value {
14
14
  flex: 1;
@@ -16,14 +16,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import React, { useContext, useMemo, useState } from 'react';
19
+ import React, { useContext, useState } from 'react';
20
20
  import { BizUserConditionContext, classPrefix } from '..';
21
21
  import BizSelect from '../../select';
22
22
  import { operatorMap } from './constants';
23
23
  import BizUserTagsSelect from '../../userTagsSelector';
24
24
  import './styles/tagsCondition.less';
25
- import { buildSelectLayer, buildTagsGroup } from '../util';
26
- import _ from 'lodash';
25
+ import { findTagFactory } from '../util';
27
26
  var options = [{
28
27
  value: 'equal',
29
28
  text: '是'
@@ -46,10 +45,6 @@ var TagsCondition = function TagsCondition(props) {
46
45
  _useState2 = _slicedToArray(_useState, 1),
47
46
  defaultValues = _useState2[0];
48
47
 
49
- var tagGroupList = useMemo(function () {
50
- return buildTagsGroup(userTagsData || []);
51
- }, [userTagsData]);
52
-
53
48
  function onOperatorChange(operator) {
54
49
  onChange(dataId, _objectSpread(_objectSpread({}, labels), {}, {
55
50
  operator: operator.value
@@ -58,7 +53,7 @@ var TagsCondition = function TagsCondition(props) {
58
53
 
59
54
  function onTagsChange(data) {
60
55
  var values = data.map(function (item) {
61
- return "".concat(item[1].id, ":").concat(item[2].layerLabelId);
56
+ return item[1].labelId;
62
57
  });
63
58
  onChange(dataId, _objectSpread(_objectSpread({}, labels), {}, {
64
59
  values: values
@@ -67,20 +62,12 @@ var TagsCondition = function TagsCondition(props) {
67
62
 
68
63
  function buildDefaultValues() {
69
64
  var values = [];
70
- var findTag = buildSelectLayer(userTagsData);
71
- labels.values.forEach(function (value) {
72
- if (_.isNumber(value)) {
73
- return;
74
- }
75
-
76
- var _value$split = value.split(':'),
77
- _value$split2 = _slicedToArray(_value$split, 2),
78
- layerId = _value$split2[1];
79
-
80
- var selectValue = findTag(Number(layerId));
65
+ var findTag = findTagFactory(userTagsData);
66
+ labels.values.forEach(function (id) {
67
+ var tag = findTag(id);
81
68
 
82
- if (selectValue) {
83
- values.push(selectValue);
69
+ if (tag) {
70
+ values.push([tag.labelGroup, tag]);
84
71
  }
85
72
  });
86
73
  return values;
@@ -105,11 +92,11 @@ var TagsCondition = function TagsCondition(props) {
105
92
  className: "".concat(classPrefix, "-tags-condition-value")
106
93
  }, /*#__PURE__*/React.createElement(BizUserTagsSelect, {
107
94
  defaultValue: defaultValues,
108
- data: tagGroupList,
109
- childFields: ['children', 'layers'],
110
- keyFields: ['labelGroup', 'id', 'layerLabelId'],
111
- labelFields: ['labelGroup', 'labelName', 'layerLabelName'],
112
- valueFields: ['labelGroup', 'id', 'layerLabelId'],
95
+ data: userTagsData,
96
+ childFields: ['children'],
97
+ keyFields: ['labelGroup', 'labelId'],
98
+ labelFields: ['labelGroup', 'labelName'],
99
+ valueFields: ['labelGroup', 'labelId'],
113
100
  onChange: onTagsChange,
114
101
  destroyPopupOnHide: true
115
102
  })), /*#__PURE__*/React.createElement("div", {
@@ -4,23 +4,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
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
6
 
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
-
9
- 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
- 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
-
17
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
-
19
- import _ from 'lodash';
20
7
  import React, { useContext, useMemo } from 'react';
21
8
  import { BizUserConditionContext, classPrefix } from '..';
22
9
  import BizGlobalDataContext from '../../context';
23
- import { findEvent, findPropAndEnv, buildSelectLayer } from '../util';
10
+ import { findEvent, findPropAndEnv, findTagFactory } from '../util';
24
11
  import { durationHandler, operatorMap } from './constants';
25
12
  import './styles/textDesc.less';
26
13
 
@@ -70,12 +57,12 @@ var Text = function Text(props) {
70
57
  function renderPeriod(label, period, isEvent) {
71
58
  var _label$after;
72
59
 
73
- 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 : '天'));
74
-
75
60
  if (period.operator === 'unlimited_time') {
76
61
  return /*#__PURE__*/React.createElement("span", null, "\u5728\u4EFB\u610F\u65F6\u95F4\u5185");
77
62
  }
78
63
 
64
+ 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 : '天'));
65
+
79
66
  if (period.operator === 'absolute') {
80
67
  valuesDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
81
68
  className: "".concat(classPrefix, "-text-desc-value")
@@ -186,23 +173,15 @@ var Text = function Text(props) {
186
173
  className: "label"
187
174
  }, /*#__PURE__*/React.createElement("b", null, "\u7528\u6237\u6807\u7B7E")), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, operatorMap[labels.operator])), /*#__PURE__*/React.createElement("span", {
188
175
  className: "".concat(classPrefix, "-text-desc-value")
189
- }, /*#__PURE__*/React.createElement("span", null, "("), labels.values.map(function (value, index) {
190
- if (_.isNumber(value)) {
191
- return null;
192
- }
193
-
194
- var _value$split = value.split(':'),
195
- _value$split2 = _slicedToArray(_value$split, 2),
196
- layerId = _value$split2[1];
197
-
198
- var tag = findTag(Number(layerId));
176
+ }, /*#__PURE__*/React.createElement("span", null, "("), labels.values.map(function (id, index) {
177
+ var tag = findTag(id);
199
178
  return /*#__PURE__*/React.createElement("span", {
200
- key: layerId
179
+ key: id
201
180
  }, index >= 1 ? /*#__PURE__*/React.createElement("span", {
202
181
  style: {
203
182
  margin: '0 4px'
204
183
  }
205
- }, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, tag && tag[1].labelName + ':' + tag[2].layerLabelName));
184
+ }, "\u6216") : null, /*#__PURE__*/React.createElement("span", null, tag && tag.labelName));
206
185
  }), /*#__PURE__*/React.createElement("span", null, ")")));
207
186
  }
208
187
 
@@ -252,7 +231,7 @@ var Text = function Text(props) {
252
231
  }
253
232
 
254
233
  var findTag = useMemo(function () {
255
- return buildSelectLayer(userTagsData);
234
+ return findTagFactory(userTagsData);
256
235
  }, [userTagsData]);
257
236
  return /*#__PURE__*/React.createElement("span", {
258
237
  className: "".concat(classPrefix, "-text-desc")
@@ -15,8 +15,216 @@ import eventData from '../../mock/event';
15
15
  import envData from '../../mock/env';
16
16
  import userData from '../../mock/user';
17
17
  import { BizUserCondition, BizGlobalDataContext, convertAttributeData } from '@zgfe/business-lib';
18
- import { conditions, tagList } from './mockData';
19
- var getTagList = Promise.resolve(tagList);
18
+ var getTagList = Promise.resolve([{
19
+ appId: 51,
20
+ createTime: '2022-07-05T13:48:51',
21
+ del: 0,
22
+ id: 286,
23
+ isInner: 0,
24
+ isStartup: 0,
25
+ labelGroup: '行为标签',
26
+ labelId: 66284406603776,
27
+ labelName: 'test8(新增)',
28
+ labelStatus: 1,
29
+ updateTime: '2022-07-05T13:48:51'
30
+ }, {
31
+ appId: 51,
32
+ createTime: '2022-07-05T13:47:38',
33
+ del: 0,
34
+ id: 285,
35
+ isInner: 0,
36
+ isStartup: 0,
37
+ labelGroup: '预测标签',
38
+ labelId: 66283215683584,
39
+ labelName: 'test7(新增)',
40
+ labelStatus: 1,
41
+ updateTime: '2022-07-05T13:47:38'
42
+ }, {
43
+ appId: 51,
44
+ createTime: '2022-07-05T13:47:10',
45
+ del: 0,
46
+ id: 284,
47
+ isInner: 0,
48
+ isStartup: 0,
49
+ labelGroup: '其他标签',
50
+ labelId: 66282747314176,
51
+ labelName: 'test6(新增)',
52
+ labelStatus: 1,
53
+ updateTime: '2022-07-05T13:47:10'
54
+ }, {
55
+ appId: 51,
56
+ createTime: '2022-07-05T13:44:20',
57
+ del: 0,
58
+ id: 283,
59
+ isInner: 0,
60
+ isStartup: 0,
61
+ labelGroup: '其他标签',
62
+ labelId: 66279963361280,
63
+ labelName: 'test5(新增)',
64
+ labelStatus: 1,
65
+ updateTime: '2022-07-05T13:44:20'
66
+ }, {
67
+ appId: 51,
68
+ createTime: '2022-07-05T13:43:08',
69
+ del: 0,
70
+ id: 282,
71
+ isInner: 0,
72
+ isStartup: 0,
73
+ labelGroup: '活跃标签',
74
+ labelId: 66278784057344,
75
+ labelName: 'test3(新增)',
76
+ labelStatus: 1,
77
+ updateTime: '2022-07-05T13:43:08'
78
+ }, {
79
+ appId: 51,
80
+ createTime: '2022-07-05T13:42:44',
81
+ del: 0,
82
+ id: 281,
83
+ isInner: 0,
84
+ isStartup: 0,
85
+ labelGroup: '其他标签',
86
+ labelId: 66278393724928,
87
+ labelName: 'test2(新增)',
88
+ labelStatus: 1,
89
+ updateTime: '2022-07-05T13:42:44'
90
+ }, {
91
+ appId: 51,
92
+ createTime: '2022-07-05T13:42:30',
93
+ del: 0,
94
+ id: 280,
95
+ isInner: 0,
96
+ isStartup: 0,
97
+ labelGroup: '预测标签',
98
+ labelId: 66278158696448,
99
+ labelName: 'test1(新增)',
100
+ labelStatus: 1,
101
+ updateTime: '2022-07-05T13:42:30'
102
+ }, {
103
+ appId: 51,
104
+ createTime: '2022-06-21T15:04:24',
105
+ del: 0,
106
+ id: 277,
107
+ isInner: 0,
108
+ isStartup: 0,
109
+ labelGroup: '活跃标签',
110
+ labelId: 46540583010304,
111
+ labelName: '匿名用户',
112
+ labelStatus: 0,
113
+ updateTime: '2022-06-21T15:04:24'
114
+ }, {
115
+ appId: 51,
116
+ createTime: '2022-06-10T11:10:52',
117
+ del: 0,
118
+ id: 197,
119
+ isInner: 0,
120
+ isStartup: 0,
121
+ labelGroup: '活跃标签',
122
+ labelId: 77384417755136,
123
+ labelName: '手动更新1',
124
+ labelStatus: 0,
125
+ updateTime: '2022-06-10T11:32:31'
126
+ }, {
127
+ appId: 51,
128
+ createTime: '2022-06-10T11:10:36',
129
+ del: 0,
130
+ id: 196,
131
+ isInner: 0,
132
+ isStartup: 0,
133
+ labelGroup: '活跃标签',
134
+ labelId: 77383474429952,
135
+ labelName: '自动更新修改',
136
+ labelStatus: 0,
137
+ updateTime: '2022-06-10T11:11:13'
138
+ }, {
139
+ appId: 51,
140
+ createTime: '2022-06-10T10:49:57',
141
+ del: 0,
142
+ id: 191,
143
+ isInner: 0,
144
+ isStartup: 0,
145
+ labelGroup: '基本标签',
146
+ labelId: 77388914425856,
147
+ labelName: '一般价值',
148
+ labelStatus: 0,
149
+ updateTime: '2022-06-10T10:49:57'
150
+ }]);
151
+ var data = {
152
+ json: [[{
153
+ eventId: -4,
154
+ attrs: [],
155
+ runPeriod: {
156
+ operator: 'relative',
157
+ values: ['30', '1']
158
+ },
159
+ runTimes: {
160
+ operator: '>=',
161
+ values: ['1']
162
+ }
163
+ }, {
164
+ eventId: -3,
165
+ attrs: [],
166
+ runPeriod: {
167
+ operator: 'absolute',
168
+ values: ['2022-07-13', '2022-07-19']
169
+ },
170
+ runTimes: {
171
+ operator: '>=',
172
+ values: ['1']
173
+ }
174
+ }], [{
175
+ attrs: [{
176
+ attrId: 0,
177
+ attrName: 'zg_id',
178
+ operator: '>',
179
+ params: ['20'],
180
+ attrType: 'cont-num',
181
+ category: 'fixed'
182
+ }]
183
+ }, {
184
+ attrs: [{
185
+ attrId: 0,
186
+ attrName: 'app_user_id',
187
+ operator: 'equal',
188
+ params: ['20'],
189
+ attrType: 'cont-string',
190
+ category: 'fixed'
191
+ }]
192
+ }], [{
193
+ attrs: [{
194
+ attrId: 0,
195
+ attrName: 'duration',
196
+ operator: 'not equal',
197
+ params: [1198800, '1'],
198
+ attrType: 'cont-num',
199
+ category: 'fixed'
200
+ }]
201
+ }, {
202
+ eventId: 24143017,
203
+ runTimes: {
204
+ operator: '>=',
205
+ values: ['1']
206
+ },
207
+ attrs: [{
208
+ attrId: 0,
209
+ attrName: 'resolution_l',
210
+ category: 'fixed',
211
+ operator: '>',
212
+ params: ['10'],
213
+ attrType: 'cont-num'
214
+ }, {
215
+ attrId: 30183430,
216
+ attrName: '扫码场景描述',
217
+ category: 'custom',
218
+ operator: 'equal',
219
+ params: ['Microsoft Edge', 'Safari', 'Apple WebKit'],
220
+ attrType: 'cont-string'
221
+ }],
222
+ runPeriod: {
223
+ operator: 'relative',
224
+ values: ['30', '0']
225
+ }
226
+ }]]
227
+ };
20
228
  export default (function () {
21
229
  var _useState = useState({
22
230
  eventGroupList: [],
@@ -40,13 +248,28 @@ export default (function () {
40
248
  setStore(newStore);
41
249
  }, []);
42
250
  useEffect(function () {
251
+ var tagsMap = {};
43
252
  getTagList.then(function (list) {
44
- setUserTagsData(list);
253
+ var data = [];
254
+ list.forEach(function (item) {
255
+ var labelGroup = item.labelGroup;
256
+
257
+ if (tagsMap[labelGroup]) {
258
+ tagsMap[labelGroup].push(item);
259
+ } else {
260
+ tagsMap[labelGroup] = [item];
261
+ data.push({
262
+ labelGroup: labelGroup,
263
+ children: tagsMap[labelGroup]
264
+ });
265
+ }
266
+ });
267
+ setUserTagsData(data);
45
268
  });
46
269
  }, []);
47
270
  var defaultValue = useMemo(function () {
48
- return conditions;
49
- }, [conditions]);
271
+ return data.json;
272
+ }, [data]);
50
273
 
51
274
  function onChange(value) {
52
275
  console.log(JSON.stringify(value));