@indfnd/utils 0.1.26 → 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.
Files changed (48) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/ind-utils.es.js +226 -75
  3. package/dist/ind-utils.umd.cjs +19 -19
  4. package/package.json +2 -2
  5. package/src/utils/request/axios.extends.ts +14 -0
  6. package/src/utils/request/index.ts +116 -0
  7. package/src/utils/request/interceptors.ts +2 -1
  8. package/types/api/index.d.ts +6 -6
  9. package/types/api/platform/base64.d.ts +5 -5
  10. package/types/api/platform/index.d.ts +5 -5
  11. package/types/config/base.config.d.ts +33 -33
  12. package/types/config/dev.config.d.ts +3 -3
  13. package/types/config/index.d.ts +6 -6
  14. package/types/config/prod.config.d.ts +3 -3
  15. package/types/index.d.ts +4 -4
  16. package/types/utils/base64.d.ts +22 -22
  17. package/types/utils/blob.d.ts +3 -3
  18. package/types/utils/cache/dict-cache.d.ts +3 -3
  19. package/types/utils/cache/index-desc.d.ts +4 -4
  20. package/types/utils/cache/index.d.ts +4 -4
  21. package/types/utils/cache/permission-cache.d.ts +4 -4
  22. package/types/utils/cache/user-cache.d.ts +4 -4
  23. package/types/utils/date.d.ts +4 -4
  24. package/types/utils/enum.d.ts +39 -43
  25. package/types/utils/event.d.ts +5 -13
  26. package/types/utils/excel.d.ts +4 -4
  27. package/types/utils/half-year.d.ts +6 -6
  28. package/types/utils/index.d.ts +20 -20
  29. package/types/utils/is-type.d.ts +33 -33
  30. package/types/utils/mime-type.d.ts +67 -67
  31. package/types/utils/number.d.ts +8 -8
  32. package/types/utils/quarter.d.ts +7 -7
  33. package/types/utils/request/axios.extends.d.ts +6 -7
  34. package/types/utils/request/axios.extends.d.ts.map +1 -1
  35. package/types/utils/request/cache-rules.d.ts +3 -3
  36. package/types/utils/request/content-type.d.ts +9 -9
  37. package/types/utils/request/index.d.ts +20 -8
  38. package/types/utils/request/index.d.ts.map +1 -1
  39. package/types/utils/request/interceptors.d.ts +4 -4
  40. package/types/utils/request/interceptors.d.ts.map +1 -1
  41. package/types/utils/request/url-params.d.ts +6 -6
  42. package/types/utils/sm3/index.d.ts +6 -6
  43. package/types/utils/sm3/sm3.d.ts +3 -3
  44. package/types/utils/storage.d.ts +8 -8
  45. package/types/utils/table.d.ts +31 -40
  46. package/types/utils/token.d.ts +3 -3
  47. package/types/utils/uuid.d.ts +4 -4
  48. package/types/utils/validate.d.ts +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indfnd/utils",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "author": "huxuetong",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  "re-publish": "yarn publish --access public"
35
35
  },
36
36
  "dependencies": {
37
- "axios": "^0.21.4",
37
+ "axios": "^0.24.0",
38
38
  "dayjs": "^1.11.9",
39
39
  "lodash": "^4.17.21",
40
40
  "md5": "^2.3.0",
@@ -6,4 +6,18 @@ export interface AxiosExtendsInstance extends AxiosInstance {
6
6
  data: any,
7
7
  config?: AxiosRequestConfig,
8
8
  ): Promise<R>
9
+
10
+ getSingleton?<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>
11
+
12
+ postSingleton?<T = any, R = AxiosResponse<T>>(
13
+ url: string,
14
+ data: any,
15
+ config?: AxiosRequestConfig,
16
+ ): Promise<R>
17
+
18
+ formPostSingleton?<T = any, R = AxiosResponse<T>>(
19
+ url: string,
20
+ data: any,
21
+ config?: AxiosRequestConfig,
22
+ ): Promise<R>
9
23
  }
@@ -16,5 +16,121 @@ instance.formPost = function (url, data, config) {
16
16
  setContentType(headers, CONTENT_TYPE.form)
17
17
  return instance.post(url, data, { ...config, headers })
18
18
  }
19
+ /**
20
+ * 对业务封装的axios service Api进行封装,封装以后的Api同一时间只有一个网络请求
21
+ * 即上一次发起的网络请求将调用浏览器取消网络请求
22
+ * 注意:如果serviceApi是多个组件共同使用时,需要慎重使用本方法,避免导致由于请求被取消导致的功能异常
23
+ * @param {Function} api - 需要封装的API函数
24
+ * @returns {Function} 封装后可取消的api
25
+ */
26
+ export const wrapApi = (api) => {
27
+ // 每个函数都有自己的 controller,避免互相干扰
28
+ let currentController = null
29
+
30
+ const wrappedFunction = async function (...args) {
31
+ // 取消之前的请求
32
+ if (currentController) {
33
+ console.log('currentController.abort trigger, now cancel before request')
34
+ currentController.abort()
35
+ currentController = null
36
+ }
37
+
38
+ // 创建新的 AbortController
39
+ const controller = new AbortController()
40
+ currentController = controller
41
+
42
+ // 准备参数
43
+ const newArgs = [...args]
44
+ const lastIndex = newArgs.length - 1
45
+
46
+ try {
47
+ // 处理配置参数
48
+ if (
49
+ newArgs.length > 0 &&
50
+ typeof newArgs[lastIndex] === 'object' &&
51
+ !Array.isArray(newArgs[lastIndex])
52
+ ) {
53
+ // 最后一个参数是配置对象
54
+ const config = newArgs[lastIndex]
55
+
56
+ // 如果有原生的 signal,需要合并处理
57
+ if (config.signal) {
58
+ // 创建一个新的 AbortController 来合并多个 signal
59
+ const combinedController = new AbortController()
60
+ const originalSignal = config.signal
61
+
62
+ // 监听原始 signal 的取消
63
+ originalSignal.addEventListener('abort', () => {
64
+ combinedController.abort(originalSignal.reason)
65
+ })
66
+
67
+ // 监听当前 controller 的取消
68
+ controller.signal.addEventListener('abort', () => {
69
+ combinedController.abort(controller.signal.reason)
70
+ })
71
+
72
+ // 使用合并后的 signal
73
+ newArgs[lastIndex] = {
74
+ ...config,
75
+ signal: combinedController.signal,
76
+ }
77
+ } else {
78
+ // 直接使用新的 signal
79
+ newArgs[lastIndex] = {
80
+ ...config,
81
+ signal: controller.signal,
82
+ }
83
+ }
84
+ } else {
85
+ // 没有配置对象,添加一个
86
+ newArgs.push({ signal: controller.signal })
87
+ }
88
+
89
+ // 执行请求
90
+ const result = await api(...newArgs)
91
+
92
+ // 请求成功后清理 controller
93
+ currentController = null
94
+ return result
95
+ } catch (error) {
96
+ // 如果是取消错误,重新抛出
97
+ if (error.name === 'AbortError' || axios.isCancel(error)) {
98
+ throw Object.assign(new Error('Request cancelled'), {
99
+ name: 'AbortError',
100
+ cancelled: true,
101
+ originalError: error,
102
+ })
103
+ }
104
+
105
+ // 其他错误正常抛出
106
+ throw error
107
+ } finally {
108
+ // 如果当前 controller 仍然是这个请求的,清理它
109
+ if (currentController === controller) {
110
+ currentController = null
111
+ }
112
+ }
113
+ }
114
+
115
+ // 添加取消方法,允许外部取消
116
+ wrappedFunction.cancel = (reason) => {
117
+ if (currentController) {
118
+ currentController.abort(reason)
119
+ currentController = null
120
+ }
121
+ }
122
+
123
+ // 添加检查是否正在请求的方法
124
+ wrappedFunction.isPending = () => {
125
+ return currentController !== null
126
+ }
127
+
128
+ return wrappedFunction
129
+ }
130
+
131
+ // 对axios进行封装,返回单例模式的Api
132
+ instance.getSingleton = wrapApi(instance.get)
133
+ instance.postSingleton = wrapApi(instance.post)
134
+ instance.formPostSingleton = wrapApi(instance.formPost)
19
135
 
20
136
  export { instance as axios }
@@ -9,6 +9,7 @@ const SUCCESS_CODE = 1
9
9
  const NO_SESSION_CODE = 10106
10
10
 
11
11
  let timer: any = null
12
+
12
13
  function _debounce(callback: Function) {
13
14
  if (timer) {
14
15
  clearTimeout(timer)
@@ -103,7 +104,7 @@ export function inspectorError(error) {
103
104
  if (error?.code === 'ECONNABORTED') {
104
105
  // 超时
105
106
  window.apiErrorHandler && window.apiErrorHandler('请求超时,请稍后再试')
106
- } else if (error?.response?.status !== 200) {
107
+ } else if (error?.response?.status !== 200 && error?.message !== 'canceled') {
107
108
  window.apiErrorHandler && window.apiErrorHandler('请求出错了')
108
109
  }
109
110
  return Promise.reject(error)
@@ -1,6 +1,6 @@
1
- export * from './platform'
2
- export * from './com'
3
- export * from './index-desc'
4
- export * from './item'
5
- export * from './user'
6
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './platform';
2
+ export * from './com';
3
+ export * from './index-desc';
4
+ export * from './item';
5
+ export * from './user';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
1
  export namespace Base64 {
2
- let Base64Chars: string
3
- function encode(s: any): any
4
- function ucs2_utf8(s: any): any[]
5
- function utf8_ucs2(s: any): string
2
+ let Base64Chars: string;
3
+ function encode(s: any): any;
4
+ function ucs2_utf8(s: any): any[];
5
+ function utf8_ucs2(s: any): string;
6
6
  }
7
- //# sourceMappingURL=base64.d.ts.map
7
+ //# sourceMappingURL=base64.d.ts.map
@@ -1,5 +1,5 @@
1
- export * from './dict'
2
- export * from './menu'
3
- export * from './oss'
4
- export * from './user'
5
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './dict';
2
+ export * from './menu';
3
+ export * from './oss';
4
+ export * from './user';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -1,34 +1,34 @@
1
1
  declare const _default: {
2
- title: string
3
- icomId: string
4
- showMenus: boolean
5
- routerBase: string
6
- loginRouteName: string
7
- rootRouteName: string
8
- homeRouteName: string
9
- authServerContext: string
10
- ossServerContext: string
11
- ismAmServerContext: string
12
- ismAcServerContext: string
13
- ismSqServerContext: string
14
- ilmServerContext: string
15
- imgServerContext: string
16
- imaServerContext: string
17
- ucExtServerContext: string
18
- dataManageServerContext: string
19
- kkfilepreviewContext: string
20
- errorMessage: string
21
- leftLockDays: number
22
- labelStyle: {
23
- labelWidthButton: number
24
- labelWidthSmall: number
25
- labelWidthMiddle: number
26
- labelWidthMiddleLarge: number
27
- labelWidthLarge: number
28
- labelWidthSuperLarge: number
29
- }
30
- /** 点击跳转的文字颜色 */
31
- linkColor: string
32
- }
33
- export default _default
34
- //# sourceMappingURL=base.config.d.ts.map
2
+ title: string;
3
+ icomId: string;
4
+ showMenus: boolean;
5
+ routerBase: string;
6
+ loginRouteName: string;
7
+ rootRouteName: string;
8
+ homeRouteName: string;
9
+ authServerContext: string;
10
+ ossServerContext: string;
11
+ ismAmServerContext: string;
12
+ ismAcServerContext: string;
13
+ ismSqServerContext: string;
14
+ ilmServerContext: string;
15
+ imgServerContext: string;
16
+ imaServerContext: string;
17
+ ucExtServerContext: string;
18
+ dataManageServerContext: string;
19
+ kkfilepreviewContext: string;
20
+ errorMessage: string;
21
+ leftLockDays: number;
22
+ labelStyle: {
23
+ labelWidthButton: number;
24
+ labelWidthSmall: number;
25
+ labelWidthMiddle: number;
26
+ labelWidthMiddleLarge: number;
27
+ labelWidthLarge: number;
28
+ labelWidthSuperLarge: number;
29
+ };
30
+ /** 点击跳转的文字颜色 */
31
+ linkColor: string;
32
+ };
33
+ export default _default;
34
+ //# sourceMappingURL=base.config.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export declare function getDevConfig(): {
2
- showMenus: boolean
3
- }
4
- //# sourceMappingURL=dev.config.d.ts.map
2
+ showMenus: boolean;
3
+ };
4
+ //# sourceMappingURL=dev.config.d.ts.map
@@ -1,6 +1,6 @@
1
- declare let config: any
2
- declare function useConfig(isDev?: boolean): any
3
- declare function setConfig(key: any, value: any): void
4
- export default config
5
- export { config, useConfig, setConfig }
6
- //# sourceMappingURL=index.d.ts.map
1
+ declare let config: any;
2
+ declare function useConfig(isDev?: boolean): any;
3
+ declare function setConfig(key: any, value: any): void;
4
+ export default config;
5
+ export { config, useConfig, setConfig };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export declare function getProdConfig(): {
2
- showMenus: boolean
3
- }
4
- //# sourceMappingURL=prod.config.d.ts.map
2
+ showMenus: boolean;
3
+ };
4
+ //# sourceMappingURL=prod.config.d.ts.map
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './api'
2
- export * from './config'
3
- export * from './utils'
4
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './api';
2
+ export * from './config';
3
+ export * from './utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,23 +1,23 @@
1
1
  declare let Base64ForLogin: {
2
- Base64Chars: string
3
- /**
4
- * Encode a string to a Base64 string follow Bse64 regular.
5
- * @param s, a normal string
6
- * @return a Base64 string
7
- */
8
- encode: (s: any) => any
9
- /**
10
- * Encodes a ucs2 string to a utf8 integer array.
11
- * @param s, a string
12
- * @return an integer array
13
- */
14
- ucs2_utf8: (s: any) => any[]
15
- /**
16
- * Encodes a utf8 integer array to a ucs2 string.
17
- * @param s, an integer array
18
- * @return a string
19
- */
20
- utf8_ucs2: (s: any) => string
21
- }
22
- export { Base64ForLogin }
23
- //# sourceMappingURL=base64.d.ts.map
2
+ Base64Chars: string;
3
+ /**
4
+ * Encode a string to a Base64 string follow Bse64 regular.
5
+ * @param s, a normal string
6
+ * @return a Base64 string
7
+ */
8
+ encode: (s: any) => any;
9
+ /**
10
+ * Encodes a ucs2 string to a utf8 integer array.
11
+ * @param s, a string
12
+ * @return an integer array
13
+ */
14
+ ucs2_utf8: (s: any) => any[];
15
+ /**
16
+ * Encodes a utf8 integer array to a ucs2 string.
17
+ * @param s, an integer array
18
+ * @return a string
19
+ */
20
+ utf8_ucs2: (s: any) => string;
21
+ };
22
+ export { Base64ForLogin };
23
+ //# sourceMappingURL=base64.d.ts.map
@@ -5,6 +5,6 @@
5
5
  * @param contentType 数据的MIME Type,如 png 为 image/png
6
6
  * @returns Blob数据
7
7
  */
8
- export declare function base64ToBlob(base64Data: string, contentType: string): Blob
9
- export declare function blobToBase64(blob: Blob, hasPrefix?: boolean): Promise<unknown>
10
- //# sourceMappingURL=blob.d.ts.map
8
+ export declare function base64ToBlob(base64Data: string, contentType: string): Blob;
9
+ export declare function blobToBase64(blob: Blob, hasPrefix?: boolean): Promise<unknown>;
10
+ //# sourceMappingURL=blob.d.ts.map
@@ -1,3 +1,3 @@
1
- export declare function getDictCache(dictId: string): any
2
- export declare function setDictCache(dictId: string, data: any): void
3
- //# sourceMappingURL=dict-cache.d.ts.map
1
+ export declare function getDictCache(dictId: string): any;
2
+ export declare function setDictCache(dictId: string, data: any): void;
3
+ //# sourceMappingURL=dict-cache.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare function getIndexDescCache(): any
2
- export declare function setIndexDescCache(data: any): void
3
- export declare function clearIndexDescCache(): void
4
- //# sourceMappingURL=index-desc.d.ts.map
1
+ export declare function getIndexDescCache(): any;
2
+ export declare function setIndexDescCache(data: any): void;
3
+ export declare function clearIndexDescCache(): void;
4
+ //# sourceMappingURL=index-desc.d.ts.map
@@ -1,4 +1,4 @@
1
- export * from './index-desc'
2
- export * from './permission-cache'
3
- export * from './user-cache'
4
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './index-desc';
2
+ export * from './permission-cache';
3
+ export * from './user-cache';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare function getPermissionCache(): any
2
- export declare function setPermissionCache(data: any): void
3
- export declare function clearPermissionCache(): void
4
- //# sourceMappingURL=permission-cache.d.ts.map
1
+ export declare function getPermissionCache(): any;
2
+ export declare function setPermissionCache(data: any): void;
3
+ export declare function clearPermissionCache(): void;
4
+ //# sourceMappingURL=permission-cache.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare function getUserInfoCache(): any
2
- export declare function setUserInfoCache(data: any): void
3
- export declare function clearUserInfoCache(): void
4
- //# sourceMappingURL=user-cache.d.ts.map
1
+ export declare function getUserInfoCache(): any;
2
+ export declare function setUserInfoCache(data: any): void;
3
+ export declare function clearUserInfoCache(): void;
4
+ //# sourceMappingURL=user-cache.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare function str2Date(value: string): Date
2
- export declare function formatDate(value: string): string
3
- export declare function formatDateChinese(value: string): string
4
- //# sourceMappingURL=date.d.ts.map
1
+ export declare function str2Date(value: string): Date;
2
+ export declare function formatDate(value: string): string;
3
+ export declare function formatDateChinese(value: string): string;
4
+ //# sourceMappingURL=date.d.ts.map
@@ -1,40 +1,40 @@
1
1
  /** 是否枚举的key */
2
- export declare const IS_OR_NOT_ENUM_KEY = 'IS_ENUM'
2
+ export declare const IS_OR_NOT_ENUM_KEY = "IS_ENUM";
3
3
  /** 是否枚举的map形式 */
4
4
  export declare const IS_OR_NOT_ENUM: {
5
- '1': string
6
- '0': string
7
- }
5
+ '1': string;
6
+ '0': string;
7
+ };
8
8
  /** 是否枚举的list形式 */
9
9
  export declare const IS_OR_NOT_ENUM_LIST: {
10
- K: string
11
- V: string
12
- }[]
10
+ K: string;
11
+ V: string;
12
+ }[];
13
13
  export declare const UC_ENUM: {
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
- }
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
- list?: any[],
52
- kProp?: string,
53
- vProp?: string,
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
@@ -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
- element: any,
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
@@ -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