@zgfe/business-lib 1.2.6 → 1.2.8-session.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.
- package/es/attrCondition/demo/group.js +28 -9
- package/es/attrCondition/demo/index.js +20 -0
- package/es/attrCondition/group.js +3 -1
- package/es/attrCondition/index.js +2 -1
- package/es/attrCondition/useAttrCondition.js +11 -0
- package/es/attrConditions/components/valuesList.js +3 -3
- package/es/attrConditions/group.js +3 -1
- package/es/attrConditions/index.js +7 -1
- package/es/attrConditions/types.d.ts +4 -3
- package/es/attributeSelector/demo/extra.d.ts +4 -0
- package/es/attributeSelector/demo/extra.js +89 -0
- package/es/attributeSelector/index.js +13 -3
- package/es/attributeSelector/listPanel.js +69 -23
- package/es/attributeSelector/styles/index.less +1 -0
- package/es/attributeSelector/types.d.ts +17 -4
- package/es/attributeSelector/types.js +1 -0
- package/es/chart/demo/data/data.d.ts +3 -0
- package/es/chart/demo/data/data.js +29 -15
- package/es/chart/demo/data/data3.d.ts +7 -2
- package/es/chart/demo/data/data3.js +17 -5
- package/es/chart/demo/index.js +3 -2
- package/es/chart/styles/index.less +13 -0
- package/es/chart/util/chartOptionConfig.js +21 -3
- package/es/chart/util/formatData.js +8 -4
- package/es/chart/util/formatOption.js +7 -3
- package/es/chart/util/mapUtil.js +2 -1
- package/es/datePicker/index.js +6 -3
- package/es/productCondition/types.d.ts +1 -1
- package/es/select/demo/index.js +2 -1
- package/es/select/handle.js +6 -4
- package/es/select/index.js +1 -0
- package/es/select/types.d.ts +2 -0
- package/es/targetConditionGroup/types.d.ts +1 -0
- package/es/userCondition/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,25 @@
|
|
|
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
|
+
}];
|
|
4
23
|
export default (function () {
|
|
5
24
|
var groupRef = useRef(null);
|
|
6
25
|
var filter = {
|
|
@@ -15,15 +34,14 @@ export default (function () {
|
|
|
15
34
|
operator: 'equal',
|
|
16
35
|
attrName: 'is_anonymous'
|
|
17
36
|
}, {
|
|
18
|
-
attrId:
|
|
19
|
-
propCategory: '
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
attrName: 'last_visit_time'
|
|
37
|
+
attrId: 'sa_duration',
|
|
38
|
+
propCategory: 'extraProp',
|
|
39
|
+
type: 2,
|
|
40
|
+
operator: 'gt',
|
|
41
|
+
values: ['158400', '1'],
|
|
42
|
+
label: 'Session时长',
|
|
43
|
+
attrName: 'Session时长',
|
|
44
|
+
subtype: 2
|
|
27
45
|
}],
|
|
28
46
|
relation: 'and'
|
|
29
47
|
};
|
|
@@ -38,6 +56,7 @@ export default (function () {
|
|
|
38
56
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
39
57
|
value: filter,
|
|
40
58
|
ref: groupRef,
|
|
59
|
+
extra: extraList,
|
|
41
60
|
enableDelete: true
|
|
42
61
|
}), /*#__PURE__*/React.createElement("div", {
|
|
43
62
|
style: {
|
|
@@ -1,5 +1,24 @@
|
|
|
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
|
+
}];
|
|
3
22
|
export default (function () {
|
|
4
23
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
5
24
|
needMeta: true
|
|
@@ -9,6 +28,7 @@ export default (function () {
|
|
|
9
28
|
background: '#fff'
|
|
10
29
|
}
|
|
11
30
|
}, /*#__PURE__*/React.createElement(BizAttrCondition, {
|
|
31
|
+
extra: extraList,
|
|
12
32
|
onChange: function onChange(condition) {
|
|
13
33
|
console.log(condition);
|
|
14
34
|
}
|
|
@@ -9,7 +9,8 @@ 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
|
|
12
|
+
disableItemList = props.disableItemList,
|
|
13
|
+
extra = props.extra;
|
|
13
14
|
var _useConditionGroup = useConditionGroup(props, ref),
|
|
14
15
|
loading = _useConditionGroup.loading,
|
|
15
16
|
conditions = _useConditionGroup.conditions,
|
|
@@ -52,6 +53,7 @@ var BizAttrConditionGroup = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
52
53
|
enableUserProp: enableUserProp,
|
|
53
54
|
enableEnvProp: enableEnvProp,
|
|
54
55
|
disableItemList: disableItemList,
|
|
56
|
+
extra: extra,
|
|
55
57
|
onChange: function onChange(data) {
|
|
56
58
|
return _onChange(data, index);
|
|
57
59
|
},
|
|
@@ -65,7 +65,8 @@ 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' : ''
|
|
68
|
+
status: isAttrError ? 'error' : '',
|
|
69
|
+
extra: props.extra
|
|
69
70
|
}), isAttrError ? /*#__PURE__*/React.createElement("div", {
|
|
70
71
|
className: "".concat(classPrefix, "-error")
|
|
71
72
|
}, "\u5C5E\u6027\u4E0D\u53EF\u4E3A\u7A7A") : null), /*#__PURE__*/React.createElement(BizOperateList, {
|
|
@@ -55,6 +55,17 @@ 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
|
+
}
|
|
58
69
|
}
|
|
59
70
|
setAttr(attrData);
|
|
60
71
|
}
|
|
@@ -37,7 +37,7 @@ var ValuesList = function ValuesList(props) {
|
|
|
37
37
|
setIsFirst = _useState6[1];
|
|
38
38
|
useEffect(function () {
|
|
39
39
|
if (defaultValue) {
|
|
40
|
-
if ((attr === null || attr === void 0 ? void 0 : attr.propCategory) ===
|
|
40
|
+
if (((attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.UserProp || (attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.ExtraProp) && (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 ((attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.UserProp && (attr === null || attr === void 0 ? void 0 : attr.subtype) === 2) {
|
|
75
|
+
if (((attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.UserProp || (attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.ExtraProp) && (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
|
-
}), attr.propCategory ===
|
|
147
|
+
}), (attr.propCategory === PropCategory.UserProp || attr.propCategory === PropCategory.ExtraProp) && attr.subtype === 2 && numberAfter);
|
|
148
148
|
} else {
|
|
149
149
|
if (operate === OperateTypes.Absolute) {
|
|
150
150
|
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
@@ -9,7 +9,8 @@ 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
|
|
12
|
+
disableItemList = props.disableItemList,
|
|
13
|
+
extra = props.extra;
|
|
13
14
|
var _useConditionGroup = useConditionGroup(props, ref),
|
|
14
15
|
loading = _useConditionGroup.loading,
|
|
15
16
|
conditions = _useConditionGroup.conditions,
|
|
@@ -47,6 +48,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
47
48
|
enableUserProp: enableUserProp,
|
|
48
49
|
enableEnvProp: enableEnvProp,
|
|
49
50
|
disableItemList: disableItemList,
|
|
51
|
+
extra: extra,
|
|
50
52
|
onChange: function onChange(data) {
|
|
51
53
|
return _onChange(data, index);
|
|
52
54
|
},
|
|
@@ -20,6 +20,11 @@ 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
|
+
}
|
|
23
28
|
} else {
|
|
24
29
|
responseData.attrName = attr.name;
|
|
25
30
|
responseData.category = attr.category;
|
|
@@ -68,7 +73,8 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
68
73
|
return _onDelete(e);
|
|
69
74
|
},
|
|
70
75
|
theme: theme,
|
|
71
|
-
destroyPopupOnHide: props.destroyPopupOnHide
|
|
76
|
+
destroyPopupOnHide: props.destroyPopupOnHide,
|
|
77
|
+
extra: props.extra
|
|
72
78
|
}), /*#__PURE__*/React.createElement("div", {
|
|
73
79
|
className: "".concat(classPrefix, "-panel")
|
|
74
80
|
}, /*#__PURE__*/React.createElement(BizOperateList, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvProp, EventProp, PropType, UserProp } from '../attributeSelector/types';
|
|
1
|
+
import { AttributeSelect, EnvProp, EventProp, PropType, UserProp } from '../attributeSelector/types';
|
|
2
2
|
import { BizSelectTypes } from '../select/types';
|
|
3
3
|
interface BasicAttrTypes {
|
|
4
4
|
eventIdList?: number[];
|
|
@@ -8,16 +8,17 @@ interface BasicAttrTypes {
|
|
|
8
8
|
enableEnvProp?: boolean;
|
|
9
9
|
disableItemList?: (EventProp | UserProp | EnvProp)[];
|
|
10
10
|
theme?: BizSelectTypes.Props['theme'];
|
|
11
|
+
extra?: AttributeSelect.AttributeExtra[];
|
|
11
12
|
}
|
|
12
13
|
export declare namespace AttrConditionTypes {
|
|
13
14
|
interface ItemValue {
|
|
14
15
|
subtype?: number;
|
|
15
|
-
attrId?: number;
|
|
16
|
+
attrId?: number | string;
|
|
16
17
|
attrName?: string;
|
|
17
18
|
label?: string;
|
|
18
19
|
attrNameStr?: string;
|
|
19
20
|
type?: PropType;
|
|
20
|
-
propCategory?: 'userProp' | 'eventProp' | 'envProp';
|
|
21
|
+
propCategory?: 'userProp' | 'eventProp' | 'envProp' | 'extraProp';
|
|
21
22
|
category?: 'fixed' | 'custom';
|
|
22
23
|
dimensionSub?: string;
|
|
23
24
|
operator?: OperateTypes;
|
|
@@ -0,0 +1,89 @@
|
|
|
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, { useEffect, 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
|
+
type: 2,
|
|
23
|
+
subtype: 2
|
|
24
|
+
}]
|
|
25
|
+
}, {
|
|
26
|
+
type: 'pageProp',
|
|
27
|
+
name: '页面属性',
|
|
28
|
+
attrList: [{
|
|
29
|
+
id: 'page_duration',
|
|
30
|
+
label: '页面访问时长',
|
|
31
|
+
propCategory: 'extraProp',
|
|
32
|
+
key: 'extraProp-page_duration'
|
|
33
|
+
}, {
|
|
34
|
+
id: 'click',
|
|
35
|
+
label: '页面点击次数',
|
|
36
|
+
propCategory: 'extraProp',
|
|
37
|
+
key: 'extraProp-click'
|
|
38
|
+
}]
|
|
39
|
+
}];
|
|
40
|
+
export default (function () {
|
|
41
|
+
var _useState = useState({
|
|
42
|
+
id: 'sa_duration',
|
|
43
|
+
label: 'Session时长',
|
|
44
|
+
propCategory: 'extraProp',
|
|
45
|
+
key: 'extraProp-sa_duration',
|
|
46
|
+
type: 2,
|
|
47
|
+
subtype: 2
|
|
48
|
+
}),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
attribute = _useState2[0],
|
|
51
|
+
setAttribute = _useState2[1];
|
|
52
|
+
var _useState3 = useState(),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
list = _useState4[0],
|
|
55
|
+
setList = _useState4[1];
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setTimeout(function () {
|
|
58
|
+
setList(extraList);
|
|
59
|
+
}, 0);
|
|
60
|
+
}, []);
|
|
61
|
+
var store = convertAttributeData({
|
|
62
|
+
eventList: eventData,
|
|
63
|
+
userPropList: userData,
|
|
64
|
+
envPropList: envData
|
|
65
|
+
});
|
|
66
|
+
function onChange(val) {
|
|
67
|
+
setAttribute(val);
|
|
68
|
+
}
|
|
69
|
+
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, {
|
|
70
|
+
value: {
|
|
71
|
+
eventGroupList: store.eventGroupList,
|
|
72
|
+
userPropList: store.userPropList,
|
|
73
|
+
eventEnvList: store.envPropList
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
76
|
+
enableEventProp: true,
|
|
77
|
+
enableUserProp: true,
|
|
78
|
+
eventIdList: [24143016],
|
|
79
|
+
value: attribute,
|
|
80
|
+
onChange: onChange,
|
|
81
|
+
enableDelete: true,
|
|
82
|
+
enableEnvProp: true,
|
|
83
|
+
extra: list,
|
|
84
|
+
disableItemList: [{
|
|
85
|
+
id: 'click',
|
|
86
|
+
propCategory: 'extraProp'
|
|
87
|
+
}]
|
|
88
|
+
})));
|
|
89
|
+
});
|
|
@@ -22,6 +22,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
22
22
|
var enableDelete = props.enableDelete,
|
|
23
23
|
placeholder = props.placeholder,
|
|
24
24
|
theme = props.theme,
|
|
25
|
+
extra = props.extra,
|
|
25
26
|
isNumber = props.isNumber;
|
|
26
27
|
var _useState = useState(),
|
|
27
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -51,7 +52,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
51
52
|
}, []);
|
|
52
53
|
useEffect(function () {
|
|
53
54
|
setCurrentAttr(getValue(props.value));
|
|
54
|
-
}, [props.value]);
|
|
55
|
+
}, [props.value, props.extra]);
|
|
55
56
|
function getValue(param) {
|
|
56
57
|
var res = undefined;
|
|
57
58
|
var hasKey = param && param.key;
|
|
@@ -84,6 +85,16 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
84
85
|
if (attr.name === param.name && attr.category === param.category) res = attr;
|
|
85
86
|
}
|
|
86
87
|
});
|
|
88
|
+
} else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'extraProp') {
|
|
89
|
+
extra === null || extra === void 0 ? void 0 : extra.forEach(function (item) {
|
|
90
|
+
item.attrList.forEach(function (attr) {
|
|
91
|
+
if (hasKey) {
|
|
92
|
+
if (attr.key === param.key) res = _.cloneDeep(attr);
|
|
93
|
+
} else {
|
|
94
|
+
if (attr.id === param.id) res = _.cloneDeep(attr);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
87
98
|
}
|
|
88
99
|
return res;
|
|
89
100
|
}
|
|
@@ -114,8 +125,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
114
125
|
},
|
|
115
126
|
trigger: ['click'],
|
|
116
127
|
overlayStyle: {
|
|
117
|
-
minWidth: 284
|
|
118
|
-
width: width
|
|
128
|
+
minWidth: width < 284 ? 284 : width > 520 ? 520 : width
|
|
119
129
|
},
|
|
120
130
|
open: visible,
|
|
121
131
|
onOpenChange: onVisibleChange,
|
|
@@ -23,6 +23,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
23
23
|
enableUserProp = props.enableUserProp,
|
|
24
24
|
eventIdList = props.eventIdList,
|
|
25
25
|
funnelEventIdList = props.funnelEventIdList,
|
|
26
|
+
extra = props.extra,
|
|
26
27
|
isNumber = props.isNumber;
|
|
27
28
|
var _useState = useState(''),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -58,18 +59,71 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
58
59
|
item.key = "eventProp-".concat(item.id);
|
|
59
60
|
} else if (item.propCategory === 'userProp') {
|
|
60
61
|
item.key = "userProp-".concat(item.name);
|
|
62
|
+
} else if (item.propCategory === 'extraProp') {
|
|
63
|
+
item.key = "extraProp-".concat(item.id);
|
|
61
64
|
}
|
|
62
65
|
return item;
|
|
63
66
|
});
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
var _useState7 = useState({
|
|
68
|
+
container: "container-".concat(id)
|
|
69
|
+
}),
|
|
70
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
71
|
+
anchor = _useState8[0],
|
|
72
|
+
stAnchor = _useState8[1];
|
|
73
|
+
var _useState9 = useState([]),
|
|
74
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
75
|
+
anchorList = _useState10[0],
|
|
76
|
+
setAnchorList = _useState10[1];
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
var data = {
|
|
79
|
+
container: "container-".concat(id),
|
|
80
|
+
event: "event".concat(id),
|
|
81
|
+
user: "user".concat(id),
|
|
82
|
+
env: "env".concat(id)
|
|
83
|
+
};
|
|
84
|
+
var list = [];
|
|
85
|
+
extra === null || extra === void 0 ? void 0 : extra.forEach(function (item) {
|
|
86
|
+
data[item.type] = "".concat(item.type).concat(id);
|
|
87
|
+
list.push({
|
|
88
|
+
id: "".concat(item.type).concat(id),
|
|
89
|
+
name: item.name
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
stAnchor(data);
|
|
93
|
+
if (enableEventProp) {
|
|
94
|
+
list.push({
|
|
95
|
+
id: data.event,
|
|
96
|
+
name: '事件属性'
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (enableUserProp) {
|
|
100
|
+
list.push({
|
|
101
|
+
id: data.user,
|
|
102
|
+
name: '用户属性'
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (enableEnvProp) {
|
|
106
|
+
list.push({
|
|
107
|
+
id: data.env,
|
|
108
|
+
name: '触发环境'
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
setAnchorList(list);
|
|
112
|
+
}, [id]);
|
|
70
113
|
var classPrefix = 'biz-attr-select';
|
|
71
114
|
useEffect(function () {
|
|
72
115
|
var list = [];
|
|
116
|
+
if (extra) {
|
|
117
|
+
extra.forEach(function (item) {
|
|
118
|
+
list.push({
|
|
119
|
+
isEvent: false,
|
|
120
|
+
groupName: item.name,
|
|
121
|
+
key: item.type,
|
|
122
|
+
anchor: anchor[item.type],
|
|
123
|
+
children: item.attrList
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
73
127
|
if (enableEventProp) {
|
|
74
128
|
if (props.showCommonProp) {
|
|
75
129
|
var group = {
|
|
@@ -148,7 +202,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
148
202
|
});
|
|
149
203
|
}
|
|
150
204
|
setOptionList(list);
|
|
151
|
-
}, [eventIdMap, userPropList, eventEnvList, eventIdList, props.showCommonProp]);
|
|
205
|
+
}, [anchor, eventIdMap, userPropList, eventEnvList, eventIdList, props.showCommonProp]);
|
|
152
206
|
useEffect(function () {
|
|
153
207
|
setCurrentAttr(props.value);
|
|
154
208
|
}, [props.value]);
|
|
@@ -213,22 +267,14 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
213
267
|
getContainer: function getContainer() {
|
|
214
268
|
return document.getElementById(anchor.container);
|
|
215
269
|
}
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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")
|
|
270
|
+
}, anchorList.map(function (item) {
|
|
271
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
272
|
+
key: item.id,
|
|
273
|
+
href: "#".concat(item.id),
|
|
274
|
+
title: /*#__PURE__*/React.createElement(Button, {
|
|
275
|
+
size: "small"
|
|
276
|
+
}, item.name)
|
|
277
|
+
});
|
|
232
278
|
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
233
279
|
id: anchor.container,
|
|
234
280
|
className: "".concat(classPrefix, "-container")
|
|
@@ -8,7 +8,8 @@ export declare enum PropType {
|
|
|
8
8
|
export declare enum PropCategory {
|
|
9
9
|
EventProp = "eventProp",
|
|
10
10
|
UserProp = "userProp",
|
|
11
|
-
EnvProp = "envProp"
|
|
11
|
+
EnvProp = "envProp",
|
|
12
|
+
ExtraProp = "extraProp"
|
|
12
13
|
}
|
|
13
14
|
export declare enum ShowStatus {
|
|
14
15
|
show = 0,
|
|
@@ -37,7 +38,7 @@ export interface EventGroup {
|
|
|
37
38
|
eventList: AnalysisEvent[];
|
|
38
39
|
}
|
|
39
40
|
export interface BasicProp {
|
|
40
|
-
id?: number;
|
|
41
|
+
id?: number | string;
|
|
41
42
|
label?: string;
|
|
42
43
|
alias?: string;
|
|
43
44
|
type?: PropType;
|
|
@@ -71,12 +72,12 @@ export interface PropGroups {
|
|
|
71
72
|
eventIdMap?: Record<number, AnalysisEvent>;
|
|
72
73
|
}
|
|
73
74
|
export declare namespace AttributeSelect {
|
|
74
|
-
type Value = EventProp | UserProp | EnvProp | null;
|
|
75
|
+
type Value = EventProp | UserProp | EnvProp | ExtraProp | null;
|
|
75
76
|
interface Props {
|
|
76
77
|
id?: string;
|
|
77
78
|
value?: Value;
|
|
78
79
|
defaultValue?: Value;
|
|
79
|
-
disableItemList?: (EventProp | UserProp | EnvProp)[];
|
|
80
|
+
disableItemList?: (EventProp | UserProp | EnvProp | ExtraProp)[];
|
|
80
81
|
enableDelete?: boolean;
|
|
81
82
|
placeholder?: string;
|
|
82
83
|
enableEventProp?: boolean;
|
|
@@ -93,8 +94,20 @@ export declare namespace AttributeSelect {
|
|
|
93
94
|
destroyPopupOnHide?: boolean;
|
|
94
95
|
size?: SizeType;
|
|
95
96
|
status?: string;
|
|
97
|
+
extra?: AttributeExtra[];
|
|
96
98
|
isNumber?: Boolean;
|
|
97
99
|
}
|
|
100
|
+
interface AttributeExtra {
|
|
101
|
+
type: string;
|
|
102
|
+
name: string;
|
|
103
|
+
attrList: ExtraProp[];
|
|
104
|
+
}
|
|
105
|
+
interface ExtraProp extends BasicProp {
|
|
106
|
+
propCategory: 'extraProp';
|
|
107
|
+
key?: number | string;
|
|
108
|
+
name?: string;
|
|
109
|
+
subtype?: number;
|
|
110
|
+
}
|
|
98
111
|
interface Option {
|
|
99
112
|
groupName: string;
|
|
100
113
|
isEvent: boolean;
|
|
@@ -9,6 +9,7 @@ export var PropCategory;
|
|
|
9
9
|
PropCategory["EventProp"] = "eventProp";
|
|
10
10
|
PropCategory["UserProp"] = "userProp";
|
|
11
11
|
PropCategory["EnvProp"] = "envProp";
|
|
12
|
+
PropCategory["ExtraProp"] = "extraProp";
|
|
12
13
|
})(PropCategory || (PropCategory = {}));
|
|
13
14
|
export var ShowStatus;
|
|
14
15
|
(function (ShowStatus) {
|
|
@@ -3,6 +3,7 @@ declare const _default: {
|
|
|
3
3
|
series: {
|
|
4
4
|
names: string[];
|
|
5
5
|
values: number[];
|
|
6
|
+
orderNum: number;
|
|
6
7
|
}[];
|
|
7
8
|
};
|
|
8
9
|
export default _default;
|
|
@@ -11,5 +12,7 @@ export declare const barData: {
|
|
|
11
12
|
series: {
|
|
12
13
|
names: string[];
|
|
13
14
|
values: number[];
|
|
15
|
+
orderNum: number;
|
|
14
16
|
}[];
|
|
15
17
|
};
|
|
18
|
+
export declare const showCharts: string[];
|
|
@@ -2,46 +2,60 @@ export default {
|
|
|
2
2
|
xAxis: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '2023-09-17', '2023-09-18'],
|
|
3
3
|
series: [{
|
|
4
4
|
names: ['付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
5
|
-
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
|
5
|
+
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38],
|
|
6
|
+
orderNum: 1
|
|
6
7
|
}, {
|
|
7
8
|
names: ['注册-发送手机验证码'],
|
|
8
|
-
values: [11, 10, 7, 5, 13, 18, 14, 17, 11, 6, 10, 12, 15, 10]
|
|
9
|
+
values: [11, 10, 7, 5, 13, 18, 14, 17, 11, 6, 10, 12, 15, 10],
|
|
10
|
+
orderNum: 1
|
|
9
11
|
}, {
|
|
10
12
|
names: ['搜索商品'],
|
|
11
|
-
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79]
|
|
13
|
+
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79],
|
|
14
|
+
orderNum: 2
|
|
12
15
|
}, {
|
|
13
16
|
names: ['pv'],
|
|
14
|
-
values: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98]
|
|
17
|
+
values: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98],
|
|
18
|
+
orderNum: 3
|
|
15
19
|
}, {
|
|
16
20
|
names: ['申请退货2'],
|
|
17
|
-
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10]
|
|
21
|
+
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10],
|
|
22
|
+
orderNum: 4
|
|
18
23
|
}, {
|
|
19
|
-
names: ['搜索商品
|
|
20
|
-
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79]
|
|
24
|
+
names: ['搜索商品'],
|
|
25
|
+
values: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79],
|
|
26
|
+
orderNum: 5
|
|
21
27
|
}, {
|
|
22
28
|
names: ['付款成功11付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功付款成功'],
|
|
23
|
-
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
|
|
29
|
+
values: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38],
|
|
30
|
+
orderNum: 1
|
|
24
31
|
}, {
|
|
25
32
|
names: ['查看商品详情'],
|
|
26
|
-
values: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117]
|
|
33
|
+
values: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117],
|
|
34
|
+
orderNum: 2
|
|
27
35
|
}, {
|
|
28
36
|
names: ['scroll'],
|
|
29
|
-
values: [98, 96, 106, 109, 113, 105, 91, 111, 99, 99, 104, 108, 116, 92]
|
|
37
|
+
values: [98, 96, 106, 109, 113, 105, 91, 111, 99, 99, 104, 108, 116, 92],
|
|
38
|
+
orderNum: 3
|
|
30
39
|
}, {
|
|
31
40
|
names: ['click'],
|
|
32
|
-
values: [108, 102, 111, 90, 111, 105, 91, 129, 117, 101, 109, 109, 105, 96]
|
|
41
|
+
values: [108, 102, 111, 90, 111, 105, 91, 129, 117, 101, 109, 109, 105, 96],
|
|
42
|
+
orderNum: 4
|
|
33
43
|
}, {
|
|
34
44
|
names: ['申请退货'],
|
|
35
|
-
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10]
|
|
45
|
+
values: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10],
|
|
46
|
+
orderNum: 5
|
|
36
47
|
}]
|
|
37
48
|
};
|
|
38
49
|
export var barData = {
|
|
39
50
|
xAxis: ['2022-08-23|2022-08-30'],
|
|
40
51
|
series: [{
|
|
41
52
|
names: ['北京市', '所有用户', '查看商品'],
|
|
42
|
-
values: [1560]
|
|
53
|
+
values: [1560],
|
|
54
|
+
orderNum: 1
|
|
43
55
|
}, {
|
|
44
56
|
names: ['北京市', '最近7天活跃用户', '查看商品'],
|
|
45
|
-
values: [1560]
|
|
57
|
+
values: [1560],
|
|
58
|
+
orderNum: 2
|
|
46
59
|
}]
|
|
47
|
-
};
|
|
60
|
+
};
|
|
61
|
+
export var showCharts = ['注册-发送手机验证码|:|1', '搜索商品|:|2', '查看商品详情|:|2', 'scroll|:|3', '申请退货|:|5', 'click|:|4', '搜索商品|:|5'];
|
|
@@ -2,22 +2,34 @@ export default {
|
|
|
2
2
|
xAxis: ['2022-08-25|2022-09-01'],
|
|
3
3
|
series: [{
|
|
4
4
|
names: ['北京市', '所有用户', '加购商品'],
|
|
5
|
+
values: [1370],
|
|
6
|
+
orderNum: 1
|
|
7
|
+
}, {
|
|
8
|
+
names: ['武汉市', '所有用户', '加购商品'],
|
|
5
9
|
values: [1370]
|
|
10
|
+
}, {
|
|
11
|
+
names: ['武汉市', '所有用户', '加购商品'],
|
|
12
|
+
values: [22]
|
|
6
13
|
}, {
|
|
7
14
|
names: ['北京市', '洞察测试用户群二', '加购商品'],
|
|
8
|
-
values: [1370]
|
|
15
|
+
values: [1370],
|
|
16
|
+
orderNum: 2
|
|
9
17
|
}, {
|
|
10
18
|
names: ['北京市', '所有用户', '查看商品'],
|
|
11
|
-
values: [2000]
|
|
19
|
+
values: [2000],
|
|
20
|
+
orderNum: 3
|
|
12
21
|
}, {
|
|
13
22
|
names: ['北京市', '洞察测试用户群二', '查看商品'],
|
|
14
|
-
values: [2000]
|
|
23
|
+
values: [2000],
|
|
24
|
+
orderNum: 3
|
|
15
25
|
}, {
|
|
16
26
|
names: ['北京市', '所有用户', '评价商品'],
|
|
17
|
-
values: [380]
|
|
27
|
+
values: [380],
|
|
28
|
+
orderNum: 3
|
|
18
29
|
}, {
|
|
19
30
|
names: ['北京市', '洞察测试用户群二', '评价商品'],
|
|
20
|
-
values: [380]
|
|
31
|
+
values: [380],
|
|
32
|
+
orderNum: 4
|
|
21
33
|
}, {
|
|
22
34
|
names: ['武汉市', '所有用户', '加购商品'],
|
|
23
35
|
values: [130]
|
package/es/chart/demo/index.js
CHANGED
|
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useRef, useState } from 'react';
|
|
8
8
|
import { BizChart } from '@zgfe/business-lib';
|
|
9
|
-
import chartData from './data/data';
|
|
9
|
+
import chartData, { showCharts } from './data/data';
|
|
10
10
|
import { Button, Image } from 'antd';
|
|
11
11
|
export default (function () {
|
|
12
12
|
var chartRef = useRef();
|
|
@@ -22,7 +22,8 @@ export default (function () {
|
|
|
22
22
|
data: chartData,
|
|
23
23
|
type: "line",
|
|
24
24
|
legendPosition: "bottom",
|
|
25
|
-
ref: chartRef
|
|
25
|
+
ref: chartRef,
|
|
26
|
+
showList: showCharts
|
|
26
27
|
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
27
28
|
onClick: onClick
|
|
28
29
|
}, "\u83B7\u53D6\u56FE\u8868\u56FE\u7247"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Image, {
|
|
@@ -38,6 +38,19 @@
|
|
|
38
38
|
margin-right: @margin-xs;
|
|
39
39
|
border-radius: 50%;
|
|
40
40
|
}
|
|
41
|
+
.biz-tooltip-order {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 12.8px;
|
|
46
|
+
height: 12.8px;
|
|
47
|
+
margin-right: @margin-xs;
|
|
48
|
+
color: #fff;
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
font-size: 8.96px;
|
|
51
|
+
background: #457dff;
|
|
52
|
+
border-radius: 50%;
|
|
53
|
+
}
|
|
41
54
|
.biz-tooltip-name {
|
|
42
55
|
max-width: 300px;
|
|
43
56
|
white-space: pre-wrap;
|
|
@@ -45,7 +45,8 @@ export var legendConfig = {
|
|
|
45
45
|
show: true,
|
|
46
46
|
formatter: function formatter(param) {
|
|
47
47
|
var maxLength = 20;
|
|
48
|
-
var
|
|
48
|
+
var name = param.name.split('|:|')[0];
|
|
49
|
+
var names = name.match(new RegExp("\\S{1,".concat(maxLength, "}"), 'g'));
|
|
49
50
|
return names ? names.join('<br/>') : '';
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -225,8 +226,12 @@ export var getPieOption = function getPieOption() {
|
|
|
225
226
|
color: '#021429',
|
|
226
227
|
fontSize: 10,
|
|
227
228
|
fontWight: 500,
|
|
229
|
+
verticalAlign: 'bottom',
|
|
228
230
|
formatter: function formatter(params) {
|
|
229
|
-
|
|
231
|
+
var nameArr = params.name.split('|:|');
|
|
232
|
+
var name = nameArr[0];
|
|
233
|
+
var orderNum = nameArr[1];
|
|
234
|
+
return "".concat(orderNum ? '{c|' + orderNum + '}' : '{a|' + ' }', " ").concat(util.strMiddleSplit(name), " {b|").concat(params.value, "}");
|
|
230
235
|
},
|
|
231
236
|
rich: {
|
|
232
237
|
a: {
|
|
@@ -239,6 +244,18 @@ export var getPieOption = function getPieOption() {
|
|
|
239
244
|
color: '#67727F',
|
|
240
245
|
fontSize: 10,
|
|
241
246
|
fontWight: 400
|
|
247
|
+
},
|
|
248
|
+
c: {
|
|
249
|
+
backgroundColor: 'inherit',
|
|
250
|
+
width: 8,
|
|
251
|
+
height: 8,
|
|
252
|
+
borderRadius: 8,
|
|
253
|
+
fontSize: 8,
|
|
254
|
+
padding: [3, 3, 2, 3],
|
|
255
|
+
color: '#fff',
|
|
256
|
+
align: 'center',
|
|
257
|
+
verticalAlign: 'middle',
|
|
258
|
+
lineHeight: 8
|
|
242
259
|
}
|
|
243
260
|
}
|
|
244
261
|
},
|
|
@@ -278,7 +295,8 @@ export var getPieOption = function getPieOption() {
|
|
|
278
295
|
var name = params.name,
|
|
279
296
|
value = params.value,
|
|
280
297
|
color = params.color;
|
|
281
|
-
|
|
298
|
+
var nameArr = name.split('|:|');
|
|
299
|
+
return "<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"".concat(nameArr[1] ? 'biz-tooltip-order' : 'biz-tooltip-marker', "\" style=\"background:").concat(color, "\">").concat(nameArr[1] || '', "</span>\n <div class=\"biz-tooltip-name\">").concat(nameArr[0], "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(value, "(").concat(params.percent, "%)</span>\n </div>");
|
|
282
300
|
};
|
|
283
301
|
}
|
|
284
302
|
return _objectSpread(_objectSpread({}, baseConfig), {}, {
|
|
@@ -11,8 +11,10 @@ export var formatPieData = function formatPieData(data, showAll, showList, showO
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
data.series.forEach(function (item) {
|
|
14
|
+
var names = item.names,
|
|
15
|
+
orderNum = item.orderNum;
|
|
14
16
|
var series = {
|
|
15
|
-
name:
|
|
17
|
+
name: "".concat(names.join(',')).concat(orderNum ? '|:|' + orderNum : ''),
|
|
16
18
|
value: item.values[0]
|
|
17
19
|
};
|
|
18
20
|
if (showAll) {
|
|
@@ -37,16 +39,18 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
|
|
|
37
39
|
var colorData = color || chartColors;
|
|
38
40
|
data.series.forEach(function (seriesItem) {
|
|
39
41
|
var name = seriesItem.names.join(',');
|
|
42
|
+
var showName = "".concat(name).concat(seriesItem.orderNum ? '|:|' + seriesItem.orderNum : '');
|
|
43
|
+
resultFormatMap["".concat(name, "Order")] = seriesItem.orderNum;
|
|
40
44
|
if (seriesItem.resultFormat && !resultFormatMap[name]) {
|
|
41
45
|
resultFormatMap[name] = seriesItem.resultFormat;
|
|
42
46
|
}
|
|
43
|
-
if (showAll || showList && showMap[
|
|
47
|
+
if (showAll || showList && showMap[showName] || !showList && sData.length < 10) {
|
|
44
48
|
if (reverseXAxis) {
|
|
45
49
|
xAxis.push(name);
|
|
46
50
|
sData.push({
|
|
47
51
|
name: xAxisData[0],
|
|
48
52
|
value: seriesItem.values[0],
|
|
49
|
-
label:
|
|
53
|
+
label: showName,
|
|
50
54
|
itemStyle: {
|
|
51
55
|
normal: {
|
|
52
56
|
color: colorData[sData.length]
|
|
@@ -55,7 +59,7 @@ export var formatChartData = function formatChartData(data, showAll, showList, r
|
|
|
55
59
|
});
|
|
56
60
|
} else {
|
|
57
61
|
sData.push({
|
|
58
|
-
name:
|
|
62
|
+
name: showName,
|
|
59
63
|
data: seriesItem.values,
|
|
60
64
|
type: isUseSelf ? seriesItem.type : undefined
|
|
61
65
|
});
|
|
@@ -32,7 +32,10 @@ var tooltipFormatterDefault = function tooltipFormatterDefault(params, resultFor
|
|
|
32
32
|
if (item.seriesType === 'bar' && params.length === 1 && !name) {
|
|
33
33
|
name = (item.data && item.data.label ? item.data.label : item.name).trim();
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
var nameArr = name.split('|:|');
|
|
36
|
+
name = nameArr[0];
|
|
37
|
+
var orderNum = nameArr[1];
|
|
38
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"".concat(orderNum ? 'biz-tooltip-order' : 'biz-tooltip-marker', "\" style=\"background:").concat(item.color, "\">").concat(orderNum || '', "</span>\n <div class=\"biz-tooltip-name\">").concat(name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span>\n </div>"));
|
|
36
39
|
});
|
|
37
40
|
return htmlArray.join('');
|
|
38
41
|
};
|
|
@@ -68,14 +71,15 @@ var mapTooltipFormatter = function mapTooltipFormatter(params) {
|
|
|
68
71
|
htmlArray.push("<div class=\"biz-chart-tooltip-title\">".concat(params.name, "</div>"));
|
|
69
72
|
var childrenOptions = data.childrenOptions;
|
|
70
73
|
childrenOptions.forEach(function (option) {
|
|
71
|
-
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n
|
|
74
|
+
htmlArray.push("<div class=\"biz-chart-tooltip-item\">\n <div class=\"biz-chart-tooltip-content\">\n <span class=\"".concat(option.orderNum ? 'biz-tooltip-order' : '', "\">").concat(option.orderNum || '', "</span>\n <div class=\"biz-tooltip-name\">").concat(option.name, "</div>\n </div> \n <span class=\"biz-chart-tooltip-value\">").concat(util.toThousands(option.value), "</span>\n </div>"));
|
|
72
75
|
});
|
|
73
76
|
return htmlArray.join('');
|
|
74
77
|
}
|
|
75
78
|
return "<div class=\"biz-chart-tooltip-item\"><span class=\"biz-chart-tooltip-content\">".concat(data.name, ": </span><span>").concat(util.toThousands(data.value), "</span></div>");
|
|
76
79
|
};
|
|
77
80
|
var legendFormatterDefault = function legendFormatterDefault(label) {
|
|
78
|
-
|
|
81
|
+
var nameArr = label.split('|:|');
|
|
82
|
+
return util.strMiddleSplit(nameArr[0], {
|
|
79
83
|
maxLength: maxLength,
|
|
80
84
|
beginLength: maxLength / 2 - 2,
|
|
81
85
|
endLength: maxLength / 2 - 2,
|
package/es/chart/util/mapUtil.js
CHANGED
|
@@ -124,7 +124,8 @@ var formatMapData = function formatMapData(seriesData, type) {
|
|
|
124
124
|
var targetName = item.names.slice(1).join(',');
|
|
125
125
|
var targeItem = {
|
|
126
126
|
name: targetName || areaName,
|
|
127
|
-
value: item.values[0]
|
|
127
|
+
value: item.values[0],
|
|
128
|
+
orderNum: item.orderNum
|
|
128
129
|
};
|
|
129
130
|
if (!areaObjMap[areaName]) {
|
|
130
131
|
areaObjMap[areaName] = {
|
package/es/datePicker/index.js
CHANGED
|
@@ -140,13 +140,16 @@ var BizDatePicker = function BizDatePicker(_ref) {
|
|
|
140
140
|
setDateRange(getDateRange(DatePickerTypes.Unit.day, 1, includeToday));
|
|
141
141
|
}
|
|
142
142
|
if (type.value === 'day') {
|
|
143
|
-
setDateRange(getDateRange(DatePickerTypes.Unit.day,
|
|
143
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.day, 7, includeToday));
|
|
144
|
+
setRelative([7, includeToday ? 0 : 1]);
|
|
144
145
|
}
|
|
145
146
|
if (type.value === 'week') {
|
|
146
|
-
setDateRange(getDateRange(DatePickerTypes.Unit.
|
|
147
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.week, 4, includeToday));
|
|
148
|
+
setRelative([4, includeToday ? 0 : 1]);
|
|
147
149
|
}
|
|
148
150
|
if (type.value === 'month') {
|
|
149
|
-
setDateRange(getDateRange(DatePickerTypes.Unit.
|
|
151
|
+
setDateRange(getDateRange(DatePickerTypes.Unit.month, 1, includeToday));
|
|
152
|
+
setRelative([1, includeToday ? 0 : 1]);
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
}), /*#__PURE__*/React.createElement(PickerShortcut, null), /*#__PURE__*/React.createElement(BizDate, {
|
package/es/select/demo/index.js
CHANGED
|
@@ -72,6 +72,7 @@ export default (function () {
|
|
|
72
72
|
theme: "secondary",
|
|
73
73
|
onChange: onChange,
|
|
74
74
|
disableItemList: disabledList,
|
|
75
|
-
dropdownExtra: /*#__PURE__*/React.createElement(Button, null, "+ \u6DFB\u52A0")
|
|
75
|
+
dropdownExtra: /*#__PURE__*/React.createElement(Button, null, "+ \u6DFB\u52A0"),
|
|
76
|
+
extraLabel: ' (别名)'
|
|
76
77
|
}), /*#__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)));
|
|
77
78
|
});
|
package/es/select/handle.js
CHANGED
|
@@ -17,7 +17,8 @@ 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
|
|
20
|
+
disable = props.disable,
|
|
21
|
+
extraLabel = props.extraLabel;
|
|
21
22
|
var classPrefix = 'biz-select-handle';
|
|
22
23
|
var _useState = useState(false),
|
|
23
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -145,7 +146,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
145
146
|
return /*#__PURE__*/React.createElement("div", {
|
|
146
147
|
ref: handleRef,
|
|
147
148
|
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'),
|
|
148
|
-
title: props.label || (optionData === null || optionData === void 0 ? void 0 : optionData[aliasField || '']) || (optionData === null || optionData === void 0 ? void 0 : optionData[labelField])
|
|
149
|
+
title: "".concat(props.label || (optionData === null || optionData === void 0 ? void 0 : optionData[aliasField || '']) || (optionData === null || optionData === void 0 ? void 0 : optionData[labelField]) || '').concat(extraLabel)
|
|
149
150
|
}, /*#__PURE__*/React.createElement("span", {
|
|
150
151
|
className: "".concat(classPrefix, "-content")
|
|
151
152
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -154,7 +155,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
154
155
|
className: "".concat(classPrefix, "-icon")
|
|
155
156
|
}, 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", {
|
|
156
157
|
className: "".concat(classPrefix, "-holder")
|
|
157
|
-
}, placeholder || '请选择'))), /*#__PURE__*/React.createElement(IconFont, {
|
|
158
|
+
}, placeholder || '请选择'), extraLabel)), /*#__PURE__*/React.createElement(IconFont, {
|
|
158
159
|
className: "".concat(classPrefix, "-expand-icon").concat(props.open ? ' open' : ''),
|
|
159
160
|
type: 'xiangxia'
|
|
160
161
|
}));
|
|
@@ -163,6 +164,7 @@ SelectHandle.defaultProps = {
|
|
|
163
164
|
labelField: 'label',
|
|
164
165
|
keyField: 'id',
|
|
165
166
|
border: true,
|
|
166
|
-
showSelectIcon: true
|
|
167
|
+
showSelectIcon: true,
|
|
168
|
+
extraLabel: ''
|
|
167
169
|
};
|
|
168
170
|
export default SelectHandle;
|
package/es/select/index.js
CHANGED
package/es/select/types.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare namespace BizSelectTypes {
|
|
|
26
26
|
minDropdownWidth?: number;
|
|
27
27
|
options: Group[] | Option[];
|
|
28
28
|
extra?: (option: Option) => ReactNode;
|
|
29
|
+
extraLabel?: ReactNode;
|
|
29
30
|
dropdownExtra?: ReactNode;
|
|
30
31
|
enableSearch?: boolean;
|
|
31
32
|
enableCreate?: boolean;
|
|
@@ -75,6 +76,7 @@ export declare namespace BizSelectTypes {
|
|
|
75
76
|
}
|
|
76
77
|
export interface HandlerTypes {
|
|
77
78
|
label?: string;
|
|
79
|
+
extraLabel?: ReactNode;
|
|
78
80
|
children?: ReactNode;
|
|
79
81
|
placeholder?: string;
|
|
80
82
|
value?: BizSelectTypes.Option | BizSelectTypes.Option[];
|
|
@@ -100,7 +100,7 @@ export declare namespace BizUserConditionT {
|
|
|
100
100
|
}[];
|
|
101
101
|
}
|
|
102
102
|
interface AttrCondition {
|
|
103
|
-
attrId: number;
|
|
103
|
+
attrId: number | string;
|
|
104
104
|
attrName: string;
|
|
105
105
|
operator: 'is not null' | 'is null' | 'not contains' | 'contains' | 'equal' | 'not equal' | 'begin with' | 'not begin with' | 'end with' | 'not end with' | Unpacked<RunTimesI, 'operator'>;
|
|
106
106
|
params: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8-session.0",
|
|
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": "8a2bf276e16ad49832b52b08dc033c8f4aa42319",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|