@zgfe/modules-attribution 1.0.1-alpha.30 → 1.0.1-alpha.32

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.
@@ -57,7 +57,9 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
57
57
  });
58
58
  request(Apis.getAnalyseData, {
59
59
  method: 'post',
60
- data: _objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time)
60
+ data: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time), {}, {
61
+ searchType: 0
62
+ })
61
63
  }).then(function (res) {
62
64
  if (res === null || res === void 0 ? void 0 : res.data) {
63
65
  var _data = handleTableData(res === null || res === void 0 ? void 0 : res.data);
@@ -99,19 +99,6 @@ var defaultValue = {
99
99
  }
100
100
  }
101
101
  }],
102
- "globalFilters": {
103
- "relation": "and",
104
- "conditions": [{
105
- "attrId": 31331,
106
- "propCategory": "eventProp",
107
- "type": 2,
108
- "operator": "gt",
109
- "values": ["55"],
110
- "dimensionSub": "event_attr",
111
- "label": "price",
112
- "attrName": "price"
113
- }]
114
- },
115
102
  "attributionType": 3,
116
103
  "otherEvent": true,
117
104
  "windowCnt": 2,
@@ -10,6 +10,7 @@ import { AttributableContext } from '../../../types';
10
10
  import _ from 'lodash';
11
11
  import { Tooltip, message } from 'antd';
12
12
  var AttributableEvents = function AttributableEvents(props) {
13
+ var _ReasonData$event3, _ReasonData$event4;
13
14
  var value = props.value,
14
15
  setMincePropCount = props.setMincePropCount,
15
16
  mincePropCount = props.mincePropCount,
@@ -126,7 +127,8 @@ var AttributableEvents = function AttributableEvents(props) {
126
127
  onChangeHandle(ReasonData, data, minceAttr);
127
128
  };
128
129
  var onAdd = function onAdd() {
129
- if (ReasonData === undefined && bizEventSelectorDefaultValue === undefined) {
130
+ var _ReasonData$event;
131
+ if ((ReasonData === null || ReasonData === void 0 ? void 0 : (_ReasonData$event = ReasonData.event) === null || _ReasonData$event === void 0 ? void 0 : _ReasonData$event.id) === -100 && Object.keys(bizEventSelectorDefaultValue)) {
130
132
  message.error('请先选择待归因事件');
131
133
  return;
132
134
  }
@@ -140,15 +142,17 @@ var AttributableEvents = function AttributableEvents(props) {
140
142
  }, 0);
141
143
  };
142
144
  var onMinceProp = function onMinceProp() {
143
- console.log('attrSelectShow', attrSelectShow);
144
- if (attrSelectShow) {
145
+ var _ReasonData$event2;
146
+ if ((ReasonData === null || ReasonData === void 0 ? void 0 : (_ReasonData$event2 = ReasonData.event) === null || _ReasonData$event2 === void 0 ? void 0 : _ReasonData$event2.id) === -100 && Object.keys(bizEventSelectorDefaultValue)) {
147
+ message.error('请先选择待归因事件');
145
148
  return;
146
149
  }
147
- if (ReasonData !== undefined || bizEventSelectorDefaultValue !== undefined) {
148
- setAttrSelectShow(true);
149
- setButtonDisable(true);
150
- handleCount('add', mincePropCount, setMincePropCount, 1);
150
+ if (attrSelectShow) {
151
+ return;
151
152
  }
153
+ setAttrSelectShow(true);
154
+ setButtonDisable(true);
155
+ handleCount('add', mincePropCount, setMincePropCount, 1);
152
156
  };
153
157
  var onChangeReason = function onChangeReason(reason) {
154
158
  setReasonData(reason);
@@ -156,8 +160,10 @@ var AttributableEvents = function AttributableEvents(props) {
156
160
  var _reason$event;
157
161
  setEventId(reason === null || reason === void 0 ? void 0 : (_reason$event = reason.event) === null || _reason$event === void 0 ? void 0 : _reason$event.id);
158
162
  }
159
- var filterData = _.cloneDeep(filters);
160
- onChangeHandle(reason, filterData, minceAttr);
163
+ setFilters(undefined);
164
+ setBizAttributeSelectorValue(undefined);
165
+ setIsAdd(false);
166
+ onChangeHandle(reason, undefined, undefined);
161
167
  };
162
168
  var onChangeAttr = function onChangeAttr(attr) {
163
169
  if (attr === undefined) {
@@ -230,14 +236,14 @@ var AttributableEvents = function AttributableEvents(props) {
230
236
  placement: "top",
231
237
  title: '添加属性细分'
232
238
  }, /*#__PURE__*/React.createElement(IconFont, {
233
- className: "".concat(attrSelectShow || ReasonData === undefined && bizEventSelectorDefaultValue === undefined ? 'disable' : ''),
239
+ className: "".concat(attrSelectShow || (ReasonData === null || ReasonData === void 0 ? void 0 : (_ReasonData$event3 = ReasonData.event) === null || _ReasonData$event3 === void 0 ? void 0 : _ReasonData$event3.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0 ? 'disable' : ''),
234
240
  type: "tianjia2",
235
241
  onClick: onMinceProp
236
242
  })), /*#__PURE__*/React.createElement(Tooltip, {
237
243
  placement: "top",
238
244
  title: '添加属性筛选'
239
245
  }, /*#__PURE__*/React.createElement(IconFont, {
240
- className: "".concat(count >= 10 || ReasonData === undefined && bizEventSelectorDefaultValue === undefined ? 'disable' : ''),
246
+ className: "".concat(count >= 10 || (ReasonData === null || ReasonData === void 0 ? void 0 : (_ReasonData$event4 = ReasonData.event) === null || _ReasonData$event4 === void 0 ? void 0 : _ReasonData$event4.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0 ? 'disable' : ''),
241
247
  type: "shaixuan",
242
248
  onClick: function onClick() {
243
249
  return onAdd();
@@ -31,7 +31,7 @@ var GlobalAttribute = function GlobalAttribute(props) {
31
31
  if (!props.value) {
32
32
  conditionRef.current.setValue(props.value);
33
33
  }
34
- }, [props.eventIdList]);
34
+ }, [props.eventIdList, props.value]);
35
35
  var onAdd = function onAdd() {
36
36
  if (props.eventIdList[0] === -100) return;
37
37
  conditionRef.current.add();
@@ -6,9 +6,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useRef, useState } from 'react';
8
8
  import { BizAttrConditionGroup, BizEventSelector, IconFont } from '@zgfe/business-lib';
9
- import _ from 'lodash';
10
9
  import { Select, Tooltip, message } from 'antd';
11
10
  var TargetEvent = function TargetEvent(props) {
11
+ var _targetData$event2;
12
12
  var value = props.value,
13
13
  setAttrTargetCount = props.setAttrTargetCount,
14
14
  eventIdList = props.eventIdList,
@@ -66,7 +66,9 @@ var TargetEvent = function TargetEvent(props) {
66
66
  onChangeHandle(targetData, data);
67
67
  };
68
68
  var onAdd = function onAdd() {
69
- if (targetData === undefined && bizEventSelectorDefaultValue === undefined) {
69
+ var _targetData$event;
70
+ console.log('添加筛选', targetData, bizEventSelectorDefaultValue);
71
+ if ((targetData === null || targetData === void 0 ? void 0 : (_targetData$event = targetData.event) === null || _targetData$event === void 0 ? void 0 : _targetData$event.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0) {
70
72
  message.error('请先选择目标事件');
71
73
  return;
72
74
  }
@@ -85,8 +87,9 @@ var TargetEvent = function TargetEvent(props) {
85
87
  var _target$event;
86
88
  setEventId(target === null || target === void 0 ? void 0 : (_target$event = target.event) === null || _target$event === void 0 ? void 0 : _target$event.id);
87
89
  }
88
- var filterData = _.cloneDeep(filters);
89
- onChangeHandle(target, filterData);
90
+ setFilters(undefined);
91
+ setIsAdd(false);
92
+ onChangeHandle(target, undefined);
90
93
  };
91
94
  useEffect(function () {
92
95
  setAttrTargetCount(count);
@@ -138,14 +141,14 @@ var TargetEvent = function TargetEvent(props) {
138
141
  placement: "top",
139
142
  title: '添加属性筛选'
140
143
  }, /*#__PURE__*/React.createElement(IconFont, {
141
- className: "".concat(count >= 5 || targetData === undefined && bizEventSelectorDefaultValue === undefined ? 'disable' : ''),
144
+ className: "".concat(count >= 5 || (targetData === null || targetData === void 0 ? void 0 : (_targetData$event2 = targetData.event) === null || _targetData$event2 === void 0 ? void 0 : _targetData$event2.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0 ? 'disable' : ''),
142
145
  type: "shaixuan",
143
146
  onClick: function onClick() {
144
147
  return onAdd();
145
148
  }
146
149
  }))), /*#__PURE__*/React.createElement("div", null, (filters || isAdd) && /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
147
150
  ref: conditionRef,
148
- value: filters,
151
+ value: undefined,
149
152
  onlyAnd: true,
150
153
  enableEventProp: true,
151
154
  enableDelete: true,
@@ -105,7 +105,6 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
105
105
  useEffect(function () {
106
106
  if (defaultValue && reset !== null) {
107
107
  var data = defaultValue;
108
- console.log('初始化', data);
109
108
  if (reset) {
110
109
  data = {
111
110
  targetFilters: initTarget,
@@ -41,10 +41,11 @@ var judgeAttrInEvents = function judgeAttrInEvents(elds, attrId, eventGroupList)
41
41
  export function operableOrNotHandle(data, attrSourceCount, attrTargetCount, mincePropCount, attrGlobalCount) {
42
42
  var flag = false;
43
43
  data.attributionType === undefined ? flag = true : null;
44
- subsetHandle(data, 'sourceFilters', attrSourceCount, mincePropCount) ? flag = true : null;
45
- subsetHandle(data, 'targetFilters', attrTargetCount) ? flag = true : null;
46
- if (data.globalFilters) {
47
- conditionsHandle('globalFilters', data.globalFilters, attrGlobalCount, 0) ? flag = true : null;
44
+ if (subsetHandle(data, 'sourceFilters', attrSourceCount, mincePropCount)) flag = true;
45
+ if (subsetHandle(data, 'targetFilters', attrTargetCount)) flag = true;
46
+ if (attrGlobalCount && data.globalFilters === undefined) flag = true;
47
+ if (data.globalFilters && conditionsHandle('globalFilters', data.globalFilters, attrGlobalCount, 0)) {
48
+ flag = true;
48
49
  }
49
50
  return flag;
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-attribution",
3
- "version": "1.0.1-alpha.30",
3
+ "version": "1.0.1-alpha.32",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -50,5 +50,5 @@
50
50
  "react": "^16.12.0 || ^17.0.0",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "d9314ca0a5f0d92e1e048db27d6006e23ba9271b"
53
+ "gitHead": "fe9209c32059c9521177c19e1858b2efaa089125"
54
54
  }