@zgfe/business-lib 1.1.34-visual.9 → 1.1.35-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/es/addToPanel/index.js +7 -1
  2. package/es/addToScene/index.js +1 -1
  3. package/es/assets/iconfont/demo_index.html +118 -3
  4. package/es/assets/iconfont/iconfont.css +23 -3
  5. package/es/assets/iconfont/iconfont.js +1 -1
  6. package/es/assets/iconfont/iconfont.json +35 -0
  7. package/es/assets/iconfont/iconfont.ttf +0 -0
  8. package/es/assets/iconfont/iconfont.woff +0 -0
  9. package/es/assets/iconfont/iconfont.woff2 +0 -0
  10. package/es/assets/theme.js +1 -2
  11. package/es/attrConditions/components/valuesList.js +1 -0
  12. package/es/attrConditions/demo/group.js +2 -3
  13. package/es/attrConditions/index.d.ts +1 -3
  14. package/es/attrConditions/index.js +19 -23
  15. package/es/attrConditions/types.d.ts +1 -1
  16. package/es/attributeSelector/index.js +10 -8
  17. package/es/attributeSelector/types.d.ts +2 -2
  18. package/es/attributeSelector/util.js +1 -5
  19. package/es/chart/util/formatOption.js +1 -1
  20. package/es/constants/common.d.ts +11 -0
  21. package/es/constants/common.js +35 -0
  22. package/es/context/index.d.ts +1 -3
  23. package/es/cycleTime/month.js +17 -15
  24. package/es/demoWrapper/content.js +0 -2
  25. package/es/eventSelector/demo/index.js +1 -0
  26. package/es/eventSelector/index.js +15 -10
  27. package/es/eventSelector/listPanel.js +22 -3
  28. package/es/eventSelector/types.d.ts +2 -0
  29. package/es/select/handle.js +6 -2
  30. package/es/select/index.js +13 -11
  31. package/es/socket/index.d.ts +2 -3
  32. package/es/socket/index.js +4 -12
  33. package/es/targetConditionGroup/components/targetDimension.js +29 -27
  34. package/es/targetConditionGroup/data/operates.js +0 -3
  35. package/es/targetConditionGroup/demo/index.js +2 -1
  36. package/es/targetConditionGroup/index.js +65 -34
  37. package/es/targetConditionGroup/types.d.ts +1 -0
  38. package/es/targetSelector/index.js +9 -7
  39. package/es/userTagsSelector/index.js +5 -3
  40. package/package.json +2 -2
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import { AttributeSelect } from '../attributeSelector/types';
3
2
  import './styles/index.less';
4
- import { AttrConditionTypes, OperateTypes } from './types';
3
+ import { AttrConditionTypes } from './types';
5
4
  export declare const classPrefix = "biz-condition-item";
6
- export declare function getCondition(attr: AttributeSelect.Value, operate: OperateTypes, values: string[]): AttrConditionTypes.ItemValue | undefined;
7
5
  declare const BizConditionItem: React.FC<AttrConditionTypes.ItemProp>;
8
6
  export default BizConditionItem;
@@ -12,28 +12,6 @@ import BizOperateList from './components/operateList';
12
12
  import ValuesList from './components/valuesList';
13
13
  import { Skeleton } from 'antd';
14
14
  export var classPrefix = 'biz-condition-item';
15
- export function getCondition(attr, operate, values) {
16
- if (!attr) return;
17
- var responseData = {
18
- attrId: attr.id,
19
- propCategory: attr.propCategory,
20
- type: attr.type,
21
- operator: operate,
22
- values: values || [],
23
- dimensionSub: attr.dimensionSub,
24
- label: attr.label
25
- };
26
- if (attr.propCategory === PropCategory.EventProp) {
27
- responseData.attrName = attr.label;
28
- } else {
29
- responseData.attrName = attr.name;
30
- responseData.category = attr.category;
31
- if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
32
- responseData.subtype = attr.subtype;
33
- }
34
- }
35
- return responseData;
36
- }
37
15
  var BizConditionItem = function BizConditionItem(props) {
38
16
  var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
39
17
  var defaultValue = props.defaultValue,
@@ -101,7 +79,25 @@ var BizConditionItem = function BizConditionItem(props) {
101
79
  useEffect(function () {
102
80
  if (props.onChange) {
103
81
  if (!attr) return;
104
- props.onChange(getCondition(attr, operate, values));
82
+ var responseData = {
83
+ attrId: attr.id,
84
+ propCategory: attr.propCategory,
85
+ type: attr.type,
86
+ operator: operate,
87
+ values: values || [],
88
+ dimensionSub: attr.dimensionSub,
89
+ label: attr.alias || attr.label
90
+ };
91
+ if (attr.propCategory === PropCategory.EventProp) {
92
+ responseData.attrName = attr.label;
93
+ } else {
94
+ responseData.attrName = attr.name;
95
+ responseData.category = attr.category;
96
+ if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
97
+ responseData.subtype = attr.subtype;
98
+ }
99
+ }
100
+ props.onChange(responseData);
105
101
  }
106
102
  }, [attr, operate, values]);
107
103
  var onChangeAttr = function onChangeAttr(attrData) {
@@ -18,7 +18,7 @@ export declare namespace AttrConditionTypes {
18
18
  propCategory?: 'userProp' | 'eventProp' | 'envProp';
19
19
  category?: 'fixed' | 'custom';
20
20
  dimensionSub?: string;
21
- operator?: OperateTypes;
21
+ operator?: string;
22
22
  values?: string[];
23
23
  }
24
24
  interface GroupValue {
@@ -87,19 +87,21 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
87
87
  }, /*#__PURE__*/React.createElement("div", {
88
88
  className: "".concat(classPrefix, "-handle")
89
89
  }, /*#__PURE__*/React.createElement(Dropdown, {
90
- overlay: /*#__PURE__*/React.createElement(AttrListPanel, _objectSpread(_objectSpread({
91
- id: id
92
- }, props), {}, {
93
- value: currentAttr,
94
- onChange: onChange
95
- })),
90
+ dropdownRender: function dropdownRender() {
91
+ return /*#__PURE__*/React.createElement(AttrListPanel, _objectSpread(_objectSpread({
92
+ id: id
93
+ }, props), {}, {
94
+ value: currentAttr,
95
+ onChange: onChange
96
+ }));
97
+ },
96
98
  trigger: ['click'],
97
99
  overlayStyle: {
98
100
  minWidth: 284,
99
101
  width: width
100
102
  },
101
- visible: visible,
102
- onVisibleChange: onVisibleChange,
103
+ open: visible,
104
+ onOpenChange: onVisibleChange,
103
105
  destroyPopupOnHide: props.destroyPopupOnHide
104
106
  }, /*#__PURE__*/React.createElement("div", {
105
107
  style: {
@@ -24,6 +24,8 @@ export interface AnalysisEvent {
24
24
  isOverview?: boolean;
25
25
  eventHidden?: ShowStatus;
26
26
  marked?: boolean;
27
+ isBuiltIn?: boolean;
28
+ type?: string;
27
29
  }
28
30
  export interface EventGroup {
29
31
  id: number;
@@ -61,8 +63,6 @@ export interface PropGroups {
61
63
  eventGroupList?: EventGroup[];
62
64
  userPropList?: UserProp[];
63
65
  envPropList?: EnvProp[];
64
- eventNameMap?: Record<string, AnalysisEvent>;
65
- eventIdMap?: Record<number, AnalysisEvent>;
66
66
  }
67
67
  export declare namespace AttributeSelect {
68
68
  type Value = EventProp | UserProp | EnvProp | null;
@@ -3,9 +3,7 @@ export default function convertAttributeData(store) {
3
3
  var res = {
4
4
  envPropList: [],
5
5
  eventGroupList: [],
6
- userPropList: [],
7
- eventNameMap: {},
8
- eventIdMap: {}
6
+ userPropList: []
9
7
  };
10
8
  (_store$eventList = store.eventList) === null || _store$eventList === void 0 ? void 0 : _store$eventList.forEach(function (group_) {
11
9
  var _res$eventGroupList;
@@ -41,8 +39,6 @@ export default function convertAttributeData(store) {
41
39
  eventHidden: e.event_hidden,
42
40
  marked: Boolean(e.mark_type)
43
41
  };
44
- res.eventNameMap[event.name] = event;
45
- res.eventIdMap[event.id] = event;
46
42
  if (event.marked) {
47
43
  markList.push(event);
48
44
  } else {
@@ -21,7 +21,7 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params) {
21
21
  } else {
22
22
  lineLabel = util.toThousands(lineLabel);
23
23
  }
24
- var name = (params.length > 1 ? item.seriesName : item.data && item.data.label ? item.data.label : item.name).trim();
24
+ var name = item.seriesName.trim();
25
25
  htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"biz-tooltip-marker\" style=\"background:".concat(item.color, "\"></span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
26
26
  });
27
27
  return htmlArray.join('');
@@ -0,0 +1,11 @@
1
+ export declare const BuiltinIndicators: {
2
+ id: number;
3
+ name: string;
4
+ eventList: {
5
+ name: string;
6
+ id: number;
7
+ type: string;
8
+ isBuiltIn: boolean;
9
+ attrList: never[];
10
+ }[];
11
+ };
@@ -0,0 +1,35 @@
1
+ export var BuiltinIndicators = {
2
+ id: -2,
3
+ name: '整体',
4
+ eventList: [{
5
+ name: '新增用户',
6
+ id: -201,
7
+ type: 'add',
8
+ isBuiltIn: true,
9
+ attrList: []
10
+ }, {
11
+ name: '活跃用户',
12
+ id: -202,
13
+ type: 'active',
14
+ isBuiltIn: true,
15
+ attrList: []
16
+ }, {
17
+ name: '访问次数',
18
+ id: -203,
19
+ type: 'times',
20
+ isBuiltIn: true,
21
+ attrList: []
22
+ }, {
23
+ name: '平均使用时长',
24
+ id: -204,
25
+ type: 'duration_avg',
26
+ isBuiltIn: true,
27
+ attrList: []
28
+ }, {
29
+ name: '使用时长分布',
30
+ id: -205,
31
+ type: 'duration',
32
+ isBuiltIn: true,
33
+ attrList: []
34
+ }]
35
+ };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { EventGroup, UserProp, EnvProp, AnalysisEvent } from '../attributeSelector/types';
2
+ import { EventGroup, UserProp, EnvProp } from '../attributeSelector/types';
3
3
  export interface AppInfoProps {
4
4
  appId?: string | number;
5
5
  platform?: string | number;
@@ -24,8 +24,6 @@ export interface Menu {
24
24
  export interface GlobalContextProps {
25
25
  userGroupList?: Array<any>;
26
26
  eventGroupList?: EventGroup[];
27
- eventNameMap?: Record<string, AnalysisEvent>;
28
- eventIdMap?: Record<number, AnalysisEvent>;
29
27
  userPropList?: UserProp[];
30
28
  eventEnvList?: EnvProp[];
31
29
  menuNameMap?: {
@@ -69,21 +69,23 @@ var MonthDay = function MonthDay(props) {
69
69
  }
70
70
  return /*#__PURE__*/React.createElement(Dropdown, {
71
71
  disabled: disable,
72
- overlay: /*#__PURE__*/React.createElement("div", {
73
- className: "".concat(classPrefix, "-overlay")
74
- }, dayList.map(function (item) {
75
- return /*#__PURE__*/React.createElement("span", {
76
- key: item.value,
77
- className: "".concat(classPrefix, "-day ").concat(chosenDayList.map(function (v) {
78
- return v.value;
79
- }).indexOf(item.value) > -1 ? 'active' : '', " ").concat(item.value === 32 ? 'lastday' : ''),
80
- onClick: function onClick() {
81
- onClickMonthDay(item.value);
82
- }
83
- }, item.label);
84
- })),
85
- visible: visible,
86
- onVisibleChange: setVisible,
72
+ dropdownRender: function dropdownRender() {
73
+ return /*#__PURE__*/React.createElement("div", {
74
+ className: "".concat(classPrefix, "-overlay")
75
+ }, dayList.map(function (item) {
76
+ return /*#__PURE__*/React.createElement("span", {
77
+ key: item.value,
78
+ className: "".concat(classPrefix, "-day ").concat(chosenDayList.map(function (v) {
79
+ return v.value;
80
+ }).indexOf(item.value) > -1 ? 'active' : '', " ").concat(item.value === 32 ? 'lastday' : ''),
81
+ onClick: function onClick() {
82
+ onClickMonthDay(item.value);
83
+ }
84
+ }, item.label);
85
+ }));
86
+ },
87
+ open: visible,
88
+ onOpenChange: setVisible,
87
89
  trigger: ['click']
88
90
  }, /*#__PURE__*/React.createElement("div", {
89
91
  className: "".concat(classPrefix, "-wrapper")
@@ -175,8 +175,6 @@ var DemoContent = function DemoContent(_ref3) {
175
175
  eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
176
176
  userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
177
177
  eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
178
- eventIdMap: store === null || store === void 0 ? void 0 : store.eventIdMap,
179
- eventNameMap: store === null || store === void 0 ? void 0 : store.eventNameMap,
180
178
  userGroupList: userGroups
181
179
  }
182
180
  }, children));
@@ -39,6 +39,7 @@ var EventDemo = function EventDemo() {
39
39
  eventGroupList: store.eventGroupList
40
40
  }
41
41
  }, /*#__PURE__*/React.createElement(BizEventSelector, {
42
+ showBuiltInTarget: true,
42
43
  defaultValue: value,
43
44
  alias: "\u522B\u540D",
44
45
  onChange: onChange
@@ -10,6 +10,7 @@ import SelectHandle from '../select/handle';
10
10
  import BizGlobalDataContext from '../context';
11
11
  import EventListPanel from './listPanel';
12
12
  import './styles/index.less';
13
+ import { BuiltinIndicators } from '../constants/common';
13
14
  export var classPrefix = 'biz-event-select';
14
15
  var BizEventSelector = function BizEventSelector(props) {
15
16
  var alias = props.alias,
@@ -42,13 +43,14 @@ var BizEventSelector = function BizEventSelector(props) {
42
43
  var getValue = function getValue(param) {
43
44
  var _param$group, _param$event;
44
45
  var res = {};
46
+ var allEvents = props.showBuiltInTarget ? eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.concat(BuiltinIndicators) : eventGroupList;
45
47
  if (!((_param$group = param.group) === null || _param$group === void 0 ? void 0 : _param$group.id)) {
46
48
  res.group = {
47
49
  id: 0,
48
50
  name: '所有分组',
49
51
  eventList: function () {
50
52
  var list = [];
51
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
53
+ allEvents === null || allEvents === void 0 ? void 0 : allEvents.forEach(function (group) {
52
54
  list = list.concat(group.eventList);
53
55
  });
54
56
  return list;
@@ -62,7 +64,7 @@ var BizEventSelector = function BizEventSelector(props) {
62
64
  attrList: []
63
65
  };
64
66
  }
65
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
67
+ allEvents === null || allEvents === void 0 ? void 0 : allEvents.forEach(function (group) {
66
68
  var _param$group2;
67
69
  if (group.id === ((_param$group2 = param.group) === null || _param$group2 === void 0 ? void 0 : _param$group2.id)) res.group = group;
68
70
  group.eventList.forEach(function (event) {
@@ -100,19 +102,22 @@ var BizEventSelector = function BizEventSelector(props) {
100
102
  return /*#__PURE__*/React.createElement("div", {
101
103
  className: [classPrefix, border ? 'border' : ''].join(' ')
102
104
  }, /*#__PURE__*/React.createElement(Dropdown, {
103
- overlay: /*#__PURE__*/React.createElement(EventListPanel, {
104
- value: currentValue,
105
- onChange: onChange,
106
- showOverview: showAllEvent,
107
- defaultSelectAble: defaultSelectAble
108
- }),
105
+ dropdownRender: function dropdownRender() {
106
+ return /*#__PURE__*/React.createElement(EventListPanel, {
107
+ value: currentValue,
108
+ onChange: onChange,
109
+ showOverview: showAllEvent,
110
+ showBuiltInTarget: props.showBuiltInTarget,
111
+ defaultSelectAble: defaultSelectAble
112
+ });
113
+ },
109
114
  trigger: ['click'],
110
115
  overlayStyle: {
111
116
  minWidth: 0,
112
117
  paddingLeft: 8
113
118
  },
114
- visible: visible,
115
- onVisibleChange: onVisibleChange,
119
+ open: visible,
120
+ onOpenChange: onVisibleChange,
116
121
  getPopupContainer: props.popupContainer ? function () {
117
122
  return document.getElementById(selectId);
118
123
  } : undefined,
@@ -15,6 +15,7 @@ import InfiniteScroll from 'react-infinite-scroll-component';
15
15
  import { classPrefix } from '.';
16
16
  import { BizGlobalDataContext } from '..';
17
17
  import { ShowStatus } from '../attributeSelector/types';
18
+ import { BuiltinIndicators } from '../constants/common';
18
19
  import BizSearchInput from '../searchInput';
19
20
  import EventListOption from './option';
20
21
  var EventListPanel = function EventListPanel(props) {
@@ -68,15 +69,33 @@ var EventListPanel = function EventListPanel(props) {
68
69
  }
69
70
  });
70
71
  });
71
- list = [].concat(markList, _toConsumableArray(list));
72
+ list = props.showBuiltInTarget ? [].concat(_toConsumableArray(BuiltinIndicators.eventList), markList, _toConsumableArray(list)) : [].concat(markList, _toConsumableArray(list));
72
73
  return list;
73
74
  }(),
74
75
  name: '所有分组'
75
76
  };
76
77
  setGroupList(function (list) {
77
- return [group].concat(_toConsumableArray(list));
78
+ return props.showBuiltInTarget ? [group, BuiltinIndicators].concat(_toConsumableArray(list)) : [group].concat(_toConsumableArray(list));
79
+ });
80
+ setCurrentGroup(function () {
81
+ var _props$value;
82
+ if (props.defaultSelectAble && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.group)) {
83
+ if (props.showBuiltInTarget && props.value.group.id === -2) {
84
+ return BuiltinIndicators;
85
+ } else {
86
+ var _currentGroup = group;
87
+ eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (eGroup) {
88
+ var _props$value2, _props$value2$group;
89
+ if (eGroup.id === ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : (_props$value2$group = _props$value2.group) === null || _props$value2$group === void 0 ? void 0 : _props$value2$group.id)) {
90
+ _currentGroup = eGroup;
91
+ return;
92
+ }
93
+ });
94
+ return _currentGroup;
95
+ }
96
+ }
97
+ return group;
78
98
  });
79
- setCurrentGroup(group);
80
99
  }, []);
81
100
  useEffect(function () {
82
101
  setCurrentValue(props.value);
@@ -23,6 +23,7 @@ export declare namespace EventSelectTypes {
23
23
  showAllEvent?: boolean;
24
24
  defaultSelectAble?: boolean;
25
25
  popupContainer?: boolean;
26
+ showBuiltInTarget?: boolean;
26
27
  onVisibleChange?: (visible: boolean) => void;
27
28
  border?: boolean;
28
29
  theme?: string;
@@ -33,6 +34,7 @@ export declare namespace EventSelectTypes {
33
34
  interface DropdownProps {
34
35
  value?: Value;
35
36
  showOverview?: boolean;
37
+ showBuiltInTarget?: boolean;
36
38
  defaultSelectAble?: boolean;
37
39
  onChange?: (value: Value, isOverview?: boolean) => void;
38
40
  }
@@ -67,7 +67,11 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
67
67
  }
68
68
  }, [focus]);
69
69
  var searchInputWidth = useMemo(function () {
70
- return textRef.current && searchValue ? textRef.current.offsetWidth : 3;
70
+ if (textRef.current && searchValue) {
71
+ textRef.current.innerText = searchValue;
72
+ return textRef.current.offsetWidth;
73
+ }
74
+ return 3;
71
75
  }, [searchValue]);
72
76
  var onDelete = function onDelete(data) {
73
77
  if (props.onDelete) props.onDelete(data);
@@ -122,7 +126,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
122
126
  }), /*#__PURE__*/React.createElement("span", {
123
127
  className: "".concat(classPrefix, "-temp"),
124
128
  ref: textRef
125
- }, searchValue));
129
+ }));
126
130
  }
127
131
  return /*#__PURE__*/React.createElement("div", {
128
132
  ref: handleRef,
@@ -146,15 +146,17 @@ var BizSelect = function BizSelect(props) {
146
146
  setVisible(true);
147
147
  };
148
148
  return /*#__PURE__*/React.createElement(Dropdown, {
149
- overlay: /*#__PURE__*/React.createElement(SelectOverlay, _objectSpread(_objectSpread({}, res), {}, {
150
- value: current,
151
- labelField: labelField,
152
- keyField: keyField,
153
- searchValue: searchValue,
154
- onChange: onChange,
155
- ref: overlayRef,
156
- searchPlaceholder: props.searchPlaceholder
157
- })),
149
+ dropdownRender: function dropdownRender() {
150
+ return /*#__PURE__*/React.createElement(SelectOverlay, _objectSpread(_objectSpread({}, res), {}, {
151
+ value: current,
152
+ labelField: labelField,
153
+ keyField: keyField,
154
+ searchValue: searchValue,
155
+ onChange: onChange,
156
+ ref: overlayRef,
157
+ searchPlaceholder: props.searchPlaceholder
158
+ }));
159
+ },
158
160
  disabled: props.disable,
159
161
  destroyPopupOnHide: props.destroyPopupOnHide,
160
162
  overlayStyle: {
@@ -165,8 +167,8 @@ var BizSelect = function BizSelect(props) {
165
167
  getPopupContainer: props.popupContainer ? function () {
166
168
  return document.getElementById(selectId);
167
169
  } : undefined,
168
- visible: visible,
169
- onVisibleChange: onVisibleChange
170
+ open: visible,
171
+ onOpenChange: onVisibleChange
170
172
  }, /*#__PURE__*/React.createElement("div", {
171
173
  className: "".concat(classPrefix, "-handle ").concat(props.className ? props.className : ''),
172
174
  ref: selectRef,
@@ -8,12 +8,11 @@ declare class SocketClient {
8
8
  private showLog;
9
9
  private pingTimer?;
10
10
  private appkey?;
11
- private token?;
12
11
  constructor(url: string, appkey: string, params?: Record<string, any>);
13
12
  emit(event: string, payload?: SocketClientTypes.Message['data']['payload']): void;
14
13
  on<T>(type: SocketClientTypes.EventType | string, handle: (data?: T) => void): void;
15
- onConnected(handle: (data?: any) => void): void;
16
- onDisconnected(handle: (data?: any) => void): void;
14
+ onConnected(handle: () => void): void;
15
+ onDisconnected(handle: () => void): void;
17
16
  onError(handle: (data?: Error) => void): void;
18
17
  private _onError;
19
18
  private _onClose;
@@ -29,7 +29,6 @@ var SocketClient = /*#__PURE__*/function () {
29
29
  this.showLog = false;
30
30
  this.pingTimer = void 0;
31
31
  this.appkey = void 0;
32
- this.token = void 0;
33
32
  this.appkey = appkey;
34
33
  this.url = url;
35
34
  this.params = params;
@@ -123,7 +122,7 @@ var SocketClient = /*#__PURE__*/function () {
123
122
  _this = this;
124
123
  this.log('info', 'socket连接成功', event);
125
124
  (_this$listeners$conne = this.listeners['connected']) === null || _this$listeners$conne === void 0 ? void 0 : _this$listeners$conne.forEach(function (handle) {
126
- handle.call(undefined, _this.token);
125
+ handle.call(undefined);
127
126
  });
128
127
  this.log('info', 'clear catch', this.catch);
129
128
  this.catch.forEach(function (_ref) {
@@ -138,7 +137,7 @@ var SocketClient = /*#__PURE__*/function () {
138
137
  }, {
139
138
  key: "onMessage",
140
139
  value: function onMessage(event) {
141
- var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3, _this$listeners$unkno;
140
+ var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3;
142
141
  var res = JSON.parse(event.data);
143
142
  if (res.code) {
144
143
  switch (Number(res.code)) {
@@ -159,10 +158,6 @@ var SocketClient = /*#__PURE__*/function () {
159
158
  break;
160
159
  case SocketClientTypes.ResponseCode.paramError:
161
160
  this._onError(new Error('参数缺失或错误'));
162
- default:
163
- (_this$listeners$unkno = this.listeners['unknownCode']) === null || _this$listeners$unkno === void 0 ? void 0 : _this$listeners$unkno.forEach(function (handle) {
164
- handle.call(undefined, res);
165
- });
166
161
  }
167
162
  } else if (res.type === SocketClientTypes.RequestType.pong) {
168
163
  return;
@@ -196,8 +191,7 @@ var SocketClient = /*#__PURE__*/function () {
196
191
  value: function removeListener(event, handle) {
197
192
  var _this3 = this;
198
193
  if (handle) {
199
- var _this$listeners$event;
200
- (_this$listeners$event = this.listeners[event]) === null || _this$listeners$event === void 0 ? void 0 : _this$listeners$event.forEach(function (item, i) {
194
+ this.listeners[event].forEach(function (item, i) {
201
195
  if (item === handle) {
202
196
  _this3.listeners[event].splice(i, 1);
203
197
  }
@@ -241,12 +235,10 @@ var SocketClient = /*#__PURE__*/function () {
241
235
  var _this4 = this;
242
236
  this.getToken().then(function (token) {
243
237
  _this4.params = params || _this4.params;
244
- _this4.token = token;
245
238
  if (_this4.client) _this4.close();
246
239
  var paramUrl = ["socketToken=".concat(token)];
247
240
  if (_this4.params) {
248
- var _Object$keys;
249
- (_Object$keys = Object.keys(_this4.params || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (key) {
241
+ Object.keys(_this4.params || {}).forEach(function (key) {
250
242
  if (_.isObject(_this4.params[key]) || _.isArray(_this4.params[key])) {
251
243
  paramUrl.push("".concat(key, "=").concat(JSON.stringify(_this4.params[key])));
252
244
  } else {
@@ -97,33 +97,35 @@ var BizTargetDimension = function BizTargetDimension(props) {
97
97
  overlayClassName: "".concat(classPrefix, "-dropmenu"),
98
98
  placement: "bottom",
99
99
  trigger: ['click'],
100
- overlay: /*#__PURE__*/React.createElement(Menu, null, options.map(function (item) {
101
- if (item.children) {
102
- return /*#__PURE__*/React.createElement(SubMenu, {
103
- popupClassName: "".concat(classPrefix, "-submenu"),
104
- key: item.label,
105
- title: item.label,
106
- className: "".concat((dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.label) === item.label ? 'active' : '')
107
- }, item.children.map(function (sub) {
108
- return /*#__PURE__*/React.createElement(Menu.Item, {
109
- className: (dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.value) === item.value && (dimension === null || dimension === void 0 ? void 0 : dimension.value) === sub.value ? 'active' : '',
110
- title: sub.label,
111
- key: "".concat(item.value, "-").concat(sub.value),
112
- onClick: function onClick() {
113
- return onChange(sub, item);
114
- }
115
- }, sub.label);
116
- }));
117
- }
118
- return /*#__PURE__*/React.createElement(Menu.Item, {
119
- className: (dimension === null || dimension === void 0 ? void 0 : dimension.value) === item.value ? 'active' : '',
120
- key: item.value,
121
- onClick: function onClick() {
122
- return onChange(item);
123
- },
124
- title: item.label
125
- }, item.label);
126
- }))
100
+ dropdownRender: function dropdownRender() {
101
+ return /*#__PURE__*/React.createElement(Menu, null, options.map(function (item) {
102
+ if (item.children) {
103
+ return /*#__PURE__*/React.createElement(SubMenu, {
104
+ popupClassName: "".concat(classPrefix, "-submenu"),
105
+ key: item.label,
106
+ title: item.label,
107
+ className: "".concat((dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.label) === item.label ? 'active' : '')
108
+ }, item.children.map(function (sub) {
109
+ return /*#__PURE__*/React.createElement(Menu.Item, {
110
+ className: (dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.value) === item.value && (dimension === null || dimension === void 0 ? void 0 : dimension.value) === sub.value ? 'active' : '',
111
+ title: sub.label,
112
+ key: "".concat(item.value, "-").concat(sub.value),
113
+ onClick: function onClick() {
114
+ return onChange(sub, item);
115
+ }
116
+ }, sub.label);
117
+ }));
118
+ }
119
+ return /*#__PURE__*/React.createElement(Menu.Item, {
120
+ className: (dimension === null || dimension === void 0 ? void 0 : dimension.value) === item.value ? 'active' : '',
121
+ key: item.value,
122
+ onClick: function onClick() {
123
+ return onChange(item);
124
+ },
125
+ title: item.label
126
+ }, item.label);
127
+ }));
128
+ }
127
129
  }, /*#__PURE__*/React.createElement("div", {
128
130
  className: "".concat(classPrefix, "-dimension")
129
131
  }, /*#__PURE__*/React.createElement(SelectHandle, {
@@ -43,9 +43,6 @@ export var attrOptions = [{
43
43
  }, {
44
44
  label: '均值',
45
45
  value: 'avg'
46
- }, {
47
- label: '分布',
48
- value: 'duration_times'
49
46
  }, {
50
47
  label: '中位数',
51
48
  value: 'median'
@@ -51,6 +51,7 @@ export default (function () {
51
51
  max: 3
52
52
  }, /*#__PURE__*/React.createElement(BizEventSelector, {
53
53
  showAllEvent: true,
54
- border: false
54
+ border: false,
55
+ showBuiltInTarget: true
55
56
  }))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(target)));
56
57
  });