@tmsfe/tms-core 0.0.81 → 0.0.82
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/package.json
CHANGED
|
@@ -29,7 +29,7 @@ function proxyLifeMethod(componentName: string, componentOptions: any, methodNam
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// 劫持绑定事件
|
|
32
|
-
function proxyBindEvent(componentName: string, methods: any, methodName: string): void {
|
|
32
|
+
function proxyBindEvent(componentName: string, methods: any, methodName: string, bindType: string): void {
|
|
33
33
|
const original = methods[methodName];
|
|
34
34
|
if (!original) {
|
|
35
35
|
return;
|
|
@@ -41,8 +41,8 @@ function proxyBindEvent(componentName: string, methods: any, methodName: string)
|
|
|
41
41
|
const extra = clone.getEventExtra(args[0]) ; // 把触发事件附加数据也带上
|
|
42
42
|
const data = clone.deepClone(this.data);
|
|
43
43
|
const eventName = `Component_${componentName}_${methodName}`;
|
|
44
|
-
helper.setLastBindEvent({ eventName, data, extra });
|
|
45
|
-
helper.reportData(eventName, data, extra);
|
|
44
|
+
helper.setLastBindEvent({ eventName, data, extra, bindType });
|
|
45
|
+
helper.reportData(eventName, data, extra, bindType);
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -56,8 +56,9 @@ function init(): void {
|
|
|
56
56
|
if (options.tmsAutoReport) {
|
|
57
57
|
// tmsReportEvents是由工具在编译时分析出的要上报的事件列表
|
|
58
58
|
const methods = options.methods || {};
|
|
59
|
-
for (const
|
|
60
|
-
|
|
59
|
+
for (const event of options.tmsReportEvents) {
|
|
60
|
+
const { name, type } = event;
|
|
61
|
+
proxyBindEvent(options.tmsComponentName, methods, name, type);
|
|
61
62
|
}
|
|
62
63
|
proxyLifeMethod(options.tmsComponentName, options, 'ready');
|
|
63
64
|
}
|
package/src/report/proxy/page.ts
CHANGED
|
@@ -85,7 +85,7 @@ function getPageLifeExtra(page: any, methodName: string, args: any[]): IPageLife
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// 劫持绑定事件
|
|
88
|
-
function proxyBindEvent(pageOptions: any, methodName: string): void {
|
|
88
|
+
function proxyBindEvent(pageOptions: any, methodName: string, bindType: string): void {
|
|
89
89
|
const original = pageOptions[methodName];
|
|
90
90
|
if (!original) {
|
|
91
91
|
return;
|
|
@@ -97,8 +97,8 @@ function proxyBindEvent(pageOptions: any, methodName: string): void {
|
|
|
97
97
|
return helper.executeFunc(this, original, args, () => {
|
|
98
98
|
const data = clone.deepClone(this.data);
|
|
99
99
|
const eventName = `Page_${methodName}`;
|
|
100
|
-
helper.setLastBindEvent({ eventName, data, extra });
|
|
101
|
-
helper.reportData(eventName, data, extra);
|
|
100
|
+
helper.setLastBindEvent({ eventName, data, extra, bindType });
|
|
101
|
+
helper.reportData(eventName, data, extra, bindType);
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
}
|
|
@@ -113,8 +113,9 @@ function proxyPage(): void {
|
|
|
113
113
|
proxyLifeMethod(options, methodName);
|
|
114
114
|
}
|
|
115
115
|
// tmsReportEvents是由工具在编译时分析出的要上报的事件列表
|
|
116
|
-
for (const
|
|
117
|
-
|
|
116
|
+
for (const event of options.tmsReportEvents) {
|
|
117
|
+
const { name, type } = event;
|
|
118
|
+
proxyBindEvent(options, name, type);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
originalPage(options);
|