uni-oaview 1.0.15 → 1.0.16
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/dist/index.d.ts +8 -3
- package/dist/index.umd.mini.js +38 -34
- package/package.json +2 -2
- package/src/utils/index.ts +2 -4
- package/src/utils/send-log.ts +17 -0
- package/src/utils/validation.ts +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 上报APP启动小程序的时候的入参
|
|
3
|
+
* @param params
|
|
4
|
+
*/
|
|
5
|
+
declare function sendLaunchAppParamsLog(params: any): void;
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* 防抖函数
|
|
3
9
|
* @param callback
|
|
4
10
|
* @param time
|
|
5
11
|
* @returns
|
|
6
12
|
*/
|
|
7
|
-
declare function createDebounceFn(callback: (...params: any[]) => void, time: number): (...params: any[]) => void;
|
|
8
|
-
declare function getAsk(): string;
|
|
13
|
+
declare function createDebounceFn(callback: (...params: any[]) => void, time: number): (...params: any[]) => void;
|
|
9
14
|
|
|
10
15
|
declare const _default: {
|
|
11
16
|
install: (Vue: any) => void;
|
|
12
17
|
};
|
|
13
18
|
|
|
14
|
-
export { createDebounceFn, _default as default,
|
|
19
|
+
export { createDebounceFn, _default as default, sendLaunchAppParamsLog };
|
package/dist/index.umd.mini.js
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["UNI-OAVIEW"] = {}));
|
|
5
|
-
})(this, (function (exports) { 'use strict';
|
|
1
|
+
import { reportLog } from 'uniapp-log-sdk';
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
timer = setTimeout(function () {
|
|
21
|
-
callback.apply(void 0, params);
|
|
22
|
-
}, time);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function getAsk() {
|
|
26
|
-
return '我是航帆范德萨范德萨';
|
|
3
|
+
/**
|
|
4
|
+
* 上报APP启动小程序的时候的入参
|
|
5
|
+
* @param params
|
|
6
|
+
*/
|
|
7
|
+
function sendLaunchAppParamsLog(params) {
|
|
8
|
+
var _a;
|
|
9
|
+
// #ifndef H5
|
|
10
|
+
try {
|
|
11
|
+
var outputData = JSON.parse(JSON.stringify((_a = params === null || params === void 0 ? void 0 : params.referrerInfo) === null || _a === void 0 ? void 0 : _a.extraData));
|
|
12
|
+
outputData === null || outputData === void 0 ? true : delete outputData.token;
|
|
13
|
+
reportLog(outputData, '小程序启动入参');
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.log(error);
|
|
27
16
|
}
|
|
17
|
+
// #endif
|
|
18
|
+
}
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 防抖函数
|
|
22
|
+
* @param callback
|
|
23
|
+
* @param time
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
function createDebounceFn(callback, time) {
|
|
27
|
+
var timer = null;
|
|
28
|
+
return function () {
|
|
29
|
+
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
+
params[_key] = arguments[_key];
|
|
31
|
+
}
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
timer = setTimeout(function () {
|
|
34
|
+
callback.apply(void 0, params);
|
|
35
|
+
}, time);
|
|
32
36
|
};
|
|
37
|
+
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
39
|
+
var install = function install(Vue) {};
|
|
40
|
+
var index = {
|
|
41
|
+
install: install
|
|
42
|
+
};
|
|
39
43
|
|
|
40
|
-
}
|
|
44
|
+
export { createDebounceFn, index as default, sendLaunchAppParamsLog };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uni-oaview",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "uniapp小程序组件库",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"rollup-plugin-typescript2": "^0.27.2",
|
|
45
45
|
"rollup-plugin-vue": "^6.0.0",
|
|
46
46
|
"typescript": "^4.0.2",
|
|
47
|
-
"uniapp-log-sdk": "^1.
|
|
47
|
+
"uniapp-log-sdk": "^1.2.17",
|
|
48
48
|
"uview-plus": "^3.1.30"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { reportLog } from 'uniapp-log-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 上报APP启动小程序的时候的入参
|
|
5
|
+
* @param params
|
|
6
|
+
*/
|
|
7
|
+
export function sendLaunchAppParamsLog(params: any) {
|
|
8
|
+
// #ifndef H5
|
|
9
|
+
try {
|
|
10
|
+
const outputData = JSON.parse(JSON.stringify(params?.referrerInfo?.extraData));
|
|
11
|
+
delete outputData?.token;
|
|
12
|
+
reportLog(outputData, '小程序启动入参');
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.log(error);
|
|
15
|
+
}
|
|
16
|
+
// #endif
|
|
17
|
+
}
|
package/src/utils/validation.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断当前参数是否是undefined或者null
|
|
3
|
-
* @param {Object} obj
|
|
4
|
-
*/
|
|
5
|
-
export function isNullOrUndefined(value: any) {
|
|
6
|
-
return typeof value === 'undefined' || value === null;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* 是否对象
|
|
10
|
-
*/
|
|
11
|
-
export function isObject(value: any) {
|
|
12
|
-
return Object.prototype.toString.call(value) === '[object Object]';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 判断当前参数是否是空, 包括空字符和空对象,空数组,null,undefined
|
|
17
|
-
* @param {Object} obj
|
|
18
|
-
*/
|
|
19
|
-
export function isEmpty(obj: any) {
|
|
20
|
-
if (isNullOrUndefined(obj)) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(obj) && obj.length === 0) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
if (typeof obj === 'string' && obj === '') {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 验证十进制数字
|
|
33
|
-
*/
|
|
34
|
-
export function isNumber(value: any) {
|
|
35
|
-
return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 正则校验是否为颜色,支持#FFF,#FFFFFF,#FFFFFFFF格式
|
|
40
|
-
*/
|
|
41
|
-
export function CheckIsColor(color: any) {
|
|
42
|
-
const type = '^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$';
|
|
43
|
-
const reg = new RegExp(type);
|
|
44
|
-
return color.match(reg) !== null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
isNullOrUndefined,
|
|
49
|
-
isObject,
|
|
50
|
-
isEmpty,
|
|
51
|
-
isNumber,
|
|
52
|
-
};
|