@zgfe/business-lib 1.2.71-hxd.30 → 1.2.71-hxd.33

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.
@@ -98,7 +98,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
98
98
  form.extendTarget ? searchParam.extendTarget = form.extendTarget : null;
99
99
  var resData = {
100
100
  data: searchParam,
101
- chosen_data: form.showList && form.showList === 'dynamic' ? [] : props.showList
101
+ chosen_data: form.showList && form.showList === 'dynamic' ? [] : props.params.showList
102
102
  };
103
103
  if (searchParam === null || searchParam === void 0 ? void 0 : searchParam.overall) {
104
104
  resData.module = 'overall';
@@ -29,7 +29,7 @@ var BizAttributeSelector = function BizAttributeSelector(_ref) {
29
29
  _ref$optionsHeaderTip = _ref.optionsHeaderTip,
30
30
  optionsHeaderTip = _ref$optionsHeaderTip === void 0 ? '带*的属性每日凌晨更新' : _ref$optionsHeaderTip,
31
31
  _ref$destroyPopupOnHi = _ref.destroyPopupOnHide,
32
- destroyPopupOnHide = _ref$destroyPopupOnHi === void 0 ? false : _ref$destroyPopupOnHi,
32
+ destroyPopupOnHide = _ref$destroyPopupOnHi === void 0 ? true : _ref$destroyPopupOnHi,
33
33
  props = _objectWithoutProperties(_ref, _excluded);
34
34
  var _props$enableDelete = props.enableDelete,
35
35
  enableDelete = _props$enableDelete === void 0 ? false : _props$enableDelete,
@@ -1,7 +1,14 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
3
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
4
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
5
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
1
6
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
7
  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."); }
3
8
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
9
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
10
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
11
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5
12
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
13
  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."); }
7
14
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -9,11 +16,12 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
9
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
17
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
18
  import { Anchor, Button } from 'antd';
12
- import React, { useContext, useEffect, useMemo, useState } from 'react';
19
+ import React, { useContext, useEffect, useState } from 'react';
13
20
  import { BizGlobalDataContext } from '..';
14
21
  import BizSearchInput from '../searchInput';
15
22
  import Option from './option';
16
23
  import _ from 'lodash';
24
+ import { eventApi } from '../utils';
17
25
  var Link = Anchor.Link;
18
26
  var AttrListPanel = function AttrListPanel(props) {
19
27
  var _props$disableItemLis;
@@ -51,17 +59,6 @@ var AttrListPanel = function AttrListPanel(props) {
51
59
  _useState6 = _slicedToArray(_useState5, 2),
52
60
  currentAttr = _useState6[0],
53
61
  setCurrentAttr = _useState6[1];
54
- var eventIdMap = useMemo(function () {
55
- var eventIdMap = {};
56
- var eventList = (eventGroupList || []).reduce(function (pre, group) {
57
- return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
58
- }, []);
59
- eventList.forEach(function (event) {
60
- if (eventIdMap[event.id]) return;
61
- eventIdMap[event.id] = event;
62
- });
63
- return eventIdMap;
64
- }, [eventGroupList]);
65
62
  var disableItemlist = (_props$disableItemLis = props.disableItemList) === null || _props$disableItemLis === void 0 ? void 0 : _props$disableItemLis.map(function (item) {
66
63
  if (item.propCategory === 'envProp') {
67
64
  item.key = "envProp-".concat(item.dimensionSub || item.name, "-").concat(item.id || 0);
@@ -84,6 +81,10 @@ var AttrListPanel = function AttrListPanel(props) {
84
81
  _useState0 = _slicedToArray(_useState9, 2),
85
82
  anchorList = _useState0[0],
86
83
  setAnchorList = _useState0[1];
84
+ var _useState1 = useState([]),
85
+ _useState10 = _slicedToArray(_useState1, 2),
86
+ eventAttrsList = _useState10[0],
87
+ setEventAttrsList = _useState10[1];
87
88
  useEffect(function () {
88
89
  var data = {
89
90
  container: "container-".concat(id),
@@ -99,7 +100,9 @@ var AttrListPanel = function AttrListPanel(props) {
99
100
  name: item.name
100
101
  });
101
102
  });
102
- stAnchor(data);
103
+ stAnchor(function () {
104
+ return data;
105
+ });
103
106
  if (enableEventProp) {
104
107
  list.push({
105
108
  id: data.event,
@@ -118,105 +121,312 @@ var AttrListPanel = function AttrListPanel(props) {
118
121
  name: '触发环境'
119
122
  });
120
123
  }
121
- setAnchorList(list);
124
+ setAnchorList(function () {
125
+ return list;
126
+ });
122
127
  }, [id]);
123
128
  var classPrefix = 'biz-attr-select';
124
129
  useEffect(function () {
125
- var list = [];
126
- if (extra) {
127
- extra.forEach(function (item) {
128
- list.push({
129
- isEvent: false,
130
- groupName: item.name,
131
- key: item.type,
132
- anchor: anchor[item.type],
133
- children: item.attrList
134
- });
130
+ var allEventIds = new Set();
131
+ if (eventIdList && eventIdList.length > 0) {
132
+ eventIdList.forEach(function (id) {
133
+ return allEventIds.add(id);
135
134
  });
136
135
  }
137
- if (enableEventProp) {
138
- if (props.showCommonProp) {
139
- var group = {
140
- isEvent: true,
141
- groupName: '共有属性',
142
- key: "event-common",
143
- children: [],
144
- anchor: anchor.event
145
- };
146
- var propMap = {};
147
- eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.forEach(function (id) {
148
- var event = eventIdMap[id];
149
- if (!event) return;
150
- event.attrList.forEach(function (attr) {
151
- var name = attr.alias || attr.label;
152
- if (!propMap[name]) {
153
- propMap[name] = _.cloneDeep(attr);
154
- } else {
155
- group.children.push(propMap[name]);
156
- }
157
- });
158
- });
159
- if (group.children.length) list.push(group);
160
- } else {
161
- var hasAnchor = false;
162
- eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.forEach(function (id) {
163
- var event = eventIdMap[id];
164
- if (!event) return;
165
- var group = {
166
- isEvent: true,
167
- groupName: event.alias || event.name,
168
- anchor: hasAnchor ? String(Math.random()) : anchor.event,
169
- key: "event-".concat(event.id),
170
- children: event.attrList.slice().filter(function (item) {
171
- return isHideYeWu || realTimeTags ? item.id != 31415926 : true;
172
- }).filter(function (item) {
173
- return isStrNum ? item.type === 2 || item.type === 1 : isNumber ? item.type === 2 : isString ? item.type === 1 : true;
174
- })
175
- };
176
- list.push(group);
177
- });
178
- funnelEventIdList === null || funnelEventIdList === void 0 ? void 0 : funnelEventIdList.forEach(function (idList, step) {
179
- idList.forEach(function (id) {
180
- var event = eventIdMap[id];
181
- if (!event) return;
182
- var group = {
183
- isEvent: true,
184
- groupName: event.alias || event.name,
185
- anchor: hasAnchor ? String(Math.random()) : anchor.event,
186
- key: "event-".concat(event.id, "-").concat(step),
187
- children: event.attrList.map(function (attr) {
188
- var res = _.cloneDeep(attr);
189
- res.step = step;
190
- return res;
191
- })
192
- };
193
- list.push(group);
194
- });
136
+ if (funnelEventIdList && funnelEventIdList.length > 0) {
137
+ funnelEventIdList.forEach(function (stepList) {
138
+ stepList.forEach(function (id) {
139
+ return allEventIds.add(id);
195
140
  });
196
- }
197
- }
198
- if (enableUserProp) {
199
- list.push({
200
- isEvent: false,
201
- groupName: "".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u5C5E\u6027"),
202
- key: 'userProps',
203
- anchor: anchor.user,
204
- children: (extraUser ? extraUser : []).concat(userPropList.filter(function (item) {
205
- return realTimeTags ? item.category === 'custom' : true;
206
- }))
207
141
  });
208
142
  }
209
- if (enableEnvProp) {
210
- list.push({
211
- isEvent: false,
212
- groupName: '触发环境',
213
- key: 'eventEnvProps',
214
- anchor: anchor.env,
215
- children: eventEnvList
216
- });
143
+ if (allEventIds.size === 0) {
144
+ setEventAttrsList([]);
145
+ return;
217
146
  }
218
- setOptionList(list);
219
- }, [anchor, eventIdMap, userPropList, eventEnvList, eventIdList, props.showCommonProp]);
147
+ var prefetchEventAttrs = /*#__PURE__*/function () {
148
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
149
+ var allAttrs, _i, _Array$from, eventId, attrs, _t;
150
+ return _regenerator().w(function (_context) {
151
+ while (1) switch (_context.n) {
152
+ case 0:
153
+ allAttrs = [];
154
+ _i = 0, _Array$from = Array.from(allEventIds);
155
+ case 1:
156
+ if (!(_i < _Array$from.length)) {
157
+ _context.n = 6;
158
+ break;
159
+ }
160
+ eventId = _Array$from[_i];
161
+ _context.p = 2;
162
+ _context.n = 3;
163
+ return eventApi.fetchEventAttrs(eventId, currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId);
164
+ case 3:
165
+ attrs = _context.v;
166
+ allAttrs.push.apply(allAttrs, _toConsumableArray(attrs));
167
+ _context.n = 5;
168
+ break;
169
+ case 4:
170
+ _context.p = 4;
171
+ _t = _context.v;
172
+ console.error("\u9884\u53D6\u4E8B\u4EF6 ".concat(eventId, " \u7684\u5C5E\u6027\u5931\u8D25"), _t);
173
+ case 5:
174
+ _i++;
175
+ _context.n = 1;
176
+ break;
177
+ case 6:
178
+ setEventAttrsList(allAttrs);
179
+ case 7:
180
+ return _context.a(2);
181
+ }
182
+ }, _callee, null, [[2, 4]]);
183
+ }));
184
+ return function prefetchEventAttrs() {
185
+ return _ref.apply(this, arguments);
186
+ };
187
+ }();
188
+ prefetchEventAttrs();
189
+ }, [eventIdList === null || eventIdList === void 0 ? void 0 : eventIdList.join(','), JSON.stringify(funnelEventIdList)]);
190
+ useEffect(function () {
191
+ var initOptionList = /*#__PURE__*/function () {
192
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
193
+ var list, group, propMap, hasAnchor, eventAttrsMap, _iterator, _step, _loop3, _loop, step, _t3;
194
+ return _regenerator().w(function (_context5) {
195
+ while (1) switch (_context5.n) {
196
+ case 0:
197
+ list = [];
198
+ if (extra) {
199
+ extra.forEach(function (item) {
200
+ list.push({
201
+ isEvent: false,
202
+ groupName: item.name,
203
+ key: item.type,
204
+ anchor: anchor[item.type],
205
+ children: item.attrList
206
+ });
207
+ });
208
+ }
209
+ if (!enableEventProp) {
210
+ _context5.n = 11;
211
+ break;
212
+ }
213
+ if (!props.showCommonProp) {
214
+ _context5.n = 1;
215
+ break;
216
+ }
217
+ group = {
218
+ isEvent: true,
219
+ groupName: '共有属性',
220
+ key: "event-common",
221
+ children: [],
222
+ anchor: anchor.event
223
+ };
224
+ propMap = {};
225
+ eventAttrsList.forEach(function (attr) {
226
+ var name = attr.alias || attr.label;
227
+ if (!propMap[name]) {
228
+ propMap[name] = _.cloneDeep(attr);
229
+ } else {
230
+ group.children.push(propMap[name]);
231
+ }
232
+ });
233
+ if (group.children.length) list.push(group);
234
+ _context5.n = 11;
235
+ break;
236
+ case 1:
237
+ hasAnchor = false;
238
+ eventAttrsMap = {};
239
+ eventAttrsList.forEach(function (attr) {
240
+ if (!eventAttrsMap[attr.eventId]) {
241
+ eventAttrsMap[attr.eventId] = [];
242
+ }
243
+ eventAttrsMap[attr.eventId].push(attr);
244
+ });
245
+ _iterator = _createForOfIteratorHelper(eventIdList || []);
246
+ _context5.p = 2;
247
+ _loop3 = /*#__PURE__*/_regenerator().m(function _loop3() {
248
+ var eventId, eventName, eventAttrs, filteredAttrs, _group2;
249
+ return _regenerator().w(function (_context4) {
250
+ while (1) switch (_context4.n) {
251
+ case 0:
252
+ eventId = _step.value;
253
+ try {
254
+ eventName = function () {
255
+ var eventList = (eventGroupList || []).reduce(function (pre, group) {
256
+ return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
257
+ }, []);
258
+ var event = eventList.find(function (e) {
259
+ return e.id === eventId;
260
+ });
261
+ return event ? event.alias || event.name : "\u4E8B\u4EF6".concat(eventId);
262
+ }();
263
+ eventAttrs = eventAttrsMap[eventId] || [];
264
+ filteredAttrs = eventAttrs.filter(function (item) {
265
+ return isHideYeWu || realTimeTags ? item.id !== 31415926 : true;
266
+ }).filter(function (item) {
267
+ return isStrNum ? item.type === 2 || item.type === 1 : isNumber ? item.type === 2 : isString ? item.type === 1 : true;
268
+ });
269
+ if (filteredAttrs.length > 0) {
270
+ _group2 = {
271
+ isEvent: true,
272
+ groupName: eventName,
273
+ anchor: hasAnchor ? String(Math.random()) : anchor.event,
274
+ key: "event-".concat(id),
275
+ children: filteredAttrs
276
+ };
277
+ list.push(_group2);
278
+ hasAnchor = true;
279
+ }
280
+ } catch (error) {
281
+ console.error("\u83B7\u53D6\u4E8B\u4EF6 ".concat(id, " \u7684\u5C5E\u6027\u5931\u8D25"), error);
282
+ }
283
+ case 1:
284
+ return _context4.a(2);
285
+ }
286
+ }, _loop3);
287
+ });
288
+ _iterator.s();
289
+ case 3:
290
+ if ((_step = _iterator.n()).done) {
291
+ _context5.n = 5;
292
+ break;
293
+ }
294
+ return _context5.d(_regeneratorValues(_loop3()), 4);
295
+ case 4:
296
+ _context5.n = 3;
297
+ break;
298
+ case 5:
299
+ _context5.n = 7;
300
+ break;
301
+ case 6:
302
+ _context5.p = 6;
303
+ _t3 = _context5.v;
304
+ _iterator.e(_t3);
305
+ case 7:
306
+ _context5.p = 7;
307
+ _iterator.f();
308
+ return _context5.f(7);
309
+ case 8:
310
+ if (!funnelEventIdList) {
311
+ _context5.n = 11;
312
+ break;
313
+ }
314
+ _loop = /*#__PURE__*/_regenerator().m(function _loop(step) {
315
+ var idList, _iterator2, _step2, _loop2, _t2;
316
+ return _regenerator().w(function (_context3) {
317
+ while (1) switch (_context3.n) {
318
+ case 0:
319
+ idList = funnelEventIdList[step];
320
+ _iterator2 = _createForOfIteratorHelper(idList);
321
+ _context3.p = 1;
322
+ _loop2 = /*#__PURE__*/_regenerator().m(function _loop2() {
323
+ var eventId, eventName, eventAttrs, _group;
324
+ return _regenerator().w(function (_context2) {
325
+ while (1) switch (_context2.n) {
326
+ case 0:
327
+ eventId = _step2.value;
328
+ try {
329
+ eventName = function () {
330
+ var eventList = (eventGroupList || []).reduce(function (pre, group) {
331
+ return [].concat(_toConsumableArray(pre), _toConsumableArray(group.eventList));
332
+ }, []);
333
+ var event = eventList.find(function (e) {
334
+ return e.id === eventId;
335
+ });
336
+ return event ? event.alias || event.name : "\u4E8B\u4EF6".concat(eventId);
337
+ }();
338
+ eventAttrs = eventAttrsMap[eventId] || [];
339
+ _group = {
340
+ isEvent: true,
341
+ groupName: eventName,
342
+ anchor: hasAnchor ? String(Math.random()) : anchor.event,
343
+ key: "event-".concat(eventId, "-").concat(step),
344
+ children: eventAttrs.map(function (attr) {
345
+ var res = _.cloneDeep(attr);
346
+ res.step = step;
347
+ return res;
348
+ })
349
+ };
350
+ list.push(_group);
351
+ hasAnchor = true;
352
+ } catch (error) {
353
+ console.error("\u83B7\u53D6\u6F0F\u6597\u4E8B\u4EF6 ".concat(id, " \u7684\u5C5E\u6027\u5931\u8D25"), error);
354
+ }
355
+ case 1:
356
+ return _context2.a(2);
357
+ }
358
+ }, _loop2);
359
+ });
360
+ _iterator2.s();
361
+ case 2:
362
+ if ((_step2 = _iterator2.n()).done) {
363
+ _context3.n = 4;
364
+ break;
365
+ }
366
+ return _context3.d(_regeneratorValues(_loop2()), 3);
367
+ case 3:
368
+ _context3.n = 2;
369
+ break;
370
+ case 4:
371
+ _context3.n = 6;
372
+ break;
373
+ case 5:
374
+ _context3.p = 5;
375
+ _t2 = _context3.v;
376
+ _iterator2.e(_t2);
377
+ case 6:
378
+ _context3.p = 6;
379
+ _iterator2.f();
380
+ return _context3.f(6);
381
+ case 7:
382
+ return _context3.a(2);
383
+ }
384
+ }, _loop, null, [[1, 5, 6, 7]]);
385
+ });
386
+ step = 0;
387
+ case 9:
388
+ if (!(step < funnelEventIdList.length)) {
389
+ _context5.n = 11;
390
+ break;
391
+ }
392
+ return _context5.d(_regeneratorValues(_loop(step)), 10);
393
+ case 10:
394
+ step++;
395
+ _context5.n = 9;
396
+ break;
397
+ case 11:
398
+ if (enableUserProp) {
399
+ list.push({
400
+ isEvent: false,
401
+ groupName: "".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u5C5E\u6027"),
402
+ key: 'userProps',
403
+ anchor: anchor.user,
404
+ children: (extraUser ? extraUser : []).concat(userPropList.filter(function (item) {
405
+ return realTimeTags ? item.category === 'custom' : true;
406
+ }))
407
+ });
408
+ }
409
+ if (enableEnvProp) {
410
+ list.push({
411
+ isEvent: false,
412
+ groupName: '触发环境',
413
+ key: 'eventEnvProps',
414
+ anchor: anchor.env,
415
+ children: eventEnvList
416
+ });
417
+ }
418
+ setOptionList(list);
419
+ case 12:
420
+ return _context5.a(2);
421
+ }
422
+ }, _callee2, null, [[2, 6, 7, 8]]);
423
+ }));
424
+ return function initOptionList() {
425
+ return _ref2.apply(this, arguments);
426
+ };
427
+ }();
428
+ initOptionList();
429
+ }, [anchor, eventGroupList, userPropList, eventEnvList, props.showCommonProp, enableEventProp, enableUserProp, enableEnvProp, extra, extraUser, isHideYeWu, realTimeTags, isNumber, isStrNum, isString, eventAttrsList]);
220
430
  useEffect(function () {
221
431
  setCurrentAttr(props.value);
222
432
  }, [props.value]);
@@ -235,7 +445,7 @@ var AttrListPanel = function AttrListPanel(props) {
235
445
  });
236
446
  var childList = [];
237
447
  group.children.forEach(function (option) {
238
- if (searchValue && !new RegExp(_.escapeRegExp(searchValue), 'i').test((option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label))) return;
448
+ if (searchValue && !(new RegExp(_.escapeRegExp(searchValue), 'i').test(option === null || option === void 0 ? void 0 : option.alias) || new RegExp(_.escapeRegExp(searchValue), 'i').test(option === null || option === void 0 ? void 0 : option.label))) return;
239
449
  var disabled = false;
240
450
  disableItemlist === null || disableItemlist === void 0 ? void 0 : disableItemlist.forEach(function (item) {
241
451
  if (item.key === option.key) disabled = true;
@@ -260,6 +470,7 @@ var AttrListPanel = function AttrListPanel(props) {
260
470
  list = list.concat(childList);
261
471
  }
262
472
  });
473
+ console.log(optionList, list, anchor, anchorList, 'anchorListanchorListanchorList');
263
474
  return list;
264
475
  }();
265
476
  if (!showList.length && !searchValue) return /*#__PURE__*/React.createElement("div", {
@@ -272,7 +483,7 @@ var AttrListPanel = function AttrListPanel(props) {
272
483
  return setSearchValue(val);
273
484
  },
274
485
  placeholder: "\u641C\u7D22\u5C5E\u6027"
275
- }), showList.length ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
486
+ }), /*#__PURE__*/React.createElement("div", null, anchor.container), showList.length ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
276
487
  className: "".concat(classPrefix, "-anchor-panel"),
277
488
  affix: false,
278
489
  onClick: function onClick(e) {
@@ -40,6 +40,7 @@ export interface EventGroup {
40
40
  export interface BasicProp {
41
41
  id?: number;
42
42
  label?: string;
43
+ encryptionType: number;
43
44
  alias?: string;
44
45
  type?: PropType;
45
46
  realTime?: boolean;
@@ -31,6 +31,7 @@ export default function convertAttributeData(store) {
31
31
  propCategory: 'eventProp',
32
32
  type: item.prop_type,
33
33
  realTime: true,
34
+ encryptionType: item.encryption_type,
34
35
  dimensionSub: item.dimension_sub || 'event_attr'
35
36
  };
36
37
  }),
@@ -66,6 +67,7 @@ export default function convertAttributeData(store) {
66
67
  propCategory: 'envProp',
67
68
  type: prop.type,
68
69
  realTime: true,
70
+ encryptionType: prop.encryption_type,
69
71
  dimensionSub: prop.dimension_sub || prop.name
70
72
  };
71
73
  });
@@ -82,6 +84,7 @@ export default function convertAttributeData(store) {
82
84
  type: prop.type,
83
85
  subtype: prop.subtype,
84
86
  realTime: prop.category === 'custom',
87
+ encryptionType: prop.encryption_type,
85
88
  dimensionSub: prop.dimension_sub || prop.name
86
89
  };
87
90
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.71-hxd.30",
3
+ "version": "1.2.71-hxd.33",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "f619d8e9acb810bf34cdfb16220eb76f0979325d",
58
+ "gitHead": "2ce79f5e8a302f8537678057aec9fc452a5a3210",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }