@indfnd/utils 0.1.25 → 0.1.27
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/CHANGELOG.md +11 -0
- package/dist/ind-utils.es.js +242 -77
- package/dist/ind-utils.umd.cjs +19 -19
- package/package.json +2 -2
- package/src/api/com.ts +3 -0
- package/src/api/item.ts +5 -0
- package/src/config/index.ts +14 -3
- package/src/utils/request/axios.extends.ts +14 -0
- package/src/utils/request/index.ts +116 -0
- package/src/utils/request/interceptors.ts +2 -1
- package/types/api/com.d.ts.map +1 -1
- package/types/api/index.d.ts +6 -6
- package/types/api/item.d.ts.map +1 -1
- package/types/api/platform/base64.d.ts +5 -5
- package/types/api/platform/index.d.ts +5 -5
- package/types/config/base.config.d.ts +33 -33
- package/types/config/dev.config.d.ts +3 -3
- package/types/config/index.d.ts +6 -67
- package/types/config/index.d.ts.map +1 -1
- package/types/config/prod.config.d.ts +3 -3
- package/types/index.d.ts +4 -4
- package/types/utils/base64.d.ts +22 -22
- package/types/utils/blob.d.ts +3 -3
- package/types/utils/cache/dict-cache.d.ts +3 -3
- package/types/utils/cache/index-desc.d.ts +4 -4
- package/types/utils/cache/index.d.ts +4 -4
- package/types/utils/cache/permission-cache.d.ts +4 -4
- package/types/utils/cache/user-cache.d.ts +4 -4
- package/types/utils/date.d.ts +4 -4
- package/types/utils/enum.d.ts +39 -43
- package/types/utils/event.d.ts +5 -13
- package/types/utils/excel.d.ts +4 -4
- package/types/utils/half-year.d.ts +6 -6
- package/types/utils/index.d.ts +20 -20
- package/types/utils/is-type.d.ts +33 -33
- package/types/utils/mime-type.d.ts +67 -67
- package/types/utils/number.d.ts +8 -8
- package/types/utils/quarter.d.ts +7 -7
- package/types/utils/request/axios.extends.d.ts +6 -7
- package/types/utils/request/axios.extends.d.ts.map +1 -1
- package/types/utils/request/cache-rules.d.ts +3 -3
- package/types/utils/request/content-type.d.ts +9 -9
- package/types/utils/request/index.d.ts +20 -8
- package/types/utils/request/index.d.ts.map +1 -1
- package/types/utils/request/interceptors.d.ts +4 -4
- package/types/utils/request/interceptors.d.ts.map +1 -1
- package/types/utils/request/url-params.d.ts +6 -6
- package/types/utils/sm3/index.d.ts +6 -6
- package/types/utils/sm3/sm3.d.ts +3 -3
- package/types/utils/storage.d.ts +8 -8
- package/types/utils/table.d.ts +31 -40
- package/types/utils/token.d.ts +3 -3
- package/types/utils/uuid.d.ts +4 -4
- package/types/utils/validate.d.ts +5 -5
package/types/utils/enum.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
/** 是否枚举的key */
|
|
2
|
-
export declare const IS_OR_NOT_ENUM_KEY =
|
|
2
|
+
export declare const IS_OR_NOT_ENUM_KEY = "IS_ENUM";
|
|
3
3
|
/** 是否枚举的map形式 */
|
|
4
4
|
export declare const IS_OR_NOT_ENUM: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
'1': string;
|
|
6
|
+
'0': string;
|
|
7
|
+
};
|
|
8
8
|
/** 是否枚举的list形式 */
|
|
9
9
|
export declare const IS_OR_NOT_ENUM_LIST: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}[]
|
|
10
|
+
K: string;
|
|
11
|
+
V: string;
|
|
12
|
+
}[];
|
|
13
13
|
export declare const UC_ENUM: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
14
|
+
MANAGE_UNIT_ID: string;
|
|
15
|
+
ORG_CODE_ADMIN: string;
|
|
16
|
+
ORG_CODE_MKT: string;
|
|
17
|
+
ORG_CODE_LOG: string;
|
|
18
|
+
ORG_CODE_ACTIVITY: string;
|
|
19
|
+
ADMIN_LEVEL_IND: string;
|
|
20
|
+
ADMIN_LEVEL_CENTER: string;
|
|
21
|
+
ADMIN_LEVEL_FAC: string;
|
|
22
|
+
ADMIN_LEVEL_DIST: string;
|
|
23
|
+
ADMIN_LEVEL_COMMON_DEPT: string;
|
|
24
|
+
ADMIN_LEVEL_COMMON_POST: string;
|
|
25
|
+
LEVEL_IND: string;
|
|
26
|
+
LEVEL_CENTER: string;
|
|
27
|
+
LEVEL_FAC: string;
|
|
28
|
+
LEVEL_DIST: string;
|
|
29
|
+
LEVEL_CIGAR_DIST: string;
|
|
30
|
+
LEVEL_COMMON_DEPT: string;
|
|
31
|
+
LEVEL_COMMON_POST: string;
|
|
32
|
+
LEVEL_DIST_MANAGE_POST: string;
|
|
33
|
+
LEVEL_CUST_MANAGE_POST: string;
|
|
34
|
+
LEVEL_CIGAR_DIST_MANAGE_POST: string;
|
|
35
|
+
LEVEL_CIGAR_CUST_MANAGE_POST: string;
|
|
36
|
+
LEVEL_INTERNAL_POST: string;
|
|
37
|
+
};
|
|
38
38
|
/**
|
|
39
39
|
* 将自定义的列表转换为枚举列表格式,如
|
|
40
40
|
* ```
|
|
@@ -47,14 +47,10 @@ export declare const UC_ENUM: {
|
|
|
47
47
|
* @param vProp value对应属性名
|
|
48
48
|
* @returns 公共组件可直接使用的枚举列表
|
|
49
49
|
*/
|
|
50
|
-
export declare function renderEnumList(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
): {
|
|
55
|
-
K: any
|
|
56
|
-
V: any
|
|
57
|
-
}[]
|
|
50
|
+
export declare function renderEnumList(list?: any[], kProp?: string, vProp?: string): {
|
|
51
|
+
K: any;
|
|
52
|
+
V: any;
|
|
53
|
+
}[];
|
|
58
54
|
/**
|
|
59
55
|
* 将自定义的列表转换为枚举对象格式,如
|
|
60
56
|
* ```
|
|
@@ -66,7 +62,7 @@ export declare function renderEnumList(
|
|
|
66
62
|
* @param vProp value对应属性名
|
|
67
63
|
* @returns 公共组件可直接使用的枚举对象
|
|
68
64
|
*/
|
|
69
|
-
export declare function renderEnumData(list?: any[], kProp?: string, vProp?: string): any
|
|
65
|
+
export declare function renderEnumData(list?: any[], kProp?: string, vProp?: string): any;
|
|
70
66
|
/**
|
|
71
67
|
* 统一处理表格列定义的枚举列
|
|
72
68
|
* - 由于表格组件不方便获取枚举数据,需要各业务先获取枚举数据后,重新组织列定义
|
|
@@ -76,7 +72,7 @@ export declare function renderEnumData(list?: any[], kProp?: string, vProp?: str
|
|
|
76
72
|
* @param enumRelation 枚举数据,支持多个枚举,格式为 `{ '枚举Id1': [{ K: '', V: ''}] }` 或 `{ '枚举Id1': { 'K': 'V' } }`
|
|
77
73
|
* @returns 新的列定义
|
|
78
74
|
*/
|
|
79
|
-
export declare function renderColumnEnums(columns?: any[], enumRelation?: {}): any[]
|
|
75
|
+
export declare function renderColumnEnums(columns?: any[], enumRelation?: {}): any[];
|
|
80
76
|
/**
|
|
81
77
|
* 统一处理表单的类枚举列
|
|
82
78
|
* - 用于处理需特定接口获取数据的列表
|
|
@@ -86,5 +82,5 @@ export declare function renderColumnEnums(columns?: any[], enumRelation?: {}): a
|
|
|
86
82
|
* @param enumRelation 枚举数据,支持多个枚举,格式为 `{ '枚举Id1': [{ K: '', V: ''}] }` 或 `{ '枚举Id1': { 'K': 'V' } }`
|
|
87
83
|
* @returns 新的表单定义
|
|
88
84
|
*/
|
|
89
|
-
export declare function renderFieldEnums(fieldList?: any[], enumRelation?: {}): any[]
|
|
90
|
-
//# sourceMappingURL=enum.d.ts.map
|
|
85
|
+
export declare function renderFieldEnums(fieldList?: any[], enumRelation?: {}): any[];
|
|
86
|
+
//# sourceMappingURL=enum.d.ts.map
|
package/types/utils/event.d.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 绑定事件 on(element, event, handler)
|
|
3
3
|
*/
|
|
4
|
-
export declare function on(
|
|
5
|
-
element: any,
|
|
6
|
-
event: any,
|
|
7
|
-
handler: any,
|
|
8
|
-
): (element: any, event: any, handler: any) => void
|
|
4
|
+
export declare function on(element: any, event: any, handler: any): (element: any, event: any, handler: any) => void;
|
|
9
5
|
/**
|
|
10
6
|
* 解绑事件 off(element, event, handler)
|
|
11
7
|
*/
|
|
12
|
-
export declare function off(
|
|
13
|
-
|
|
14
|
-
event: any,
|
|
15
|
-
handler: any,
|
|
16
|
-
): (element: HTMLElement, event: string, handler: EventListenerOrEventListenerObject) => void
|
|
17
|
-
export declare const stopPropagation: (event: Event) => void
|
|
8
|
+
export declare function off(element: any, event: any, handler: any): (element: HTMLElement, event: string, handler: EventListenerOrEventListenerObject) => void;
|
|
9
|
+
export declare const stopPropagation: (event: Event) => void;
|
|
18
10
|
/**
|
|
19
11
|
* 事件 preventDefault
|
|
20
12
|
*
|
|
21
13
|
* @param event 事件
|
|
22
14
|
* @param isStopPropagation 是否阻止冒泡
|
|
23
15
|
*/
|
|
24
|
-
export declare function preventDefault(event: Event, isStopPropagation?: Boolean): void
|
|
25
|
-
//# sourceMappingURL=event.d.ts.map
|
|
16
|
+
export declare function preventDefault(event: Event, isStopPropagation?: Boolean): void;
|
|
17
|
+
//# sourceMappingURL=event.d.ts.map
|
package/types/utils/excel.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* rowSpanIndexCol:'', // 根据哪一列进行跨行计算,如根据卷烟ITEM_NAME
|
|
18
18
|
* } excelData
|
|
19
19
|
*/
|
|
20
|
-
export function exportJsonToExcel(excelData: any): void
|
|
20
|
+
export function exportJsonToExcel(excelData: any): void;
|
|
21
21
|
/**
|
|
22
22
|
* 根据参数导出excel,目前系统仅支持agGrid和iviewTable,这两个表格的columns定义都是树形的,所以这里仅支持树形的列定义即可
|
|
23
23
|
* 根据每个column的树形信息,可以计算出每个column定义的单元格跨行跨列信息,直接得出excel待导出的表头
|
|
@@ -37,12 +37,12 @@ export function exportJsonToExcel(excelData: any): void
|
|
|
37
37
|
* rowSpanIndexCol:'', // 根据哪一列进行跨行计算,如根据卷烟ITEM_NAME
|
|
38
38
|
* } excelData
|
|
39
39
|
*/
|
|
40
|
-
export function importJsonFromExcel(excelData: any): Promise<any
|
|
40
|
+
export function importJsonFromExcel(excelData: any): Promise<any>;
|
|
41
41
|
/**
|
|
42
42
|
* 根据列的数组下标返回excel对应的列号 (目前是按照.xlsx的定义计算的)
|
|
43
43
|
*
|
|
44
44
|
* @param {number} number 列的下标,从0开始计数
|
|
45
45
|
* @returns excel里的列号
|
|
46
46
|
*/
|
|
47
|
-
export function getExcelColumnIdx(number: number): string
|
|
48
|
-
//# sourceMappingURL=excel.d.ts.map
|
|
47
|
+
export function getExcelColumnIdx(number: number): string;
|
|
48
|
+
//# sourceMappingURL=excel.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function getHalfYear(date: string): string
|
|
2
|
-
export declare function getHalfYearNum(month: number | string): 0 | 1 | 2
|
|
3
|
-
export declare function formatHalfYear(halfYear: string): string
|
|
4
|
-
export declare function getHalfYearBeginMonth(halfYear: string): string
|
|
5
|
-
export declare function getHalfYearEndMonth(halfYear: string): string
|
|
6
|
-
//# sourceMappingURL=half-year.d.ts.map
|
|
1
|
+
export declare function getHalfYear(date: string): string;
|
|
2
|
+
export declare function getHalfYearNum(month: number | string): 0 | 1 | 2;
|
|
3
|
+
export declare function formatHalfYear(halfYear: string): string;
|
|
4
|
+
export declare function getHalfYearBeginMonth(halfYear: string): string;
|
|
5
|
+
export declare function getHalfYearEndMonth(halfYear: string): string;
|
|
6
|
+
//# sourceMappingURL=half-year.d.ts.map
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from './cache'
|
|
2
|
-
export * from './request'
|
|
3
|
-
export * from './sm3'
|
|
4
|
-
export * from './base64'
|
|
5
|
-
export * from './blob'
|
|
6
|
-
export * from './date'
|
|
7
|
-
export * from './enum'
|
|
8
|
-
export * from './excel'
|
|
9
|
-
export * from './event'
|
|
10
|
-
export * from './half-year'
|
|
11
|
-
export * from './is-type'
|
|
12
|
-
export * from './mime-type'
|
|
13
|
-
export * from './number'
|
|
14
|
-
export * from './quarter'
|
|
15
|
-
export * from './storage'
|
|
16
|
-
export * from './table'
|
|
17
|
-
export * from './token'
|
|
18
|
-
export * from './uuid'
|
|
19
|
-
export * from './validate'
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './cache';
|
|
2
|
+
export * from './request';
|
|
3
|
+
export * from './sm3';
|
|
4
|
+
export * from './base64';
|
|
5
|
+
export * from './blob';
|
|
6
|
+
export * from './date';
|
|
7
|
+
export * from './enum';
|
|
8
|
+
export * from './excel';
|
|
9
|
+
export * from './event';
|
|
10
|
+
export * from './half-year';
|
|
11
|
+
export * from './is-type';
|
|
12
|
+
export * from './mime-type';
|
|
13
|
+
export * from './number';
|
|
14
|
+
export * from './quarter';
|
|
15
|
+
export * from './storage';
|
|
16
|
+
export * from './table';
|
|
17
|
+
export * from './token';
|
|
18
|
+
export * from './uuid';
|
|
19
|
+
export * from './validate';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
package/types/utils/is-type.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export declare const isNull: (value: any) => value is null
|
|
2
|
-
export declare const isUndefined: (value: any) => value is undefined
|
|
3
|
-
export declare const isNil: (value: any) => value is null
|
|
4
|
-
export declare const getType: (value: any) => string
|
|
5
|
-
export declare const isType: (value: any, type: string) => boolean
|
|
6
|
-
export declare const isPrototype: (value: any) => boolean
|
|
7
|
-
export declare const isBoolean: (value: any) => value is boolean
|
|
8
|
-
export declare const isNumber: (value: any) => value is number
|
|
9
|
-
export declare const isString: (str: any) => str is string
|
|
10
|
-
export declare const isArray: (value: any) => value is any[]
|
|
11
|
-
export declare const isArrayLike: (value: any) => boolean
|
|
12
|
-
export declare const isObject: <T = object>(value: any) => value is T
|
|
13
|
-
export declare const isObjectLike: (value: any) => value is object
|
|
14
|
-
export declare const isPlainObject: (value: any) => value is object
|
|
15
|
-
export declare const isFunction: (value: any) => value is Function
|
|
16
|
-
export declare const isPromise: (value: any) => boolean
|
|
17
|
-
export declare const isDate: (value: any) => value is Date
|
|
18
|
-
export declare const isArguments: (value: any) => boolean
|
|
19
|
-
export declare const isRegExp: (str: any) => str is RegExp
|
|
20
|
-
export declare const isError: (value: any) => value is Error
|
|
21
|
-
export declare const isElement: (o: any) => boolean
|
|
22
|
-
export declare const isEmpty: (value: any) => boolean
|
|
23
|
-
export declare const isEqual: (value: any, other: any) => boolean
|
|
1
|
+
export declare const isNull: (value: any) => value is null;
|
|
2
|
+
export declare const isUndefined: (value: any) => value is undefined;
|
|
3
|
+
export declare const isNil: (value: any) => value is null;
|
|
4
|
+
export declare const getType: (value: any) => string;
|
|
5
|
+
export declare const isType: (value: any, type: string) => boolean;
|
|
6
|
+
export declare const isPrototype: (value: any) => boolean;
|
|
7
|
+
export declare const isBoolean: (value: any) => value is boolean;
|
|
8
|
+
export declare const isNumber: (value: any) => value is number;
|
|
9
|
+
export declare const isString: (str: any) => str is string;
|
|
10
|
+
export declare const isArray: (value: any) => value is any[];
|
|
11
|
+
export declare const isArrayLike: (value: any) => boolean;
|
|
12
|
+
export declare const isObject: <T = object>(value: any) => value is T;
|
|
13
|
+
export declare const isObjectLike: (value: any) => value is object;
|
|
14
|
+
export declare const isPlainObject: (value: any) => value is object;
|
|
15
|
+
export declare const isFunction: (value: any) => value is Function;
|
|
16
|
+
export declare const isPromise: (value: any) => boolean;
|
|
17
|
+
export declare const isDate: (value: any) => value is Date;
|
|
18
|
+
export declare const isArguments: (value: any) => boolean;
|
|
19
|
+
export declare const isRegExp: (str: any) => str is RegExp;
|
|
20
|
+
export declare const isError: (value: any) => value is Error;
|
|
21
|
+
export declare const isElement: (o: any) => boolean;
|
|
22
|
+
export declare const isEmpty: (value: any) => boolean;
|
|
23
|
+
export declare const isEqual: (value: any, other: any) => boolean;
|
|
24
24
|
/** number */
|
|
25
|
-
export declare const isEven: (num: any) => boolean
|
|
26
|
-
export declare const isOdd: (num: any) => boolean
|
|
27
|
-
export declare const isFinite: (value: any) => value is number
|
|
28
|
-
export declare const isInteger: (number: unknown) => boolean
|
|
29
|
-
export declare const isDecimal: (num: any) => boolean
|
|
30
|
-
export declare const isNegative: (num: any) => boolean
|
|
31
|
-
export declare const isPositive: (num: any) => boolean
|
|
32
|
-
export declare const isNumberEqual: (a: number, b: number, precision?: number) => boolean
|
|
33
|
-
export declare const isEqualWith: <T>(value: T, other: T, fn: (v1: T, v2: T) => boolean) => boolean
|
|
34
|
-
//# sourceMappingURL=is-type.d.ts.map
|
|
25
|
+
export declare const isEven: (num: any) => boolean;
|
|
26
|
+
export declare const isOdd: (num: any) => boolean;
|
|
27
|
+
export declare const isFinite: (value: any) => value is number;
|
|
28
|
+
export declare const isInteger: (number: unknown) => boolean;
|
|
29
|
+
export declare const isDecimal: (num: any) => boolean;
|
|
30
|
+
export declare const isNegative: (num: any) => boolean;
|
|
31
|
+
export declare const isPositive: (num: any) => boolean;
|
|
32
|
+
export declare const isNumberEqual: (a: number, b: number, precision?: number) => boolean;
|
|
33
|
+
export declare const isEqualWith: <T>(value: T, other: T, fn: (v1: T, v2: T) => boolean) => boolean;
|
|
34
|
+
//# sourceMappingURL=is-type.d.ts.map
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
export declare const MIME_TYPE: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=mime-type.d.ts.map
|
|
2
|
+
aac: string;
|
|
3
|
+
abw: string;
|
|
4
|
+
arc: string;
|
|
5
|
+
avi: string;
|
|
6
|
+
azw: string;
|
|
7
|
+
bin: string;
|
|
8
|
+
bmp: string;
|
|
9
|
+
bz: string;
|
|
10
|
+
bz2: string;
|
|
11
|
+
csh: string;
|
|
12
|
+
css: string;
|
|
13
|
+
csv: string;
|
|
14
|
+
doc: string;
|
|
15
|
+
docx: string;
|
|
16
|
+
eot: string;
|
|
17
|
+
epub: string;
|
|
18
|
+
gif: string;
|
|
19
|
+
html: string;
|
|
20
|
+
ico: string;
|
|
21
|
+
ics: string;
|
|
22
|
+
jar: string;
|
|
23
|
+
jpg: string;
|
|
24
|
+
jpeg: string;
|
|
25
|
+
js: string;
|
|
26
|
+
json: string;
|
|
27
|
+
jsonld: string;
|
|
28
|
+
mid: string;
|
|
29
|
+
midi: string;
|
|
30
|
+
mjs: string;
|
|
31
|
+
mp3: string;
|
|
32
|
+
mpeg: string;
|
|
33
|
+
mpkg: string;
|
|
34
|
+
odp: string;
|
|
35
|
+
ods: string;
|
|
36
|
+
odt: string;
|
|
37
|
+
oga: string;
|
|
38
|
+
ogv: string;
|
|
39
|
+
ogx: string;
|
|
40
|
+
otf: string;
|
|
41
|
+
png: string;
|
|
42
|
+
pdf: string;
|
|
43
|
+
ppt: string;
|
|
44
|
+
pptx: string;
|
|
45
|
+
rar: string;
|
|
46
|
+
rtf: string;
|
|
47
|
+
sh: string;
|
|
48
|
+
svg: string;
|
|
49
|
+
swf: string;
|
|
50
|
+
tar: string;
|
|
51
|
+
tiff: string;
|
|
52
|
+
ttf: string;
|
|
53
|
+
txt: string;
|
|
54
|
+
vsd: string;
|
|
55
|
+
wav: string;
|
|
56
|
+
weba: string;
|
|
57
|
+
webm: string;
|
|
58
|
+
webp: string;
|
|
59
|
+
woff: string;
|
|
60
|
+
woff2: string;
|
|
61
|
+
xhtml: string;
|
|
62
|
+
xls: string;
|
|
63
|
+
xlsx: string;
|
|
64
|
+
xul: string;
|
|
65
|
+
zip: string;
|
|
66
|
+
'7z': string;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=mime-type.d.ts.map
|
package/types/utils/number.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare function toThousands(numStr: string): string
|
|
1
|
+
export declare function toThousands(numStr: string): string;
|
|
2
2
|
/**
|
|
3
3
|
* 数字金额转为汉字
|
|
4
4
|
*/
|
|
5
|
-
export declare function toChies(numStr: string): string
|
|
6
|
-
export declare function numToDX(numStr: string): string
|
|
7
|
-
export declare function formatDecimal(num: number | string, decimal?: number): string
|
|
5
|
+
export declare function toChies(numStr: string): string;
|
|
6
|
+
export declare function numToDX(numStr: string): string;
|
|
7
|
+
export declare function formatDecimal(num: number | string, decimal?: number): string;
|
|
8
8
|
/**
|
|
9
9
|
* 保留指定位数的小数,对最后一位进行四舍五入
|
|
10
10
|
*/
|
|
11
|
-
export declare function round(number: number, precision?: number): number
|
|
11
|
+
export declare function round(number: number, precision?: number): number;
|
|
12
12
|
/**
|
|
13
13
|
* 保留指定位数的小数,对最后一位进行四舍五入,并返回字符串
|
|
14
14
|
*/
|
|
15
|
-
export declare function toFixed(num: number | string, precision?: number): string
|
|
15
|
+
export declare function toFixed(num: number | string, precision?: number): string;
|
|
16
16
|
/**
|
|
17
17
|
* 数字转中文
|
|
18
18
|
*/
|
|
19
|
-
export declare const numToChineseNumerals: (num: any) => any
|
|
20
|
-
//# sourceMappingURL=number.d.ts.map
|
|
19
|
+
export declare const numToChineseNumerals: (num: any) => any;
|
|
20
|
+
//# sourceMappingURL=number.d.ts.map
|
package/types/utils/quarter.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function quarter2Chinese(quarterNum: number): string
|
|
2
|
-
export declare function getQuarter(date: string): string
|
|
3
|
-
export declare function getQuarterNum(month: number | string): number
|
|
4
|
-
export declare function formatQuarter(quarter: string): string
|
|
5
|
-
export declare function getQuarterBeginMonth(quarter: string): string
|
|
6
|
-
export declare function getQuarterEndMonth(quarter: string): string
|
|
7
|
-
//# sourceMappingURL=quarter.d.ts.map
|
|
1
|
+
export declare function quarter2Chinese(quarterNum: number): string;
|
|
2
|
+
export declare function getQuarter(date: string): string;
|
|
3
|
+
export declare function getQuarterNum(month: number | string): number;
|
|
4
|
+
export declare function formatQuarter(quarter: string): string;
|
|
5
|
+
export declare function getQuarterBeginMonth(quarter: string): string;
|
|
6
|
+
export declare function getQuarterEndMonth(quarter: string): string;
|
|
7
|
+
//# sourceMappingURL=quarter.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
|
|
1
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
export interface AxiosExtendsInstance extends AxiosInstance {
|
|
3
|
-
|
|
4
|
-
url: string,
|
|
5
|
-
data: any,
|
|
6
|
-
config?: AxiosRequestConfig
|
|
7
|
-
): Promise<R>
|
|
3
|
+
formPost?<T = any, R = AxiosResponse<T>>(url: string, data: any, config?: AxiosRequestConfig): Promise<R>;
|
|
4
|
+
getSingleton?<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
|
|
5
|
+
postSingleton?<T = any, R = AxiosResponse<T>>(url: string, data: any, config?: AxiosRequestConfig): Promise<R>;
|
|
6
|
+
formPostSingleton?<T = any, R = AxiosResponse<T>>(url: string, data: any, config?: AxiosRequestConfig): Promise<R>;
|
|
8
7
|
}
|
|
9
|
-
//# sourceMappingURL=axios.extends.d.ts.map
|
|
8
|
+
//# sourceMappingURL=axios.extends.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios.extends.d.ts","sourceRoot":"","sources":["../../../src/utils/request/axios.extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE7E,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACrC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,GAAG,EACT,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAA;CACd"}
|
|
1
|
+
{"version":3,"file":"axios.extends.d.ts","sourceRoot":"","sources":["../../../src/utils/request/axios.extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE7E,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EACrC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,GAAG,EACT,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAA;IAEb,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAElG,aAAa,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,GAAG,EACT,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAA;IAEb,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAC9C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,GAAG,EACT,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,CAAC,CAAC,CAAA;CACd"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* 配置在该文件下的正则匹配都会被缓存
|
|
3
3
|
* @type {RegExp[]}
|
|
4
4
|
*/
|
|
5
|
-
declare const cacheRules: RegExp[]
|
|
6
|
-
export default cacheRules
|
|
7
|
-
//# sourceMappingURL=cache-rules.d.ts.map
|
|
5
|
+
declare const cacheRules: RegExp[];
|
|
6
|
+
export default cacheRules;
|
|
7
|
+
//# sourceMappingURL=cache-rules.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare function getContentType(config: any): any
|
|
2
|
-
export declare function setContentType(headers: any, type: string): void
|
|
1
|
+
export declare function getContentType(config: any): any;
|
|
2
|
+
export declare function setContentType(headers: any, type: string): void;
|
|
3
3
|
export declare const CONTENT_TYPE: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=content-type.d.ts.map
|
|
4
|
+
form: string;
|
|
5
|
+
multiForm: string;
|
|
6
|
+
body: string;
|
|
7
|
+
os: string;
|
|
8
|
+
json: string;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=content-type.d.ts.map
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type { AxiosExtendsInstance } from './axios.extends'
|
|
2
|
-
import { responseInterceptors } from './interceptors'
|
|
3
|
-
export * from './url-params'
|
|
4
|
-
export * from './content-type'
|
|
5
|
-
export { responseInterceptors }
|
|
6
|
-
declare const instance: AxiosExtendsInstance
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { AxiosExtendsInstance } from './axios.extends';
|
|
2
|
+
import { responseInterceptors } from './interceptors';
|
|
3
|
+
export * from './url-params';
|
|
4
|
+
export * from './content-type';
|
|
5
|
+
export { responseInterceptors };
|
|
6
|
+
declare const instance: AxiosExtendsInstance;
|
|
7
|
+
/**
|
|
8
|
+
* 对业务封装的axios service Api进行封装,封装以后的Api同一时间只有一个网络请求
|
|
9
|
+
* 即上一次发起的网络请求将调用浏览器取消网络请求
|
|
10
|
+
* 注意:如果serviceApi是多个组件共同使用时,需要慎重使用本方法,避免导致由于请求被取消导致的功能异常
|
|
11
|
+
* @param {Function} api - 需要封装的API函数
|
|
12
|
+
* @returns {Function} 封装后可取消的api
|
|
13
|
+
*/
|
|
14
|
+
export declare const wrapApi: (api: any) => {
|
|
15
|
+
(...args: any[]): Promise<any>;
|
|
16
|
+
cancel(reason: any): void;
|
|
17
|
+
isPending(): boolean;
|
|
18
|
+
};
|
|
19
|
+
export { instance as axios };
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/request/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAuB,oBAAoB,EAAkB,MAAM,gBAAgB,CAAA;AAG1F,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAE/B,QAAA,MAAM,QAAQ,EAAE,oBAA+D,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/request/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAuB,oBAAoB,EAAkB,MAAM,gBAAgB,CAAA;AAG1F,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAE/B,QAAA,MAAM,QAAQ,EAAE,oBAA+D,CAAA;AAS/E;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;CAuGnB,CAAA;AAOD,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function requestInterceptors(config: any): any
|
|
2
|
-
export declare function responseInterceptors(response: any): any
|
|
3
|
-
export declare function inspectorError(error: any): Promise<never
|
|
4
|
-
//# sourceMappingURL=interceptors.d.ts.map
|
|
1
|
+
export declare function requestInterceptors(config: any): any;
|
|
2
|
+
export declare function responseInterceptors(response: any): any;
|
|
3
|
+
export declare function inspectorError(error: any): Promise<never>;
|
|
4
|
+
//# sourceMappingURL=interceptors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../../src/utils/request/interceptors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../../src/utils/request/interceptors.ts"],"names":[],"mappings":"AAwBA,wBAAgB,mBAAmB,CAAC,MAAM,KAAA,OAwCzC;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,KAAA,OAkC5C;AAED,wBAAgB,cAAc,CAAC,KAAK,KAAA,kBAQnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
interface UrlParams {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
sso_token?: string;
|
|
3
|
+
sso_id?: string;
|
|
4
|
+
[propName: string]: any;
|
|
5
5
|
}
|
|
6
|
-
export declare function getUrlParams(): UrlParams
|
|
7
|
-
export {}
|
|
8
|
-
//# sourceMappingURL=url-params.d.ts.map
|
|
6
|
+
export declare function getUrlParams(): UrlParams;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=url-params.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import sm3 from './sm3'
|
|
1
|
+
import sm3 from './sm3';
|
|
2
2
|
export declare const cryptor: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
3
|
+
encrypt: typeof sm3;
|
|
4
|
+
encryptForLogin(s: any, method: any, add: any): string;
|
|
5
|
+
genSalt(s: any): string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/types/utils/sm3/sm3.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare function sm3(str: any): string
|
|
2
|
-
export default sm3
|
|
3
|
-
//# sourceMappingURL=sm3.d.ts.map
|
|
1
|
+
declare function sm3(str: any): string;
|
|
2
|
+
export default sm3;
|
|
3
|
+
//# sourceMappingURL=sm3.d.ts.map
|