@zgfe/modules-attribution 1.0.1-alpha.8 → 1.0.2-alpha.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/components/option/index.js +12 -5
- package/es/components/option/types.d.ts +3 -6
- package/es/components/searchTime/index.js +12 -5
- package/es/components/tableList/index.d.ts +2 -2
- package/es/components/tableList/index.js +12 -3
- package/es/components/tableList/styles/index.less +9 -1
- package/es/components/title/index.js +6 -5
- package/es/constants/apis.d.ts +0 -4
- package/es/constants/apis.js +0 -4
- package/es/constants/fields.d.ts +0 -139
- package/es/constants/fields.js +1 -148
- package/es/constants/index.d.ts +2 -4
- package/es/constants/index.js +2 -4
- package/es/images/empty.png +0 -0
- package/es/modules/content/index.d.ts +3 -3
- package/es/modules/content/index.js +42 -44
- package/es/modules/content/types.d.ts +3 -3
- package/es/modules/content/utils.d.ts +0 -6
- package/es/modules/content/utils.js +0 -163
- package/es/modules/home/demo/create.js +5 -35
- package/es/modules/home/demo/edit.js +61 -105
- package/es/modules/home/demo/index.js +4 -36
- package/es/modules/home/demo/scene.js +4 -34
- package/es/modules/home/index.d.ts +2 -2
- package/es/modules/home/index.js +13 -17
- package/es/modules/home/styles/index.less +2 -1
- package/es/modules/home/types.d.ts +1 -5
- package/es/modules/searchPanel/components/attributableEvents.js +117 -54
- package/es/modules/searchPanel/components/globalAttribute.d.ts +3 -1
- package/es/modules/searchPanel/components/globalAttribute.js +8 -4
- package/es/modules/searchPanel/components/targetEvent.js +28 -21
- package/es/modules/searchPanel/index.d.ts +1 -1
- package/es/modules/searchPanel/index.js +120 -78
- package/es/modules/searchPanel/types.d.ts +24 -10
- package/es/modules/searchPanel/utils.d.ts +8 -5
- package/es/modules/searchPanel/utils.js +51 -102
- package/es/types.d.ts +29 -39
- package/package.json +3 -3
- package/es/constants/chart.d.ts +0 -2
- package/es/constants/chart.js +0 -24
- package/es/constants/color.d.ts +0 -1
- package/es/constants/color.js +0 -1
- package/es/modules/searchPanel/demo/index.d.ts +0 -2
- package/es/modules/searchPanel/demo/index.js +0 -28
- package/es/utils/transfer.d.ts +0 -65
- package/es/utils/transfer.js +0 -173
|
@@ -9,18 +9,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
9
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
10
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
11
11
|
import request from '../../utils/request';
|
|
12
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
13
|
-
import Request from 'umi-request';
|
|
12
|
+
import React, { useContext, useEffect, useState, useRef } from 'react';
|
|
14
13
|
import SearchPanel from '../searchPanel';
|
|
15
14
|
import './styles/index.less';
|
|
16
15
|
import { Apis } from '../../constants';
|
|
17
16
|
import { handleTableData } from './utils';
|
|
18
17
|
import { TableList, OptionGroup, SearchTime } from '../../components';
|
|
19
|
-
import util from '../../utils/util';
|
|
20
|
-
var CancelToken = Request.CancelToken;
|
|
21
|
-
var cancel;
|
|
22
18
|
var classPrefix = 'attribution-content';
|
|
23
|
-
var
|
|
19
|
+
var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24
20
|
var _useState = useState(props.value),
|
|
25
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
22
|
searchData = _useState2[0],
|
|
@@ -29,29 +25,20 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
29
25
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
26
|
loading = _useState4[0],
|
|
31
27
|
setLoading = _useState4[1];
|
|
32
|
-
var _useState5 = useState(0),
|
|
33
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
|
-
timer = _useState6[0],
|
|
35
|
-
setTimer = _useState6[1];
|
|
36
28
|
var _useContext = useContext(BizGlobalDataContext),
|
|
37
29
|
currentApp = _useContext.currentApp;
|
|
30
|
+
var _useState5 = useState(true),
|
|
31
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
32
|
+
isFetchRequest = _useState6[0],
|
|
33
|
+
setIsFetchRequest = _useState6[1];
|
|
38
34
|
var _useState7 = useState(null),
|
|
39
35
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
40
36
|
time = _useState8[0],
|
|
41
37
|
setTime = _useState8[1];
|
|
42
38
|
useEffect(function () {
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (flag) {
|
|
47
|
-
fetchRequest();
|
|
48
|
-
}
|
|
49
|
-
}, 500));
|
|
50
|
-
return function () {
|
|
51
|
-
if (timer) clearTimeout(timer);
|
|
52
|
-
flag = false;
|
|
53
|
-
};
|
|
54
|
-
}, [searchData, time]);
|
|
39
|
+
if (searchData.sourceFilters && searchData.sourceFilters[0].eventId === -100) return;
|
|
40
|
+
fetchRequest();
|
|
41
|
+
}, [searchData]);
|
|
55
42
|
useEffect(function () {
|
|
56
43
|
props.onSearching && props.onSearching(loading);
|
|
57
44
|
}, [loading]);
|
|
@@ -60,38 +47,34 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
60
47
|
total = _useState10[0],
|
|
61
48
|
setTotal = _useState10[1];
|
|
62
49
|
var fetchRequest = function fetchRequest() {
|
|
63
|
-
if (
|
|
64
|
-
|
|
50
|
+
if (!isFetchRequest) {
|
|
51
|
+
return;
|
|
65
52
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
console.log('请求表格数据:', _searchData);
|
|
53
|
+
setIsFetchRequest(false);
|
|
54
|
+
setLoading(true);
|
|
55
|
+
var _searchData = _objectSpread(_objectSpread({}, searchData), {}, {
|
|
56
|
+
targetFilters: searchData.targetFilters[0]
|
|
57
|
+
});
|
|
73
58
|
request(Apis.getAnalyseData, {
|
|
74
59
|
method: 'post',
|
|
75
|
-
data: _objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time),
|
|
76
|
-
|
|
77
|
-
cancel = c;
|
|
60
|
+
data: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time), {}, {
|
|
61
|
+
searchType: 0
|
|
78
62
|
})
|
|
79
63
|
}).then(function (res) {
|
|
80
|
-
if (res.data) {
|
|
81
|
-
var _data = handleTableData(res.data);
|
|
82
|
-
console.log('表格数据', _data);
|
|
64
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
65
|
+
var _data = handleTableData(res === null || res === void 0 ? void 0 : res.data);
|
|
83
66
|
setTableDataList(_data);
|
|
84
67
|
setTotal(res.data.total);
|
|
85
68
|
}
|
|
86
69
|
setTimeout(function () {
|
|
87
70
|
setLoading(false);
|
|
88
|
-
},
|
|
71
|
+
}, 20);
|
|
89
72
|
}).catch(function () {
|
|
90
73
|
setLoading(false);
|
|
91
74
|
});
|
|
92
75
|
};
|
|
93
|
-
var onChangeSearch = function onChangeSearch(allData) {
|
|
94
|
-
|
|
76
|
+
var onChangeSearch = function onChangeSearch(allData, isFetchRequest) {
|
|
77
|
+
setIsFetchRequest(isFetchRequest);
|
|
95
78
|
setSearchData(function (data) {
|
|
96
79
|
return _objectSpread(_objectSpread({}, allData), {}, {
|
|
97
80
|
time: data === null || data === void 0 ? void 0 : data.time
|
|
@@ -99,7 +82,6 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
99
82
|
});
|
|
100
83
|
};
|
|
101
84
|
var onChangeContent = function onChangeContent(data) {
|
|
102
|
-
console.log('改变时间和图表类型', data);
|
|
103
85
|
setTime(data);
|
|
104
86
|
setSearchData(function (value) {
|
|
105
87
|
return _objectSpread(_objectSpread({}, value), data);
|
|
@@ -109,13 +91,28 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
109
91
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
110
92
|
tableDataList = _useState12[0],
|
|
111
93
|
setTableDataList = _useState12[1];
|
|
94
|
+
var SearchPanelRef = useRef(null);
|
|
95
|
+
var onGetSearchData = function onGetSearchData() {
|
|
96
|
+
if (SearchPanelRef) {
|
|
97
|
+
SearchPanelRef.current.onGetSearchData();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var resetTime = function resetTime() {
|
|
101
|
+
setSearchData(function (value) {
|
|
102
|
+
return _objectSpread(_objectSpread({}, value), {}, {
|
|
103
|
+
time: undefined
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
112
107
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
108
|
className: classPrefix
|
|
114
109
|
}, /*#__PURE__*/React.createElement("div", {
|
|
115
110
|
className: "".concat(classPrefix, "-top-content-box")
|
|
116
111
|
}, /*#__PURE__*/React.createElement(SearchPanel, {
|
|
112
|
+
ref: SearchPanelRef,
|
|
117
113
|
defaultValue: searchData,
|
|
118
|
-
onChange: onChangeSearch
|
|
114
|
+
onChange: onChangeSearch,
|
|
115
|
+
resetTime: resetTime
|
|
119
116
|
})), /*#__PURE__*/React.createElement("div", {
|
|
120
117
|
className: "".concat(classPrefix, "-bottom-content-box")
|
|
121
118
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -125,10 +122,11 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
125
122
|
onChange: onChangeContent
|
|
126
123
|
}), searchData && /*#__PURE__*/React.createElement(OptionGroup, {
|
|
127
124
|
ref: ref,
|
|
128
|
-
searchData: searchData
|
|
125
|
+
searchData: searchData,
|
|
126
|
+
onGetSearchData: onGetSearchData
|
|
129
127
|
})), /*#__PURE__*/React.createElement(TableList, {
|
|
130
128
|
total: total,
|
|
131
129
|
tableDataList: tableDataList
|
|
132
130
|
})));
|
|
133
131
|
});
|
|
134
|
-
export default
|
|
132
|
+
export default AttributionContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare namespace
|
|
1
|
+
import { SearchValueProps } from '../../types';
|
|
2
|
+
export declare namespace attributionContentProps {
|
|
3
3
|
interface Props {
|
|
4
|
-
value:
|
|
4
|
+
value: SearchValueProps;
|
|
5
5
|
show?: string[];
|
|
6
6
|
onSearching?: (flag: boolean) => void;
|
|
7
7
|
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
import { TableDataHandleProps, TableDataProps } from '../../types';
|
|
2
|
-
export declare function getSortData(data: any, userGroup?: number[]): {
|
|
3
|
-
x_axis: any;
|
|
4
|
-
series: any[];
|
|
5
|
-
} | undefined;
|
|
6
|
-
export declare const sortData: (data: Array<any>, hasUserGroup?: boolean) => any[];
|
|
7
|
-
export declare function getChartTypes(type: string): any;
|
|
8
2
|
export declare const handleTableData: (data: TableDataHandleProps) => TableDataProps;
|
|
@@ -2,169 +2,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
2
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
3
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
4
|
import { nanoid } from 'nanoid';
|
|
5
|
-
export function getSortData(data, userGroup) {
|
|
6
|
-
if (!data) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
if (userGroup && userGroup.length === 1 && userGroup[0] === 0) {
|
|
10
|
-
data.series.forEach(function (item) {
|
|
11
|
-
item.names.splice(item.names.length - 2, 1);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
var seriesData = (data.series || []).map(function (item) {
|
|
15
|
-
var names = item.names,
|
|
16
|
-
values = item.values;
|
|
17
|
-
var len = names.length - 1;
|
|
18
|
-
if (names[len] === '平均使用时长') {
|
|
19
|
-
names[len] += '(s)';
|
|
20
|
-
values = values.map(function (data) {
|
|
21
|
-
return Math.round(data / 10) / 100;
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
names[len] += item.index ? "\uFF08".concat(item.index, "\uFF09") : '';
|
|
25
|
-
}
|
|
26
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
27
|
-
names: names,
|
|
28
|
-
values: values
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
var hasUserGroup = userGroup && userGroup.length > 1;
|
|
32
|
-
var series = sortData(seriesData, hasUserGroup);
|
|
33
|
-
return {
|
|
34
|
-
x_axis: data.xAxis || [],
|
|
35
|
-
series: series
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export var sortData = function sortData(data, hasUserGroup) {
|
|
39
|
-
if (!data.length) return data;
|
|
40
|
-
var len = data[0].names.length;
|
|
41
|
-
var compare = function compare(a, b) {
|
|
42
|
-
var flag = 0;
|
|
43
|
-
var aNames = a.names;
|
|
44
|
-
var bNames = b.names;
|
|
45
|
-
for (var i = 0; i < len; i++) {
|
|
46
|
-
var k = i;
|
|
47
|
-
if (hasUserGroup) {
|
|
48
|
-
if (i === len - 2) {
|
|
49
|
-
k = len - 1;
|
|
50
|
-
} else if (i === len - 1) {
|
|
51
|
-
k = len - 2;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
var aName = aNames[k];
|
|
55
|
-
var bName = bNames[k];
|
|
56
|
-
if (aName !== bName) {
|
|
57
|
-
flag = sortDevName(aName, bName);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return flag;
|
|
62
|
-
};
|
|
63
|
-
data.sort(compare);
|
|
64
|
-
return data;
|
|
65
|
-
};
|
|
66
|
-
function sortDevName(str1, str2) {
|
|
67
|
-
str1 = String(str1);
|
|
68
|
-
str2 = String(str2);
|
|
69
|
-
var res = 0;
|
|
70
|
-
for (var i = 0;; i++) {
|
|
71
|
-
if (!str1[i] || !str2[i]) {
|
|
72
|
-
res = str1.length - str2.length;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
var char1 = str1[i];
|
|
76
|
-
var char1Type = getCharType(char1);
|
|
77
|
-
var char2 = str2[i];
|
|
78
|
-
var char2Type = getCharType(char2);
|
|
79
|
-
if (char1Type[0] === char2Type[0]) {
|
|
80
|
-
if (char1 === char2) {
|
|
81
|
-
continue;
|
|
82
|
-
} else {
|
|
83
|
-
if (char1Type[0] === 'zh') {
|
|
84
|
-
res = char1.localeCompare(char2);
|
|
85
|
-
} else if (char1Type[0] === 'en') {
|
|
86
|
-
res = char2.charCodeAt(0) - char1.charCodeAt(0);
|
|
87
|
-
} else {
|
|
88
|
-
res = parseInt(char1) - parseInt(char2);
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
res = char1Type[1] - char2Type[1];
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return res;
|
|
98
|
-
}
|
|
99
|
-
function getCharType(char) {
|
|
100
|
-
if (/^[\u4e00-\u9fa5]$/.test(char)) {
|
|
101
|
-
return ['zh', 300];
|
|
102
|
-
}
|
|
103
|
-
if (/^[a-zA-Z]$/.test(char)) {
|
|
104
|
-
return ['en', 200];
|
|
105
|
-
}
|
|
106
|
-
if (/^[0-9]$/.test(char)) {
|
|
107
|
-
return ['number', 100];
|
|
108
|
-
}
|
|
109
|
-
return ['others', 999];
|
|
110
|
-
}
|
|
111
|
-
export function getChartTypes(type) {
|
|
112
|
-
var result = [{
|
|
113
|
-
label: '趋势图',
|
|
114
|
-
value: 'line',
|
|
115
|
-
icon: 'qushitu1'
|
|
116
|
-
}, {
|
|
117
|
-
label: '汇总图',
|
|
118
|
-
value: 'bar',
|
|
119
|
-
icon: 'huizongtu'
|
|
120
|
-
}];
|
|
121
|
-
var gridChildren = [{
|
|
122
|
-
label: '',
|
|
123
|
-
value: 'line',
|
|
124
|
-
icon: 'qushitu1'
|
|
125
|
-
}, {
|
|
126
|
-
label: '',
|
|
127
|
-
value: 'bar',
|
|
128
|
-
icon: 'huizongtu'
|
|
129
|
-
}];
|
|
130
|
-
if (type === 'whole' || type === 'revenue') {
|
|
131
|
-
result.push({
|
|
132
|
-
label: '占比图',
|
|
133
|
-
icon: 'pie',
|
|
134
|
-
value: 'pie'
|
|
135
|
-
});
|
|
136
|
-
gridChildren.push({
|
|
137
|
-
value: 'pie',
|
|
138
|
-
icon: 'pie',
|
|
139
|
-
label: ''
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
if (type === 'event' || type === 'whole' || type === 'revenue') {
|
|
143
|
-
gridChildren.push({
|
|
144
|
-
value: 'map',
|
|
145
|
-
icon: 'ditu',
|
|
146
|
-
label: ''
|
|
147
|
-
});
|
|
148
|
-
result.push({
|
|
149
|
-
label: '地图',
|
|
150
|
-
icon: 'ditu',
|
|
151
|
-
value: 'map'
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
result.push({
|
|
155
|
-
label: '表格',
|
|
156
|
-
icon: 'biaoge',
|
|
157
|
-
value: 'grid',
|
|
158
|
-
children: gridChildren
|
|
159
|
-
});
|
|
160
|
-
result.push({
|
|
161
|
-
label: '数值',
|
|
162
|
-
icon: 'fenshu',
|
|
163
|
-
disable: true,
|
|
164
|
-
value: 'number'
|
|
165
|
-
});
|
|
166
|
-
return result;
|
|
167
|
-
}
|
|
168
5
|
export var handleTableData = function handleTableData(data) {
|
|
169
6
|
var tableData = {};
|
|
170
7
|
var dataSource = [],
|
|
@@ -1,53 +1,23 @@
|
|
|
1
|
-
|
|
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 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["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';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
8
2
|
import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
|
|
9
3
|
import { AttributionHome } from '@zgfe/modules-attribution';
|
|
10
4
|
import { requestConfig } from '../../../utils/ajaxConfig';
|
|
11
|
-
import { Button } from 'antd';
|
|
12
5
|
var defaultValue = {
|
|
13
6
|
panelId: 438,
|
|
14
7
|
panelType: 'add'
|
|
15
8
|
};
|
|
16
9
|
export default (function () {
|
|
17
|
-
var _useState = useState(false),
|
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
-
isDetail = _useState2[0],
|
|
20
|
-
setIsDetail = _useState2[1];
|
|
21
|
-
var _useState3 = useState(),
|
|
22
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
-
detailParams = _useState4[0],
|
|
24
|
-
setDetailParams = _useState4[1];
|
|
25
|
-
var _useState5 = useState(defaultValue),
|
|
26
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
27
|
-
searchParams = _useState6[0],
|
|
28
|
-
setSearchParams = _useState6[1];
|
|
29
10
|
useEffect(function () {
|
|
30
11
|
setGlobalConfig(requestConfig);
|
|
31
12
|
}, []);
|
|
32
13
|
var afterEditTarget = function afterEditTarget(type, data) {
|
|
33
14
|
console.log("".concat(type, "\u56DE\u8C03"), data);
|
|
34
15
|
};
|
|
35
|
-
var onUserDrill = function onUserDrill(data, searchData) {
|
|
36
|
-
console.log('onUserDrill:', data, searchData);
|
|
37
|
-
setIsDetail(true);
|
|
38
|
-
setSearchParams(searchData);
|
|
39
|
-
setDetailParams(data);
|
|
40
|
-
};
|
|
41
16
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
42
17
|
needMeta: true,
|
|
43
|
-
defaultApp:
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(AttributionHome, {
|
|
49
|
-
defaultValue: searchParams,
|
|
50
|
-
afterEditTarget: afterEditTarget,
|
|
51
|
-
onUserDrill: onUserDrill
|
|
18
|
+
defaultApp: 328
|
|
19
|
+
}, /*#__PURE__*/React.createElement(AttributionHome, {
|
|
20
|
+
defaultValue: defaultValue,
|
|
21
|
+
afterEditTarget: afterEditTarget
|
|
52
22
|
}));
|
|
53
23
|
});
|
|
@@ -1,124 +1,104 @@
|
|
|
1
|
-
|
|
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 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["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';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
8
2
|
import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
|
|
9
3
|
import { AttributionHome } from '@zgfe/modules-attribution';
|
|
10
4
|
import { requestConfig } from '../../../utils/ajaxConfig';
|
|
11
|
-
import { Button } from 'antd';
|
|
12
5
|
var defaultValue = {
|
|
13
|
-
id: 1426,
|
|
14
|
-
name: '999',
|
|
15
|
-
type: 0,
|
|
16
|
-
enlarged: 0,
|
|
17
|
-
panelId: 438,
|
|
18
|
-
panelType: 'edit',
|
|
19
6
|
data: {
|
|
20
|
-
"app_id":
|
|
7
|
+
"app_id": 331,
|
|
21
8
|
"module": "attribution",
|
|
22
|
-
"targetFilters": {
|
|
23
|
-
"eventId":
|
|
24
|
-
"eventName": "
|
|
9
|
+
"targetFilters": [{
|
|
10
|
+
"eventId": 4024,
|
|
11
|
+
"eventName": "收入",
|
|
25
12
|
"filters": {
|
|
26
13
|
"relation": "and",
|
|
27
14
|
"conditions": [{
|
|
28
|
-
"attrId":
|
|
15
|
+
"attrId": 31331,
|
|
29
16
|
"propCategory": "eventProp",
|
|
30
17
|
"type": 2,
|
|
31
18
|
"operator": "gt",
|
|
32
|
-
"values": ["
|
|
19
|
+
"values": ["88"],
|
|
33
20
|
"dimensionSub": "event_attr",
|
|
34
|
-
"label": "
|
|
35
|
-
"attrName": "
|
|
21
|
+
"label": "price",
|
|
22
|
+
"attrName": "price"
|
|
36
23
|
}, {
|
|
37
|
-
"attrId":
|
|
24
|
+
"attrId": 31328,
|
|
38
25
|
"propCategory": "eventProp",
|
|
39
|
-
"type":
|
|
40
|
-
"operator": "
|
|
41
|
-
"values": ["
|
|
26
|
+
"type": 2,
|
|
27
|
+
"operator": "gt",
|
|
28
|
+
"values": ["99"],
|
|
42
29
|
"dimensionSub": "event_attr",
|
|
43
|
-
"label": "
|
|
44
|
-
"attrName": "
|
|
30
|
+
"label": "total",
|
|
31
|
+
"attrName": "total"
|
|
45
32
|
}]
|
|
46
33
|
}
|
|
47
|
-
},
|
|
34
|
+
}],
|
|
48
35
|
"sourceFilters": [{
|
|
49
|
-
"eventId":
|
|
50
|
-
"eventName": "
|
|
36
|
+
"eventId": 4023,
|
|
37
|
+
"eventName": "查看商品",
|
|
51
38
|
"filters": {
|
|
52
39
|
"relation": "and",
|
|
53
40
|
"conditions": [{
|
|
54
|
-
"attrId":
|
|
41
|
+
"attrId": 31321,
|
|
55
42
|
"propCategory": "eventProp",
|
|
56
43
|
"type": 2,
|
|
57
44
|
"operator": "gt",
|
|
58
|
-
"values": ["
|
|
45
|
+
"values": ["77"],
|
|
59
46
|
"dimensionSub": "event_attr",
|
|
60
|
-
"label": "
|
|
61
|
-
"attrName": "
|
|
47
|
+
"label": "商品价格",
|
|
48
|
+
"attrName": "商品价格"
|
|
62
49
|
}, {
|
|
63
|
-
"attrId":
|
|
50
|
+
"attrId": 31332,
|
|
64
51
|
"propCategory": "eventProp",
|
|
65
|
-
"type":
|
|
66
|
-
"operator": "
|
|
67
|
-
"values": ["
|
|
52
|
+
"type": 1,
|
|
53
|
+
"operator": "equal",
|
|
54
|
+
"values": ["移动电话"],
|
|
68
55
|
"dimensionSub": "event_attr",
|
|
69
|
-
"label": "
|
|
70
|
-
"attrName": "
|
|
56
|
+
"label": "商品类型",
|
|
57
|
+
"attrName": "商品类型"
|
|
71
58
|
}]
|
|
72
59
|
},
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
60
|
+
"attributionSubdivision": {
|
|
61
|
+
"relation": "and",
|
|
62
|
+
"conditions": {
|
|
63
|
+
"propCategory": "eventProp",
|
|
64
|
+
"type": 1,
|
|
65
|
+
"attrId": 31332
|
|
66
|
+
}
|
|
77
67
|
}
|
|
78
68
|
}, {
|
|
79
|
-
"eventId":
|
|
80
|
-
"eventName": "
|
|
69
|
+
"eventId": 4026,
|
|
70
|
+
"eventName": "加购商品",
|
|
81
71
|
"filters": {
|
|
82
72
|
"relation": "and",
|
|
83
73
|
"conditions": [{
|
|
84
|
-
"attrId":
|
|
74
|
+
"attrId": 31334,
|
|
85
75
|
"propCategory": "eventProp",
|
|
86
76
|
"type": 2,
|
|
87
77
|
"operator": "gt",
|
|
88
|
-
"values": ["
|
|
78
|
+
"values": ["66"],
|
|
89
79
|
"dimensionSub": "event_attr",
|
|
90
|
-
"label": "
|
|
91
|
-
"attrName": "
|
|
80
|
+
"label": "商品价格",
|
|
81
|
+
"attrName": "商品价格"
|
|
92
82
|
}, {
|
|
93
|
-
"attrId":
|
|
83
|
+
"attrId": 31336,
|
|
94
84
|
"propCategory": "eventProp",
|
|
95
|
-
"type":
|
|
96
|
-
"operator": "
|
|
97
|
-
"values": ["
|
|
85
|
+
"type": 1,
|
|
86
|
+
"operator": "equal",
|
|
87
|
+
"values": ["移动电话"],
|
|
98
88
|
"dimensionSub": "event_attr",
|
|
99
|
-
"label": "
|
|
100
|
-
"attrName": "
|
|
89
|
+
"label": "商品类型",
|
|
90
|
+
"attrName": "商品类型"
|
|
101
91
|
}]
|
|
102
92
|
},
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
93
|
+
"attributionSubdivision": {
|
|
94
|
+
"relation": "and",
|
|
95
|
+
"conditions": {
|
|
96
|
+
"propCategory": "eventProp",
|
|
97
|
+
"type": 1,
|
|
98
|
+
"attrId": 31329
|
|
99
|
+
}
|
|
107
100
|
}
|
|
108
101
|
}],
|
|
109
|
-
"globalFilters": {
|
|
110
|
-
"relation": "and",
|
|
111
|
-
"conditions": [{
|
|
112
|
-
"attrId": 139300,
|
|
113
|
-
"propCategory": "eventProp",
|
|
114
|
-
"type": 2,
|
|
115
|
-
"operator": "gt",
|
|
116
|
-
"values": ["87"],
|
|
117
|
-
"dimensionSub": "event_attr",
|
|
118
|
-
"label": "商品价格",
|
|
119
|
-
"attrName": "商品价格"
|
|
120
|
-
}]
|
|
121
|
-
},
|
|
122
102
|
"attributionType": 3,
|
|
123
103
|
"otherEvent": true,
|
|
124
104
|
"windowCnt": 2,
|
|
@@ -126,48 +106,24 @@ var defaultValue = {
|
|
|
126
106
|
"time": {
|
|
127
107
|
"unit": "day",
|
|
128
108
|
"relative": [14, 0],
|
|
129
|
-
"begin": "2023-05-
|
|
130
|
-
"end": "2023-
|
|
109
|
+
"begin": "2023-05-29",
|
|
110
|
+
"end": "2023-06-12"
|
|
131
111
|
},
|
|
132
112
|
"chartType": "grid"
|
|
133
|
-
}
|
|
134
|
-
chosen_data: []
|
|
113
|
+
}
|
|
135
114
|
};
|
|
136
115
|
export default (function () {
|
|
137
|
-
var _useState = useState(false),
|
|
138
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
139
|
-
isDetail = _useState2[0],
|
|
140
|
-
setIsDetail = _useState2[1];
|
|
141
|
-
var _useState3 = useState(),
|
|
142
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
143
|
-
detailParams = _useState4[0],
|
|
144
|
-
setDetailParams = _useState4[1];
|
|
145
|
-
var _useState5 = useState(defaultValue),
|
|
146
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
147
|
-
searchParams = _useState6[0],
|
|
148
|
-
setSearchParams = _useState6[1];
|
|
149
116
|
useEffect(function () {
|
|
150
117
|
setGlobalConfig(requestConfig);
|
|
151
118
|
}, []);
|
|
152
119
|
var afterEditTarget = function afterEditTarget(type, data) {
|
|
153
120
|
console.log("".concat(type, "\u56DE\u8C03"), data);
|
|
154
121
|
};
|
|
155
|
-
var onUserDrill = function onUserDrill(data, searchData) {
|
|
156
|
-
console.log('onUserDrill:', data, searchData);
|
|
157
|
-
setIsDetail(true);
|
|
158
|
-
setSearchParams(searchData);
|
|
159
|
-
setDetailParams(data);
|
|
160
|
-
};
|
|
161
122
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
162
123
|
needMeta: true,
|
|
163
|
-
defaultApp:
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(AttributionHome, {
|
|
169
|
-
defaultValue: searchParams,
|
|
170
|
-
afterEditTarget: afterEditTarget,
|
|
171
|
-
onUserDrill: onUserDrill
|
|
124
|
+
defaultApp: 331
|
|
125
|
+
}, /*#__PURE__*/React.createElement(AttributionHome, {
|
|
126
|
+
defaultValue: defaultValue,
|
|
127
|
+
afterEditTarget: afterEditTarget
|
|
172
128
|
}));
|
|
173
129
|
});
|