@zgfe/modules-attribution 1.0.1-alpha.2 → 1.0.1-alpha.23
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 +0 -1
- package/es/components/tableList/index.d.ts +2 -2
- package/es/components/tableList/index.js +9 -3
- package/es/components/title/index.js +7 -6
- 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/modules/content/index.d.ts +3 -3
- package/es/modules/content/index.js +41 -22
- 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 +116 -157
- package/es/modules/home/demo/index.js +4 -36
- package/es/modules/home/demo/scene.js +5 -35
- package/es/modules/home/index.d.ts +2 -2
- package/es/modules/home/index.js +14 -31
- 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 +122 -47
- package/es/modules/searchPanel/components/globalAttribute.d.ts +2 -1
- package/es/modules/searchPanel/components/globalAttribute.js +1 -2
- package/es/modules/searchPanel/components/targetEvent.js +33 -26
- package/es/modules/searchPanel/index.d.ts +1 -1
- package/es/modules/searchPanel/index.js +102 -80
- package/es/modules/searchPanel/types.d.ts +26 -11
- package/es/modules/searchPanel/utils.d.ts +8 -5
- package/es/modules/searchPanel/utils.js +44 -101
- package/es/types.d.ts +28 -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
package/es/constants/chart.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IconFont } from '@zgfe/business-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export var chartTypeOptions = [{
|
|
4
|
-
label: '趋势图',
|
|
5
|
-
value: 'line',
|
|
6
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
7
|
-
type: "qushitu1",
|
|
8
|
-
size: 16
|
|
9
|
-
})
|
|
10
|
-
}, {
|
|
11
|
-
label: '汇总图',
|
|
12
|
-
value: 'bar',
|
|
13
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
14
|
-
type: "huizongtu",
|
|
15
|
-
size: 16
|
|
16
|
-
})
|
|
17
|
-
}, {
|
|
18
|
-
label: '地图',
|
|
19
|
-
value: 'map',
|
|
20
|
-
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
21
|
-
type: "ditu",
|
|
22
|
-
size: 16
|
|
23
|
-
})
|
|
24
|
-
}];
|
package/es/constants/color.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const chartColors: string[];
|
package/es/constants/color.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var chartColors = ['#165DFF', '#80E1D9', '#65789B', '#F8BC3B', '#6F66ED', '#66AFED', '#9661BC', '#FF7557', '#4DB273', '#F08BB4', '#CDDBFD', '#CDF3F0', '#CED4DE', '#FCE7B9', '#D1CEFD', '#D3E7F9', '#DFCFEA', '#FFD1C7', '#BBDEC8', '#FFE0ED'];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DemoWrapper } from '@zgfe/business-lib';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import SearchPanel from '..';
|
|
4
|
-
var defaultValue = {
|
|
5
|
-
targets: [{
|
|
6
|
-
type: 'event',
|
|
7
|
-
alias: '事件概览',
|
|
8
|
-
eventId: -100,
|
|
9
|
-
eventName: '事件概览',
|
|
10
|
-
eventGroupId: 0,
|
|
11
|
-
analysisDimension: {
|
|
12
|
-
analysisIndex: 'number'
|
|
13
|
-
}
|
|
14
|
-
}],
|
|
15
|
-
userGroup: [0]
|
|
16
|
-
};
|
|
17
|
-
export default (function () {
|
|
18
|
-
var onChange = function onChange(data) {
|
|
19
|
-
console.log(data);
|
|
20
|
-
};
|
|
21
|
-
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
22
|
-
needMeta: true,
|
|
23
|
-
defaultApp: 177
|
|
24
|
-
}, /*#__PURE__*/React.createElement(SearchPanel, {
|
|
25
|
-
defaultValue: defaultValue,
|
|
26
|
-
onChange: onChange
|
|
27
|
-
}));
|
|
28
|
-
});
|
package/es/utils/transfer.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { EnvProp, EventGroup, UserProp } from '@zgfe/business-lib/es/attributeSelector/types';
|
|
2
|
-
interface OldSearchData {
|
|
3
|
-
app_id: number;
|
|
4
|
-
platform: number;
|
|
5
|
-
analysis_index: string;
|
|
6
|
-
module: 'event';
|
|
7
|
-
chartType: 'string';
|
|
8
|
-
event_attr?: string;
|
|
9
|
-
user_attr?: string;
|
|
10
|
-
event?: number;
|
|
11
|
-
time: {
|
|
12
|
-
dimension_date: string;
|
|
13
|
-
begin_date: string | number;
|
|
14
|
-
end_date: string | number;
|
|
15
|
-
} | string;
|
|
16
|
-
event_group_id?: number;
|
|
17
|
-
user_group: string;
|
|
18
|
-
analysis_attr?: string;
|
|
19
|
-
dimension_sub?: string;
|
|
20
|
-
filter_condition?: {
|
|
21
|
-
eventCondition?: {
|
|
22
|
-
eventSingleConditions?: [
|
|
23
|
-
{
|
|
24
|
-
attrConditions: OldEventCondition[];
|
|
25
|
-
environmentConditions: OldCondition[];
|
|
26
|
-
eventId: number;
|
|
27
|
-
eventName: string;
|
|
28
|
-
extra?: string;
|
|
29
|
-
happenTime?: {
|
|
30
|
-
name: string;
|
|
31
|
-
operator: string;
|
|
32
|
-
params: any[];
|
|
33
|
-
type: number;
|
|
34
|
-
};
|
|
35
|
-
isNew?: boolean;
|
|
36
|
-
}
|
|
37
|
-
];
|
|
38
|
-
operator: 'and';
|
|
39
|
-
};
|
|
40
|
-
userCondition: {
|
|
41
|
-
userSingleConditions: OldUserCondition[];
|
|
42
|
-
operator: 'and';
|
|
43
|
-
};
|
|
44
|
-
} | string;
|
|
45
|
-
}
|
|
46
|
-
interface OldCondition {
|
|
47
|
-
attrId: number;
|
|
48
|
-
name: string;
|
|
49
|
-
type: number;
|
|
50
|
-
category: 'fixed' | 'custom';
|
|
51
|
-
operator: string;
|
|
52
|
-
text: string;
|
|
53
|
-
params: any[];
|
|
54
|
-
}
|
|
55
|
-
interface OldUserCondition extends OldCondition {
|
|
56
|
-
isUserProp: boolean;
|
|
57
|
-
subtype?: number;
|
|
58
|
-
}
|
|
59
|
-
interface OldEventCondition extends OldCondition {
|
|
60
|
-
isEventProp: boolean;
|
|
61
|
-
eventId: number;
|
|
62
|
-
eventName: string;
|
|
63
|
-
}
|
|
64
|
-
export declare function transferEventSearchData(params: OldSearchData, userPropList?: UserProp[], eventGroupList?: EventGroup[], eventEnvList?: EnvProp[]): any;
|
|
65
|
-
export {};
|
package/es/utils/transfer.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
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; }
|
|
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
|
-
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
|
-
import moment from 'moment';
|
|
5
|
-
import util from './util';
|
|
6
|
-
export function transferEventSearchData(params) {
|
|
7
|
-
var userPropList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
8
|
-
var eventGroupList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
9
|
-
var eventEnvList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
10
|
-
var result = {
|
|
11
|
-
userGroup: params.user_group.split(','),
|
|
12
|
-
targets: [],
|
|
13
|
-
chartType: params.chartType
|
|
14
|
-
};
|
|
15
|
-
var timeData = params.time;
|
|
16
|
-
if (util.isString(timeData)) {
|
|
17
|
-
timeData = JSON.parse(timeData);
|
|
18
|
-
}
|
|
19
|
-
var time = timeData.dimension_date.split(',');
|
|
20
|
-
var unit = time[0];
|
|
21
|
-
var begin = timeData.begin_date;
|
|
22
|
-
var end = timeData.end_date;
|
|
23
|
-
if (time.includes('total') || begin.indexOf('-') < 0) {
|
|
24
|
-
result.time = {
|
|
25
|
-
unit: unit,
|
|
26
|
-
relative: [begin, end],
|
|
27
|
-
begin: moment().subtract(begin, unit).format('YYYY-MM-DD'),
|
|
28
|
-
end: moment().subtract(end, 'days').format('YYYY-MM-DD')
|
|
29
|
-
};
|
|
30
|
-
} else {
|
|
31
|
-
result.time = {
|
|
32
|
-
unit: unit,
|
|
33
|
-
begin: begin,
|
|
34
|
-
end: end
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (params.platform) {
|
|
38
|
-
var envData;
|
|
39
|
-
eventEnvList.forEach(function (env) {
|
|
40
|
-
if (env.name === 'platform') {
|
|
41
|
-
envData = env;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
if (envData) {
|
|
45
|
-
var platforms = ['android', 'ios', 'js'];
|
|
46
|
-
result.globalFilters = {
|
|
47
|
-
relation: 'and',
|
|
48
|
-
conditions: [{
|
|
49
|
-
attrId: envData.id,
|
|
50
|
-
attrName: 'platform',
|
|
51
|
-
dimensionSub: 'platform',
|
|
52
|
-
label: envData.label,
|
|
53
|
-
category: envData.category,
|
|
54
|
-
type: envData.type,
|
|
55
|
-
operator: 'equal',
|
|
56
|
-
propCategory: 'envProp',
|
|
57
|
-
values: [platforms[params.platform - 1]]
|
|
58
|
-
}]
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (params.dimension_sub && params.event) {
|
|
63
|
-
var data = transferDimension(userPropList, eventGroupList, eventEnvList, params.dimension_sub, params.event, params.event_attr, params.user_attr);
|
|
64
|
-
if (data) {
|
|
65
|
-
result.globalDimensions = [data];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var targets = {
|
|
69
|
-
type: params.module,
|
|
70
|
-
alias: '',
|
|
71
|
-
eventGroupId: params.event_group_id || 0,
|
|
72
|
-
eventId: params.event || -100,
|
|
73
|
-
analysisDimension: {
|
|
74
|
-
analysisIndex: params.analysis_index,
|
|
75
|
-
analysisAttr: params.event_attr
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
if (params.filter_condition) {
|
|
79
|
-
var conditions = [];
|
|
80
|
-
var filterCondition = params.filter_condition;
|
|
81
|
-
if (util.isString(filterCondition)) {
|
|
82
|
-
filterCondition = JSON.parse(filterCondition);
|
|
83
|
-
}
|
|
84
|
-
var _filterCondition = filterCondition,
|
|
85
|
-
eventCondition = _filterCondition.eventCondition,
|
|
86
|
-
userCondition = _filterCondition.userCondition;
|
|
87
|
-
if (eventCondition && eventCondition.eventSingleConditions) {
|
|
88
|
-
eventCondition.eventSingleConditions.forEach(function (e) {
|
|
89
|
-
if (e.happenTime && e.happenTime.params.length) {
|
|
90
|
-
if (e.happenTime.params[0] === 'relative') {
|
|
91
|
-
result.time.relative = [e.happenTime.params[1], e.happenTime.params[2]];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (e.eventName) {
|
|
95
|
-
targets.eventName = e.eventName;
|
|
96
|
-
}
|
|
97
|
-
if (e.attrConditions) {
|
|
98
|
-
conditions = conditions.concat(transferCondition(e.attrConditions));
|
|
99
|
-
}
|
|
100
|
-
if (e.environmentConditions) {
|
|
101
|
-
conditions = conditions.concat(transferCondition(e.environmentConditions));
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
if (userCondition && userCondition.userSingleConditions) {
|
|
106
|
-
conditions = conditions.concat(transferCondition(userCondition.userSingleConditions));
|
|
107
|
-
}
|
|
108
|
-
targets.filters = {
|
|
109
|
-
conditions: conditions,
|
|
110
|
-
relation: 'and'
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
result.targets = [targets];
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
function transferDimension(userPropList, eventGroupList, eventEnvList, dimensionSub, eventId, eventAttr, userAttr) {
|
|
117
|
-
var data;
|
|
118
|
-
if (eventAttr) {
|
|
119
|
-
eventGroupList.forEach(function (group) {
|
|
120
|
-
group.eventList.forEach(function (event) {
|
|
121
|
-
if (event.id === eventId) {
|
|
122
|
-
event.attrList.forEach(function (attr) {
|
|
123
|
-
if (attr.label === eventAttr && !data) {
|
|
124
|
-
data = {
|
|
125
|
-
attrId: attr.id,
|
|
126
|
-
attrName: attr.label,
|
|
127
|
-
propCategory: 'eventProp',
|
|
128
|
-
type: attr.type
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
} else if (userAttr) {
|
|
136
|
-
userPropList.forEach(function (user) {
|
|
137
|
-
if (user.name === userAttr) {
|
|
138
|
-
data = _objectSpread({
|
|
139
|
-
attrId: user.id,
|
|
140
|
-
attrName: user.name
|
|
141
|
-
}, user);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
} else {
|
|
145
|
-
eventEnvList.forEach(function (env) {
|
|
146
|
-
if (env.name === dimensionSub) {
|
|
147
|
-
data = _objectSpread({
|
|
148
|
-
attrId: env.id,
|
|
149
|
-
attrName: env.name
|
|
150
|
-
}, env);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return data;
|
|
155
|
-
}
|
|
156
|
-
function transferCondition(conditions) {
|
|
157
|
-
var result = [];
|
|
158
|
-
conditions.forEach(function (attr) {
|
|
159
|
-
result.push({
|
|
160
|
-
subtype: attr.subtype,
|
|
161
|
-
attrId: attr.attrId,
|
|
162
|
-
attrName: attr.name,
|
|
163
|
-
label: attr.text,
|
|
164
|
-
type: attr.type,
|
|
165
|
-
propCategory: attr.isEventProp ? 'eventProp' : attr.isUserProp ? 'userProp' : 'envProp',
|
|
166
|
-
category: attr.category,
|
|
167
|
-
dimensionSub: attr.category,
|
|
168
|
-
operator: attr.operator,
|
|
169
|
-
values: attr.params
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
return result;
|
|
173
|
-
}
|