@zgfe/modules-attribution 1.0.1-alpha.31 → 1.0.1-alpha.33
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/modules/content/index.js +3 -1
- package/es/modules/searchPanel/components/attributableEvents.js +17 -11
- package/es/modules/searchPanel/components/globalAttribute.js +1 -1
- package/es/modules/searchPanel/components/targetEvent.js +9 -6
- package/es/modules/searchPanel/index.js +0 -1
- package/package.json +2 -2
|
@@ -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);
|
|
@@ -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
|
-
|
|
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
|
-
|
|
144
|
-
if (
|
|
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 (
|
|
148
|
-
|
|
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
|
-
|
|
160
|
-
|
|
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 ===
|
|
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 >=
|
|
246
|
+
className: "".concat(count >= 5 || (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
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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 ===
|
|
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:
|
|
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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-attribution",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.33",
|
|
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": "
|
|
53
|
+
"gitHead": "582f0dbf81c8d3ab20d01e52d182d4613cf3bbb0"
|
|
54
54
|
}
|