halo-fe 1.0.24 → 1.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +3604 -3524
- package/dist/style.css +1 -1
- package/esm/@types/CreateFeOptions.d.ts +4 -0
- package/esm/coms/@types/SocketProgressProps.d.ts +23 -0
- package/esm/coms/@types/TabProps.d.ts +11 -0
- package/esm/coms/@types/TableProps.d.ts +22 -0
- package/esm/coms/@types/index.d.ts +4 -1
- package/esm/coms/Empty.vue.d.ts +12 -10
- package/esm/coms/Fill.vue.d.ts +8 -10
- package/esm/coms/Scroller.vue.d.ts +11 -13
- package/esm/coms/Timer.vue.d.ts +7 -9
- package/esm/coms/cards/Index.vue.d.ts +16 -0
- package/esm/coms/cards/index.d.ts +2 -0
- package/esm/coms/conditions/Condition.vue.d.ts +1 -1
- package/esm/coms/conditions/Index.vue.d.ts +1 -1
- package/esm/coms/controls/Code.vue.d.ts +4 -6
- package/esm/coms/controls/Compare.vue.d.ts +16 -8
- package/esm/coms/controls/Input.vue.d.ts +2 -0
- package/esm/coms/controls/Option.vue.d.ts +1 -1
- package/esm/coms/controls/RichText.vue.d.ts +2 -4
- package/esm/coms/controls/Select.vue.d.ts +1 -1
- package/esm/coms/controls/index.d.ts +2 -1
- package/esm/coms/index.d.ts +1 -0
- package/esm/coms/layouts/Col.vue.d.ts +6 -8
- package/esm/coms/layouts/Container.vue.d.ts +12 -11
- package/esm/coms/layouts/Desc.vue.d.ts +2 -0
- package/esm/coms/layouts/Row.vue.d.ts +6 -8
- package/esm/coms/pagers/Index.vue.d.ts +2 -0
- package/esm/coms/pagers/index.d.ts +2 -0
- package/esm/coms/progresses/Index.vue.d.ts +6 -0
- package/esm/coms/progresses/SocketProgress.vue.d.ts +7 -9
- package/esm/coms/progresses/index.d.ts +1 -1
- package/esm/coms/tables/Index.vue.d.ts +14 -0
- package/esm/coms/tabs/Tab.vue.d.ts +2 -2
- package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
- package/esm/drivers/cdns/Cdn.d.ts +6 -8
- package/esm/drivers/cdns/ICdn.d.ts +0 -5
- package/esm/drivers/encoders/EncoderFactory.d.ts +1 -0
- package/esm/drivers/encoders/implement/UrlEncoder.d.ts +7 -0
- package/esm/drivers/https/Http.d.ts +13 -2
- package/esm/drivers/https/IHttp.d.ts +4 -0
- package/esm/drivers/https/entities/HttpModel.d.ts +12 -0
- package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
- package/esm/drivers/https/implements/HaloHttp.d.ts +1 -9
- package/esm/drivers/https/implements/MkHttp.d.ts +1 -2
- package/esm/drivers/index.d.ts +2 -1
- package/esm/drivers/sockets/ISocket.d.ts +35 -0
- package/esm/drivers/sockets/Socket.d.ts +8 -0
- package/esm/drivers/sockets/SocketFactory.d.ts +13 -0
- package/esm/drivers/sockets/implement/DefaultSocket.d.ts +39 -0
- package/esm/drivers/sockets/index.d.ts +2 -0
- package/esm/drivers/tasks/ITask.d.ts +3 -0
- package/esm/drivers/util/@types/JsonConfig.d.ts +10 -0
- package/esm/drivers/util/@types/TreeNodeProp.d.ts +9 -0
- package/esm/drivers/util/@types/index.d.ts +3 -0
- package/esm/drivers/util/IUtil.d.ts +8 -0
- package/esm/drivers/util/Util.d.ts +8 -0
- package/esm/drivers/util/UtilFactory.d.ts +32 -0
- package/esm/drivers/util/implements/ArrayUtil.d.ts +123 -0
- package/esm/drivers/util/implements/BrowserUtil.d.ts +12 -0
- package/esm/drivers/util/implements/ComponentUtil.d.ts +20 -0
- package/esm/drivers/util/implements/DictionaryUtil.d.ts +40 -0
- package/esm/drivers/util/implements/DomUtil.d.ts +118 -0
- package/esm/drivers/util/implements/EventUtil.d.ts +32 -0
- package/esm/drivers/util/implements/FileUtil.d.ts +24 -0
- package/esm/drivers/util/implements/HtmlUtil.d.ts +16 -0
- package/esm/drivers/util/implements/ImageUtil.d.ts +12 -0
- package/esm/drivers/util/implements/JsonUtil.d.ts +53 -0
- package/esm/drivers/util/implements/MathUtil.d.ts +52 -0
- package/esm/drivers/util/implements/MicroUtil.d.ts +12 -0
- package/esm/drivers/util/implements/MountUtil.d.ts +16 -0
- package/esm/drivers/util/implements/ObjectUtil.d.ts +44 -0
- package/esm/drivers/util/implements/ScrollUtil.d.ts +16 -0
- package/esm/drivers/util/implements/SignUtil.d.ts +16 -0
- package/esm/drivers/util/implements/StringUtil.d.ts +104 -0
- package/esm/drivers/util/implements/TaskUtil.d.ts +28 -0
- package/esm/drivers/util/implements/TimeUtil.d.ts +72 -0
- package/esm/drivers/util/implements/TreeUtil.d.ts +56 -0
- package/esm/drivers/util/implements/TypeUtil.d.ts +28 -0
- package/esm/drivers/util/implements/UrlUtil.d.ts +90 -0
- package/esm/drivers/util/index.d.ts +24 -0
- package/esm/factorying/Factories.d.ts +9 -5
- package/esm/factorying/Factory.d.ts +4 -7
- package/esm/factorying/IFactory.d.ts +6 -2
- package/esm/factorying/Utils.d.ts +24 -9
- package/esm/factorying/index.d.ts +7 -2
- package/esm/svcs/implement/ConfigSvc.d.ts +1 -1
- package/esm/svcs/index.d.ts +1 -3
- package/package.json +4 -4
@@ -0,0 +1,24 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 文件帮助类
|
4
|
+
*/
|
5
|
+
declare class FileUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 保存文件
|
9
|
+
*/
|
10
|
+
save: (base64: string, fileName: string) => void;
|
11
|
+
/**
|
12
|
+
* 获取文件扩展名
|
13
|
+
*/
|
14
|
+
getExtension: (name: string) => string;
|
15
|
+
/**
|
16
|
+
* 判断当前文件名是否是excel文件
|
17
|
+
*/
|
18
|
+
isExcel: (name: string) => boolean;
|
19
|
+
/**
|
20
|
+
* 判断当前文件是否是图片文件
|
21
|
+
*/
|
22
|
+
isImage: (url: string) => boolean;
|
23
|
+
}
|
24
|
+
export default FileUtil;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* Html帮助类
|
4
|
+
*/
|
5
|
+
declare class HtmlUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 获取Html内容
|
9
|
+
*/
|
10
|
+
getHtml: (value: string) => string;
|
11
|
+
/**
|
12
|
+
* 获取Html中的文字
|
13
|
+
*/
|
14
|
+
getText: (value: string) => string;
|
15
|
+
}
|
16
|
+
export default HtmlUtil;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { JsonConfig, TreeNodeProp } from "../@types";
|
2
|
+
import Util from "../Util";
|
3
|
+
/**
|
4
|
+
* JSON帮助类
|
5
|
+
*/
|
6
|
+
declare class JsonUtil extends Util {
|
7
|
+
type: string;
|
8
|
+
/**
|
9
|
+
* 对非字符串进行序列化
|
10
|
+
*/
|
11
|
+
serializeWithoutString(value: any): string;
|
12
|
+
/**
|
13
|
+
* 把对象格式化为Json字符串
|
14
|
+
*/
|
15
|
+
serialize(value: any, config?: boolean | JsonConfig): string;
|
16
|
+
/**
|
17
|
+
* 反序列化成json对象
|
18
|
+
*/
|
19
|
+
deserialize(value: string): any;
|
20
|
+
/**
|
21
|
+
* 判断指定值,是否包含key
|
22
|
+
*/
|
23
|
+
hasKey(value: any, props: string | string[]): boolean;
|
24
|
+
/**
|
25
|
+
* 根据props中的.自动分割得到属性值
|
26
|
+
*/
|
27
|
+
getValue(value: any, props: string | string[]): any;
|
28
|
+
/**
|
29
|
+
* 获取所有key集合
|
30
|
+
*/
|
31
|
+
getKeys: (props: string | string[]) => string[];
|
32
|
+
/**
|
33
|
+
* 把json字符串合并到目标对象上
|
34
|
+
*/
|
35
|
+
mergeTo(target: any, from: string): void;
|
36
|
+
/**
|
37
|
+
* 从树集合构建出Json对象
|
38
|
+
*/
|
39
|
+
buildObject(tree: any[], childProp: string, fn: (node: any) => TreeNodeProp): string;
|
40
|
+
/**
|
41
|
+
* 从开始层级开始构建Json字符串
|
42
|
+
*/
|
43
|
+
private buildObjectLevel;
|
44
|
+
/**
|
45
|
+
* 填充指定长度的字符串
|
46
|
+
*/
|
47
|
+
private fillSpace;
|
48
|
+
/**
|
49
|
+
* 填充指定长度的字符串
|
50
|
+
*/
|
51
|
+
private fillKey;
|
52
|
+
}
|
53
|
+
export default JsonUtil;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 数学帮助类
|
4
|
+
*/
|
5
|
+
declare class MathUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 过滤某一页数据
|
9
|
+
*/
|
10
|
+
filterPage: (rows: any[], page: number, size: number) => any[];
|
11
|
+
/**
|
12
|
+
* 总页数
|
13
|
+
*/
|
14
|
+
pageCount: (count: number, size: number) => number;
|
15
|
+
/**
|
16
|
+
* 四舍五入
|
17
|
+
*/
|
18
|
+
round: (value: number, digits: number) => string;
|
19
|
+
/**
|
20
|
+
* 天花板函数
|
21
|
+
*/
|
22
|
+
ceil: (value: number) => number;
|
23
|
+
/**
|
24
|
+
* 获取最大值
|
25
|
+
*/
|
26
|
+
max(...values: number[]): number;
|
27
|
+
/**
|
28
|
+
* 生成指定范围内的随机数
|
29
|
+
*/
|
30
|
+
random(start: number, end: number): number;
|
31
|
+
/**
|
32
|
+
* 获取在指定范围内的值
|
33
|
+
*/
|
34
|
+
between(value: number, min: number, max: number): number;
|
35
|
+
/**
|
36
|
+
* 尝试把任意类型转成数字,转换不成功返回原值
|
37
|
+
*/
|
38
|
+
getNumber(value: any): any;
|
39
|
+
/**
|
40
|
+
* 获取百分比
|
41
|
+
*/
|
42
|
+
getPercentage: (handled: number, total: number) => number;
|
43
|
+
/**
|
44
|
+
* 获取百分比,保留2位小数
|
45
|
+
*/
|
46
|
+
getPercentageText: (handled: number, total: number) => string;
|
47
|
+
/**
|
48
|
+
* 获取大小
|
49
|
+
*/
|
50
|
+
size: (bytes: number) => string;
|
51
|
+
}
|
52
|
+
export default MathUtil;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 事件挂载帮助类
|
4
|
+
*/
|
5
|
+
declare class MountUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 激发主框架事件
|
9
|
+
*/
|
10
|
+
emit: (event: string, payload: any) => void;
|
11
|
+
/**
|
12
|
+
* 批量激发主框架事件
|
13
|
+
*/
|
14
|
+
emits: (events: any) => void;
|
15
|
+
}
|
16
|
+
export default MountUtil;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 对象帮助类
|
4
|
+
*/
|
5
|
+
declare class ObjectUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 净化对象,返回不带默认属性的对象
|
9
|
+
*/
|
10
|
+
pure(input: object): {};
|
11
|
+
/**
|
12
|
+
* 过滤key,并输出新对象
|
13
|
+
*/
|
14
|
+
filter(input: object, filter: (n: any) => boolean, valueFn: (n: any) => {}): any[];
|
15
|
+
/**
|
16
|
+
* 提取部分属性,并得到新对象
|
17
|
+
*/
|
18
|
+
extract(value: object, keys: string[]): any;
|
19
|
+
/**
|
20
|
+
* 把数组转换成对象
|
21
|
+
*/
|
22
|
+
toObject(array: any[], keyFn: (n: any) => string, valueFn: (n: any) => string): any;
|
23
|
+
/**
|
24
|
+
* 手动复制,并对字段执行指定自定义处理
|
25
|
+
*/
|
26
|
+
copy: (obj: any, handler?: {}) => any[] | any;
|
27
|
+
/**
|
28
|
+
* 对对象进行深度克隆,同时可以移除Proxy对象
|
29
|
+
*/
|
30
|
+
clone<T>(obj: T, handler?: (n: any) => void): T;
|
31
|
+
/**
|
32
|
+
* 合并来源对象到目标对象上
|
33
|
+
*/
|
34
|
+
mergeTo(target: any, from: any): any;
|
35
|
+
/**
|
36
|
+
* 给对象添加多层属性,并赋值
|
37
|
+
*/
|
38
|
+
addProperties: (obj: object, keys: string[], value: string) => void;
|
39
|
+
/**
|
40
|
+
* 获取对象不区分大小写的key
|
41
|
+
*/
|
42
|
+
getKey(value: object, key: string): string;
|
43
|
+
}
|
44
|
+
export default ObjectUtil;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 滚动帮助类
|
4
|
+
*/
|
5
|
+
declare class ScrollUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 判断指定元素滚动条位置,是否到了页面底部
|
9
|
+
*/
|
10
|
+
isBottom: (selector: any) => boolean;
|
11
|
+
/**
|
12
|
+
* 滚动指定元素的滚动条到页面底部
|
13
|
+
*/
|
14
|
+
scrollToBottom: (selector: any) => void;
|
15
|
+
}
|
16
|
+
export default ScrollUtil;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 签名帮助类
|
4
|
+
*/
|
5
|
+
declare class SignUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 清空对象中的空值
|
9
|
+
*/
|
10
|
+
clean(obj: object): void;
|
11
|
+
/**
|
12
|
+
* 签名字典
|
13
|
+
*/
|
14
|
+
signDictionary(dictionary: object, encoding?: boolean): any;
|
15
|
+
}
|
16
|
+
export default SignUtil;
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 字符串帮助类
|
4
|
+
*/
|
5
|
+
declare class StringUtil extends Util {
|
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) => any;
|
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 StringUtil;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 任务执行帮助类
|
4
|
+
*/
|
5
|
+
declare class TaskUtil extends Util {
|
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 TaskUtil;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 时间帮助类
|
4
|
+
*/
|
5
|
+
declare class TimeUtil extends Util {
|
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
|
+
formatSecondTime: (value: any) => string;
|
23
|
+
/**
|
24
|
+
* 对时间值进行时间格式化
|
25
|
+
*/
|
26
|
+
formatMillisecondTime: (value: string) => string;
|
27
|
+
/**
|
28
|
+
* 格式化成24小时时间格式
|
29
|
+
*/
|
30
|
+
formatTime: (value: any) => string;
|
31
|
+
/**
|
32
|
+
* 对时间值进行日期格式化
|
33
|
+
*/
|
34
|
+
formatDate: (value: any) => string;
|
35
|
+
/**
|
36
|
+
* 格式化时间
|
37
|
+
*/
|
38
|
+
formatDateTime: (value: number) => string;
|
39
|
+
/**
|
40
|
+
* 获取当前日期时间的字符串
|
41
|
+
*/
|
42
|
+
getDateTimeString: () => string;
|
43
|
+
/**
|
44
|
+
* 获取当前时间的字符串
|
45
|
+
*/
|
46
|
+
getDateString: () => string;
|
47
|
+
/**
|
48
|
+
* 获取当前时间的字符串
|
49
|
+
*/
|
50
|
+
getTimeString: () => string;
|
51
|
+
/**
|
52
|
+
* 添加天数
|
53
|
+
*/
|
54
|
+
addDays: (value: any, days: number) => Date;
|
55
|
+
/**
|
56
|
+
* 添加月份
|
57
|
+
*/
|
58
|
+
addMonths: (value: any, months: number) => Date;
|
59
|
+
/**
|
60
|
+
* 添加小时
|
61
|
+
*/
|
62
|
+
addHours: (value: any, hours: number) => Date;
|
63
|
+
/**
|
64
|
+
* 判断指定时间是否是周末
|
65
|
+
*/
|
66
|
+
isWeekend: (value: any) => boolean;
|
67
|
+
/**
|
68
|
+
* 把中国时间,转换为当地时间
|
69
|
+
*/
|
70
|
+
localeTime: (time: any) => Date;
|
71
|
+
}
|
72
|
+
export default TimeUtil;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 树帮助类
|
4
|
+
*/
|
5
|
+
declare class TreeUtil extends Util {
|
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 TreeUtil;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 类型帮助类
|
4
|
+
*/
|
5
|
+
declare class TypeUtil extends Util {
|
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 TypeUtil;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* Url帮助类
|
4
|
+
*/
|
5
|
+
declare class UrlUtil extends Util {
|
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 UrlUtil;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import UtilFactory from "./UtilFactory";
|
2
|
+
import ArrayUtil from "./implements/ArrayUtil";
|
3
|
+
import ComponentUtil from './implements/ComponentUtil';
|
4
|
+
import DomUtil from "./implements/DomUtil";
|
5
|
+
import DictionaryUtil from "./implements/DictionaryUtil";
|
6
|
+
import EventUtil from "./implements/EventUtil";
|
7
|
+
import FileUtil from "./implements/FileUtil";
|
8
|
+
import HtmlUtil from "./implements/HtmlUtil";
|
9
|
+
import ImageUtil from "./implements/ImageUtil";
|
10
|
+
import MathUtil from "./implements/MathUtil";
|
11
|
+
import MicroUtil from "./implements/MicroUtil";
|
12
|
+
import MountUtil from "./implements/MountUtil";
|
13
|
+
import ObjectUtil from "./implements/ObjectUtil";
|
14
|
+
import StringUtil from "./implements/StringUtil";
|
15
|
+
import TaskUtil from "./implements/TaskUtil";
|
16
|
+
import TypeUtil from "./implements/TypeUtil";
|
17
|
+
import TimeUtil from "./implements/TimeUtil";
|
18
|
+
import TreeUtil from "./implements/TreeUtil";
|
19
|
+
import ScrollUtil from "./implements/ScrollUtil";
|
20
|
+
import JsonUtil from "./implements/JsonUtil";
|
21
|
+
import BrowserUtil from "./implements/BrowserUtil";
|
22
|
+
import UrlUtil from "./implements/UrlUtil";
|
23
|
+
import SignUtil from "./implements/SignUtil";
|
24
|
+
export { UtilFactory, ArrayUtil, ComponentUtil, DomUtil, DictionaryUtil, EventUtil, FileUtil, HtmlUtil, ImageUtil, MathUtil, MountUtil, ObjectUtil, MicroUtil, StringUtil, TaskUtil, TypeUtil, TimeUtil, TreeUtil, ScrollUtil, JsonUtil, BrowserUtil, UrlUtil, SignUtil };
|