@zgfe/modules-attribution 1.0.1-alpha.2 → 1.0.1-alpha.21
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 +110 -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 +114 -42
- 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 +103 -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 +25 -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
|
@@ -15,7 +15,8 @@ import './styles/index.less';
|
|
|
15
15
|
import { AttributableContext } from '../../types';
|
|
16
16
|
var classPrefix = 'option-group';
|
|
17
17
|
var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
|
-
var searchData = props.searchData
|
|
18
|
+
var searchData = props.searchData,
|
|
19
|
+
_onGetSearchData = props.onGetSearchData;
|
|
19
20
|
var _useState = useState(false),
|
|
20
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
22
|
showPanelDialog = _useState2[0],
|
|
@@ -38,6 +39,7 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
38
39
|
panelId = _useContext2.panelId,
|
|
39
40
|
panelName = _useContext2.panelName,
|
|
40
41
|
elementId = _useContext2.elementId,
|
|
42
|
+
buttonDisable = _useContext2.buttonDisable,
|
|
41
43
|
searching = _useContext2.searching,
|
|
42
44
|
enableAddScene = _useContext2.enableAddScene,
|
|
43
45
|
afterEditTarget = _useContext2.afterEditTarget;
|
|
@@ -63,6 +65,9 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
63
65
|
setPanelValue(item);
|
|
64
66
|
setShowPanelDialog(true);
|
|
65
67
|
setPanelType('edit');
|
|
68
|
+
},
|
|
69
|
+
onGetSearchData: function onGetSearchData() {
|
|
70
|
+
_onGetSearchData && _onGetSearchData();
|
|
66
71
|
}
|
|
67
72
|
};
|
|
68
73
|
});
|
|
@@ -86,22 +91,24 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
86
91
|
return /*#__PURE__*/React.createElement("div", {
|
|
87
92
|
className: classPrefix
|
|
88
93
|
}, !panelId && enableAddScene && /*#__PURE__*/React.createElement(Button, {
|
|
89
|
-
disabled: searching,
|
|
94
|
+
disabled: buttonDisable || searching,
|
|
90
95
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
91
96
|
className: "".concat(classPrefix, "-icon"),
|
|
92
97
|
type: "tianjia2"
|
|
93
98
|
}),
|
|
94
99
|
onClick: function onClick() {
|
|
95
|
-
|
|
100
|
+
_onGetSearchData && _onGetSearchData();
|
|
101
|
+
setShowSceneDialog(true);
|
|
96
102
|
}
|
|
97
103
|
}, "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F"), !panelId && /*#__PURE__*/React.createElement(Button, {
|
|
98
|
-
disabled: searching,
|
|
104
|
+
disabled: buttonDisable || searching,
|
|
99
105
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
100
106
|
className: "".concat(classPrefix, "-icon"),
|
|
101
107
|
type: "tianjia2"
|
|
102
108
|
}),
|
|
103
109
|
onClick: function onClick() {
|
|
104
|
-
|
|
110
|
+
_onGetSearchData && _onGetSearchData();
|
|
111
|
+
setShowPanelDialog(true);
|
|
105
112
|
}
|
|
106
113
|
}, "\u6DFB\u52A0\u5230\u770B\u677F"), showSceneDialog && /*#__PURE__*/React.createElement(BizAddToScene, {
|
|
107
114
|
params: _objectSpread({
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
+
import { SearchValueProps } from '../../types';
|
|
1
2
|
export interface OptionGroupProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
searchData: any;
|
|
5
|
-
result?: any;
|
|
6
|
-
enableSelectChart?: boolean;
|
|
7
|
-
onClickGenerateReport?: (value: any) => void;
|
|
3
|
+
searchData: SearchValueProps;
|
|
4
|
+
onGetSearchData?: Function;
|
|
8
5
|
}
|
|
@@ -13,7 +13,6 @@ var classPrefix = 'search-panel';
|
|
|
13
13
|
var SearchTime = function SearchTime(props) {
|
|
14
14
|
var _useContext = useContext(AttributableContext),
|
|
15
15
|
includeToday = _useContext.includeToday;
|
|
16
|
-
console.log('当前时间段', getInitDate(includeToday));
|
|
17
16
|
var _useState = useState(props.time || getInitDate(includeToday)),
|
|
18
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
19
18
|
time = _useState2[0],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/index.less';
|
|
3
|
-
import {
|
|
3
|
+
import { TableDataProps } from '../../types';
|
|
4
4
|
declare const TableList: React.FC<{
|
|
5
5
|
total: number;
|
|
6
|
-
tableDataList:
|
|
6
|
+
tableDataList: TableDataProps;
|
|
7
7
|
}>;
|
|
8
8
|
export default TableList;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { Table } from 'antd';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
+
import { AttributableContext } from '../../types';
|
|
4
5
|
var TableList = function TableList(props) {
|
|
5
6
|
var classPrefix = 'table-list';
|
|
6
7
|
var tableDataList = props.tableDataList,
|
|
7
8
|
total = props.total;
|
|
9
|
+
var _useContext = useContext(AttributableContext),
|
|
10
|
+
searching = _useContext.searching;
|
|
8
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
12
|
className: classPrefix
|
|
10
|
-
},
|
|
13
|
+
}, !tableDataList.dataSource && !searching && /*#__PURE__*/React.createElement("p", {
|
|
14
|
+
className: "".concat(classPrefix, "-empty-tips")
|
|
15
|
+
}, "\u8BF7\u9009\u62E9\u6761\u4EF6\u8FDB\u884C\u67E5\u8BE2"), (tableDataList.dataSource || searching) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, {
|
|
11
16
|
dataSource: tableDataList.dataSource,
|
|
12
17
|
columns: tableDataList.columns,
|
|
13
18
|
rowKey: "key",
|
|
@@ -17,7 +22,8 @@ var TableList = function TableList(props) {
|
|
|
17
22
|
},
|
|
18
23
|
showQuickJumper: true,
|
|
19
24
|
showSizeChanger: total > 10
|
|
20
|
-
}
|
|
25
|
+
},
|
|
26
|
+
loading: searching
|
|
21
27
|
})));
|
|
22
28
|
};
|
|
23
29
|
export default TableList;
|
|
@@ -30,7 +30,8 @@ var EditTitle = function EditTitle(props) {
|
|
|
30
30
|
panelName = _useContext.panelName,
|
|
31
31
|
changeLoading = _useContext.changeLoading,
|
|
32
32
|
afterEditTarget = _useContext.afterEditTarget,
|
|
33
|
-
searching = _useContext.searching
|
|
33
|
+
searching = _useContext.searching,
|
|
34
|
+
buttonDisable = _useContext.buttonDisable;
|
|
34
35
|
var inputRef = useRef(null);
|
|
35
36
|
var menu = /*#__PURE__*/React.createElement(Menu, {
|
|
36
37
|
items: [{
|
|
@@ -46,7 +47,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
46
47
|
}
|
|
47
48
|
}, {
|
|
48
49
|
key: '2',
|
|
49
|
-
label: '
|
|
50
|
+
label: '删除归因',
|
|
50
51
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
51
52
|
type: "shanchu"
|
|
52
53
|
}),
|
|
@@ -65,7 +66,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
65
66
|
}
|
|
66
67
|
}).then(function (res) {
|
|
67
68
|
changeLoading(false);
|
|
68
|
-
if (res.flag === 101) {
|
|
69
|
+
if ((res === null || res === void 0 ? void 0 : res.flag) === 101) {
|
|
69
70
|
message.success('删除成功');
|
|
70
71
|
callback('delete');
|
|
71
72
|
} else {
|
|
@@ -157,12 +158,12 @@ var EditTitle = function EditTitle(props) {
|
|
|
157
158
|
}
|
|
158
159
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
159
160
|
className: "attribution-btn",
|
|
160
|
-
disabled: searching || !curTitle,
|
|
161
|
+
disabled: buttonDisable || searching || !curTitle,
|
|
161
162
|
type: "primary",
|
|
162
163
|
onClick: onSave
|
|
163
164
|
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(Button, {
|
|
164
165
|
className: "attribution-btn",
|
|
165
|
-
disabled: searching,
|
|
166
|
+
disabled: buttonDisable || searching,
|
|
166
167
|
type: "primary",
|
|
167
168
|
onClick: onSaveAs
|
|
168
169
|
}, "\u53E6\u5B58\u4E3A")) : /*#__PURE__*/React.createElement("div", {
|
|
@@ -175,7 +176,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
175
176
|
}
|
|
176
177
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
177
178
|
className: "attribution-btn",
|
|
178
|
-
disabled: searching || !curTitle,
|
|
179
|
+
disabled: buttonDisable || searching || !curTitle,
|
|
179
180
|
type: "primary",
|
|
180
181
|
onClick: onSaveAs
|
|
181
182
|
}, "\u4FDD\u5B58")));
|
package/es/constants/apis.d.ts
CHANGED
package/es/constants/apis.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
var Apis = {
|
|
2
2
|
delPanelElement: '/apppanel/delPanelElement.jsp',
|
|
3
3
|
updateElementName: '/apppanel/updateElementName.jsp',
|
|
4
|
-
eventAnalytics: '/zg/web/v2/insight/analysis',
|
|
5
|
-
download: '/zg/web/v2/insight/download',
|
|
6
|
-
queryScenesOfGroup: '/scene/queryScenesOfGroup.jsp',
|
|
7
|
-
updateElemet: '/apppanel/updateElemet.jsp',
|
|
8
4
|
getAnalyseData: '/zg/web/v2/attribution/getAnalyseData'
|
|
9
5
|
};
|
|
10
6
|
export default Apis;
|
package/es/constants/fields.d.ts
CHANGED
|
@@ -4,143 +4,4 @@ export declare const chartTypes: {
|
|
|
4
4
|
icon: string;
|
|
5
5
|
value: string;
|
|
6
6
|
}[];
|
|
7
|
-
export declare const addPanelFields: ({
|
|
8
|
-
label: string;
|
|
9
|
-
name: string;
|
|
10
|
-
extendName: string;
|
|
11
|
-
type: string;
|
|
12
|
-
options: never[];
|
|
13
|
-
children: string[];
|
|
14
|
-
fieldNames: {
|
|
15
|
-
label: string;
|
|
16
|
-
value: string;
|
|
17
|
-
};
|
|
18
|
-
rules: {
|
|
19
|
-
required: boolean;
|
|
20
|
-
message: string;
|
|
21
|
-
}[];
|
|
22
|
-
direction?: undefined;
|
|
23
|
-
dependenceFields?: undefined;
|
|
24
|
-
} | {
|
|
25
|
-
label: string;
|
|
26
|
-
name: string;
|
|
27
|
-
type: string;
|
|
28
|
-
rules: {
|
|
29
|
-
required: boolean;
|
|
30
|
-
message: string;
|
|
31
|
-
}[];
|
|
32
|
-
extendName?: undefined;
|
|
33
|
-
options?: undefined;
|
|
34
|
-
children?: undefined;
|
|
35
|
-
fieldNames?: undefined;
|
|
36
|
-
direction?: undefined;
|
|
37
|
-
dependenceFields?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
label: string;
|
|
40
|
-
name: string;
|
|
41
|
-
type: string;
|
|
42
|
-
options: {
|
|
43
|
-
label: string;
|
|
44
|
-
icon: string;
|
|
45
|
-
value: string;
|
|
46
|
-
}[];
|
|
47
|
-
rules: {
|
|
48
|
-
required: boolean;
|
|
49
|
-
message: string;
|
|
50
|
-
}[];
|
|
51
|
-
extendName?: undefined;
|
|
52
|
-
children?: undefined;
|
|
53
|
-
fieldNames?: undefined;
|
|
54
|
-
direction?: undefined;
|
|
55
|
-
dependenceFields?: undefined;
|
|
56
|
-
} | {
|
|
57
|
-
label: string;
|
|
58
|
-
name: string;
|
|
59
|
-
type: string;
|
|
60
|
-
direction: string;
|
|
61
|
-
dependenceFields: {
|
|
62
|
-
chart: string;
|
|
63
|
-
};
|
|
64
|
-
options: {
|
|
65
|
-
label: string;
|
|
66
|
-
value: string;
|
|
67
|
-
}[];
|
|
68
|
-
rules: {
|
|
69
|
-
required: boolean;
|
|
70
|
-
message: string;
|
|
71
|
-
}[];
|
|
72
|
-
extendName?: undefined;
|
|
73
|
-
children?: undefined;
|
|
74
|
-
fieldNames?: undefined;
|
|
75
|
-
})[];
|
|
76
|
-
export declare const editPanelFields: ({
|
|
77
|
-
label: string;
|
|
78
|
-
name: string;
|
|
79
|
-
type: string;
|
|
80
|
-
options: {
|
|
81
|
-
label: string;
|
|
82
|
-
icon: string;
|
|
83
|
-
value: string;
|
|
84
|
-
}[];
|
|
85
|
-
rules: {
|
|
86
|
-
required: boolean;
|
|
87
|
-
message: string;
|
|
88
|
-
}[];
|
|
89
|
-
direction?: undefined;
|
|
90
|
-
dependenceFields?: undefined;
|
|
91
|
-
} | {
|
|
92
|
-
label: string;
|
|
93
|
-
name: string;
|
|
94
|
-
type: string;
|
|
95
|
-
direction: string;
|
|
96
|
-
dependenceFields: {
|
|
97
|
-
chart: string;
|
|
98
|
-
};
|
|
99
|
-
options: {
|
|
100
|
-
label: string;
|
|
101
|
-
value: string;
|
|
102
|
-
}[];
|
|
103
|
-
rules: {
|
|
104
|
-
required: boolean;
|
|
105
|
-
message: string;
|
|
106
|
-
}[];
|
|
107
|
-
})[];
|
|
108
|
-
export declare const addSceneFields: ({
|
|
109
|
-
label: string;
|
|
110
|
-
name: string;
|
|
111
|
-
type: string;
|
|
112
|
-
options: never[];
|
|
113
|
-
fieldNames: {
|
|
114
|
-
label: string;
|
|
115
|
-
value: string;
|
|
116
|
-
};
|
|
117
|
-
rules: {
|
|
118
|
-
required: boolean;
|
|
119
|
-
message: string;
|
|
120
|
-
}[];
|
|
121
|
-
} | {
|
|
122
|
-
label: string;
|
|
123
|
-
name: string;
|
|
124
|
-
type: string;
|
|
125
|
-
rules: {
|
|
126
|
-
required: boolean;
|
|
127
|
-
message: string;
|
|
128
|
-
}[];
|
|
129
|
-
options?: undefined;
|
|
130
|
-
fieldNames?: undefined;
|
|
131
|
-
})[];
|
|
132
7
|
export declare const searchFields: SearchPanelTypes.FieldProp[];
|
|
133
|
-
export declare const indexObject: {
|
|
134
|
-
[key: string]: string;
|
|
135
|
-
};
|
|
136
|
-
export declare const BuiltinIndicators: {
|
|
137
|
-
id: number;
|
|
138
|
-
name: string;
|
|
139
|
-
eventList: {
|
|
140
|
-
name: string;
|
|
141
|
-
id: number;
|
|
142
|
-
type: string;
|
|
143
|
-
isBuiltIn: boolean;
|
|
144
|
-
attrList: never[];
|
|
145
|
-
}[];
|
|
146
|
-
};
|
package/es/constants/fields.js
CHANGED
|
@@ -3,109 +3,6 @@ export var chartTypes = [{
|
|
|
3
3
|
icon: 'biaoge',
|
|
4
4
|
value: 'grid'
|
|
5
5
|
}];
|
|
6
|
-
export var addPanelFields = [{
|
|
7
|
-
label: '看板',
|
|
8
|
-
name: 'panel',
|
|
9
|
-
extendName: 'range',
|
|
10
|
-
type: 'selectToInput',
|
|
11
|
-
options: [],
|
|
12
|
-
children: ['range'],
|
|
13
|
-
fieldNames: {
|
|
14
|
-
label: 'name',
|
|
15
|
-
value: 'id'
|
|
16
|
-
},
|
|
17
|
-
rules: [{
|
|
18
|
-
required: true,
|
|
19
|
-
message: '请选择看板'
|
|
20
|
-
}]
|
|
21
|
-
}, {
|
|
22
|
-
label: '名称',
|
|
23
|
-
name: 'name',
|
|
24
|
-
type: 'input',
|
|
25
|
-
rules: [{
|
|
26
|
-
required: true,
|
|
27
|
-
message: '请输入名称'
|
|
28
|
-
}]
|
|
29
|
-
}, {
|
|
30
|
-
label: '样式',
|
|
31
|
-
name: 'chart',
|
|
32
|
-
type: 'tab',
|
|
33
|
-
options: chartTypes,
|
|
34
|
-
rules: [{
|
|
35
|
-
required: true,
|
|
36
|
-
message: '请选择图表'
|
|
37
|
-
}]
|
|
38
|
-
}, {
|
|
39
|
-
label: '显示',
|
|
40
|
-
name: 'show',
|
|
41
|
-
type: 'radio',
|
|
42
|
-
direction: 'vertical',
|
|
43
|
-
dependenceFields: {
|
|
44
|
-
chart: 'line'
|
|
45
|
-
},
|
|
46
|
-
options: [{
|
|
47
|
-
label: '动态显示数据最多的10个分组',
|
|
48
|
-
value: 'dynamic'
|
|
49
|
-
}, {
|
|
50
|
-
label: '固定显示当前选择的分组',
|
|
51
|
-
value: 'fix'
|
|
52
|
-
}],
|
|
53
|
-
rules: [{
|
|
54
|
-
required: true,
|
|
55
|
-
message: '请选择'
|
|
56
|
-
}]
|
|
57
|
-
}];
|
|
58
|
-
export var editPanelFields = [{
|
|
59
|
-
label: '样式',
|
|
60
|
-
name: 'chart',
|
|
61
|
-
type: 'tab',
|
|
62
|
-
options: chartTypes,
|
|
63
|
-
rules: [{
|
|
64
|
-
required: true,
|
|
65
|
-
message: '请选择图表'
|
|
66
|
-
}]
|
|
67
|
-
}, {
|
|
68
|
-
label: '显示',
|
|
69
|
-
name: 'show',
|
|
70
|
-
type: 'radio',
|
|
71
|
-
direction: 'vertical',
|
|
72
|
-
dependenceFields: {
|
|
73
|
-
chart: 'line'
|
|
74
|
-
},
|
|
75
|
-
options: [{
|
|
76
|
-
label: '动态显示数据最多的10个分组',
|
|
77
|
-
value: 'dynamic'
|
|
78
|
-
}, {
|
|
79
|
-
label: '固定显示当前选择的分组',
|
|
80
|
-
value: 'fix'
|
|
81
|
-
}],
|
|
82
|
-
rules: [{
|
|
83
|
-
required: true,
|
|
84
|
-
message: '请选择'
|
|
85
|
-
}]
|
|
86
|
-
}];
|
|
87
|
-
export var addSceneFields = [{
|
|
88
|
-
label: '场景分类',
|
|
89
|
-
name: 'class',
|
|
90
|
-
type: 'selectToInput',
|
|
91
|
-
options: [],
|
|
92
|
-
fieldNames: {
|
|
93
|
-
label: 'groupName',
|
|
94
|
-
value: 'groupId'
|
|
95
|
-
},
|
|
96
|
-
rules: [{
|
|
97
|
-
required: true,
|
|
98
|
-
message: '请选择场景分类'
|
|
99
|
-
}]
|
|
100
|
-
}, {
|
|
101
|
-
label: '场景名称',
|
|
102
|
-
name: 'name',
|
|
103
|
-
type: 'input',
|
|
104
|
-
rules: [{
|
|
105
|
-
required: true,
|
|
106
|
-
message: '请输入场景名称'
|
|
107
|
-
}]
|
|
108
|
-
}];
|
|
109
6
|
export var searchFields = [{
|
|
110
7
|
key: 'mi-targetFilters',
|
|
111
8
|
type: 'targetFilters',
|
|
@@ -132,48 +29,4 @@ export var searchFields = [{
|
|
|
132
29
|
max: 5,
|
|
133
30
|
addLabel: '添加属性',
|
|
134
31
|
required: false
|
|
135
|
-
}];
|
|
136
|
-
export var indexObject = {
|
|
137
|
-
number: '人数',
|
|
138
|
-
times: '次数',
|
|
139
|
-
per: '人均次数',
|
|
140
|
-
sum: '总和',
|
|
141
|
-
avg: '均值',
|
|
142
|
-
duration_times: '分布',
|
|
143
|
-
median: '中位数'
|
|
144
|
-
};
|
|
145
|
-
export var BuiltinIndicators = {
|
|
146
|
-
id: -2,
|
|
147
|
-
name: '整体',
|
|
148
|
-
eventList: [{
|
|
149
|
-
name: '新增用户',
|
|
150
|
-
id: -201,
|
|
151
|
-
type: 'add',
|
|
152
|
-
isBuiltIn: true,
|
|
153
|
-
attrList: []
|
|
154
|
-
}, {
|
|
155
|
-
name: '活跃用户',
|
|
156
|
-
id: -202,
|
|
157
|
-
type: 'active',
|
|
158
|
-
isBuiltIn: true,
|
|
159
|
-
attrList: []
|
|
160
|
-
}, {
|
|
161
|
-
name: '访问次数',
|
|
162
|
-
id: -203,
|
|
163
|
-
type: 'times',
|
|
164
|
-
isBuiltIn: true,
|
|
165
|
-
attrList: []
|
|
166
|
-
}, {
|
|
167
|
-
name: '平均使用时长',
|
|
168
|
-
id: -204,
|
|
169
|
-
type: 'duration_avg',
|
|
170
|
-
isBuiltIn: true,
|
|
171
|
-
attrList: []
|
|
172
|
-
}, {
|
|
173
|
-
name: '使用时长分布',
|
|
174
|
-
id: -205,
|
|
175
|
-
type: 'duration',
|
|
176
|
-
isBuiltIn: true,
|
|
177
|
-
attrList: []
|
|
178
|
-
}]
|
|
179
|
-
};
|
|
32
|
+
}];
|
package/es/constants/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import Apis from './apis';
|
|
2
|
-
import {
|
|
3
|
-
import { chartColors } from './color';
|
|
4
|
-
import { chartTypes, addPanelFields, editPanelFields, addSceneFields, searchFields } from './fields';
|
|
2
|
+
import { chartTypes, searchFields } from './fields';
|
|
5
3
|
import { initTarget, initEvent, getInitDate } from './initData';
|
|
6
|
-
export { Apis,
|
|
4
|
+
export { Apis, chartTypes, searchFields, initTarget, initEvent, getInitDate, };
|
package/es/constants/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import Apis from './apis';
|
|
2
|
-
import {
|
|
3
|
-
import { chartColors } from './color';
|
|
4
|
-
import { chartTypes, addPanelFields, editPanelFields, addSceneFields, searchFields } from './fields';
|
|
2
|
+
import { chartTypes, searchFields } from './fields';
|
|
5
3
|
import { initTarget, initEvent, getInitDate } from './initData';
|
|
6
|
-
export { Apis,
|
|
4
|
+
export { Apis, chartTypes, searchFields, initTarget, initEvent, getInitDate };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { attributionContentProps } from './types';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const AttributionContent: React.ForwardRefExoticComponent<attributionContentProps.Props & React.RefAttributes<any>>;
|
|
5
|
+
export default AttributionContent;
|
|
@@ -9,7 +9,7 @@ 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';
|
|
12
|
+
import React, { useContext, useEffect, useState, useRef } from 'react';
|
|
13
13
|
import Request from 'umi-request';
|
|
14
14
|
import SearchPanel from '../searchPanel';
|
|
15
15
|
import './styles/index.less';
|
|
@@ -19,7 +19,7 @@ import { TableList, OptionGroup, SearchTime } from '../../components';
|
|
|
19
19
|
var CancelToken = Request.CancelToken;
|
|
20
20
|
var cancel;
|
|
21
21
|
var classPrefix = 'attribution-content';
|
|
22
|
-
var
|
|
22
|
+
var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
23
23
|
var _useState = useState(props.value),
|
|
24
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
25
|
searchData = _useState2[0],
|
|
@@ -34,11 +34,16 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34
34
|
setTimer = _useState6[1];
|
|
35
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
36
36
|
currentApp = _useContext.currentApp;
|
|
37
|
-
var _useState7 = useState(
|
|
37
|
+
var _useState7 = useState(true),
|
|
38
38
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
isFetchRequest = _useState8[0],
|
|
40
|
+
setIsFetchRequest = _useState8[1];
|
|
41
|
+
var _useState9 = useState(null),
|
|
42
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
43
|
+
time = _useState10[0],
|
|
44
|
+
setTime = _useState10[1];
|
|
41
45
|
useEffect(function () {
|
|
46
|
+
if (searchData.sourceFilters && searchData.sourceFilters[0].eventId === -100) return;
|
|
42
47
|
if (timer) clearTimeout(timer);
|
|
43
48
|
var flag = true;
|
|
44
49
|
setTimer(setTimeout(function () {
|
|
@@ -54,24 +59,30 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
54
59
|
useEffect(function () {
|
|
55
60
|
props.onSearching && props.onSearching(loading);
|
|
56
61
|
}, [loading]);
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
total =
|
|
60
|
-
setTotal =
|
|
62
|
+
var _useState11 = useState(100),
|
|
63
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
64
|
+
total = _useState12[0],
|
|
65
|
+
setTotal = _useState12[1];
|
|
61
66
|
var fetchRequest = function fetchRequest() {
|
|
67
|
+
if (!isFetchRequest) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
setLoading(true);
|
|
62
71
|
if (typeof cancel === 'function') {
|
|
63
72
|
cancel();
|
|
64
73
|
}
|
|
74
|
+
var _searchData = _objectSpread(_objectSpread({}, searchData), {}, {
|
|
75
|
+
targetFilters: searchData.targetFilters[0]
|
|
76
|
+
});
|
|
65
77
|
request(Apis.getAnalyseData, {
|
|
66
78
|
method: 'post',
|
|
67
|
-
data: _objectSpread(_objectSpread(_objectSpread({}, currentApp),
|
|
79
|
+
data: _objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time),
|
|
68
80
|
cancelToken: new CancelToken(function executor(c) {
|
|
69
81
|
cancel = c;
|
|
70
82
|
})
|
|
71
83
|
}).then(function (res) {
|
|
72
|
-
if (res.data) {
|
|
73
|
-
var _data = handleTableData(res.data);
|
|
74
|
-
console.log('表格数据', _data);
|
|
84
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
85
|
+
var _data = handleTableData(res === null || res === void 0 ? void 0 : res.data);
|
|
75
86
|
setTableDataList(_data);
|
|
76
87
|
setTotal(res.data.total);
|
|
77
88
|
}
|
|
@@ -82,8 +93,8 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
82
93
|
setLoading(false);
|
|
83
94
|
});
|
|
84
95
|
};
|
|
85
|
-
var onChangeSearch = function onChangeSearch(allData) {
|
|
86
|
-
|
|
96
|
+
var onChangeSearch = function onChangeSearch(allData, isFetchRequest) {
|
|
97
|
+
setIsFetchRequest(isFetchRequest);
|
|
87
98
|
setSearchData(function (data) {
|
|
88
99
|
return _objectSpread(_objectSpread({}, allData), {}, {
|
|
89
100
|
time: data === null || data === void 0 ? void 0 : data.time
|
|
@@ -96,15 +107,22 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
96
107
|
return _objectSpread(_objectSpread({}, value), data);
|
|
97
108
|
});
|
|
98
109
|
};
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
tableDataList =
|
|
102
|
-
setTableDataList =
|
|
110
|
+
var _useState13 = useState({}),
|
|
111
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
112
|
+
tableDataList = _useState14[0],
|
|
113
|
+
setTableDataList = _useState14[1];
|
|
114
|
+
var SearchPanelRef = useRef(null);
|
|
115
|
+
var onGetSearchData = function onGetSearchData() {
|
|
116
|
+
if (SearchPanelRef) {
|
|
117
|
+
SearchPanelRef.current.onGetSearchData();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
103
120
|
return /*#__PURE__*/React.createElement("div", {
|
|
104
121
|
className: classPrefix
|
|
105
122
|
}, /*#__PURE__*/React.createElement("div", {
|
|
106
123
|
className: "".concat(classPrefix, "-top-content-box")
|
|
107
124
|
}, /*#__PURE__*/React.createElement(SearchPanel, {
|
|
125
|
+
ref: SearchPanelRef,
|
|
108
126
|
defaultValue: searchData,
|
|
109
127
|
onChange: onChangeSearch
|
|
110
128
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -112,14 +130,15 @@ var InsightContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
112
130
|
}, /*#__PURE__*/React.createElement("div", {
|
|
113
131
|
className: "".concat(classPrefix, "-bottom-content-box-times")
|
|
114
132
|
}, /*#__PURE__*/React.createElement(SearchTime, {
|
|
115
|
-
time: time,
|
|
133
|
+
time: searchData === null || searchData === void 0 ? void 0 : searchData.time,
|
|
116
134
|
onChange: onChangeContent
|
|
117
135
|
}), searchData && /*#__PURE__*/React.createElement(OptionGroup, {
|
|
118
136
|
ref: ref,
|
|
119
|
-
searchData: searchData
|
|
137
|
+
searchData: searchData,
|
|
138
|
+
onGetSearchData: onGetSearchData
|
|
120
139
|
})), /*#__PURE__*/React.createElement(TableList, {
|
|
121
140
|
total: total,
|
|
122
141
|
tableDataList: tableDataList
|
|
123
142
|
})));
|
|
124
143
|
});
|
|
125
|
-
export default
|
|
144
|
+
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;
|