@zgfe/business-lib 1.2.3-session.0 → 1.2.3
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.
- package/es/attrCondition/demo/group.js +9 -28
- package/es/attrCondition/demo/index.js +0 -20
- package/es/attrCondition/group.js +1 -3
- package/es/attrCondition/index.js +1 -2
- package/es/attrCondition/useAttrCondition.js +0 -11
- package/es/attrConditions/components/valuesList.js +3 -3
- package/es/attrConditions/group.js +1 -3
- package/es/attrConditions/index.js +1 -7
- package/es/attrConditions/types.d.ts +2 -3
- package/es/attributeSelector/demo/index.js +1 -0
- package/es/attributeSelector/index.js +5 -13
- package/es/attributeSelector/listPanel.js +27 -70
- package/es/attributeSelector/styles/index.less +0 -1
- package/es/attributeSelector/types.d.ts +4 -16
- package/es/attributeSelector/types.js +0 -1
- package/es/chart/demo/data/data4.d.ts +24 -0
- package/es/chart/demo/data/data4.js +60 -0
- package/es/{attributeSelector/demo/extra.d.ts → chart/demo/line_bar.d.ts} +0 -1
- package/es/chart/demo/line_bar.js +11 -0
- package/es/chart/index.js +3 -2
- package/es/chart/types.d.ts +1 -1
- package/es/chart/util/chartOptionConfig.js +7 -3
- package/es/chart/util/formatData.d.ts +1 -1
- package/es/chart/util/formatData.js +3 -2
- package/es/datePicker/index.js +12 -0
- package/es/select/demo/index.js +1 -2
- package/es/select/handle.js +4 -6
- package/es/select/index.js +0 -1
- package/es/select/types.d.ts +0 -2
- package/package.json +2 -2
- package/es/attributeSelector/demo/extra.js +0 -80
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { BizAttrConditionGroup, DemoWrapper } from '@zgfe/business-lib';
|
|
3
3
|
import { Button } from 'antd';
|
|
4
|
-
var extraList = [{
|
|
5
|
-
type: 'sessionProp',
|
|
6
|
-
name: 'Session属性',
|
|
7
|
-
attrList: [{
|
|
8
|
-
id: 'sa_duration',
|
|
9
|
-
label: 'Session时长',
|
|
10
|
-
propCategory: 'extraProp',
|
|
11
|
-
key: 'extraProp-sa_duration',
|
|
12
|
-
type: 2,
|
|
13
|
-
subtype: 2
|
|
14
|
-
}, {
|
|
15
|
-
id: 'se_duration',
|
|
16
|
-
label: '事件使用时长',
|
|
17
|
-
propCategory: 'extraProp',
|
|
18
|
-
key: 'extraProp-se_duration',
|
|
19
|
-
type: 2,
|
|
20
|
-
subtype: 2
|
|
21
|
-
}]
|
|
22
|
-
}];
|
|
23
4
|
export default (function () {
|
|
24
5
|
var groupRef = useRef(null);
|
|
25
6
|
var filter = {
|
|
@@ -34,14 +15,15 @@ export default (function () {
|
|
|
34
15
|
operator: 'equal',
|
|
35
16
|
attrName: 'is_anonymous'
|
|
36
17
|
}, {
|
|
37
|
-
attrId:
|
|
38
|
-
propCategory: '
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
attrId: 0,
|
|
19
|
+
propCategory: 'userProp',
|
|
20
|
+
values: ['30', '1'],
|
|
21
|
+
dimensionSub: 'last_visit_time',
|
|
22
|
+
label: '最后一次访问时间',
|
|
23
|
+
type: 3,
|
|
24
|
+
category: 'fixed',
|
|
25
|
+
operator: 'relative',
|
|
26
|
+
attrName: 'last_visit_time'
|
|
45
27
|
}],
|
|
46
28
|
relation: 'and'
|
|
47
29
|
};
|
|
@@ -56,7 +38,6 @@ export default (function () {
|
|
|
56
38
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
57
39
|
value: filter,
|
|
58
40
|
ref: groupRef,
|
|
59
|
-
extra: extraList,
|
|
60
41
|
enableDelete: true
|
|
61
42
|
}), /*#__PURE__*/React.createElement("div", {
|
|
62
43
|
style: {
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BizAttrCondition, DemoWrapper } from '@zgfe/business-lib';
|
|
3
|
-
var extraList = [{
|
|
4
|
-
type: 'sessionProp',
|
|
5
|
-
name: 'Session属性',
|
|
6
|
-
attrList: [{
|
|
7
|
-
id: 'sa_duration',
|
|
8
|
-
label: 'Session时长',
|
|
9
|
-
propCategory: 'extraProp',
|
|
10
|
-
key: 'extraProp-sa_duration',
|
|
11
|
-
type: 2,
|
|
12
|
-
subtype: 2
|
|
13
|
-
}, {
|
|
14
|
-
id: 'se_duration',
|
|
15
|
-
label: '事件使用时长',
|
|
16
|
-
propCategory: 'extraProp',
|
|
17
|
-
key: 'extraProp-se_duration',
|
|
18
|
-
type: 2,
|
|
19
|
-
subtype: 2
|
|
20
|
-
}]
|
|
21
|
-
}];
|
|
22
3
|
export default (function () {
|
|
23
4
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
24
5
|
needMeta: true
|
|
@@ -28,7 +9,6 @@ export default (function () {
|
|
|
28
9
|
background: '#fff'
|
|
29
10
|
}
|
|
30
11
|
}, /*#__PURE__*/React.createElement(BizAttrCondition, {
|
|
31
|
-
extra: extraList,
|
|
32
12
|
onChange: function onChange(condition) {
|
|
33
13
|
console.log(condition);
|
|
34
14
|
}
|
|
@@ -9,8 +9,7 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
9
9
|
enableEventProp = props.enableEventProp,
|
|
10
10
|
enableUserProp = props.enableUserProp,
|
|
11
11
|
enableEnvProp = props.enableEnvProp,
|
|
12
|
-
disableItemList = props.disableItemList
|
|
13
|
-
extra = props.extra;
|
|
12
|
+
disableItemList = props.disableItemList;
|
|
14
13
|
var _useConditionGroup = useConditionGroup(props, ref),
|
|
15
14
|
loading = _useConditionGroup.loading,
|
|
16
15
|
conditions = _useConditionGroup.conditions,
|
|
@@ -53,7 +52,6 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
53
52
|
enableUserProp: enableUserProp,
|
|
54
53
|
enableEnvProp: enableEnvProp,
|
|
55
54
|
disableItemList: disableItemList,
|
|
56
|
-
extra: extra,
|
|
57
55
|
onChange: function onChange(data) {
|
|
58
56
|
return _onChange(data, index);
|
|
59
57
|
},
|
|
@@ -65,8 +65,7 @@ var BizAttrCondition = function BizAttrCondition(props) {
|
|
|
65
65
|
theme: theme,
|
|
66
66
|
destroyPopupOnHide: props.destroyPopupOnHide,
|
|
67
67
|
placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027",
|
|
68
|
-
status: isAttrError ? 'error' : ''
|
|
69
|
-
extra: props.extra
|
|
68
|
+
status: isAttrError ? 'error' : ''
|
|
70
69
|
}), isAttrError ? /*#__PURE__*/React.createElement("div", {
|
|
71
70
|
className: "".concat(classPrefix, "-error")
|
|
72
71
|
}, "\u5C5E\u6027\u4E0D\u53EF\u4E3A\u7A7A") : null), /*#__PURE__*/React.createElement(BizOperateList, {
|
|
@@ -55,17 +55,6 @@ var useAttrCondition = function useAttrCondition(props) {
|
|
|
55
55
|
dimensionSub: data.dimensionSub || data.attrName
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
} else if (data.propCategory === PropCategory.ExtraProp) {
|
|
59
|
-
if (data.attrId) {
|
|
60
|
-
attrData = {
|
|
61
|
-
id: data.attrId,
|
|
62
|
-
propCategory: data.propCategory,
|
|
63
|
-
type: data.type,
|
|
64
|
-
key: "".concat(data.propCategory, "-").concat(data.attrId),
|
|
65
|
-
label: data.attrNameStr || data.label,
|
|
66
|
-
subtype: data.subtype
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
58
|
}
|
|
70
59
|
setAttr(attrData);
|
|
71
60
|
}
|
|
@@ -37,7 +37,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
37
37
|
setIsFirst = _useState6[1];
|
|
38
38
|
useEffect(function () {
|
|
39
39
|
if (defaultValue) {
|
|
40
|
-
if ((
|
|
40
|
+
if ((attr === null || attr === void 0 ? void 0 : attr.propCategory) === 'userProp' && (attr === null || attr === void 0 ? void 0 : attr.subtype) === 2) {
|
|
41
41
|
var num = String(parseFloat(defaultValue[0]) / getUnitCount(defaultValue[1]));
|
|
42
42
|
setCurrent([num, defaultValue[1]]);
|
|
43
43
|
} else {
|
|
@@ -72,7 +72,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
72
72
|
};
|
|
73
73
|
var onChangeNumber = function onChangeNumber(e) {
|
|
74
74
|
var data = [e.target.value];
|
|
75
|
-
if ((
|
|
75
|
+
if ((attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.UserProp && (attr === null || attr === void 0 ? void 0 : attr.subtype) === 2) {
|
|
76
76
|
var num = String(parseFloat(e.target.value) * getUnitCount(unit));
|
|
77
77
|
data = [num, unit];
|
|
78
78
|
setCurrent([e.target.value, unit]);
|
|
@@ -144,7 +144,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
144
144
|
status: status,
|
|
145
145
|
onChange: onChangeNumber,
|
|
146
146
|
suffix: attr.propCategory === 'userProp' && attr.subtype === 1 ? '%' : null
|
|
147
|
-
}),
|
|
147
|
+
}), attr.propCategory === 'userProp' && attr.subtype === 2 && numberAfter);
|
|
148
148
|
} else {
|
|
149
149
|
if (operate === OperateTypes.Absolute) {
|
|
150
150
|
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
@@ -9,8 +9,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
9
9
|
enableEventProp = props.enableEventProp,
|
|
10
10
|
enableUserProp = props.enableUserProp,
|
|
11
11
|
enableEnvProp = props.enableEnvProp,
|
|
12
|
-
disableItemList = props.disableItemList
|
|
13
|
-
extra = props.extra;
|
|
12
|
+
disableItemList = props.disableItemList;
|
|
14
13
|
var _useConditionGroup = useConditionGroup(props, ref),
|
|
15
14
|
loading = _useConditionGroup.loading,
|
|
16
15
|
conditions = _useConditionGroup.conditions,
|
|
@@ -48,7 +47,6 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
48
47
|
enableUserProp: enableUserProp,
|
|
49
48
|
enableEnvProp: enableEnvProp,
|
|
50
49
|
disableItemList: disableItemList,
|
|
51
|
-
extra: extra,
|
|
52
50
|
onChange: function onChange(data) {
|
|
53
51
|
return _onChange(data, index);
|
|
54
52
|
},
|
|
@@ -20,11 +20,6 @@ export function getCondition(attr, operate, values) {
|
|
|
20
20
|
};
|
|
21
21
|
if (attr.propCategory === PropCategory.EventProp) {
|
|
22
22
|
responseData.attrName = attr.label;
|
|
23
|
-
} else if (attr.propCategory === PropCategory.ExtraProp) {
|
|
24
|
-
responseData.attrName = attr.label;
|
|
25
|
-
if (attr.propCategory === PropCategory.ExtraProp && attr.subtype) {
|
|
26
|
-
responseData.subtype = attr.subtype;
|
|
27
|
-
}
|
|
28
23
|
} else {
|
|
29
24
|
responseData.attrName = attr.name;
|
|
30
25
|
responseData.category = attr.category;
|
|
@@ -73,8 +68,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
73
68
|
return _onDelete(e);
|
|
74
69
|
},
|
|
75
70
|
theme: theme,
|
|
76
|
-
destroyPopupOnHide: props.destroyPopupOnHide
|
|
77
|
-
extra: props.extra
|
|
71
|
+
destroyPopupOnHide: props.destroyPopupOnHide
|
|
78
72
|
}), /*#__PURE__*/React.createElement("div", {
|
|
79
73
|
className: "".concat(classPrefix, "-panel")
|
|
80
74
|
}, /*#__PURE__*/React.createElement(BizOperateList, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvProp, EventProp, PropType, UserProp } from '../attributeSelector/types';
|
|
2
2
|
import { BizSelectTypes } from '../select/types';
|
|
3
3
|
interface BasicAttrTypes {
|
|
4
4
|
eventIdList?: number[];
|
|
@@ -8,7 +8,6 @@ interface BasicAttrTypes {
|
|
|
8
8
|
enableEnvProp?: boolean;
|
|
9
9
|
disableItemList?: (EventProp | UserProp | EnvProp)[];
|
|
10
10
|
theme?: BizSelectTypes.Props['theme'];
|
|
11
|
-
extra?: AttributeSelect.AttributeExtra[];
|
|
12
11
|
}
|
|
13
12
|
export declare namespace AttrConditionTypes {
|
|
14
13
|
interface ItemValue {
|
|
@@ -18,7 +17,7 @@ export declare namespace AttrConditionTypes {
|
|
|
18
17
|
label?: string;
|
|
19
18
|
attrNameStr?: string;
|
|
20
19
|
type?: PropType;
|
|
21
|
-
propCategory?: 'userProp' | 'eventProp' | 'envProp'
|
|
20
|
+
propCategory?: 'userProp' | 'eventProp' | 'envProp';
|
|
22
21
|
category?: 'fixed' | 'custom';
|
|
23
22
|
dimensionSub?: string;
|
|
24
23
|
operator?: OperateTypes;
|
|
@@ -22,7 +22,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
22
22
|
var enableDelete = props.enableDelete,
|
|
23
23
|
placeholder = props.placeholder,
|
|
24
24
|
theme = props.theme,
|
|
25
|
-
|
|
25
|
+
isNumber = props.isNumber;
|
|
26
26
|
var _useState = useState(),
|
|
27
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
28
|
currentAttr = _useState2[0],
|
|
@@ -84,16 +84,6 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
84
84
|
if (attr.name === param.name && attr.category === param.category) res = attr;
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'extraProp') {
|
|
88
|
-
extra === null || extra === void 0 ? void 0 : extra.forEach(function (item) {
|
|
89
|
-
item.attrList.forEach(function (attr) {
|
|
90
|
-
if (hasKey) {
|
|
91
|
-
if (attr.key === param.key) res = _.cloneDeep(attr);
|
|
92
|
-
} else {
|
|
93
|
-
if (attr.id === param.id) res = _.cloneDeep(attr);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
87
|
}
|
|
98
88
|
return res;
|
|
99
89
|
}
|
|
@@ -118,12 +108,14 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
118
108
|
id: id
|
|
119
109
|
}, props), {}, {
|
|
120
110
|
value: currentAttr,
|
|
121
|
-
onChange: onChange
|
|
111
|
+
onChange: onChange,
|
|
112
|
+
isNumber: isNumber
|
|
122
113
|
}));
|
|
123
114
|
},
|
|
124
115
|
trigger: ['click'],
|
|
125
116
|
overlayStyle: {
|
|
126
|
-
minWidth:
|
|
117
|
+
minWidth: 284,
|
|
118
|
+
width: width
|
|
127
119
|
},
|
|
128
120
|
open: visible,
|
|
129
121
|
onOpenChange: onVisibleChange,
|
|
@@ -23,7 +23,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
23
23
|
enableUserProp = props.enableUserProp,
|
|
24
24
|
eventIdList = props.eventIdList,
|
|
25
25
|
funnelEventIdList = props.funnelEventIdList,
|
|
26
|
-
|
|
26
|
+
isNumber = props.isNumber;
|
|
27
27
|
var _useState = useState(''),
|
|
28
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
29
|
searchValue = _useState2[0],
|
|
@@ -58,71 +58,18 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
58
58
|
item.key = "eventProp-".concat(item.id);
|
|
59
59
|
} else if (item.propCategory === 'userProp') {
|
|
60
60
|
item.key = "userProp-".concat(item.name);
|
|
61
|
-
} else if (item.propCategory === 'extraProp') {
|
|
62
|
-
item.key = "extraProp-".concat(item.id);
|
|
63
61
|
}
|
|
64
62
|
return item;
|
|
65
63
|
});
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _useState9 = useState([]),
|
|
73
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
74
|
-
anchorList = _useState10[0],
|
|
75
|
-
setAnchorList = _useState10[1];
|
|
76
|
-
useEffect(function () {
|
|
77
|
-
var data = {
|
|
78
|
-
container: "container-".concat(id),
|
|
79
|
-
event: "event".concat(id),
|
|
80
|
-
user: "user".concat(id),
|
|
81
|
-
env: "env".concat(id)
|
|
82
|
-
};
|
|
83
|
-
var list = [];
|
|
84
|
-
extra === null || extra === void 0 ? void 0 : extra.forEach(function (item) {
|
|
85
|
-
data[item.type] = "".concat(item.type).concat(id);
|
|
86
|
-
list.push({
|
|
87
|
-
id: "".concat(item.type).concat(id),
|
|
88
|
-
name: item.name
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
stAnchor(data);
|
|
92
|
-
if (enableEventProp) {
|
|
93
|
-
list.push({
|
|
94
|
-
id: data.event,
|
|
95
|
-
name: '事件属性'
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if (enableUserProp) {
|
|
99
|
-
list.push({
|
|
100
|
-
id: data.user,
|
|
101
|
-
name: '用户属性'
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (enableEnvProp) {
|
|
105
|
-
list.push({
|
|
106
|
-
id: data.env,
|
|
107
|
-
name: '触发环境'
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
setAnchorList(list);
|
|
111
|
-
}, [id]);
|
|
64
|
+
var anchor = {
|
|
65
|
+
container: "container-".concat(id),
|
|
66
|
+
event: "event".concat(id),
|
|
67
|
+
user: "user".concat(id),
|
|
68
|
+
env: "env".concat(id)
|
|
69
|
+
};
|
|
112
70
|
var classPrefix = 'biz-attr-select';
|
|
113
71
|
useEffect(function () {
|
|
114
72
|
var list = [];
|
|
115
|
-
if (extra) {
|
|
116
|
-
extra.forEach(function (item) {
|
|
117
|
-
list.push({
|
|
118
|
-
isEvent: false,
|
|
119
|
-
groupName: item.name,
|
|
120
|
-
key: item.type,
|
|
121
|
-
anchor: anchor[item.type],
|
|
122
|
-
children: item.attrList
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
73
|
if (enableEventProp) {
|
|
127
74
|
if (props.showCommonProp) {
|
|
128
75
|
var group = {
|
|
@@ -156,7 +103,9 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
156
103
|
groupName: event.alias || event.name,
|
|
157
104
|
anchor: hasAnchor ? String(Math.random()) : anchor.event,
|
|
158
105
|
key: "event-".concat(event.id),
|
|
159
|
-
children: event.attrList.slice()
|
|
106
|
+
children: event.attrList.slice().filter(function (item) {
|
|
107
|
+
return isNumber ? item.type === 2 : true;
|
|
108
|
+
})
|
|
160
109
|
};
|
|
161
110
|
list.push(group);
|
|
162
111
|
});
|
|
@@ -199,7 +148,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
199
148
|
});
|
|
200
149
|
}
|
|
201
150
|
setOptionList(list);
|
|
202
|
-
}, [
|
|
151
|
+
}, [eventIdMap, userPropList, eventEnvList, eventIdList, props.showCommonProp]);
|
|
203
152
|
useEffect(function () {
|
|
204
153
|
setCurrentAttr(props.value);
|
|
205
154
|
}, [props.value]);
|
|
@@ -264,14 +213,22 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
264
213
|
getContainer: function getContainer() {
|
|
265
214
|
return document.getElementById(anchor.container);
|
|
266
215
|
}
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
216
|
+
}, enableEventProp && /*#__PURE__*/React.createElement(Link, {
|
|
217
|
+
href: "#".concat(anchor.event),
|
|
218
|
+
title: /*#__PURE__*/React.createElement(Button, {
|
|
219
|
+
size: "small"
|
|
220
|
+
}, "\u4E8B\u4EF6\u5C5E\u6027")
|
|
221
|
+
}), enableUserProp && /*#__PURE__*/React.createElement(Link, {
|
|
222
|
+
href: "#".concat(anchor.user),
|
|
223
|
+
title: /*#__PURE__*/React.createElement(Button, {
|
|
224
|
+
size: "small"
|
|
225
|
+
}, "\u7528\u6237\u5C5E\u6027")
|
|
226
|
+
}), enableEnvProp && /*#__PURE__*/React.createElement(Link, {
|
|
227
|
+
"data-type": 'event',
|
|
228
|
+
href: "#".concat(anchor.env),
|
|
229
|
+
title: /*#__PURE__*/React.createElement(Button, {
|
|
230
|
+
size: "small"
|
|
231
|
+
}, "\u89E6\u53D1\u73AF\u5883")
|
|
275
232
|
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
276
233
|
id: anchor.container,
|
|
277
234
|
className: "".concat(classPrefix, "-container")
|
|
@@ -8,8 +8,7 @@ export declare enum PropType {
|
|
|
8
8
|
export declare enum PropCategory {
|
|
9
9
|
EventProp = "eventProp",
|
|
10
10
|
UserProp = "userProp",
|
|
11
|
-
EnvProp = "envProp"
|
|
12
|
-
ExtraProp = "extraProp"
|
|
11
|
+
EnvProp = "envProp"
|
|
13
12
|
}
|
|
14
13
|
export declare enum ShowStatus {
|
|
15
14
|
show = 0,
|
|
@@ -72,12 +71,12 @@ export interface PropGroups {
|
|
|
72
71
|
eventIdMap?: Record<number, AnalysisEvent>;
|
|
73
72
|
}
|
|
74
73
|
export declare namespace AttributeSelect {
|
|
75
|
-
type Value = EventProp | UserProp | EnvProp |
|
|
74
|
+
type Value = EventProp | UserProp | EnvProp | null;
|
|
76
75
|
interface Props {
|
|
77
76
|
id?: string;
|
|
78
77
|
value?: Value;
|
|
79
78
|
defaultValue?: Value;
|
|
80
|
-
disableItemList?: (EventProp | UserProp | EnvProp
|
|
79
|
+
disableItemList?: (EventProp | UserProp | EnvProp)[];
|
|
81
80
|
enableDelete?: boolean;
|
|
82
81
|
placeholder?: string;
|
|
83
82
|
enableEventProp?: boolean;
|
|
@@ -94,18 +93,7 @@ export declare namespace AttributeSelect {
|
|
|
94
93
|
destroyPopupOnHide?: boolean;
|
|
95
94
|
size?: SizeType;
|
|
96
95
|
status?: string;
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
interface AttributeExtra {
|
|
100
|
-
type: string;
|
|
101
|
-
name: string;
|
|
102
|
-
attrList: ExtraProp[];
|
|
103
|
-
}
|
|
104
|
-
interface ExtraProp extends BasicProp {
|
|
105
|
-
propCategory: 'extraProp';
|
|
106
|
-
key?: number | string;
|
|
107
|
-
name?: string;
|
|
108
|
-
subtype?: number;
|
|
96
|
+
isNumber?: Boolean;
|
|
109
97
|
}
|
|
110
98
|
interface Option {
|
|
111
99
|
groupName: string;
|
|
@@ -9,7 +9,6 @@ export var PropCategory;
|
|
|
9
9
|
PropCategory["EventProp"] = "eventProp";
|
|
10
10
|
PropCategory["UserProp"] = "userProp";
|
|
11
11
|
PropCategory["EnvProp"] = "envProp";
|
|
12
|
-
PropCategory["ExtraProp"] = "extraProp";
|
|
13
12
|
})(PropCategory || (PropCategory = {}));
|
|
14
13
|
export var ShowStatus;
|
|
15
14
|
(function (ShowStatus) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
series: ({
|
|
3
|
+
type: string;
|
|
4
|
+
names: string[];
|
|
5
|
+
values: number[];
|
|
6
|
+
duration?: undefined;
|
|
7
|
+
index?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
duration: never[];
|
|
10
|
+
type: string;
|
|
11
|
+
index: string;
|
|
12
|
+
names: string[];
|
|
13
|
+
values: number[];
|
|
14
|
+
})[];
|
|
15
|
+
xAxis: string[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const barData: {
|
|
19
|
+
xAxis: string[];
|
|
20
|
+
series: {
|
|
21
|
+
names: string[];
|
|
22
|
+
values: number[];
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
series: [{
|
|
3
|
+
type: 'bar',
|
|
4
|
+
names: ['histogramFirstUv'],
|
|
5
|
+
values: [0, 0, 1, 0, 0, 10000, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
6
|
+
}, {
|
|
7
|
+
duration: [],
|
|
8
|
+
type: 'bar',
|
|
9
|
+
index: '人数',
|
|
10
|
+
names: ['histogramSecondUv'],
|
|
11
|
+
values: [0, 0, 0, 0, 0, 0, 10000, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
12
|
+
}, {
|
|
13
|
+
duration: [],
|
|
14
|
+
type: 'bar',
|
|
15
|
+
index: '人数',
|
|
16
|
+
names: ['lineChartFirstUv'],
|
|
17
|
+
values: [0, 0, 0, 0, 0, 0, 0, 10000, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
18
|
+
}, {
|
|
19
|
+
duration: [],
|
|
20
|
+
type: 'bar',
|
|
21
|
+
index: '人数',
|
|
22
|
+
names: ['lineChartSecondUv'],
|
|
23
|
+
values: [0, 0, 0, 0, 0, 0, 0, 10000, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
24
|
+
}, {
|
|
25
|
+
duration: [],
|
|
26
|
+
type: 'line',
|
|
27
|
+
index: '额度',
|
|
28
|
+
names: ['histogramFirstNv'],
|
|
29
|
+
values: [0, 0, 1, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
30
|
+
}, {
|
|
31
|
+
duration: [],
|
|
32
|
+
type: 'line',
|
|
33
|
+
index: '额度',
|
|
34
|
+
names: ['histogramSecondNv'],
|
|
35
|
+
values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
36
|
+
}, {
|
|
37
|
+
duration: [],
|
|
38
|
+
type: 'line',
|
|
39
|
+
index: '额度',
|
|
40
|
+
names: ['lineChartFirstNv'],
|
|
41
|
+
values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920]
|
|
42
|
+
}, {
|
|
43
|
+
duration: [],
|
|
44
|
+
type: 'line',
|
|
45
|
+
index: '额度',
|
|
46
|
+
names: ['lineChartSecondNv'],
|
|
47
|
+
values: [0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
48
|
+
}],
|
|
49
|
+
xAxis: ['2023-10-25 00:00:00', '2023-10-25 01:00:00', '2023-10-25 02:00:00', '2023-10-25 03:00:00', '2023-10-25 04:00:00', '2023-10-25 05:00:00', '2023-10-25 06:00:00', '2023-10-25 07:00:00', '2023-10-25 08:00:00', '2023-10-25 09:00:00', '2023-10-25 10:00:00', '2023-10-25 11:00:00', '2023-10-25 12:00:00', '2023-10-25 13:00:00', '2023-10-25 14:00:00', '2023-10-25 15:00:00', '2023-10-25 16:00:00', '2023-10-25 17:00:00', '2023-10-25 18:00:00', '2023-10-25 19:00:00', '2023-10-25 20:00:00', '2023-10-25 21:00:00', '2023-10-25 22:00:00', '2023-10-25 23:00:00']
|
|
50
|
+
};
|
|
51
|
+
export var barData = {
|
|
52
|
+
xAxis: ['2022-08-23|2022-08-30'],
|
|
53
|
+
series: [{
|
|
54
|
+
names: ['北京市', '所有用户', '查看商品'],
|
|
55
|
+
values: [1560]
|
|
56
|
+
}, {
|
|
57
|
+
names: ['北京市', '最近7天活跃用户', '查看商品'],
|
|
58
|
+
values: [1560]
|
|
59
|
+
}]
|
|
60
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BizChart } from '@zgfe/business-lib';
|
|
3
|
+
import data from './data/data4';
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement(BizChart, {
|
|
6
|
+
data: data,
|
|
7
|
+
type: "line_bar",
|
|
8
|
+
showAll: false,
|
|
9
|
+
legendPosition: "bottom"
|
|
10
|
+
});
|
|
11
|
+
});
|
package/es/chart/index.js
CHANGED
|
@@ -107,8 +107,8 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
107
107
|
if (type === 'pie') {
|
|
108
108
|
var rData = formatPieData(data, showAll, showList, props.showOther);
|
|
109
109
|
eOption = getPieOption(rData, legendPosition, legendOrient, props.showLabel, props.radius, props.center, tooltipFormatter);
|
|
110
|
-
} else if (type === 'line' || type === 'bar') {
|
|
111
|
-
var _rData = formatChartData(data, showAll, showList, reverseXAxis, colors);
|
|
110
|
+
} else if (type === 'line' || type === 'bar' || type === 'line_bar') {
|
|
111
|
+
var _rData = formatChartData(data, showAll, showList, reverseXAxis, colors, type === 'line_bar');
|
|
112
112
|
eOption = getChartOption(type, _rData, legendPosition, legendOrient, valueUnit, xRotate, yRotate, tooltipFormatter, xAxisFormatter, yAxisFormatter, legendFormatter, reverseXAxis, seriesName);
|
|
113
113
|
} else if (type === 'map') {
|
|
114
114
|
var series = isCity ? citySeries(data) : provinceSeries(data);
|
|
@@ -122,6 +122,7 @@ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
122
122
|
if (type === 'line') {
|
|
123
123
|
eOption = dashedLineFormat(eOption);
|
|
124
124
|
}
|
|
125
|
+
console.log('eOption', eOption);
|
|
125
126
|
setChartOption(function () {
|
|
126
127
|
return _objectSpread({}, eOption);
|
|
127
128
|
});
|
package/es/chart/types.d.ts
CHANGED
|
@@ -157,7 +157,8 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
157
157
|
if (!reverseXAxis) {
|
|
158
158
|
series = data.series.map(function (item) {
|
|
159
159
|
return _objectSpread(_objectSpread(_objectSpread({}, item), seriesItem), {}, {
|
|
160
|
-
type: chartType
|
|
160
|
+
type: chartType === 'line_bar' ? item.type : chartType,
|
|
161
|
+
yAxisIndex: item.type === 'line' ? 0 : 1
|
|
161
162
|
});
|
|
162
163
|
});
|
|
163
164
|
} else {
|
|
@@ -165,7 +166,8 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
165
166
|
name: seriesName || '',
|
|
166
167
|
data: data.series
|
|
167
168
|
}, seriesItem), {}, {
|
|
168
|
-
type: chartType
|
|
169
|
+
type: chartType === 'line_bar' ? seriesItem.type : chartType,
|
|
170
|
+
yAxisIndex: seriesItem.type === 'line' ? 0 : 1
|
|
169
171
|
})];
|
|
170
172
|
}
|
|
171
173
|
tooltip.axisPointer = tooltip.axisPointer || {};
|
|
@@ -190,10 +192,12 @@ export var getChartOption = function getChartOption(chartType, data) {
|
|
|
190
192
|
legend.icon = 'circle';
|
|
191
193
|
}
|
|
192
194
|
legend.formatter = legendFormatter ? legendFormatter : legendFormatterDefault;
|
|
195
|
+
var dealyAxis = [yAxis, yAxis];
|
|
196
|
+
console.log('yAxis', dealyAxis);
|
|
193
197
|
return _objectSpread(_objectSpread({}, baseConfig), {}, {
|
|
194
198
|
legend: legend,
|
|
195
199
|
xAxis: xAxis,
|
|
196
|
-
yAxis:
|
|
200
|
+
yAxis: dealyAxis,
|
|
197
201
|
tooltip: tooltip,
|
|
198
202
|
grid: grid,
|
|
199
203
|
series: series
|
|
@@ -6,7 +6,7 @@ export declare const formatPieData: (data: ChartTypes.Value, showAll?: boolean,
|
|
|
6
6
|
color: string;
|
|
7
7
|
};
|
|
8
8
|
}[];
|
|
9
|
-
export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[]) => {
|
|
9
|
+
export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[], isUseSelf?: boolean) => {
|
|
10
10
|
xAxis: string[];
|
|
11
11
|
series: any;
|
|
12
12
|
resultFormatMap: {
|
|
@@ -28,7 +28,7 @@ export var formatPieData = function formatPieData(data, showAll, showList, showO
|
|
|
28
28
|
if (showOther && !showAll && other.value > 0) list.push(other);
|
|
29
29
|
return list;
|
|
30
30
|
};
|
|
31
|
-
export var formatChartData = function formatChartData(data, showAll, showList, reverseXAxis, color) {
|
|
31
|
+
export var formatChartData = function formatChartData(data, showAll, showList, reverseXAxis, color, isUseSelf) {
|
|
32
32
|
var showMap = getShowMap(showList);
|
|
33
33
|
var xAxisData = data.xAxis || data.x_axis;
|
|
34
34
|
var xAxis = reverseXAxis && data.series.length ? [] : xAxisData;
|
|
@@ -56,7 +56,8 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
|
|
|
56
56
|
} else {
|
|
57
57
|
sData.push({
|
|
58
58
|
name: name,
|
|
59
|
-
data: seriesItem.values
|
|
59
|
+
data: seriesItem.values,
|
|
60
|
+
type: isUseSelf ? seriesItem.type : undefined
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
}
|
package/es/datePicker/index.js
CHANGED
|
@@ -136,6 +136,18 @@ var BizDatePicker = function BizDatePicker(_ref) {
|
|
|
136
136
|
if (type.value === 'custom') {
|
|
137
137
|
setDateRange(getDateRange(DatePickerTypes.Unit.day, 7, includeToday));
|
|
138
138
|
}
|
|
139
|
+
if (type.value === 'hour') {
|
|
140
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.day, 1, includeToday));
|
|
141
|
+
}
|
|
142
|
+
if (type.value === 'day') {
|
|
143
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.day, 1, includeToday));
|
|
144
|
+
}
|
|
145
|
+
if (type.value === 'week') {
|
|
146
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.day, 7, includeToday));
|
|
147
|
+
}
|
|
148
|
+
if (type.value === 'month') {
|
|
149
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.day, 30, includeToday));
|
|
150
|
+
}
|
|
139
151
|
}
|
|
140
152
|
}), /*#__PURE__*/React.createElement(PickerShortcut, null), /*#__PURE__*/React.createElement(BizDate, {
|
|
141
153
|
selectRange: selectRange
|
package/es/select/demo/index.js
CHANGED
|
@@ -72,7 +72,6 @@ export default (function () {
|
|
|
72
72
|
theme: "secondary",
|
|
73
73
|
onChange: onChange,
|
|
74
74
|
disableItemList: disabledList,
|
|
75
|
-
dropdownExtra: /*#__PURE__*/React.createElement(Button, null, "+ \u6DFB\u52A0")
|
|
76
|
-
extraLabel: ' (别名)'
|
|
75
|
+
dropdownExtra: /*#__PURE__*/React.createElement(Button, null, "+ \u6DFB\u52A0")
|
|
77
76
|
}), /*#__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)));
|
|
78
77
|
});
|
package/es/select/handle.js
CHANGED
|
@@ -17,8 +17,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
17
17
|
keyField = props.keyField,
|
|
18
18
|
border = props.border,
|
|
19
19
|
showSelectIcon = props.showSelectIcon,
|
|
20
|
-
disable = props.disable
|
|
21
|
-
extraLabel = props.extraLabel;
|
|
20
|
+
disable = props.disable;
|
|
22
21
|
var classPrefix = 'biz-select-handle';
|
|
23
22
|
var _useState = useState(false),
|
|
24
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -146,7 +145,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
146
145
|
return /*#__PURE__*/React.createElement("div", {
|
|
147
146
|
ref: handleRef,
|
|
148
147
|
className: "".concat(classPrefix, "-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', " \n ").concat(mergedStatus ? "".concat(classPrefix, "-status-").concat(mergedStatus) : '', "\n ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : 'middle'),
|
|
149
|
-
title:
|
|
148
|
+
title: props.label || (optionData === null || optionData === void 0 ? void 0 : optionData[aliasField || '']) || (optionData === null || optionData === void 0 ? void 0 : optionData[labelField])
|
|
150
149
|
}, /*#__PURE__*/React.createElement("span", {
|
|
151
150
|
className: "".concat(classPrefix, "-content")
|
|
152
151
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -155,7 +154,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
155
154
|
className: "".concat(classPrefix, "-icon")
|
|
156
155
|
}, props.value.icon), props.children || props.label || (optionData === null || optionData === void 0 ? void 0 : optionData[aliasField || '']) || (optionData === null || optionData === void 0 ? void 0 : optionData[labelField]) || /*#__PURE__*/React.createElement("span", {
|
|
157
156
|
className: "".concat(classPrefix, "-holder")
|
|
158
|
-
}, placeholder || '请选择')
|
|
157
|
+
}, placeholder || '请选择'))), /*#__PURE__*/React.createElement(IconFont, {
|
|
159
158
|
className: "".concat(classPrefix, "-expand-icon").concat(props.open ? ' open' : ''),
|
|
160
159
|
type: 'xiangxia'
|
|
161
160
|
}));
|
|
@@ -164,7 +163,6 @@ SelectHandle.defaultProps = {
|
|
|
164
163
|
labelField: 'label',
|
|
165
164
|
keyField: 'id',
|
|
166
165
|
border: true,
|
|
167
|
-
showSelectIcon: true
|
|
168
|
-
extraLabel: ''
|
|
166
|
+
showSelectIcon: true
|
|
169
167
|
};
|
|
170
168
|
export default SelectHandle;
|
package/es/select/index.js
CHANGED
package/es/select/types.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export declare namespace BizSelectTypes {
|
|
|
26
26
|
minDropdownWidth?: number;
|
|
27
27
|
options: Group[] | Option[];
|
|
28
28
|
extra?: (option: Option) => ReactNode;
|
|
29
|
-
extraLabel?: ReactNode;
|
|
30
29
|
dropdownExtra?: ReactNode;
|
|
31
30
|
enableSearch?: boolean;
|
|
32
31
|
enableCreate?: boolean;
|
|
@@ -76,7 +75,6 @@ export declare namespace BizSelectTypes {
|
|
|
76
75
|
}
|
|
77
76
|
export interface HandlerTypes {
|
|
78
77
|
label?: string;
|
|
79
|
-
extraLabel?: ReactNode;
|
|
80
78
|
children?: ReactNode;
|
|
81
79
|
placeholder?: string;
|
|
82
80
|
value?: BizSelectTypes.Option | BizSelectTypes.Option[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.3
|
|
3
|
+
"version": "1.2.3",
|
|
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": "
|
|
58
|
+
"gitHead": "691c01390d4672d59fe4f686bbe7ee0a41046a10",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useState } from 'react';
|
|
8
|
-
import { BizAttributeSelector, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
9
|
-
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
|
-
import eventData from '../../mock/event';
|
|
11
|
-
import envData from '../../mock/env';
|
|
12
|
-
import userData from './userData.js';
|
|
13
|
-
import convertAttributeData from '../util';
|
|
14
|
-
var extraList = [{
|
|
15
|
-
type: 'sessionProp',
|
|
16
|
-
name: 'Session属性',
|
|
17
|
-
attrList: [{
|
|
18
|
-
id: 'sa_duration',
|
|
19
|
-
label: 'Session时长',
|
|
20
|
-
propCategory: 'extraProp',
|
|
21
|
-
key: 'extraProp-sa_duration'
|
|
22
|
-
}, {
|
|
23
|
-
id: 'se_duration',
|
|
24
|
-
label: '事件使用时长',
|
|
25
|
-
propCategory: 'extraProp',
|
|
26
|
-
key: 'extraProp-se_duration'
|
|
27
|
-
}]
|
|
28
|
-
}, {
|
|
29
|
-
type: 'pageProp',
|
|
30
|
-
name: '页面属性',
|
|
31
|
-
attrList: [{
|
|
32
|
-
id: 'page_duration',
|
|
33
|
-
label: '页面访问时长',
|
|
34
|
-
propCategory: 'extraProp',
|
|
35
|
-
key: 'extraProp-page_duration'
|
|
36
|
-
}, {
|
|
37
|
-
id: 'click',
|
|
38
|
-
label: '页面点击次数',
|
|
39
|
-
propCategory: 'extraProp',
|
|
40
|
-
key: 'extraProp-click'
|
|
41
|
-
}]
|
|
42
|
-
}];
|
|
43
|
-
export default (function () {
|
|
44
|
-
var _useState = useState({
|
|
45
|
-
propCategory: 'extraProp',
|
|
46
|
-
key: 'extraProp-click',
|
|
47
|
-
id: 'page_duration'
|
|
48
|
-
}),
|
|
49
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
-
attribute = _useState2[0],
|
|
51
|
-
setAttribute = _useState2[1];
|
|
52
|
-
var store = convertAttributeData({
|
|
53
|
-
eventList: eventData,
|
|
54
|
-
userPropList: userData,
|
|
55
|
-
envPropList: envData
|
|
56
|
-
});
|
|
57
|
-
function onChange(val) {
|
|
58
|
-
setAttribute(val);
|
|
59
|
-
}
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
61
|
-
value: {
|
|
62
|
-
eventGroupList: store.eventGroupList,
|
|
63
|
-
userPropList: store.userPropList,
|
|
64
|
-
eventEnvList: store.envPropList
|
|
65
|
-
}
|
|
66
|
-
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
67
|
-
enableEventProp: true,
|
|
68
|
-
enableUserProp: true,
|
|
69
|
-
eventIdList: [24143016],
|
|
70
|
-
value: attribute,
|
|
71
|
-
onChange: onChange,
|
|
72
|
-
enableDelete: true,
|
|
73
|
-
enableEnvProp: true,
|
|
74
|
-
extra: extraList,
|
|
75
|
-
disableItemList: [{
|
|
76
|
-
id: 'click',
|
|
77
|
-
propCategory: 'extraProp'
|
|
78
|
-
}]
|
|
79
|
-
})));
|
|
80
|
-
});
|