@zgfe/modules-attribution 1.0.5 → 1.1.1
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/README.md +4 -2
- package/{dist/esm → es}/components/common/index.js +1 -5
- package/es/components/index.d.ts +5 -0
- package/es/components/index.js +5 -0
- package/es/components/option/index.js +141 -0
- package/{dist/esm → es}/components/option/styles/index.less +1 -1
- package/es/components/option/types.d.ts +5 -0
- package/{dist/esm/components/searchPanel → es/components/searchTime}/index.d.ts +2 -2
- package/es/components/searchTime/index.js +49 -0
- package/es/components/searchTime/styles/index.less +19 -0
- package/{dist/esm/components/searchPanel → es/components/searchTime}/types.d.ts +0 -2
- package/es/components/tableList/index.d.ts +8 -0
- package/es/components/tableList/index.js +32 -0
- package/es/components/tableList/styles/index.less +18 -0
- package/{dist/esm → es}/components/title/index.js +31 -27
- package/{dist/esm → es}/components/title/searchTitle.js +3 -3
- package/{dist/esm → es}/components/title/styles/index.less +22 -10
- package/es/constants/apis.d.ts +6 -0
- package/es/constants/apis.js +6 -0
- package/es/constants/fields.d.ts +11 -0
- package/es/constants/fields.js +45 -0
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.js +4 -0
- package/{dist/esm → es}/constants/initData.js +0 -6
- package/es/images/empty.png +0 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +2 -0
- package/es/modules/content/index.d.ts +5 -0
- package/es/modules/content/index.js +134 -0
- package/es/modules/content/styles/index.less +7 -0
- package/es/modules/content/types.d.ts +8 -0
- package/es/modules/content/utils.d.ts +2 -0
- package/es/modules/content/utils.js +29 -0
- package/{dist/esm → es}/modules/home/demo/create.d.ts +0 -1
- package/es/modules/home/demo/create.js +23 -0
- package/{dist/esm → es}/modules/home/demo/edit.d.ts +0 -1
- package/es/modules/home/demo/edit.js +129 -0
- package/{dist/esm → es}/modules/home/demo/index.d.ts +0 -1
- package/es/modules/home/demo/index.js +19 -0
- package/{dist/esm → es}/modules/home/demo/scene.d.ts +0 -1
- package/es/modules/home/demo/scene.js +44 -0
- package/{dist/esm → es}/modules/home/index.d.ts +2 -2
- package/{dist/esm → es}/modules/home/index.js +35 -73
- package/es/modules/home/styles/index.less +68 -0
- package/{dist/esm → es}/modules/home/types.d.ts +1 -4
- package/es/modules/searchPanel/components/attributableEvents.d.ts +4 -0
- package/es/modules/searchPanel/components/attributableEvents.js +290 -0
- package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.d.ts +3 -1
- package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.js +19 -19
- package/es/modules/searchPanel/components/index.d.ts +4 -0
- package/es/modules/searchPanel/components/index.js +21 -0
- package/es/modules/searchPanel/components/targetEvent.d.ts +4 -0
- package/es/modules/searchPanel/components/targetEvent.js +159 -0
- package/es/modules/searchPanel/index.d.ts +6 -0
- package/es/modules/searchPanel/index.js +398 -0
- package/es/modules/searchPanel/styles/index.less +226 -0
- package/es/modules/searchPanel/types.d.ts +49 -0
- package/es/modules/searchPanel/utils.d.ts +8 -0
- package/es/modules/searchPanel/utils.js +81 -0
- package/{dist/esm → es}/style/index.less +2 -2
- package/{dist/esm → es}/style/theme.js +0 -2
- package/es/types.d.ts +52 -0
- package/es/types.js +2 -0
- package/{dist/esm → es}/utils/ajaxConfig.js +0 -7
- package/es/utils/request.d.ts +3 -0
- package/es/utils/request.js +5 -0
- package/{dist/esm → es}/utils/util.js +4 -42
- package/package.json +21 -21
- package/dist/esm/components/index.d.ts +0 -6
- package/dist/esm/components/index.js +0 -6
- package/dist/esm/components/option/index.js +0 -222
- package/dist/esm/components/option/types.d.ts +0 -9
- package/dist/esm/components/renderContent/index.d.ts +0 -5
- package/dist/esm/components/renderContent/index.js +0 -92
- package/dist/esm/components/renderContent/styles/index.less +0 -21
- package/dist/esm/components/renderContent/types.d.ts +0 -15
- package/dist/esm/components/searchPanel/index.js +0 -124
- package/dist/esm/components/searchPanel/styles/index.less +0 -44
- package/dist/esm/components/showList/index.d.ts +0 -10
- package/dist/esm/components/showList/index.js +0 -92
- package/dist/esm/components/showList/listPanel.d.ts +0 -9
- package/dist/esm/components/showList/listPanel.js +0 -118
- package/dist/esm/components/showList/styles/index.less +0 -75
- package/dist/esm/components/showList/types.d.ts +0 -9
- package/dist/esm/components/table/index.d.ts +0 -5
- package/dist/esm/components/table/index.js +0 -194
- package/dist/esm/components/table/styles/index.less +0 -12
- package/dist/esm/components/table/types.d.ts +0 -11
- package/dist/esm/constants/apis.d.ts +0 -9
- package/dist/esm/constants/apis.js +0 -9
- package/dist/esm/constants/chart.d.ts +0 -2
- package/dist/esm/constants/chart.js +0 -24
- package/dist/esm/constants/color.d.ts +0 -1
- package/dist/esm/constants/color.js +0 -1
- package/dist/esm/constants/fields.d.ts +0 -218
- package/dist/esm/constants/fields.js +0 -242
- package/dist/esm/constants/index.d.ts +0 -6
- package/dist/esm/constants/index.js +0 -6
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/modules/content/index.d.ts +0 -5
- package/dist/esm/modules/content/index.js +0 -218
- package/dist/esm/modules/content/styles/index.less +0 -7
- package/dist/esm/modules/content/types.d.ts +0 -8
- package/dist/esm/modules/content/types.js +0 -2
- package/dist/esm/modules/content/utiles.d.ts +0 -12
- package/dist/esm/modules/content/utiles.js +0 -231
- package/dist/esm/modules/home/demo/create.js +0 -54
- package/dist/esm/modules/home/demo/edit.js +0 -80
- package/dist/esm/modules/home/demo/index.js +0 -52
- package/dist/esm/modules/home/demo/scene.js +0 -74
- package/dist/esm/modules/home/styles/index.less +0 -37
- package/dist/esm/modules/home/types.js +0 -2
- package/dist/esm/modules/leftPanel/components/panel.d.ts +0 -4
- package/dist/esm/modules/leftPanel/components/panel.js +0 -92
- package/dist/esm/modules/leftPanel/demo/index.d.ts +0 -3
- package/dist/esm/modules/leftPanel/demo/index.js +0 -28
- package/dist/esm/modules/leftPanel/index.d.ts +0 -6
- package/dist/esm/modules/leftPanel/index.js +0 -285
- package/dist/esm/modules/leftPanel/styles/index.less +0 -55
- package/dist/esm/modules/leftPanel/types.d.ts +0 -27
- package/dist/esm/modules/leftPanel/types.js +0 -2
- package/dist/esm/modules/leftPanel/utils.d.ts +0 -5
- package/dist/esm/modules/leftPanel/utils.js +0 -262
- package/dist/esm/types.d.ts +0 -46
- package/dist/esm/types.js +0 -2
- package/dist/esm/utils/base64.d.ts +0 -23
- package/dist/esm/utils/base64.js +0 -132
- package/dist/esm/utils/formData.d.ts +0 -18
- package/dist/esm/utils/formData.js +0 -485
- package/dist/esm/utils/transfer.d.ts +0 -65
- package/dist/esm/utils/transfer.js +0 -206
- /package/{dist/esm → es}/components/common/index.d.ts +0 -0
- /package/{dist/esm → es}/components/common/styles/index.less +0 -0
- /package/{dist/esm → es}/components/option/index.d.ts +0 -0
- /package/{dist/esm → es}/components/option/types.js +0 -0
- /package/{dist/esm/components/renderContent → es/components/searchTime}/types.js +0 -0
- /package/{dist/esm → es}/components/title/index.d.ts +0 -0
- /package/{dist/esm → es}/components/title/searchTitle.d.ts +0 -0
- /package/{dist/esm → es}/components/title/styles/search.less +0 -0
- /package/{dist/esm → es}/components/title/types.d.ts +0 -0
- /package/{dist/esm/components/searchPanel → es/components/title}/types.js +0 -0
- /package/{dist/esm → es}/constants/initData.d.ts +0 -0
- /package/{dist/esm/components/showList → es/modules/content}/types.js +0 -0
- /package/{dist/esm → es}/modules/home/demo/styles/index.less +0 -0
- /package/{dist/esm/components/table → es/modules/home}/types.js +0 -0
- /package/{dist/esm/components/title → es/modules/searchPanel}/types.js +0 -0
- /package/{dist/esm → es}/style/image/noData.png +0 -0
- /package/{dist/esm → es}/style/image/ring.svg +0 -0
- /package/{dist/esm → es}/style/theme.d.ts +0 -0
- /package/{dist/esm → es}/utils/ajaxConfig.d.ts +0 -0
- /package/{dist/esm → es}/utils/util.d.ts +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
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; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import util from "./util";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 老事件分析的查询数据
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export function transferEventSearchData(params) {
|
|
15
|
-
var userPropList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
16
|
-
var eventGroupList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
17
|
-
var eventEnvList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
18
|
-
var result = {
|
|
19
|
-
userGroup: params.user_group.split(','),
|
|
20
|
-
targets: [],
|
|
21
|
-
chartType: params.chartType
|
|
22
|
-
};
|
|
23
|
-
// 时间
|
|
24
|
-
var timeData = params.time;
|
|
25
|
-
if (util.isString(timeData)) {
|
|
26
|
-
timeData = JSON.parse(timeData);
|
|
27
|
-
}
|
|
28
|
-
var time = timeData.dimension_date.split(',');
|
|
29
|
-
var unit = time[0];
|
|
30
|
-
var begin = timeData.begin_date;
|
|
31
|
-
var end = timeData.end_date;
|
|
32
|
-
if (time.includes('total') || begin.indexOf('-') < 0) {
|
|
33
|
-
result.time = {
|
|
34
|
-
unit: unit,
|
|
35
|
-
relative: [begin, end],
|
|
36
|
-
begin: moment().subtract(begin, unit).format('YYYY-MM-DD'),
|
|
37
|
-
end: moment().subtract(end, 'days').format('YYYY-MM-DD')
|
|
38
|
-
};
|
|
39
|
-
} else {
|
|
40
|
-
result.time = {
|
|
41
|
-
unit: unit,
|
|
42
|
-
begin: begin,
|
|
43
|
-
end: end
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// 全局属性(平台)
|
|
47
|
-
if (params.platform) {
|
|
48
|
-
var envData;
|
|
49
|
-
eventEnvList.forEach(function (env) {
|
|
50
|
-
if (env.name === 'platform') {
|
|
51
|
-
envData = env;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
if (envData) {
|
|
55
|
-
var platforms = ['android', 'ios', 'js'];
|
|
56
|
-
result.globalFilters = {
|
|
57
|
-
relation: 'and',
|
|
58
|
-
conditions: [{
|
|
59
|
-
attrId: envData.id,
|
|
60
|
-
attrName: 'platform',
|
|
61
|
-
dimensionSub: 'platform',
|
|
62
|
-
label: envData.label,
|
|
63
|
-
category: envData.category,
|
|
64
|
-
type: envData.type,
|
|
65
|
-
operator: 'equal',
|
|
66
|
-
propCategory: 'envProp',
|
|
67
|
-
values: [platforms[params.platform - 1]]
|
|
68
|
-
}]
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// 属性细分
|
|
73
|
-
if (params.dimension_sub && params.event) {
|
|
74
|
-
var data = transferDimension(userPropList, eventGroupList, eventEnvList, params.dimension_sub, params.event, params.event_attr, params.user_attr);
|
|
75
|
-
if (data) {
|
|
76
|
-
result.globalDimensions = [data];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// 指标
|
|
80
|
-
var targets = {
|
|
81
|
-
type: params.module,
|
|
82
|
-
alias: '',
|
|
83
|
-
eventGroupId: params.event_group_id || 0,
|
|
84
|
-
eventId: params.event || -100,
|
|
85
|
-
analysisDimension: {
|
|
86
|
-
analysisIndex: params.analysis_index,
|
|
87
|
-
analysisAttr: params.event_attr
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
if (params.filter_condition) {
|
|
91
|
-
var conditions = [];
|
|
92
|
-
var filterCondition = params.filter_condition;
|
|
93
|
-
if (util.isString(filterCondition)) {
|
|
94
|
-
filterCondition = JSON.parse(filterCondition);
|
|
95
|
-
}
|
|
96
|
-
var _filterCondition = filterCondition,
|
|
97
|
-
eventCondition = _filterCondition.eventCondition,
|
|
98
|
-
userCondition = _filterCondition.userCondition;
|
|
99
|
-
if (eventCondition && eventCondition.eventSingleConditions) {
|
|
100
|
-
eventCondition.eventSingleConditions.forEach(function (e) {
|
|
101
|
-
if (e.happenTime && e.happenTime.params.length) {
|
|
102
|
-
if (e.happenTime.params[0] === 'relative') {
|
|
103
|
-
result.time.relative = [e.happenTime.params[1], e.happenTime.params[2]];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (e.eventName) {
|
|
107
|
-
targets.eventName = e.eventName;
|
|
108
|
-
}
|
|
109
|
-
if (e.attrConditions) {
|
|
110
|
-
conditions = conditions.concat(transferCondition(e.attrConditions));
|
|
111
|
-
}
|
|
112
|
-
if (e.environmentConditions) {
|
|
113
|
-
conditions = conditions.concat(transferCondition(e.environmentConditions));
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
if (userCondition && userCondition.userSingleConditions) {
|
|
118
|
-
conditions = conditions.concat(transferCondition(userCondition.userSingleConditions));
|
|
119
|
-
}
|
|
120
|
-
targets.filters = {
|
|
121
|
-
conditions: conditions,
|
|
122
|
-
relation: 'and'
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
result.targets = [targets];
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* 转化属性细分
|
|
131
|
-
* @param userPropList 用户属性
|
|
132
|
-
* @param eventGroupList 事件属性
|
|
133
|
-
* @param eventEnvList 环境属性
|
|
134
|
-
* @param eventId 事件id
|
|
135
|
-
* @param dimensionSub dimension_sub
|
|
136
|
-
* @param eventAttr 事件属性name
|
|
137
|
-
* @param userAttr 用户属性name
|
|
138
|
-
* @returns
|
|
139
|
-
*/
|
|
140
|
-
function transferDimension(userPropList, eventGroupList, eventEnvList, dimensionSub, eventId, eventAttr, userAttr) {
|
|
141
|
-
var data;
|
|
142
|
-
// 事件属性
|
|
143
|
-
if (eventAttr) {
|
|
144
|
-
eventGroupList.forEach(function (group) {
|
|
145
|
-
group.eventList.forEach(function (event) {
|
|
146
|
-
if (event.id === eventId) {
|
|
147
|
-
event.attrList.forEach(function (attr) {
|
|
148
|
-
if (attr.label === eventAttr && !data) {
|
|
149
|
-
data = {
|
|
150
|
-
attrId: attr.id,
|
|
151
|
-
attrName: attr.label,
|
|
152
|
-
propCategory: 'eventProp',
|
|
153
|
-
type: attr.type
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
} else if (userAttr) {
|
|
161
|
-
// 用户属性
|
|
162
|
-
userPropList.forEach(function (user) {
|
|
163
|
-
if (user.name === userAttr) {
|
|
164
|
-
data = _objectSpread({
|
|
165
|
-
attrId: user.id,
|
|
166
|
-
attrName: user.name
|
|
167
|
-
}, user);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
} else {
|
|
171
|
-
// 环境属性
|
|
172
|
-
eventEnvList.forEach(function (env) {
|
|
173
|
-
if (env.name === dimensionSub) {
|
|
174
|
-
data = _objectSpread({
|
|
175
|
-
attrId: env.id,
|
|
176
|
-
attrName: env.name
|
|
177
|
-
}, env);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
return data;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* 转化筛选属性
|
|
186
|
-
* @param conditions 筛选属性
|
|
187
|
-
* @returns
|
|
188
|
-
*/
|
|
189
|
-
function transferCondition(conditions) {
|
|
190
|
-
var result = [];
|
|
191
|
-
conditions.forEach(function (attr) {
|
|
192
|
-
result.push({
|
|
193
|
-
subtype: attr.subtype,
|
|
194
|
-
attrId: attr.attrId,
|
|
195
|
-
attrName: attr.name,
|
|
196
|
-
label: attr.text,
|
|
197
|
-
type: attr.type,
|
|
198
|
-
propCategory: attr.isEventProp ? 'eventProp' : attr.isUserProp ? 'userProp' : 'envProp',
|
|
199
|
-
category: attr.category,
|
|
200
|
-
dimensionSub: attr.category,
|
|
201
|
-
operator: attr.operator,
|
|
202
|
-
values: attr.params
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|