@zgfe/business-lib 1.0.26 → 1.0.27-adanalysis.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 (83) hide show
  1. package/es/addToPanel/index.js +16 -33
  2. package/es/assets/iconfont/demo_index.html +3 -647
  3. package/es/assets/iconfont/iconfont.css +3 -115
  4. package/es/assets/iconfont/iconfont.js +33 -37
  5. package/es/assets/iconfont/iconfont.json +0 -196
  6. package/es/assets/iconfont/iconfont.ttf +0 -0
  7. package/es/assets/iconfont/iconfont.woff +0 -0
  8. package/es/assets/iconfont/iconfont.woff2 +0 -0
  9. package/es/assets/styles/resetAntd.less +2 -7
  10. package/es/attrConditions/components/stringList.js +1 -1
  11. package/es/attrConditions/components/valuesList.js +5 -7
  12. package/es/attrConditions/group.js +4 -4
  13. package/es/attrConditions/types.d.ts +0 -1
  14. package/es/attributeSelector/styles/index.less +2 -31
  15. package/es/attributeSelector/util.js +1 -9
  16. package/es/chart/demo/bar.js +4 -3
  17. package/es/chart/demo/data/data.d.ts +0 -7
  18. package/es/chart/demo/data/data.js +0 -10
  19. package/es/chart/demo/data/data3.d.ts +2 -0
  20. package/es/chart/demo/data/data3.js +574 -15
  21. package/es/chart/demo/map.js +2 -1
  22. package/es/chart/index.js +2 -2
  23. package/es/chart/util/chartOptionConfig.d.ts +54 -1
  24. package/es/chart/util/chartOptionConfig.js +7 -13
  25. package/es/chart/util/formatData.js +1 -2
  26. package/es/chart/util/formatOption.js +23 -7
  27. package/es/chart/util/mapUtil.d.ts +2 -2
  28. package/es/chart/util/mapUtil.js +75 -59
  29. package/es/cycleTime/index.d.ts +0 -1
  30. package/es/cycleTime/index.js +5 -12
  31. package/es/cycleTime/month.d.ts +0 -1
  32. package/es/cycleTime/month.js +3 -6
  33. package/es/cycleTime/styles/month.less +0 -12
  34. package/es/datePicker/datePicker.js +1 -3
  35. package/es/{cycleTime/demo/disable.d.ts → datePicker/demo/day.d.ts} +1 -0
  36. package/es/datePicker/demo/day.js +49 -0
  37. package/es/datePicker/index.js +5 -3
  38. package/es/datePicker/styles/index.less +2 -1
  39. package/es/datePicker/types.d.ts +2 -0
  40. package/es/datePicker/utils.d.ts +1 -0
  41. package/es/datePicker/utils.js +37 -1
  42. package/es/eventSelector/index.js +2 -2
  43. package/es/eventSelector/listPanel.js +5 -20
  44. package/es/eventSelector/types.d.ts +1 -1
  45. package/es/layout/analysisLayout/demo/index.js +1 -5
  46. package/es/layout/analysisLayout/index.js +5 -5
  47. package/es/layout/analysisLayout/index.less +6 -0
  48. package/es/select/demo/multiple.js +2 -3
  49. package/es/select/handle.js +12 -50
  50. package/es/select/index.js +9 -44
  51. package/es/select/overlay.d.ts +1 -1
  52. package/es/select/overlay.js +5 -4
  53. package/es/select/styles/handle.less +28 -50
  54. package/es/select/types.d.ts +0 -6
  55. package/es/targetConditionGroup/index.js +1 -3
  56. package/es/targetConditionGroup/types.d.ts +0 -1
  57. package/es/targetSelector/index.js +0 -13
  58. package/es/targetSelector/styles/index.less +0 -1
  59. package/es/userCondition/conditions/styles/eventCondition.less +1 -1
  60. package/es/userCondition/conditions/styles/tagsCondition.less +1 -1
  61. package/es/userCondition/conditions/tagsCondition.js +13 -26
  62. package/es/userCondition/conditions/textDesc.js +8 -29
  63. package/es/userCondition/demo/index.js +228 -5
  64. package/es/userCondition/types.d.ts +3 -21
  65. package/es/userCondition/util.d.ts +1 -23
  66. package/es/userCondition/util.js +5 -39
  67. package/es/userTagsSelector/cascaderOverlay.js +42 -132
  68. package/es/userTagsSelector/demo/index.js +5 -12
  69. package/es/userTagsSelector/groups/groupOption.js +2 -3
  70. package/es/userTagsSelector/groups/index.js +11 -18
  71. package/es/userTagsSelector/groups/styles/option.less +1 -6
  72. package/es/userTagsSelector/index.js +3 -17
  73. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +1 -2
  74. package/es/userTagsSelector/multipleCheckPanel/index.js +16 -7
  75. package/es/userTagsSelector/styles/cascaderOverlay.less +4 -9
  76. package/es/userTagsSelector/types.d.ts +10 -1
  77. package/es/userTagsSelector/util.d.ts +1 -1
  78. package/es/userTagsSelector/util.js +2 -6
  79. package/es/utils/ajax.js +1 -5
  80. package/package.json +3 -3
  81. package/es/cycleTime/demo/disable.js +0 -17
  82. package/es/userCondition/demo/mockData.d.ts +0 -85
  83. package/es/userCondition/demo/mockData.js +0 -546
@@ -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
 
60
+ 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 : '天'));
61
+
73
62
  if (period.operator === 'unlimited_time') {
74
63
  return /*#__PURE__*/React.createElement("span", null, "\u5728\u4EFB\u610F\u65F6\u95F4\u5185");
75
64
  }
76
65
 
77
- 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 : '天'));
78
-
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));
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { UserProp } from '../attributeSelector/types';
3
+ import { TagI } from './../userTagsSelector/types';
3
4
  export declare type Unpacked<T, U extends keyof T> = Required<T> extends {
4
5
  [key in U]: infer R;
5
6
  } ? R : never;
@@ -29,27 +30,8 @@ export declare namespace BizUserConditionT {
29
30
  isRealTime?: boolean;
30
31
  }
31
32
  interface UserTagsDataI {
32
- appId: number;
33
- createTime: string;
34
- updateTime: string;
35
- del: number;
36
33
  labelGroup: string;
37
- id: number;
38
- labelName: string;
39
- labelStatus: number;
40
- labelType: number;
41
- remark: string;
42
- creator: string;
43
- userAmount: number;
44
- layerNum: number;
45
- endProcessTime: string;
46
- layers: {
47
- layerLabelId: number;
48
- layerLabelName: string;
49
- layerRemark: string;
50
- layerCondition: any[][];
51
- sequence: number;
52
- }[];
34
+ children: TagI[];
53
35
  }
54
36
  interface AttrCondition {
55
37
  attrId: number;
@@ -80,7 +62,7 @@ export declare namespace BizUserConditionT {
80
62
  }
81
63
  interface Labels {
82
64
  operator: 'not equal' | 'equal';
83
- values: string[];
65
+ values: number[];
84
66
  }
85
67
  interface TagsCondition {
86
68
  attrs: [];
@@ -4,26 +4,4 @@ export declare function buildCondition(type: BizUserConditionT.ConditionType): B
4
4
  export declare function transformNumberOperate(key: string, output?: boolean): string;
5
5
  export declare function findEvent(eventId: number, eventGroupList: Unpacked<GlobalContextProps, 'eventGroupList'>): import("../attributeSelector/types").AnalysisEvent | null;
6
6
  export declare function findPropAndEnv(name: string, list: Unpacked<GlobalContextProps, 'userPropList' | 'eventEnvList'>): import("../attributeSelector/types").UserProp | import("../attributeSelector/types").EnvProp | null;
7
- export declare function buildSelectLayer(data: BizUserConditionT.UserTagsDataI[]): (layerLabelId: number) => ({
8
- labelGroup: string;
9
- id?: undefined;
10
- labelName?: undefined;
11
- layerLabelId?: undefined;
12
- layerLabelName?: undefined;
13
- } | {
14
- id: number;
15
- labelName: string;
16
- labelGroup?: undefined;
17
- layerLabelId?: undefined;
18
- layerLabelName?: undefined;
19
- } | {
20
- layerLabelId: number;
21
- layerLabelName: string;
22
- labelGroup?: undefined;
23
- id?: undefined;
24
- labelName?: undefined;
25
- })[] | null;
26
- export declare function buildTagsGroup(list: BizUserConditionT.UserTagsDataI[]): {
27
- labelGroup: string;
28
- children: BizUserConditionT.UserTagsDataI[];
29
- }[];
7
+ export declare function findTagFactory(data: BizUserConditionT.UserTagsDataI[]): (id: number) => import("../userTagsSelector/types").TagI | null;
@@ -1,9 +1,3 @@
1
- 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
- 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
-
7
1
  export function buildCondition(type) {
8
2
  switch (type) {
9
3
  case 'add':
@@ -105,45 +99,17 @@ export function findPropAndEnv(name, list) {
105
99
 
106
100
  return null;
107
101
  }
108
- export function buildSelectLayer(data) {
109
- return function (layerLabelId) {
102
+ export function findTagFactory(data) {
103
+ return function (id) {
110
104
  var i = -1;
111
105
  var j = data.findIndex(function (item) {
112
- i = item.layers.findIndex(function (layer) {
113
- return layer.layerLabelId === layerLabelId;
106
+ i = item.children.findIndex(function (tag) {
107
+ return tag.labelId === id;
114
108
  });
115
109
  if (i < 0) return false;
116
110
  return true;
117
111
  });
118
112
  if (j < 0) return null;
119
- return [{
120
- labelGroup: data[j].labelGroup
121
- }, {
122
- id: data[j].id,
123
- labelName: data[j].labelName
124
- }, {
125
- layerLabelId: data[j].layers[i].layerLabelId,
126
- layerLabelName: data[j].layers[i].layerLabelName
127
- }];
113
+ return data[j].children[i];
128
114
  };
129
- }
130
- export function buildTagsGroup(list) {
131
- var groupOrder = ['基本标签', '活跃标签', '行为标签', '预测标签', '其它标签'];
132
- var groupsMap = {};
133
- var options = [];
134
- list.forEach(function (label) {
135
- if (Object.hasOwn(groupsMap, label.labelGroup)) {
136
- groupsMap[label.labelGroup].children.push(_objectSpread({}, label));
137
- } else {
138
- var group = {
139
- labelGroup: label.labelGroup,
140
- children: [_objectSpread({}, label)]
141
- };
142
- groupsMap[label.labelGroup] = group;
143
- }
144
- });
145
- groupOrder.map(function (group) {
146
- groupsMap[group] && options.push(groupsMap[group]);
147
- });
148
- return options;
149
115
  }