halo-fe 1.0.21 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +4165 -3630
- package/dist/style.css +1 -1
- package/esm/coms/Code.vue.d.ts +41 -0
- package/esm/coms/Col.vue.d.ts +11 -0
- package/esm/coms/Compare.vue.d.ts +40 -0
- package/esm/coms/Container.vue.d.ts +23 -0
- package/esm/coms/RichText.vue.d.ts +24 -0
- package/esm/coms/Row.vue.d.ts +21 -0
- package/esm/coms/index.d.ts +1 -1
- package/esm/coms/progresses/SocketProgress.vue.d.ts +10 -1
- package/esm/coms/types/CodeEmit.d.ts +23 -0
- package/esm/coms/types/CodeProps.d.ts +18 -0
- package/esm/coms/types/RichTextOptions.d.ts +14 -0
- package/esm/coms/types/RichTextProps.d.ts +12 -0
- package/esm/coms/types/RowProps.d.ts +14 -0
- package/esm/drivers/@types/IOpen.d.ts +1 -1
- package/esm/drivers/IDriver.d.ts +10 -0
- package/esm/drivers/cdns/Cdn.d.ts +1 -1
- package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
- package/esm/drivers/cdns/implements/BootCdn.d.ts +12 -0
- package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +15 -0
- package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +21 -0
- package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +12 -0
- package/esm/drivers/encoders/EncoderFactory.d.ts +1 -1
- package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
- package/esm/drivers/factories/DriverFactory.d.ts +64 -0
- package/esm/drivers/factories/Factory.d.ts +18 -0
- package/esm/drivers/factories/IFactory.d.ts +18 -0
- package/esm/drivers/factories/index.d.ts +42 -0
- package/esm/drivers/features/FeatureFactory.d.ts +1 -1
- package/esm/drivers/hashers/HasherFactory.d.ts +4 -1
- package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
- package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
- package/esm/drivers/helpers/@types/JsonConfig.d.ts +10 -0
- package/esm/drivers/helpers/@types/TreeNodeProp.d.ts +9 -0
- package/esm/drivers/helpers/@types/index.d.ts +3 -0
- package/esm/drivers/helpers/Helper.d.ts +8 -0
- package/esm/drivers/helpers/HelperFactory.d.ts +32 -0
- package/esm/drivers/helpers/IHelper.d.ts +4 -0
- package/esm/drivers/helpers/implements/ArrayHelper.d.ts +124 -0
- package/esm/drivers/helpers/implements/BrowserHelper.d.ts +12 -0
- package/esm/drivers/helpers/implements/ComponentHelper.d.ts +20 -0
- package/esm/drivers/helpers/implements/DictionaryHelper.d.ts +40 -0
- package/esm/drivers/helpers/implements/DomHelper.d.ts +118 -0
- package/esm/drivers/helpers/implements/EventHelper.d.ts +32 -0
- package/esm/drivers/helpers/implements/FileHelper.d.ts +24 -0
- package/esm/drivers/helpers/implements/HtmlHelper.d.ts +16 -0
- package/esm/drivers/helpers/implements/ImageHelper.d.ts +12 -0
- package/esm/drivers/helpers/implements/JsonHelper.d.ts +49 -0
- package/esm/drivers/helpers/implements/MathHelper.d.ts +52 -0
- package/esm/drivers/helpers/implements/MicroHelper.d.ts +12 -0
- package/esm/drivers/helpers/implements/MountHelper.d.ts +16 -0
- package/esm/drivers/helpers/implements/ObjectHelper.d.ts +44 -0
- package/esm/drivers/helpers/implements/ScrollHelper.d.ts +16 -0
- package/esm/drivers/helpers/implements/SignHelper.d.ts +16 -0
- package/esm/drivers/helpers/implements/StringHelper.d.ts +104 -0
- package/esm/drivers/helpers/implements/TaskHelper.d.ts +28 -0
- package/esm/drivers/helpers/implements/TimeHelper.d.ts +68 -0
- package/esm/drivers/helpers/implements/TreeHelper.d.ts +56 -0
- package/esm/drivers/helpers/implements/TypeHelper.d.ts +28 -0
- package/esm/drivers/helpers/implements/UrlHelper.d.ts +90 -0
- package/esm/drivers/helpers/index.d.ts +24 -0
- package/esm/drivers/https/HttpFactory.d.ts +1 -1
- package/esm/drivers/https/implements/HaloHttp.d.ts +1 -4
- package/esm/drivers/https/implements/MkHttp.d.ts +1 -1
- package/esm/drivers/i18ns/I18n.d.ts +9 -5
- package/esm/drivers/i18ns/II18n.d.ts +6 -2
- package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +1 -1
- package/esm/drivers/index.d.ts +1 -0
- package/esm/drivers/providers/ProviderFactory.d.ts +1 -1
- package/esm/drivers/providers/implements/StorageHelper.d.ts +34 -0
- package/esm/drivers/signers/SignerFactory.d.ts +1 -1
- package/esm/drivers/signers/implements/DefaultSigner.d.ts +1 -1
- package/esm/drivers/ssos/SsoFactory.d.ts +1 -1
- package/esm/factorying/Factories.d.ts +11 -7
- package/esm/factorying/Factory.d.ts +10 -5
- package/esm/factorying/Helpers.d.ts +29 -0
- package/esm/factorying/IFactory.d.ts +13 -5
- package/esm/factorying/index.d.ts +3 -1
- package/esm/helpers/MathHelper.d.ts +0 -4
- package/esm/helpers/ScriptHelper.d.ts +19 -0
- package/esm/helpers/StringHelper.d.ts +26 -18
- package/esm/helpers/array-helper.d.ts +97 -0
- package/esm/helpers/component-helper.d.ts +18 -0
- package/esm/helpers/cookie-helper.d.ts +6 -0
- package/esm/helpers/dictionary-helper.d.ts +18 -0
- package/esm/helpers/dom-helper.d.ts +86 -0
- package/esm/helpers/event-helper.d.ts +30 -0
- package/esm/helpers/file-helper.d.ts +22 -0
- package/esm/helpers/html-helper.d.ts +10 -0
- package/esm/helpers/i18n-helper.d.ts +14 -0
- package/esm/helpers/image-helper.d.ts +10 -0
- package/esm/helpers/json-helper.d.ts +39 -0
- package/esm/helpers/math-helper.d.ts +46 -0
- package/esm/helpers/micro-helper.d.ts +10 -0
- package/esm/helpers/mount-helper.d.ts +14 -0
- package/esm/helpers/object-helper.d.ts +38 -0
- package/esm/helpers/script-helper.d.ts +31 -0
- package/esm/helpers/scroll-helper.d.ts +14 -0
- package/esm/helpers/sign-helper.d.ts +14 -0
- package/esm/helpers/storage-helper.d.ts +34 -0
- package/esm/helpers/string-helper.d.ts +94 -0
- package/esm/helpers/task-helper.d.ts +26 -0
- package/esm/helpers/time-helper.d.ts +66 -0
- package/esm/helpers/tree-helper.d.ts +54 -0
- package/esm/helpers/type-helper.d.ts +26 -0
- package/esm/helpers/url-helper.d.ts +96 -0
- package/esm/main.d.ts +1 -2
- package/esm/plugins/HtmlTransform.d.ts +6 -0
- package/esm/plugins/types/IMessager.d.ts +34 -0
- package/esm/plugins/types/index.d.ts +7 -0
- package/esm/services/ConfigService.d.ts +66 -0
- package/esm/services/DriverService.d.ts +36 -0
- package/esm/services/EnvService.d.ts +14 -0
- package/esm/services/LogService.d.ts +19 -0
- package/esm/services/SettingService.d.ts +42 -0
- package/esm/services/SocketService.d.ts +23 -0
- package/esm/services/UserService.d.ts +47 -0
- package/esm/services/index.d.ts +15 -0
- package/esm/services/types/IMessage.d.ts +14 -0
- package/esm/services/types/IMessager.d.ts +34 -0
- package/esm/services/types/index.d.ts +2 -0
- package/esm/servs/ConfigServ.d.ts +66 -0
- package/esm/servs/DriverServ.d.ts +36 -0
- package/esm/servs/EnvServ.d.ts +14 -0
- package/esm/servs/IServ.d.ts +6 -0
- package/esm/servs/LogServ.d.ts +19 -0
- package/esm/servs/Serv.d.ts +4 -0
- package/esm/servs/ServFactory.d.ts +11 -0
- package/esm/servs/SettingServ.d.ts +42 -0
- package/esm/servs/SocketServ.d.ts +38 -0
- package/esm/servs/UserServ.d.ts +47 -0
- package/esm/servs/implement/ConfigServ.d.ts +66 -0
- package/esm/servs/implement/DriverServ.d.ts +36 -0
- package/esm/servs/implement/EnvServ.d.ts +14 -0
- package/esm/servs/implement/LogServ.d.ts +19 -0
- package/esm/servs/implement/SettingServ.d.ts +42 -0
- package/esm/servs/implement/SocketServ.d.ts +38 -0
- package/esm/servs/implement/UserServ.d.ts +47 -0
- package/esm/servs/index.d.ts +15 -0
- package/esm/stores/config.d.ts +63 -0
- package/esm/stores/driver.d.ts +37 -0
- package/esm/stores/env.d.ts +12 -0
- package/esm/stores/index.d.ts +8 -0
- package/esm/stores/log.d.ts +20 -0
- package/esm/stores/setting.d.ts +43 -0
- package/esm/stores/socket.d.ts +27 -0
- package/esm/stores/user.d.ts +40 -0
- package/esm/svcs/implement/ConfigSvc.d.ts +6 -2
- package/esm/svcs/implement/DriverSvc.d.ts +4 -0
- package/esm/svcs/implement/I18nSvc.d.ts +1 -1
- package/esm/svcs/implement/SettingSvc.d.ts +1 -1
- package/esm/svcs/implement/UserSvc.d.ts +8 -4
- package/esm/svcs/index.d.ts +26 -30
- package/esm/types/CreateOptions.d.ts +18 -0
- package/esm/utilities/RandomUtility.d.ts +40 -0
- package/esm/utilities/index.d.ts +2 -1
- package/package.json +1 -1
- package/esm/drivers/builders/types/ProviderTable.d.ts +0 -6
- package/esm/drivers/builders/types/index.d.ts +0 -2
- package/esm/svcs/@types/Dictionary.d.ts +0 -4
@@ -0,0 +1,104 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* 字符串帮助类
|
4
|
+
*/
|
5
|
+
declare class StringHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 生成唯一字符串
|
9
|
+
*/
|
10
|
+
getUniqueId: (length?: number) => string;
|
11
|
+
/**
|
12
|
+
* 填充字符串到指定长度,使用pad填充
|
13
|
+
*/
|
14
|
+
padLeft: (value: string, length: number, pad: string) => any;
|
15
|
+
/**
|
16
|
+
* 填充字符串到指定长度,使用pad填充
|
17
|
+
*/
|
18
|
+
padStart: (input: string, length: number, pad: string) => string;
|
19
|
+
/**
|
20
|
+
* 去掉头部字符串
|
21
|
+
*/
|
22
|
+
trimStart: (value: string, trim: string) => string;
|
23
|
+
/**
|
24
|
+
* 去掉尾部字符串
|
25
|
+
*/
|
26
|
+
trimEnd: (value: string, trim: string) => string;
|
27
|
+
/**
|
28
|
+
* 去掉头尾字符串
|
29
|
+
*/
|
30
|
+
trim: (value: string, start: string, end: string) => string;
|
31
|
+
/**
|
32
|
+
* 获取中划线命名法
|
33
|
+
*/
|
34
|
+
getDashName: (value: string) => string;
|
35
|
+
/**
|
36
|
+
* 判断字符串是否为空或空串
|
37
|
+
*/
|
38
|
+
isNullOrEmpty: (value: string) => boolean;
|
39
|
+
/**
|
40
|
+
* 判断字符串是否为空或空串
|
41
|
+
*/
|
42
|
+
isEmpty: (value: string) => value is "";
|
43
|
+
/**
|
44
|
+
* 判断是否符合密码要求
|
45
|
+
*/
|
46
|
+
isPassword: (value: string) => boolean;
|
47
|
+
/**
|
48
|
+
* 判断是否是数字类型,这样支持0
|
49
|
+
*/
|
50
|
+
isNumber: (value: any) => boolean;
|
51
|
+
/**
|
52
|
+
* 验证是否是邮箱格式
|
53
|
+
*/
|
54
|
+
isEmail: (email: string) => boolean;
|
55
|
+
/**
|
56
|
+
* 判断是否是json
|
57
|
+
*/
|
58
|
+
isJson: (value: string) => boolean;
|
59
|
+
/**
|
60
|
+
* 判断是否是isJsonp
|
61
|
+
*/
|
62
|
+
isJsonp: (value: string) => boolean;
|
63
|
+
/**
|
64
|
+
* 判断是否是html
|
65
|
+
*/
|
66
|
+
isHtml: (value: string) => boolean;
|
67
|
+
/**
|
68
|
+
* 是否以字符串开头
|
69
|
+
*/
|
70
|
+
startWith: (value: string, startWith: string) => boolean;
|
71
|
+
/**
|
72
|
+
* 忽略大小写包含判断,支持从数组中搜索关键词
|
73
|
+
*/
|
74
|
+
containsIgnoreCase: (keywords: string, value: string | string[]) => boolean;
|
75
|
+
/**
|
76
|
+
* 忽略大小写比较
|
77
|
+
*/
|
78
|
+
equalsIgnoreCase(value: any, valueCompare: string): boolean;
|
79
|
+
/**
|
80
|
+
* 获取内容类型
|
81
|
+
*/
|
82
|
+
getContentType: (value: string) => "html" | "json" | "text";
|
83
|
+
/**
|
84
|
+
* 获取数据值或者空
|
85
|
+
*/
|
86
|
+
getNumberOrNull: (value: any) => number;
|
87
|
+
/**
|
88
|
+
* 获取两个字符串之间的字符串
|
89
|
+
*/
|
90
|
+
getBetween: (value: string, start: string, end: string) => string;
|
91
|
+
/**
|
92
|
+
* 根据字符串或数组,自动返回数组
|
93
|
+
*/
|
94
|
+
getArray(name: string | string[]): string[];
|
95
|
+
/**
|
96
|
+
* 按占位符格式化成字符串
|
97
|
+
*/
|
98
|
+
format: (value: string, placeholder: any) => string;
|
99
|
+
/**
|
100
|
+
* 格式化成留指定位数的小数
|
101
|
+
*/
|
102
|
+
formatDigits: (value: string, digits: number) => string;
|
103
|
+
}
|
104
|
+
export default StringHelper;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* 任务执行帮助类
|
4
|
+
*/
|
5
|
+
declare class TaskHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 延时指定ms后执行指定任务
|
9
|
+
*/
|
10
|
+
delay: (fun: Function, ms: number) => number;
|
11
|
+
/**
|
12
|
+
* 在执行指定延时后,每隔指定ms执行指定任务
|
13
|
+
*/
|
14
|
+
execute: (fun: Function, ms: number, delay: number) => Promise<unknown>;
|
15
|
+
/**
|
16
|
+
* 清空定时器
|
17
|
+
*/
|
18
|
+
clearInterval: (id: number) => void;
|
19
|
+
/**
|
20
|
+
* 防抖(指定时间内只触发一次)
|
21
|
+
*/
|
22
|
+
debounce: (fun: Function, delay: number) => (e: any) => void;
|
23
|
+
/**
|
24
|
+
* 节流:https://segmentfault.com/a/1190000018428170
|
25
|
+
*/
|
26
|
+
throttle: (fun: Function, delay: number) => (e: any) => boolean;
|
27
|
+
}
|
28
|
+
export default TaskHelper;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* 时间帮助类
|
4
|
+
*/
|
5
|
+
declare class TimeHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 获取相对于1970年1月1日的时间戳(ms),不同时区结果相同
|
9
|
+
*/
|
10
|
+
getTimestamp: (value?: any) => number;
|
11
|
+
/**
|
12
|
+
* 根据字符串获取可对比的时间
|
13
|
+
*/
|
14
|
+
getTime: (value?: any) => Date;
|
15
|
+
/**
|
16
|
+
* 格式化时间
|
17
|
+
*/
|
18
|
+
format: (value: number, format: string) => string;
|
19
|
+
/**
|
20
|
+
* 获取当前日期时间的字符串
|
21
|
+
*/
|
22
|
+
getDateTimeString: () => string;
|
23
|
+
/**
|
24
|
+
* 获取当前时间的字符串
|
25
|
+
*/
|
26
|
+
getDateString: () => string;
|
27
|
+
/**
|
28
|
+
* 获取当前时间的字符串
|
29
|
+
*/
|
30
|
+
getTimeString: () => string;
|
31
|
+
/**
|
32
|
+
* 对时间值进行时间格式化
|
33
|
+
*/
|
34
|
+
formatSecondTime: (value: any) => string;
|
35
|
+
/**
|
36
|
+
* 对时间值进行时间格式化
|
37
|
+
*/
|
38
|
+
formatMillisecondTime: (value: string) => string;
|
39
|
+
/**
|
40
|
+
* 格式化成24小时时间格式
|
41
|
+
*/
|
42
|
+
formatTime: (value: any) => string;
|
43
|
+
/**
|
44
|
+
* 对时间值进行日期格式化
|
45
|
+
*/
|
46
|
+
formatDate: (value: any) => string;
|
47
|
+
/**
|
48
|
+
* 添加天数
|
49
|
+
*/
|
50
|
+
addDays: (value: any, days: number) => Date;
|
51
|
+
/**
|
52
|
+
* 添加月份
|
53
|
+
*/
|
54
|
+
addMonths: (value: any, months: number) => Date;
|
55
|
+
/**
|
56
|
+
* 添加小时
|
57
|
+
*/
|
58
|
+
addHours: (value: any, hours: number) => Date;
|
59
|
+
/**
|
60
|
+
* 判断指定时间是否是周末
|
61
|
+
*/
|
62
|
+
isWeekend: (value: any) => boolean;
|
63
|
+
/**
|
64
|
+
* 把中国时间,转换为当地时间
|
65
|
+
*/
|
66
|
+
localeTime: (time: any) => Date;
|
67
|
+
}
|
68
|
+
export default TimeHelper;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* 树帮助类
|
4
|
+
*/
|
5
|
+
declare class TreeHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 从树结构数据中,递归获取指定主键的对象
|
9
|
+
*/
|
10
|
+
getById: (id: any, idProp: string, tree: any[], childProp: string) => any;
|
11
|
+
/**
|
12
|
+
* 树节点
|
13
|
+
*/
|
14
|
+
getByIds: (ids: any[], idProp: string, tree: any[], childProp: string) => any[];
|
15
|
+
/**
|
16
|
+
* 找出指定层级集合中,指定对象的下一个对象
|
17
|
+
*/
|
18
|
+
getNextById: (id: any, idProp: string, tree: any[], childProp: string) => any;
|
19
|
+
/**
|
20
|
+
* 获取兄弟节点
|
21
|
+
*/
|
22
|
+
getSiblingsById: (id: any, idProp: string, tree: any[], childProp: string) => any;
|
23
|
+
/**
|
24
|
+
* 获取父节点
|
25
|
+
*/
|
26
|
+
getParentById: (id: any, idProp: string, tree: any[], childProp: string) => any;
|
27
|
+
/**
|
28
|
+
* 从树结构数据中,递归获取指定主键的父元素集合
|
29
|
+
*/
|
30
|
+
getParentsById: (id: any, idProp: string, tree: any[], childProp: string, hasSelf?: boolean) => any[];
|
31
|
+
/**
|
32
|
+
* 获取当前节点的所有孩子节点的集合
|
33
|
+
*/
|
34
|
+
getChildrenById: (id: any, idProp: string, tree: any[], childProp: string, hasSelf?: boolean) => any[];
|
35
|
+
/**
|
36
|
+
* 获取当前节点的所有孩子节点的集合
|
37
|
+
*/
|
38
|
+
getChildren: (element: any, childProp: string, hasSelf?: boolean) => any[];
|
39
|
+
/**
|
40
|
+
* 搜索指定文本的树结构
|
41
|
+
*/
|
42
|
+
searchTree: (keywords: string, tree: any[], childProp: string, searchProps: any) => any[];
|
43
|
+
/**
|
44
|
+
* 删除指定子元素
|
45
|
+
*/
|
46
|
+
removeById: (id: any, idProp: string, tree: any[], childProp: string) => void;
|
47
|
+
/**
|
48
|
+
* 获取树结构扁平化后的节点信息
|
49
|
+
*/
|
50
|
+
getFlat: (tree: any[], childProp: string) => any[];
|
51
|
+
/**
|
52
|
+
* 对树结点的数据进行重新映射,映射得到新的Tree数组
|
53
|
+
*/
|
54
|
+
map: (tree: any[], prevChildProp: string, childProp: string, fn: Function) => any[];
|
55
|
+
}
|
56
|
+
export default TreeHelper;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* 类型帮助类
|
4
|
+
*/
|
5
|
+
declare class TypeHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 判断输入类型是否是字符串类型 null -> false
|
9
|
+
*/
|
10
|
+
isString: (input: any) => boolean;
|
11
|
+
/**
|
12
|
+
* 判断输入类型是否是Object类型
|
13
|
+
*/
|
14
|
+
isObject: (input: any) => boolean;
|
15
|
+
/**
|
16
|
+
* 判断输入类型是否是Array类型
|
17
|
+
*/
|
18
|
+
isArray: (input: any) => boolean;
|
19
|
+
/**
|
20
|
+
* 判断输入类型是否是Number类型,null -> false
|
21
|
+
*/
|
22
|
+
isNumber: (input: any) => boolean;
|
23
|
+
/**
|
24
|
+
* 判断输入类型是否是isBoolean类型
|
25
|
+
*/
|
26
|
+
isBoolean: (input: any) => boolean;
|
27
|
+
}
|
28
|
+
export default TypeHelper;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import Helper from "../Helper";
|
2
|
+
/**
|
3
|
+
* Url帮助类
|
4
|
+
*/
|
5
|
+
declare class UrlHelper extends Helper {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 获取指定地址路由对象
|
9
|
+
*/
|
10
|
+
getToRoute(url: string, withReturnUrl?: boolean): any;
|
11
|
+
/**
|
12
|
+
* 获取要跳转的Url地址信息,自动涵盖后退地址
|
13
|
+
*/
|
14
|
+
getToUrl(url: string, withReturnUrl?: boolean): string;
|
15
|
+
/**
|
16
|
+
* 获取菜单参数
|
17
|
+
*/
|
18
|
+
getM(url: string): any;
|
19
|
+
/**
|
20
|
+
* 获取后退地址路由
|
21
|
+
*/
|
22
|
+
getBackRoute(): any;
|
23
|
+
/**
|
24
|
+
* 获取要后退的地址URL
|
25
|
+
*/
|
26
|
+
getBackUrl(): string;
|
27
|
+
/**
|
28
|
+
* 获取指定地址的路由对象,自动合并qs,并解码
|
29
|
+
*/
|
30
|
+
getRoute(url: string, queryObj?: object): any;
|
31
|
+
/**
|
32
|
+
* 处理实体,得到url query参数形式
|
33
|
+
* 如:app=Tool&compare[language]=json&compare[sql]=App%3D%27Tool%27+and+[Table]+like+%27Ctl_%25%27+order+by+[Table],+Name
|
34
|
+
*/
|
35
|
+
getQuery(value: any): string;
|
36
|
+
/**
|
37
|
+
* 处理键值对的值
|
38
|
+
*/
|
39
|
+
private handleQueryValue;
|
40
|
+
/**
|
41
|
+
* 自动根据后面路径,决定是否要合并Url
|
42
|
+
*/
|
43
|
+
concatUrl: (url: string, path: string) => string;
|
44
|
+
/**
|
45
|
+
* 合并路径和查询对象(自动编码,并支持覆盖现有参数),得到完整URL地址,并会省略默认值
|
46
|
+
* ? 对url参数不编码,只对 queryObj 参数编码,防止用户的参数被改成编码形式
|
47
|
+
* ? 目前,对Url参数对象和目标对象都编码,因为源对象属性是经过解码的
|
48
|
+
*/
|
49
|
+
getUrl: (url: string, params?: any) => string;
|
50
|
+
/**
|
51
|
+
* 获取超链接配置对象
|
52
|
+
*/
|
53
|
+
getAnchor: (url: string, params?: any) => {
|
54
|
+
href: any;
|
55
|
+
target: any;
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
* 从Url中提取路径
|
59
|
+
*/
|
60
|
+
getPath(url: string): string;
|
61
|
+
/**
|
62
|
+
* 获取path中最后一个片段信息
|
63
|
+
*/
|
64
|
+
getLastSegment(url: string): string;
|
65
|
+
/**
|
66
|
+
* 获取地址中的查询参数
|
67
|
+
*/
|
68
|
+
getQueryParam(url: string, key: string): string;
|
69
|
+
/**
|
70
|
+
* 从Url中提取查询对象
|
71
|
+
*/
|
72
|
+
deserialize(url: string): object;
|
73
|
+
/**
|
74
|
+
* 把查询字符串转换成对象(自动解码成源数据)
|
75
|
+
*/
|
76
|
+
deserializeQs(qs: string, decode?: boolean): any;
|
77
|
+
/**
|
78
|
+
* 把对象转换成查询字符串,自动编码
|
79
|
+
*/
|
80
|
+
serialize(obj: object, encoding?: boolean): string;
|
81
|
+
/**
|
82
|
+
* URL编码
|
83
|
+
*/
|
84
|
+
encode(value: string): string;
|
85
|
+
/**
|
86
|
+
* 是否是http或https开头的地址
|
87
|
+
*/
|
88
|
+
httpOrHttps(url: string): boolean;
|
89
|
+
}
|
90
|
+
export default UrlHelper;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import HelperFactory from "./HelperFactory";
|
2
|
+
import ArrayHelper from "./implements/ArrayHelper";
|
3
|
+
import ComponentHelper from './implements/ComponentHelper';
|
4
|
+
import DomHelper from "./implements/DomHelper";
|
5
|
+
import DictionaryHelper from "./implements/DictionaryHelper";
|
6
|
+
import EventHelper from "./implements/EventHelper";
|
7
|
+
import FileHelper from "./implements/FileHelper";
|
8
|
+
import HtmlHelper from "./implements/HtmlHelper";
|
9
|
+
import ImageHelper from "./implements/ImageHelper";
|
10
|
+
import MathHelper from "./implements/MathHelper";
|
11
|
+
import MicroHelper from "./implements/MicroHelper";
|
12
|
+
import MountHelper from "./implements/MountHelper";
|
13
|
+
import ObjectHelper from "./implements/ObjectHelper";
|
14
|
+
import StringHelper from "./implements/StringHelper";
|
15
|
+
import TaskHelper from "./implements/TaskHelper";
|
16
|
+
import TypeHelper from "./implements/TypeHelper";
|
17
|
+
import TimeHelper from "./implements/TimeHelper";
|
18
|
+
import TreeHelper from "./implements/TreeHelper";
|
19
|
+
import ScrollHelper from "./implements/ScrollHelper";
|
20
|
+
import JsonHelper from "./implements/JsonHelper";
|
21
|
+
import BrowserHelper from "./implements/BrowserHelper";
|
22
|
+
import UrlHelper from "./implements/UrlHelper";
|
23
|
+
import SignHelper from "./implements/SignHelper";
|
24
|
+
export { HelperFactory, ArrayHelper, ComponentHelper, DomHelper, DictionaryHelper, EventHelper, FileHelper, HtmlHelper, ImageHelper, MathHelper, MountHelper, ObjectHelper, MicroHelper, StringHelper, TaskHelper, TypeHelper, TimeHelper, TreeHelper, ScrollHelper, JsonHelper, BrowserHelper, UrlHelper, SignHelper };
|
@@ -1,10 +1,17 @@
|
|
1
1
|
import II18n from "./II18n";
|
2
|
+
/**
|
3
|
+
* 多语言翻译基类
|
4
|
+
*/
|
2
5
|
declare abstract class I18n implements II18n {
|
3
6
|
type: string;
|
4
7
|
lang: string;
|
5
8
|
messages: {
|
6
9
|
[key: string]: any;
|
7
10
|
};
|
11
|
+
/**
|
12
|
+
* 已加载的语言集合
|
13
|
+
*/
|
14
|
+
loaded: string[];
|
8
15
|
open(conn?: string): Promise<void>;
|
9
16
|
t: (key: string, params?: any) => string;
|
10
17
|
abstract translate(key: string, params: any): string;
|
@@ -29,10 +36,7 @@ declare abstract class I18n implements II18n {
|
|
29
36
|
addMessages: (messages: {
|
30
37
|
[key: string]: string;
|
31
38
|
}) => void;
|
32
|
-
abstract
|
33
|
-
|
34
|
-
* 切换语言,自动加载菜单
|
35
|
-
*/
|
36
|
-
switchI18n: (lang: string) => Promise<void>;
|
39
|
+
abstract load(lang: string): Promise<void>;
|
40
|
+
switch: (lang: string) => Promise<void>;
|
37
41
|
}
|
38
42
|
export default I18n;
|
@@ -65,7 +65,7 @@ interface II18n extends IDriver, IOpen {
|
|
65
65
|
/**
|
66
66
|
* 设置标题
|
67
67
|
*/
|
68
|
-
setTitle(title: string, env
|
68
|
+
setTitle(title: string, env?: string): void;
|
69
69
|
/**
|
70
70
|
* 添加自定义多语言包
|
71
71
|
*/
|
@@ -75,6 +75,10 @@ interface II18n extends IDriver, IOpen {
|
|
75
75
|
/**
|
76
76
|
* 加载指定语言包,需http请求器先加载完毕
|
77
77
|
*/
|
78
|
-
|
78
|
+
load(lang: string): Promise<void>;
|
79
|
+
/**
|
80
|
+
* 切换语言,自动加载菜单
|
81
|
+
*/
|
82
|
+
switch(lang: string): Promise<void>;
|
79
83
|
}
|
80
84
|
export default II18n;
|
@@ -8,6 +8,6 @@ declare class DefaultI18n extends I18n {
|
|
8
8
|
open(conn?: string): Promise<void>;
|
9
9
|
translate: (key: string, params?: any) => string;
|
10
10
|
t_exists: (key: string) => boolean;
|
11
|
-
|
11
|
+
load: (lang: string) => Promise<void>;
|
12
12
|
}
|
13
13
|
export default DefaultI18n;
|
package/esm/drivers/index.d.ts
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* 存储帮助类
|
3
|
+
*/
|
4
|
+
declare class StorageHelper {
|
5
|
+
/**
|
6
|
+
* 获取本地存储
|
7
|
+
*/
|
8
|
+
static get: (key: string, value?: any) => any;
|
9
|
+
/**
|
10
|
+
* 设置本地存储
|
11
|
+
*/
|
12
|
+
static set: (key: string, value: string) => void;
|
13
|
+
/**
|
14
|
+
* 获取本地存储
|
15
|
+
*/
|
16
|
+
static getObject: (key: string) => any;
|
17
|
+
/**
|
18
|
+
* 设置本地存储
|
19
|
+
*/
|
20
|
+
static setObject: (key: string, value: any) => void;
|
21
|
+
/**
|
22
|
+
* 移除存储数据
|
23
|
+
*/
|
24
|
+
static remove: (key: string) => void;
|
25
|
+
/**
|
26
|
+
* 以5M为基准,获取剩余可用容量(KB)
|
27
|
+
*/
|
28
|
+
static getLeftStorage: () => number;
|
29
|
+
/**
|
30
|
+
* 判断指定值是否能够存储到storage中
|
31
|
+
*/
|
32
|
+
static canStorage: (value: object) => boolean;
|
33
|
+
}
|
34
|
+
export default StorageHelper;
|
@@ -9,7 +9,7 @@ declare class DefaultSigner extends Signer {
|
|
9
9
|
app_id: string;
|
10
10
|
}): Promise<void>;
|
11
11
|
callback(token: string): void;
|
12
|
-
getSign(userId: string, url: string, body: string, timestamp: number, secret: string)
|
12
|
+
getSign: (userId: string, url: string, body: string, timestamp: number, secret: string) => Promise<string>;
|
13
13
|
loginUrl(callback: string): string;
|
14
14
|
dispose(): void;
|
15
15
|
}
|
@@ -1,9 +1,15 @@
|
|
1
|
-
import { BuilderFactory, CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, I18nFactory, HttpFactory, MessengerFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory, TemplateFactory } from "../drivers";
|
1
|
+
import { BuilderFactory, CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HelperFactory, I18nFactory, HttpFactory, MessengerFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory, TemplateFactory } from "../drivers";
|
2
2
|
import { SvcFactory } from "../svcs";
|
3
3
|
/**
|
4
4
|
* 驱动工厂类
|
5
5
|
*/
|
6
6
|
declare class Factories {
|
7
|
+
/**
|
8
|
+
* 工厂缓存
|
9
|
+
*/
|
10
|
+
static mappings: {
|
11
|
+
[key: string]: any;
|
12
|
+
};
|
7
13
|
/**
|
8
14
|
* Builder工厂
|
9
15
|
*/
|
@@ -40,6 +46,10 @@ declare class Factories {
|
|
40
46
|
* 多语言工厂
|
41
47
|
*/
|
42
48
|
static get i18n(): I18nFactory;
|
49
|
+
/**
|
50
|
+
* 帮助类工厂
|
51
|
+
*/
|
52
|
+
static get helper(): HelperFactory;
|
43
53
|
/**
|
44
54
|
* 消息提示请求工厂
|
45
55
|
*/
|
@@ -68,12 +78,6 @@ declare class Factories {
|
|
68
78
|
* 服务工厂
|
69
79
|
*/
|
70
80
|
static get svc(): SvcFactory;
|
71
|
-
/**
|
72
|
-
* 工厂缓存
|
73
|
-
*/
|
74
|
-
static mappings: {
|
75
|
-
[key: string]: any;
|
76
|
-
};
|
77
81
|
/**
|
78
82
|
* 并缓存工厂实例
|
79
83
|
*/
|
@@ -26,18 +26,23 @@ declare abstract class Factory<T extends IDriver> implements IFactory<T> {
|
|
26
26
|
* 开启
|
27
27
|
*/
|
28
28
|
open(): void;
|
29
|
-
/**
|
30
|
-
* 创建指定类型驱动
|
31
|
-
*/
|
32
|
-
create(type: string): Promise<T>;
|
33
29
|
/**
|
34
30
|
* 根据主键创建驱动,并返回加载后的驱动信息
|
35
31
|
*/
|
36
32
|
createById(id: number, driverRef?: Ref<any>): Promise<T>;
|
33
|
+
createIfAbsent(type: string): T;
|
37
34
|
/**
|
38
35
|
* 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
|
39
36
|
*/
|
40
|
-
|
37
|
+
createIfAbsentAsync(type?: string, open?: (entity: T) => Promise<void>): Promise<T>;
|
38
|
+
/**
|
39
|
+
* 创建指定类型驱动
|
40
|
+
*/
|
41
|
+
create(type: string): T;
|
42
|
+
/**
|
43
|
+
* 异步创建指定类型驱动
|
44
|
+
*/
|
45
|
+
createAsync(type: string): Promise<T>;
|
41
46
|
/**
|
42
47
|
* 加载驱动明细
|
43
48
|
*/
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ArrayHelper, ComponentHelper, DomHelper, DictionaryHelper, EventHelper, FileHelper, HtmlHelper, ImageHelper, MathHelper, MountHelper, ObjectHelper, MicroHelper, StringHelper, TaskHelper, TypeHelper, TimeHelper, TreeHelper, ScrollHelper, JsonHelper, BrowserHelper, UrlHelper, SignHelper } from "../drivers/helpers";
|
2
|
+
/**
|
3
|
+
* 帮助类工厂
|
4
|
+
*/
|
5
|
+
declare class Helpers {
|
6
|
+
static get array(): ArrayHelper;
|
7
|
+
static get browser(): BrowserHelper;
|
8
|
+
static get component(): ComponentHelper;
|
9
|
+
static get dom(): DomHelper;
|
10
|
+
static get dictionary(): DictionaryHelper;
|
11
|
+
static get event(): EventHelper;
|
12
|
+
static get file(): FileHelper;
|
13
|
+
static get html(): HtmlHelper;
|
14
|
+
static get image(): ImageHelper;
|
15
|
+
static get json(): JsonHelper;
|
16
|
+
static get math(): MathHelper;
|
17
|
+
static get mount(): MountHelper;
|
18
|
+
static get object(): ObjectHelper;
|
19
|
+
static get micro(): MicroHelper;
|
20
|
+
static get scroll(): ScrollHelper;
|
21
|
+
static get string(): StringHelper;
|
22
|
+
static get task(): TaskHelper;
|
23
|
+
static get type(): TypeHelper;
|
24
|
+
static get time(): TimeHelper;
|
25
|
+
static get tree(): TreeHelper;
|
26
|
+
static get url(): UrlHelper;
|
27
|
+
static get sign(): SignHelper;
|
28
|
+
}
|
29
|
+
export default Helpers;
|