@zgfe/business-lib 1.2.10-session.2 → 1.2.10-session.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.
@@ -7,15 +7,15 @@ var extraList = [{
7
7
  attrList: [{
8
8
  id: 'sa_duration',
9
9
  label: 'Session时长',
10
- propCategory: 'extraProp',
11
- key: 'extraProp-sa_duration',
10
+ propCategory: 'sessionProp',
11
+ key: 'sessionProp-sa_duration',
12
12
  type: 2,
13
13
  subtype: 2
14
14
  }, {
15
15
  id: 'se_duration',
16
16
  label: '事件使用时长',
17
- propCategory: 'extraProp',
18
- key: 'extraProp-se_duration',
17
+ propCategory: 'sessionProp',
18
+ key: 'sessionProp-se_duration',
19
19
  type: 2,
20
20
  subtype: 2
21
21
  }]
@@ -35,7 +35,7 @@ export default (function () {
35
35
  attrName: 'is_anonymous'
36
36
  }, {
37
37
  attrId: 'sa_duration',
38
- propCategory: 'extraProp',
38
+ propCategory: 'sessionProp',
39
39
  type: 2,
40
40
  operator: 'gt',
41
41
  values: ['158400', '1'],
@@ -6,15 +6,15 @@ var extraList = [{
6
6
  attrList: [{
7
7
  id: 'sa_duration',
8
8
  label: 'Session时长',
9
- propCategory: 'extraProp',
10
- key: 'extraProp-sa_duration',
9
+ propCategory: 'sessionProp',
10
+ key: 'sessionProp-sa_duration',
11
11
  type: 2,
12
12
  subtype: 2
13
13
  }, {
14
14
  id: 'se_duration',
15
15
  label: '事件使用时长',
16
- propCategory: 'extraProp',
17
- key: 'extraProp-se_duration',
16
+ propCategory: 'sessionProp',
17
+ key: 'sessionProp-se_duration',
18
18
  type: 2,
19
19
  subtype: 2
20
20
  }]
@@ -55,8 +55,8 @@ 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) {
58
+ } else {
59
+ if (data.attrId && data.propCategory) {
60
60
  attrData = {
61
61
  id: data.attrId,
62
62
  propCategory: data.propCategory,
@@ -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) === PropCategory.UserProp || (attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.ExtraProp) && (attr === null || attr === void 0 ? void 0 : attr.subtype) === 2) {
40
+ if (((attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.UserProp || (attr === null || attr === void 0 ? void 0 : attr.propCategory) === PropCategory.SessionProp) && (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.propCategory) === PropCategory.ExtraProp) && (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.SessionProp) && (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 === PropCategory.UserProp || attr.propCategory === PropCategory.ExtraProp) && attr.subtype === 2 && numberAfter);
147
+ }), (attr.propCategory === PropCategory.UserProp || attr.propCategory === PropCategory.SessionProp) && attr.subtype === 2 && numberAfter);
148
148
  } else {
149
149
  if (operate === OperateTypes.Absolute) {
150
150
  return /*#__PURE__*/React.createElement(RangePicker, {
@@ -20,17 +20,17 @@ 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
- } else {
23
+ } else if (attr.propCategory === PropCategory.UserProp || attr.propCategory === PropCategory.EnvProp) {
29
24
  responseData.attrName = attr.name;
30
25
  responseData.category = attr.category;
31
26
  if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
32
27
  responseData.subtype = attr.subtype;
33
28
  }
29
+ } else {
30
+ responseData.attrName = attr.label;
31
+ if (attr.propCategory === PropCategory.SessionProp && attr.subtype) {
32
+ responseData.subtype = attr.subtype;
33
+ }
34
34
  }
35
35
  return responseData;
36
36
  }
@@ -18,7 +18,7 @@ export declare namespace AttrConditionTypes {
18
18
  label?: string;
19
19
  attrNameStr?: string;
20
20
  type?: PropType;
21
- propCategory?: 'userProp' | 'eventProp' | 'envProp' | 'extraProp';
21
+ propCategory?: 'userProp' | 'eventProp' | 'envProp' | string;
22
22
  category?: 'fixed' | 'custom';
23
23
  dimensionSub?: string;
24
24
  operator?: OperateTypes;
@@ -17,8 +17,8 @@ var extraList = [{
17
17
  attrList: [{
18
18
  id: 'sa_duration',
19
19
  label: 'Session时长',
20
- propCategory: 'extraProp',
21
- key: 'extraProp-sa_duration',
20
+ propCategory: 'sessionProp',
21
+ key: 'sessionProp-sa_duration',
22
22
  type: 2,
23
23
  subtype: 2
24
24
  }]
@@ -28,21 +28,21 @@ var extraList = [{
28
28
  attrList: [{
29
29
  id: 'page_duration',
30
30
  label: '页面访问时长',
31
- propCategory: 'extraProp',
32
- key: 'extraProp-page_duration'
31
+ propCategory: 'pageProp',
32
+ key: 'pageProp-page_duration'
33
33
  }, {
34
34
  id: 'click',
35
35
  label: '页面点击次数',
36
- propCategory: 'extraProp',
37
- key: 'extraProp-click'
36
+ propCategory: 'pageProp',
37
+ key: 'pageProp-click'
38
38
  }]
39
39
  }];
40
40
  export default (function () {
41
41
  var _useState = useState({
42
42
  id: 'sa_duration',
43
43
  label: 'Session时长',
44
- propCategory: 'extraProp',
45
- key: 'extraProp-sa_duration',
44
+ propCategory: 'sessionProp',
45
+ key: 'sessionProp-sa_duration',
46
46
  type: 2,
47
47
  subtype: 2
48
48
  }),
@@ -83,7 +83,7 @@ export default (function () {
83
83
  extra: list,
84
84
  disableItemList: [{
85
85
  id: 'click',
86
- propCategory: 'extraProp'
86
+ propCategory: 'sessionProp'
87
87
  }]
88
88
  })));
89
89
  });
@@ -85,13 +85,13 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
85
85
  if (attr.name === param.name && attr.category === param.category) res = attr;
86
86
  }
87
87
  });
88
- } else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'extraProp') {
88
+ } else {
89
89
  extra === null || extra === void 0 ? void 0 : extra.forEach(function (item) {
90
90
  item.attrList.forEach(function (attr) {
91
91
  if (hasKey) {
92
- if (attr.key === param.key) res = _.cloneDeep(attr);
92
+ if (attr.key === (param === null || param === void 0 ? void 0 : param.key)) res = _.cloneDeep(attr);
93
93
  } else {
94
- if (attr.id === param.id) res = _.cloneDeep(attr);
94
+ if (attr.id === (param === null || param === void 0 ? void 0 : param.id)) res = _.cloneDeep(attr);
95
95
  }
96
96
  });
97
97
  });
@@ -59,8 +59,8 @@ var AttrListPanel = function AttrListPanel(props) {
59
59
  item.key = "eventProp-".concat(item.id);
60
60
  } else if (item.propCategory === 'userProp') {
61
61
  item.key = "userProp-".concat(item.name);
62
- } else if (item.propCategory === 'extraProp') {
63
- item.key = "extraProp-".concat(item.id);
62
+ } else {
63
+ item.key = "".concat(item.propCategory, "-").concat(item.id || (item === null || item === void 0 ? void 0 : item.name));
64
64
  }
65
65
  return item;
66
66
  });
@@ -9,7 +9,7 @@ export declare enum PropCategory {
9
9
  EventProp = "eventProp",
10
10
  UserProp = "userProp",
11
11
  EnvProp = "envProp",
12
- ExtraProp = "extraProp"
12
+ SessionProp = "sessionProp"
13
13
  }
14
14
  export declare enum ShowStatus {
15
15
  show = 0,
@@ -103,10 +103,11 @@ export declare namespace AttributeSelect {
103
103
  attrList: ExtraProp[];
104
104
  }
105
105
  interface ExtraProp extends BasicProp {
106
- propCategory: 'extraProp';
106
+ propCategory: string;
107
107
  key?: number | string;
108
108
  name?: string;
109
109
  subtype?: number;
110
+ [key: string]: any;
110
111
  }
111
112
  interface Option {
112
113
  groupName: string;
@@ -9,7 +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
+ PropCategory["SessionProp"] = "sessionProp";
13
13
  })(PropCategory || (PropCategory = {}));
14
14
  export var ShowStatus;
15
15
  (function (ShowStatus) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.10-session.2",
3
+ "version": "1.2.10-session.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": "dd0fcae68835a8dfbc1bacd80ed6a06c7f7a7e4c",
58
+ "gitHead": "a4619711126c3b1efd8a5fbfa2abf56e9da6fb96",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }