@cloudbase/framework-plugin-low-code 0.6.32 → 0.6.33
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/lib/builder/config/index.js +2 -5
- package/lib/builder/core/copy.d.ts.map +1 -1
- package/lib/builder/mp/materials.d.ts.map +1 -1
- package/lib/builder/mp/materials.js +21 -5
- package/package.json +5 -3
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/cookie.js +0 -286
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/history.js +0 -133
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/local-storage.js +0 -103
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/location.js +0 -588
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/miniprogram.js +0 -101
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/navigator.js +0 -80
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/performance.js +0 -28
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/screen.js +0 -31
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/session-storage.js +0 -96
- package/template/dist/mp/miniprogram_npm/miniprogram-render/bom/xml-http-request.js +0 -290
- package/template/dist/mp/miniprogram_npm/miniprogram-render/document.js +0 -396
- package/template/dist/mp/miniprogram_npm/miniprogram-render/event/custom-event.js +0 -12
- package/template/dist/mp/miniprogram_npm/miniprogram-render/event/event-target.js +0 -389
- package/template/dist/mp/miniprogram_npm/miniprogram-render/event/event.js +0 -186
- package/template/dist/mp/miniprogram_npm/miniprogram-render/index.js +0 -41
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/attribute.js +0 -226
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/class-list.js +0 -153
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/comment.js +0 -80
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/a.js +0 -165
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/canvas.js +0 -138
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/image.js +0 -177
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/input.js +0 -181
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/not-support.js +0 -60
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/option.js +0 -126
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/select.js +0 -155
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/textarea.js +0 -178
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/video.js +0 -165
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/wx-component.js +0 -84
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element/wx-custom-component.js +0 -64
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/element.js +0 -970
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/node.js +0 -140
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/style-list.js +0 -28
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/style.js +0 -158
- package/template/dist/mp/miniprogram_npm/miniprogram-render/node/text-node.js +0 -127
- package/template/dist/mp/miniprogram_npm/miniprogram-render/tree/parser.js +0 -269
- package/template/dist/mp/miniprogram_npm/miniprogram-render/tree/query-selector.js +0 -420
- package/template/dist/mp/miniprogram_npm/miniprogram-render/tree/tree.js +0 -130
- package/template/dist/mp/miniprogram_npm/miniprogram-render/util/cache.js +0 -95
- package/template/dist/mp/miniprogram_npm/miniprogram-render/util/pool.js +0 -24
- package/template/dist/mp/miniprogram_npm/miniprogram-render/util/tool.js +0 -131
- package/template/dist/mp/miniprogram_npm/miniprogram-render/window.js +0 -651
- package/template/generator/app/common.js +0 -17
- package/template/generator/app/global-api.js +0 -163
- package/template/generator/app/handlers.js +0 -13
- package/template/generator/datasources/config.js.tpl +0 -21
- package/template/generator/datasources/dataset-profiles.js.tpl +0 -5
- package/template/generator/datasources/datasource-profiles.js.tpl +0 -4
- package/template/generator/datasources/index.js.tpl +0 -14
- package/template/generator/handlers/NodeRenderer.jsx +0 -471
- package/template/generator/handlers/RenderWrapper.jsx +0 -145
- package/template/generator/index.jsx +0 -116
- package/template/generator/index.less +0 -120
- package/template/generator/pages/app.tpl +0 -181
- package/template/generator/pages/composite.tpl +0 -267
- package/template/generator/router/index.tpl +0 -49
- package/template/generator/store/computed.js +0 -11
- package/template/generator/store/index.js +0 -5
- package/template/generator/utils/ScanCodeComponent.js +0 -345
- package/template/generator/utils/actionHandler.js +0 -119
- package/template/generator/utils/common.js +0 -225
- package/template/generator/utils/computed.js +0 -9
- package/template/generator/utils/date.js +0 -324
- package/template/generator/utils/error.jsx +0 -14
- package/template/generator/utils/eventProxy.js +0 -64
- package/template/generator/utils/history.js +0 -35
- package/template/generator/utils/hooks.js +0 -10
- package/template/generator/utils/index.js +0 -41
- package/template/generator/utils/initGlobalVar.js +0 -14
- package/template/generator/utils/lifecycle.js +0 -158
- package/template/generator/utils/monitor-jssdk.min.js +0 -881
- package/template/generator/utils/page.js +0 -10
- package/template/generator/utils/scan-code-action.js +0 -27
- package/template/generator/utils/style.js +0 -81
- package/template/generator/utils/widgets.js +0 -343
|
@@ -1,881 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @govcloud/gsd-monitor v1.0.0
|
|
3
|
-
* @modify: sdk完善
|
|
4
|
-
* @release 2020-08-13 14:16
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
var yyptReport = (function () {
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
var storage = {
|
|
11
|
-
/**
|
|
12
|
-
* 获取cookie信息
|
|
13
|
-
* @method carLoanLib.Cookie.getCookie
|
|
14
|
-
* @param {String} name 获取的cookie的键值
|
|
15
|
-
* @return {String} 获取的cookie值
|
|
16
|
-
*/
|
|
17
|
-
getCookie: function (name) {
|
|
18
|
-
var re = new RegExp('(?:^|;+|\\s+)' + name + '=([^;]*)');
|
|
19
|
-
var result = document.cookie.match(re);
|
|
20
|
-
return !result ? '' : result[1];
|
|
21
|
-
},
|
|
22
|
-
/**
|
|
23
|
-
* 设置cookie信息
|
|
24
|
-
*
|
|
25
|
-
* @method setCookie
|
|
26
|
-
* @param {String} name 设置cookie的键值
|
|
27
|
-
* @param {String} value 设置的cookie的值
|
|
28
|
-
* @param {String} domain 设置cookie的域名
|
|
29
|
-
* @param {String} [path:/] cookie存放的路径
|
|
30
|
-
* @param {Number} minute 设置的cookie的有效期
|
|
31
|
-
*/
|
|
32
|
-
setCookie: function (name, value, domain, path, minute) {
|
|
33
|
-
if (domain === void 0) {
|
|
34
|
-
domain = '';
|
|
35
|
-
}
|
|
36
|
-
if (path === void 0) {
|
|
37
|
-
path = '';
|
|
38
|
-
}
|
|
39
|
-
if (minute === void 0) {
|
|
40
|
-
minute = null;
|
|
41
|
-
}
|
|
42
|
-
var expire;
|
|
43
|
-
if (minute) {
|
|
44
|
-
expire = new Date();
|
|
45
|
-
expire.setTime(Date.now() + 60 * 1000 * minute);
|
|
46
|
-
}
|
|
47
|
-
document.cookie =
|
|
48
|
-
name +
|
|
49
|
-
'=' +
|
|
50
|
-
value +
|
|
51
|
-
'; ' +
|
|
52
|
-
(expire ? 'expires=' + expire.toUTCString() + '; ' : '') +
|
|
53
|
-
('path=' +
|
|
54
|
-
(path || '/') +
|
|
55
|
-
'; domain=' +
|
|
56
|
-
(domain || location.host).split(':')[0] +
|
|
57
|
-
';');
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* 删除cookie
|
|
61
|
-
*
|
|
62
|
-
* @method carLoanLib.Cookie.delCookie
|
|
63
|
-
* @param {String} name 设置cookie的键值
|
|
64
|
-
* @param {String} domain 设置cookie的域名
|
|
65
|
-
* @param {String} path cookie存放的路径
|
|
66
|
-
*/
|
|
67
|
-
delCookie: function (name, domain, path) {
|
|
68
|
-
if (domain === void 0) {
|
|
69
|
-
domain = '';
|
|
70
|
-
}
|
|
71
|
-
if (path === void 0) {
|
|
72
|
-
path = '';
|
|
73
|
-
}
|
|
74
|
-
document.cookie =
|
|
75
|
-
name +
|
|
76
|
-
'=; expires=Mon, 26 Jul 1997 05:00:00 GMT; ' +
|
|
77
|
-
('path=' +
|
|
78
|
-
(path || '/') +
|
|
79
|
-
'; domain=' +
|
|
80
|
-
(domain || location.host).split(':')[0] +
|
|
81
|
-
';');
|
|
82
|
-
},
|
|
83
|
-
set: function (key, val) {
|
|
84
|
-
if (!!window.localStorage) {
|
|
85
|
-
try {
|
|
86
|
-
localStorage.setItem(key, val);
|
|
87
|
-
} catch (e) {}
|
|
88
|
-
} else {
|
|
89
|
-
//只能存cookie
|
|
90
|
-
// 30天
|
|
91
|
-
this.setCookie(key, val, '', '', 30 * 24 * 60);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
get: function (key) {
|
|
95
|
-
if (!!window.localStorage) {
|
|
96
|
-
return localStorage.getItem(key);
|
|
97
|
-
} else {
|
|
98
|
-
return this.getCookie(key);
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
},
|
|
102
|
-
remove: function (key) {
|
|
103
|
-
if (!!window.localStorage) {
|
|
104
|
-
try {
|
|
105
|
-
localStorage.removeItem(key);
|
|
106
|
-
} catch (e) {}
|
|
107
|
-
} else {
|
|
108
|
-
this.delCookie(key);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var ajax = function (opt) {
|
|
114
|
-
opt = opt || {};
|
|
115
|
-
opt.method = opt.method.toUpperCase() || 'POST';
|
|
116
|
-
opt.url = opt.url || '';
|
|
117
|
-
opt.async = opt.async || true;
|
|
118
|
-
opt.data = opt.data || null;
|
|
119
|
-
opt.success = opt.success || function () {};
|
|
120
|
-
opt.error = opt.error || function () {};
|
|
121
|
-
var xmlHttp = null;
|
|
122
|
-
if (XMLHttpRequest) {
|
|
123
|
-
xmlHttp = new XMLHttpRequest();
|
|
124
|
-
} else {
|
|
125
|
-
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
|
|
126
|
-
}
|
|
127
|
-
var params = [];
|
|
128
|
-
for (var key in opt.data) {
|
|
129
|
-
params.push(key + '=' + opt.data[key]);
|
|
130
|
-
}
|
|
131
|
-
var postData = params.join('&');
|
|
132
|
-
if (opt.method.toUpperCase() === 'POST') {
|
|
133
|
-
xmlHttp.open(opt.method, opt.url, opt.async);
|
|
134
|
-
xmlHttp.setRequestHeader(
|
|
135
|
-
'Content-Type',
|
|
136
|
-
'application/x-www-form-urlencoded;charset=utf-8'
|
|
137
|
-
);
|
|
138
|
-
xmlHttp.send(postData);
|
|
139
|
-
} else if (opt.method.toUpperCase() === 'GET') {
|
|
140
|
-
xmlHttp.open(opt.method, opt.url + '?' + postData, opt.async);
|
|
141
|
-
xmlHttp.send(null);
|
|
142
|
-
}
|
|
143
|
-
xmlHttp.onreadystatechange = function () {
|
|
144
|
-
if (xmlHttp.readyState == 4) {
|
|
145
|
-
if (xmlHttp.status == 200) {
|
|
146
|
-
opt.success(JSON.parse(xmlHttp.responseText));
|
|
147
|
-
} else {
|
|
148
|
-
opt.error(xmlHttp);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
var utils = {
|
|
155
|
-
wrapHistory: function () {
|
|
156
|
-
// 处理replaceState和pushState行为的监听
|
|
157
|
-
var _wr = function (type) {
|
|
158
|
-
var orig = window.history[type];
|
|
159
|
-
return function () {
|
|
160
|
-
var rv = orig.apply(this, arguments);
|
|
161
|
-
var e = document.createEvent('HTMLEvents');
|
|
162
|
-
e.initEvent(type, false, true);
|
|
163
|
-
e.arguments = arguments;
|
|
164
|
-
window.dispatchEvent(e);
|
|
165
|
-
return rv;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
window.history.pushState = _wr('pushState');
|
|
169
|
-
window.history.replaceState = _wr('replaceState');
|
|
170
|
-
},
|
|
171
|
-
// 删除无用数据
|
|
172
|
-
_delUselessParam: function (obj) {
|
|
173
|
-
var cookiedObj = {};
|
|
174
|
-
for (var item in obj) {
|
|
175
|
-
var temVal = obj[item];
|
|
176
|
-
if (temVal) {
|
|
177
|
-
cookiedObj[item] = temVal;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return cookiedObj;
|
|
181
|
-
},
|
|
182
|
-
// 获取操作系统
|
|
183
|
-
_getOsName: function () {
|
|
184
|
-
var name = 'unknown';
|
|
185
|
-
var userAgent = window.navigator.userAgent;
|
|
186
|
-
if (userAgent.indexOf('Android') != -1) {
|
|
187
|
-
name = 'Android';
|
|
188
|
-
} else if (userAgent.indexOf('iPhone') != -1) {
|
|
189
|
-
name = 'iPhone';
|
|
190
|
-
} else if (userAgent.indexOf('SymbianOS') != -1) {
|
|
191
|
-
name = 'SymbianOS';
|
|
192
|
-
} else if (userAgent.indexOf('Windows Phone') != -1) {
|
|
193
|
-
name = 'Windows Phone';
|
|
194
|
-
} else if (userAgent.indexOf('iPad') != -1) {
|
|
195
|
-
name = 'iPad';
|
|
196
|
-
} else if (userAgent.indexOf('iPod') != -1) {
|
|
197
|
-
name = 'iPod';
|
|
198
|
-
} else if (userAgent.indexOf('Windows NT 10.0') != -1) {
|
|
199
|
-
name = 'Windows 10';
|
|
200
|
-
} else if (userAgent.indexOf('Windows NT 6.2') != -1) {
|
|
201
|
-
name = 'Windows 8';
|
|
202
|
-
} else if (userAgent.indexOf('Windows NT 6.1') != -1) {
|
|
203
|
-
name = 'Windows 7';
|
|
204
|
-
} else if (userAgent.indexOf('Windows NT 6.0') != -1) {
|
|
205
|
-
name = 'Windows Vista';
|
|
206
|
-
} else if (userAgent.indexOf('Windows NT 5.1') != -1) {
|
|
207
|
-
name = 'Windows XP';
|
|
208
|
-
} else if (userAgent.indexOf('Windows NT 5.0') != -1) {
|
|
209
|
-
name = 'Windows 2000';
|
|
210
|
-
} else if (userAgent.indexOf('Mac') != -1) {
|
|
211
|
-
name = 'Mac/iOS';
|
|
212
|
-
} else if (userAgent.indexOf('X11') != -1) {
|
|
213
|
-
name = 'UNIX';
|
|
214
|
-
} else if (userAgent.indexOf('Linux') != -1) {
|
|
215
|
-
name = 'Linux';
|
|
216
|
-
}
|
|
217
|
-
return name;
|
|
218
|
-
},
|
|
219
|
-
_objectMerge: function (object, source) {
|
|
220
|
-
if (source) {
|
|
221
|
-
for (var key in source) {
|
|
222
|
-
if (typeof source[key] === 'object') {
|
|
223
|
-
object[key] = Object.assign({}, source[key], object[key]);
|
|
224
|
-
} else {
|
|
225
|
-
object[key] = source[key];
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return object;
|
|
230
|
-
},
|
|
231
|
-
_randomString: function (len) {
|
|
232
|
-
if (len === void 0) {
|
|
233
|
-
len = 10;
|
|
234
|
-
}
|
|
235
|
-
var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz123456789';
|
|
236
|
-
var maxPos = $chars.length;
|
|
237
|
-
var pwd = '';
|
|
238
|
-
for (var i = 0; i < len; i++) {
|
|
239
|
-
pwd = pwd + $chars.charAt(Math.floor(Math.random() * maxPos));
|
|
240
|
-
}
|
|
241
|
-
return pwd + new Date().getTime();
|
|
242
|
-
},
|
|
243
|
-
// get query param
|
|
244
|
-
getQueryString: function (key, search) {
|
|
245
|
-
var reg = new RegExp('(?:^|[&\\?])' + key + '=([^&#]*)(?:[&#].*|$)');
|
|
246
|
-
var arrVal = (search || location.href || '').match(reg);
|
|
247
|
-
var result = '';
|
|
248
|
-
if (arrVal) {
|
|
249
|
-
result = arrVal[1] || '';
|
|
250
|
-
}
|
|
251
|
-
return decodeURIComponent(result);
|
|
252
|
-
},
|
|
253
|
-
/** 图片发送请求 */
|
|
254
|
-
request: function (url) {
|
|
255
|
-
var _image = new Image();
|
|
256
|
-
_image.onload =
|
|
257
|
-
_image.onerror =
|
|
258
|
-
_image.onabort =
|
|
259
|
-
function () {
|
|
260
|
-
_image.onload = _image.onerror = _image.onabort = null;
|
|
261
|
-
};
|
|
262
|
-
_image.src = url;
|
|
263
|
-
},
|
|
264
|
-
_getPixelSize: function () {
|
|
265
|
-
var winWidth = 0,
|
|
266
|
-
winHeight = 0;
|
|
267
|
-
if (
|
|
268
|
-
document.documentElement &&
|
|
269
|
-
document.documentElement.clientHeight &&
|
|
270
|
-
document.documentElement.clientWidth
|
|
271
|
-
) {
|
|
272
|
-
winHeight = document.documentElement.clientHeight;
|
|
273
|
-
winWidth = document.documentElement.clientWidth;
|
|
274
|
-
} else {
|
|
275
|
-
//获取窗口宽度
|
|
276
|
-
if (window.innerWidth) {
|
|
277
|
-
winWidth = window.innerWidth;
|
|
278
|
-
} else if (document.body && document.body.clientWidth) {
|
|
279
|
-
winWidth = document.body.clientWidth;
|
|
280
|
-
}
|
|
281
|
-
//获取窗口高度
|
|
282
|
-
if (window.innerHeight) {
|
|
283
|
-
winHeight = window.innerHeight;
|
|
284
|
-
} else if (document.body && document.body.clientHeight) {
|
|
285
|
-
winHeight = document.body.clientHeight;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return winWidth + '*' + winHeight;
|
|
289
|
-
},
|
|
290
|
-
// 获取元素坐标
|
|
291
|
-
_getElementPos: function (e) {
|
|
292
|
-
if (e.parentNode === null || !e.style || e.style.display == 'none')
|
|
293
|
-
return !1;
|
|
294
|
-
var t = navigator.userAgent.toLowerCase(),
|
|
295
|
-
n = null,
|
|
296
|
-
r = [],
|
|
297
|
-
i;
|
|
298
|
-
if (e.getBoundingClientRect) {
|
|
299
|
-
var s = void 0,
|
|
300
|
-
o = void 0,
|
|
301
|
-
u = void 0,
|
|
302
|
-
a = void 0;
|
|
303
|
-
return (
|
|
304
|
-
(i = e.getBoundingClientRect()),
|
|
305
|
-
(s = Math.max(
|
|
306
|
-
document.documentElement.scrollTop,
|
|
307
|
-
document.body.scrollTop
|
|
308
|
-
)),
|
|
309
|
-
(o = Math.max(
|
|
310
|
-
document.documentElement.scrollLeft,
|
|
311
|
-
document.body.scrollLeft
|
|
312
|
-
)),
|
|
313
|
-
(u = document.body.clientTop),
|
|
314
|
-
(a = document.body.clientLeft),
|
|
315
|
-
{
|
|
316
|
-
htx: i.left + o - a,
|
|
317
|
-
hty: i.top + s - u,
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
if (document['getBoxObjectFor']) {
|
|
322
|
-
i = document['getBoxObjectFor'](e);
|
|
323
|
-
var f = e.style.borderLeftWidth
|
|
324
|
-
? Math.floor(e.style.borderLeftWidth)
|
|
325
|
-
: 0,
|
|
326
|
-
l = e.style.borderTopWidth ? Math.floor(e.style.borderTopWidth) : 0;
|
|
327
|
-
r = [i.x - f, i.y - l];
|
|
328
|
-
} else {
|
|
329
|
-
(r = [e.offsetLeft, e.offsetTop]), (n = e.offsetParent);
|
|
330
|
-
if (n != e)
|
|
331
|
-
while (n)
|
|
332
|
-
(r[0] += n.offsetLeft), (r[1] += n.offsetTop), (n = n.offsetParent);
|
|
333
|
-
if (
|
|
334
|
-
t.indexOf('opera') > -1 ||
|
|
335
|
-
(t.indexOf('safari') > -1 && e.style.position == 'absolute')
|
|
336
|
-
)
|
|
337
|
-
(r[0] -= document.body.offsetLeft), (r[1] -= document.body.offsetTop);
|
|
338
|
-
}
|
|
339
|
-
e.parentNode ? (n = e.parentNode) : (n = null);
|
|
340
|
-
while (n && n.tagName != 'BODY' && n.tagName != 'HTML')
|
|
341
|
-
(r[0] -= n.scrollLeft),
|
|
342
|
-
(r[1] -= n.scrollTop),
|
|
343
|
-
n.parentNode ? (n = n.parentNode) : (n = null);
|
|
344
|
-
return {
|
|
345
|
-
htx: r[0],
|
|
346
|
-
hty: r[1],
|
|
347
|
-
};
|
|
348
|
-
},
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
var errorHandler = {
|
|
352
|
-
logObj: null,
|
|
353
|
-
init: function (logObj) {
|
|
354
|
-
this.logObj = logObj;
|
|
355
|
-
this.startListen();
|
|
356
|
-
},
|
|
357
|
-
// 监听错误
|
|
358
|
-
startListen: function () {
|
|
359
|
-
// 监听js执行错误
|
|
360
|
-
var orgError = window.onerror;
|
|
361
|
-
var self = this;
|
|
362
|
-
window.onerror = function () {
|
|
363
|
-
var args = [];
|
|
364
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
365
|
-
args[_i] = arguments[_i];
|
|
366
|
-
}
|
|
367
|
-
self.logObj._logReport(
|
|
368
|
-
{
|
|
369
|
-
type: 'error',
|
|
370
|
-
msg:
|
|
371
|
-
(args[0] || '') +
|
|
372
|
-
' @ (' +
|
|
373
|
-
(args[1] || '') +
|
|
374
|
-
':' +
|
|
375
|
-
(args[2] || 0) +
|
|
376
|
-
':' +
|
|
377
|
-
(args[3] || 0) +
|
|
378
|
-
')',
|
|
379
|
-
},
|
|
380
|
-
true
|
|
381
|
-
);
|
|
382
|
-
orgError && orgError.call.apply(orgError, [window].concat(args));
|
|
383
|
-
};
|
|
384
|
-
// 监听未被catch的promise错误
|
|
385
|
-
window.addEventListener('unhandledrejection', function (event) {
|
|
386
|
-
var reason = event && self.stringifyPlus(event.reason);
|
|
387
|
-
// 给每一个实例发送 Promise 未被 catch 错误日志
|
|
388
|
-
self.logObj._logReport(
|
|
389
|
-
{
|
|
390
|
-
type: 'error',
|
|
391
|
-
msg: 'unhandledrejection promise_error: ' + reason,
|
|
392
|
-
},
|
|
393
|
-
true
|
|
394
|
-
);
|
|
395
|
-
});
|
|
396
|
-
// 监听静态资源加载错误
|
|
397
|
-
window.document.addEventListener(
|
|
398
|
-
'error',
|
|
399
|
-
function (event) {
|
|
400
|
-
if (!event || !event.target || !event.srcElement) return;
|
|
401
|
-
var target = event.target || event.srcElement;
|
|
402
|
-
// @ts-ignore
|
|
403
|
-
var url = target.src || target.href;
|
|
404
|
-
// @ts-ignore
|
|
405
|
-
var tagName = target.tagName;
|
|
406
|
-
// 将错误上报到错误日志
|
|
407
|
-
if (url && tagName) {
|
|
408
|
-
self.logObj._logReport(
|
|
409
|
-
{
|
|
410
|
-
type: 'error',
|
|
411
|
-
msg: tagName + ' load fail: ' + url,
|
|
412
|
-
},
|
|
413
|
-
true
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
true
|
|
418
|
-
);
|
|
419
|
-
},
|
|
420
|
-
stringifyPlus: function (target) {
|
|
421
|
-
try {
|
|
422
|
-
return (
|
|
423
|
-
JSON.stringify(target, this.stringifyHandler(), 4) || 'undefined'
|
|
424
|
-
).replace(/"/gim, ''); // 这里之所以要去掉字符串中的所有 “ " ” ,是因为传进来的是 Error 对象时会 stringify 两次
|
|
425
|
-
} catch (e) {
|
|
426
|
-
return (
|
|
427
|
-
'error happen when stringify: \n ' + e.message + ' \n ' + e.stack
|
|
428
|
-
);
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
stringifyHandler: function () {
|
|
432
|
-
var cache = [];
|
|
433
|
-
var keyCache = [];
|
|
434
|
-
return function (key, value) {
|
|
435
|
-
if (value instanceof Error) {
|
|
436
|
-
// 处理Error对象
|
|
437
|
-
return (
|
|
438
|
-
'Error.message\u3010 ' +
|
|
439
|
-
value.message +
|
|
440
|
-
' \u3011; Error.stack\u3010 ' +
|
|
441
|
-
value.stack +
|
|
442
|
-
' \u3011'
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
if (typeof value === 'object' && value !== null) {
|
|
446
|
-
// 处理循环引用
|
|
447
|
-
var index = cache.indexOf(value);
|
|
448
|
-
if (index !== -1) {
|
|
449
|
-
return '[Circular ' + keyCache[index] + ']';
|
|
450
|
-
}
|
|
451
|
-
cache.push(value);
|
|
452
|
-
keyCache.push(key || 'root');
|
|
453
|
-
}
|
|
454
|
-
return value;
|
|
455
|
-
};
|
|
456
|
-
},
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
var MonitorJSSDK = /** @class */ (function () {
|
|
460
|
-
function MonitorJSSDK(config) {
|
|
461
|
-
this._reportParams = [];
|
|
462
|
-
this._storeMark = '_monitor_report_cache_data_v2';
|
|
463
|
-
this._sdkConf = {
|
|
464
|
-
report_url: '',
|
|
465
|
-
appKey: '',
|
|
466
|
-
env: 'prod',
|
|
467
|
-
userKey: 'user_id',
|
|
468
|
-
autoWatchClick: true,
|
|
469
|
-
autoReportPv: false,
|
|
470
|
-
customUserPrams: null,
|
|
471
|
-
isWxEnv: false,
|
|
472
|
-
reportNum: 5,
|
|
473
|
-
// 通过传入函数,可以让业务方写代码传入要上报的属性
|
|
474
|
-
getCusParams: function () {},
|
|
475
|
-
stopReport: false, // 停止上报
|
|
476
|
-
};
|
|
477
|
-
// 默认的参数
|
|
478
|
-
this._defReportParams = {
|
|
479
|
-
ky: '',
|
|
480
|
-
pf: utils.getQueryString('pf') || 'H5',
|
|
481
|
-
id: '',
|
|
482
|
-
cui: '',
|
|
483
|
-
geo: '',
|
|
484
|
-
my_appid: utils.getQueryString('appid'),
|
|
485
|
-
scene: utils.getQueryString('scene'),
|
|
486
|
-
region: utils.getQueryString('region'),
|
|
487
|
-
ua: navigator.userAgent,
|
|
488
|
-
ev: {
|
|
489
|
-
cn: 'unknown',
|
|
490
|
-
lg: (
|
|
491
|
-
navigator.language || navigator['browserLanguage']
|
|
492
|
-
).toLowerCase(),
|
|
493
|
-
sr: '',
|
|
494
|
-
tz: new Date().getTimezoneOffset(),
|
|
495
|
-
os: '',
|
|
496
|
-
ua: '',
|
|
497
|
-
av: '', //app version,应用的版本(App版本号)
|
|
498
|
-
},
|
|
499
|
-
ui: '',
|
|
500
|
-
si: '',
|
|
501
|
-
ts: '',
|
|
502
|
-
pi: '',
|
|
503
|
-
rf: '',
|
|
504
|
-
et: '1',
|
|
505
|
-
ht: '',
|
|
506
|
-
htx: '',
|
|
507
|
-
hty: '',
|
|
508
|
-
dm: location.hostname,
|
|
509
|
-
rdm: document.referrer,
|
|
510
|
-
ei: '',
|
|
511
|
-
kv: '',
|
|
512
|
-
du: '',
|
|
513
|
-
er: '',
|
|
514
|
-
ea: '',
|
|
515
|
-
sp: '',
|
|
516
|
-
ext: '',
|
|
517
|
-
cp: '',
|
|
518
|
-
adt: '', // 渠道来源
|
|
519
|
-
};
|
|
520
|
-
if (config.env === 'dev') {
|
|
521
|
-
console.info('当前JSSDK[env]为dev:非正式环境不做上报!');
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
this._sdkConf = Object.assign(this._sdkConf, config);
|
|
525
|
-
if (this._sdkConf.stopReport) return;
|
|
526
|
-
this._defReportParams.cp = config.customUserPrams;
|
|
527
|
-
if (this._sdkConf.report_url && this._sdkConf.appKey) {
|
|
528
|
-
utils.wrapHistory();
|
|
529
|
-
this._run();
|
|
530
|
-
this._reportCp();
|
|
531
|
-
errorHandler.init(this);
|
|
532
|
-
} else {
|
|
533
|
-
this._sdkConf.stopReport = true;
|
|
534
|
-
console.error('report_url或appKey为空,不进行上报');
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
// 上报自定义的用户属性,只有在用户属性变化的时候才会上报
|
|
538
|
-
MonitorJSSDK.prototype._reportCp = function (params) {
|
|
539
|
-
if (params === void 0) {
|
|
540
|
-
params = {};
|
|
541
|
-
}
|
|
542
|
-
if (!this._defReportParams.cp) {
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
var cpKey = '_monitor_cp_v2';
|
|
546
|
-
var cp = storage.get(cpKey);
|
|
547
|
-
var newCp = JSON.stringify(this._defReportParams.cp);
|
|
548
|
-
if (cp === newCp) {
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
var reportParams = this._cookiedReportParams(
|
|
552
|
-
Object.assign(params, { et: '6' })
|
|
553
|
-
);
|
|
554
|
-
this._requestCgi(this._sdkConf.report_url, reportParams);
|
|
555
|
-
storage.set(cpKey, newCp);
|
|
556
|
-
};
|
|
557
|
-
MonitorJSSDK.prototype._wrapGetCusParams = function () {
|
|
558
|
-
return (
|
|
559
|
-
typeof this._sdkConf.getCusParams === 'function' &&
|
|
560
|
-
this._sdkConf.getCusParams()
|
|
561
|
-
);
|
|
562
|
-
};
|
|
563
|
-
// 上报页面PV
|
|
564
|
-
MonitorJSSDK.prototype._reportPV = function (params) {
|
|
565
|
-
if (params === void 0) {
|
|
566
|
-
params = {};
|
|
567
|
-
}
|
|
568
|
-
var reportParams = this._cookiedReportParams(
|
|
569
|
-
utils._objectMerge(params, this._wrapGetCusParams())
|
|
570
|
-
);
|
|
571
|
-
this._requestCgi(this._sdkConf.report_url, reportParams);
|
|
572
|
-
};
|
|
573
|
-
// 单页应用监听页面路径改变自动上报
|
|
574
|
-
MonitorJSSDK.prototype._watchPathChange = function () {
|
|
575
|
-
var _self = this;
|
|
576
|
-
//或者
|
|
577
|
-
window.addEventListener('hashchange', function (e) {
|
|
578
|
-
_self._reportPV();
|
|
579
|
-
});
|
|
580
|
-
window.addEventListener('replaceState', function (e) {
|
|
581
|
-
_self._reportPV();
|
|
582
|
-
});
|
|
583
|
-
window.addEventListener('pushState', function (e) {
|
|
584
|
-
_self._reportPV();
|
|
585
|
-
});
|
|
586
|
-
};
|
|
587
|
-
// 获得Uv
|
|
588
|
-
MonitorJSSDK.prototype._markUv = function () {
|
|
589
|
-
var date = new Date();
|
|
590
|
-
var markUv = storage.get('ps_markUv') || '';
|
|
591
|
-
var datatime = storage.get('ps_markUvTime') || '';
|
|
592
|
-
var today =
|
|
593
|
-
date.getFullYear() +
|
|
594
|
-
'/' +
|
|
595
|
-
(date.getMonth() + 1) +
|
|
596
|
-
'/' +
|
|
597
|
-
date.getDate() +
|
|
598
|
-
' 23:59:59';
|
|
599
|
-
if ((!markUv && !datatime) || date.getTime() > +datatime) {
|
|
600
|
-
markUv = utils._randomString();
|
|
601
|
-
storage.set('ps_markUv', markUv);
|
|
602
|
-
storage.set('ps_markUvTime', new Date(today).getTime() + '');
|
|
603
|
-
}
|
|
604
|
-
return markUv;
|
|
605
|
-
};
|
|
606
|
-
// 加工上报参数
|
|
607
|
-
MonitorJSSDK.prototype._cookiedReportParams = function (params) {
|
|
608
|
-
if (params === void 0) {
|
|
609
|
-
params = {};
|
|
610
|
-
}
|
|
611
|
-
var idx = Number(storage.getCookie('_monitor_idx_v2') || '0') + 1;
|
|
612
|
-
storage.setCookie('_monitor_idx_v2', idx);
|
|
613
|
-
return Object.assign(
|
|
614
|
-
{},
|
|
615
|
-
this._defReportParams,
|
|
616
|
-
{
|
|
617
|
-
adt:
|
|
618
|
-
utils.getQueryString('adt') ||
|
|
619
|
-
storage.getCookie('adt') ||
|
|
620
|
-
sessionStorage.getItem('adt'),
|
|
621
|
-
ts: Date.now(),
|
|
622
|
-
pi: location.href,
|
|
623
|
-
idx: idx,
|
|
624
|
-
rf: document.referrer,
|
|
625
|
-
rdm: document.referrer
|
|
626
|
-
.replace(/https?:\/\//, '')
|
|
627
|
-
.replace(/(\/.+)|(\?.+)|(#.+)/g, ''), // 来源域名 string
|
|
628
|
-
},
|
|
629
|
-
params
|
|
630
|
-
);
|
|
631
|
-
};
|
|
632
|
-
// 日志上报
|
|
633
|
-
MonitorJSSDK.prototype._logReport = function (params, immediate) {
|
|
634
|
-
if (params === void 0) {
|
|
635
|
-
params = {};
|
|
636
|
-
}
|
|
637
|
-
if (immediate === void 0) {
|
|
638
|
-
immediate = false;
|
|
639
|
-
}
|
|
640
|
-
var cookiedObj = { kv: params };
|
|
641
|
-
utils._objectMerge(cookiedObj, this._wrapGetCusParams());
|
|
642
|
-
var reportParams = this._cookiedReportParams(
|
|
643
|
-
Object.assign(cookiedObj, { et: '2000' })
|
|
644
|
-
);
|
|
645
|
-
reportParams.ev.ua = reportParams.ua;
|
|
646
|
-
delete reportParams.ua;
|
|
647
|
-
var storeArr = this.getStoreArr();
|
|
648
|
-
// 非立刻上报,且目前缓存的条数不够
|
|
649
|
-
if (!immediate && storeArr.length < this._sdkConf.reportNum - 1) {
|
|
650
|
-
storeArr.push(utils._delUselessParam(reportParams));
|
|
651
|
-
storage.set(this._storeMark, JSON.stringify(storeArr));
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
this._requestCgi(this._sdkConf.report_url, reportParams);
|
|
655
|
-
};
|
|
656
|
-
/*点击流上报
|
|
657
|
-
* ei 自定义事件id string
|
|
658
|
-
* params 额外参数对象
|
|
659
|
-
* cache 缓存,下次在上报
|
|
660
|
-
* target 事件源对象
|
|
661
|
-
* */
|
|
662
|
-
MonitorJSSDK.prototype._eventClick = function (ei, params, cache, target) {
|
|
663
|
-
if (params === void 0) {
|
|
664
|
-
params = {};
|
|
665
|
-
}
|
|
666
|
-
if (cache === void 0) {
|
|
667
|
-
cache = false;
|
|
668
|
-
}
|
|
669
|
-
if (this._sdkConf.stopReport) return;
|
|
670
|
-
if (target) {
|
|
671
|
-
Object.assign(params, utils._getElementPos(target));
|
|
672
|
-
}
|
|
673
|
-
utils._objectMerge(params, this._wrapGetCusParams());
|
|
674
|
-
var reportParams = this._cookiedReportParams(
|
|
675
|
-
Object.assign(params, { ei: ei, et: '1000' })
|
|
676
|
-
);
|
|
677
|
-
// 先缓存
|
|
678
|
-
if (cache) {
|
|
679
|
-
var storeArr = this.getStoreArr();
|
|
680
|
-
storeArr.push(utils._delUselessParam(reportParams));
|
|
681
|
-
storage.set(this._storeMark, JSON.stringify(storeArr));
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
this._requestCgi(this._sdkConf.report_url, reportParams);
|
|
685
|
-
};
|
|
686
|
-
// 获取缓存数据
|
|
687
|
-
MonitorJSSDK.prototype.getStoreArr = function () {
|
|
688
|
-
var storeArr = storage.get(this._storeMark);
|
|
689
|
-
if (!storeArr) {
|
|
690
|
-
storeArr = [];
|
|
691
|
-
} else {
|
|
692
|
-
storeArr = JSON.parse(storeArr);
|
|
693
|
-
}
|
|
694
|
-
return storeArr;
|
|
695
|
-
};
|
|
696
|
-
// 保存缓存数据
|
|
697
|
-
MonitorJSSDK.prototype.setStoreArr = function (arr) {
|
|
698
|
-
var newArr = this.getStoreArr();
|
|
699
|
-
storage.set(this._storeMark, JSON.stringify(newArr.concat(arr)));
|
|
700
|
-
};
|
|
701
|
-
MonitorJSSDK.prototype._run = function () {
|
|
702
|
-
this._getPageBaseInfo();
|
|
703
|
-
if (this._sdkConf.autoWatchClick) {
|
|
704
|
-
this._watchClick();
|
|
705
|
-
}
|
|
706
|
-
if (this._sdkConf.autoReportPv) {
|
|
707
|
-
this._watchPathChange();
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
// 获取页面基本信息
|
|
711
|
-
MonitorJSSDK.prototype._getPageBaseInfo = function () {
|
|
712
|
-
if (this._sdkConf.isWxEnv) {
|
|
713
|
-
this._getNetworkType();
|
|
714
|
-
}
|
|
715
|
-
var realUserId =
|
|
716
|
-
utils.getQueryString('id') ||
|
|
717
|
-
storage.getCookie(this._sdkConf['userKey']) ||
|
|
718
|
-
this._getUUID();
|
|
719
|
-
Object.assign(this._defReportParams, {
|
|
720
|
-
dm: location.hostname,
|
|
721
|
-
ky: this._sdkConf.appKey,
|
|
722
|
-
si: this._getSessionId(),
|
|
723
|
-
id: realUserId + '_id',
|
|
724
|
-
cui: realUserId + '_cui',
|
|
725
|
-
ui: realUserId + '_ui', // 一个随机生成的id,因为大多数没有id,cui,所以用ui计算uv
|
|
726
|
-
});
|
|
727
|
-
this._defReportParams.ev.sr = utils._getPixelSize();
|
|
728
|
-
this._defReportParams.ev.os = utils._getOsName();
|
|
729
|
-
};
|
|
730
|
-
// 获取sessionid
|
|
731
|
-
MonitorJSSDK.prototype._getSessionId = function () {
|
|
732
|
-
var sessionKey = '_monitor_sessionid_v2';
|
|
733
|
-
var sessionId = storage.getCookie(sessionKey);
|
|
734
|
-
if (!sessionId) {
|
|
735
|
-
sessionId = utils._randomString();
|
|
736
|
-
storage.setCookie(sessionKey, sessionId);
|
|
737
|
-
storage.setCookie('_monitor_idx_v2', 1);
|
|
738
|
-
}
|
|
739
|
-
return sessionId;
|
|
740
|
-
};
|
|
741
|
-
// 生成唯一id
|
|
742
|
-
MonitorJSSDK.prototype._getUUID = function () {
|
|
743
|
-
var uuidKey = '_monitor_uuid_v2';
|
|
744
|
-
var uuid = storage.get(uuidKey);
|
|
745
|
-
if (uuid) {
|
|
746
|
-
return uuid;
|
|
747
|
-
}
|
|
748
|
-
var d = new Date().getTime();
|
|
749
|
-
if (window.performance && typeof window.performance.now === 'function') {
|
|
750
|
-
d += performance.now(); //use high-precision timer if available
|
|
751
|
-
}
|
|
752
|
-
uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
|
|
753
|
-
/[xy]/g,
|
|
754
|
-
function (c) {
|
|
755
|
-
var r = (d + Math.random() * 16) % 16 | 0;
|
|
756
|
-
d = Math.floor(d / 16);
|
|
757
|
-
return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);
|
|
758
|
-
}
|
|
759
|
-
);
|
|
760
|
-
uuid = 'mc_' + uuid;
|
|
761
|
-
storage.set(uuidKey, uuid);
|
|
762
|
-
return uuid;
|
|
763
|
-
};
|
|
764
|
-
// 获取网络类型
|
|
765
|
-
MonitorJSSDK.prototype._getNetworkType = function () {
|
|
766
|
-
var self = this;
|
|
767
|
-
if (this._sdkConf.isWxEnv) {
|
|
768
|
-
wx.getNetworkType({
|
|
769
|
-
success: function (res) {
|
|
770
|
-
self._defReportParams.ev.cn = res.networkType; // 返回网络类型2g,3g,4g,wifi
|
|
771
|
-
},
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
MonitorJSSDK.prototype._requestCgi = function (url, data) {
|
|
776
|
-
var _self = this;
|
|
777
|
-
if (_self._sdkConf.stopReport) return;
|
|
778
|
-
var storeArr = this.getStoreArr();
|
|
779
|
-
storeArr.push(utils._delUselessParam(data));
|
|
780
|
-
var reportInfo = storeArr.splice(0 - _self._sdkConf.reportNum);
|
|
781
|
-
storage.set(this._storeMark, JSON.stringify(storeArr));
|
|
782
|
-
ajax({
|
|
783
|
-
method: 'POST',
|
|
784
|
-
url: url,
|
|
785
|
-
data: {
|
|
786
|
-
reportInfo: encodeURIComponent(JSON.stringify(reportInfo)),
|
|
787
|
-
},
|
|
788
|
-
success: function (response) {
|
|
789
|
-
if (+response.errcode !== 0) {
|
|
790
|
-
_self.setStoreArr(reportInfo);
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
error: function () {
|
|
794
|
-
_self.setStoreArr(reportInfo);
|
|
795
|
-
},
|
|
796
|
-
});
|
|
797
|
-
};
|
|
798
|
-
// 监听有hottag的标签
|
|
799
|
-
MonitorJSSDK.prototype._watchClick = function () {
|
|
800
|
-
var _self = this;
|
|
801
|
-
document.addEventListener(
|
|
802
|
-
'click',
|
|
803
|
-
function (e) {
|
|
804
|
-
var target = e.srcElement || e.target; // src 就是事件的触发源
|
|
805
|
-
var hottag = target.getAttribute('hottag');
|
|
806
|
-
var ht = target.getAttribute('ht');
|
|
807
|
-
hottag && _self._eventClick(hottag, { ht: ht }, false, target);
|
|
808
|
-
},
|
|
809
|
-
false
|
|
810
|
-
);
|
|
811
|
-
};
|
|
812
|
-
return MonitorJSSDK;
|
|
813
|
-
})();
|
|
814
|
-
var yyptReport = {
|
|
815
|
-
g_monitor: null,
|
|
816
|
-
// 初始化
|
|
817
|
-
initMonitor: function (config) {
|
|
818
|
-
if (!this.g_monitor) {
|
|
819
|
-
this.g_monitor = new MonitorJSSDK(config);
|
|
820
|
-
}
|
|
821
|
-
},
|
|
822
|
-
// 初始化并进行pv上报
|
|
823
|
-
pgvMain: function (config, params) {
|
|
824
|
-
if (params === void 0) {
|
|
825
|
-
params = {};
|
|
826
|
-
}
|
|
827
|
-
this.initMonitor(config);
|
|
828
|
-
if (config.autoReportPv) {
|
|
829
|
-
this.g_monitor._reportPV(params);
|
|
830
|
-
}
|
|
831
|
-
},
|
|
832
|
-
// 手动上报pv
|
|
833
|
-
reportPV: function (params) {
|
|
834
|
-
this.g_monitor._reportPV(params);
|
|
835
|
-
},
|
|
836
|
-
// 点击上报
|
|
837
|
-
eventClick: function () {
|
|
838
|
-
var params = [];
|
|
839
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
840
|
-
params[_i] = arguments[_i];
|
|
841
|
-
}
|
|
842
|
-
var _a;
|
|
843
|
-
if (!this.g_monitor) {
|
|
844
|
-
console.error('请先运行initMonitor方法!!');
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
(_a = this.g_monitor)._eventClick.apply(_a, params);
|
|
848
|
-
},
|
|
849
|
-
logInfo: function (msg, params, immediate) {
|
|
850
|
-
if (params === void 0) {
|
|
851
|
-
params = {};
|
|
852
|
-
}
|
|
853
|
-
this.g_monitor._logReport(
|
|
854
|
-
Object.assign(params, { type: 'info', msg: msg }),
|
|
855
|
-
immediate
|
|
856
|
-
);
|
|
857
|
-
},
|
|
858
|
-
logWarn: function (msg, params, immediate) {
|
|
859
|
-
if (params === void 0) {
|
|
860
|
-
params = {};
|
|
861
|
-
}
|
|
862
|
-
this.g_monitor._logReport(
|
|
863
|
-
Object.assign(params, { type: 'warn', msg: msg }),
|
|
864
|
-
immediate
|
|
865
|
-
);
|
|
866
|
-
},
|
|
867
|
-
logError: function (msg, params, immediate) {
|
|
868
|
-
if (params === void 0) {
|
|
869
|
-
params = {};
|
|
870
|
-
}
|
|
871
|
-
this.g_monitor._logReport(
|
|
872
|
-
Object.assign(params, { type: 'error', msg: msg }),
|
|
873
|
-
immediate
|
|
874
|
-
);
|
|
875
|
-
},
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
return yyptReport;
|
|
879
|
-
})();
|
|
880
|
-
|
|
881
|
-
window.yyptReport = yyptReport;
|