halo-fe 1.0.23 → 1.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/{liquidjs-C-LVcoaY.js → liquidjs-B8dqQyVv.js} +639 -632
- package/dist/main.js +4365 -4206
- 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 +11 -7
- package/esm/coms/Fill.vue.d.ts +11 -4
- package/esm/coms/Scroller.vue.d.ts +16 -15
- package/esm/coms/Timer.vue.d.ts +9 -4
- package/esm/coms/{Col.vue.d.ts → cards/Index.vue.d.ts} +8 -3
- package/esm/coms/cards/index.d.ts +2 -0
- package/esm/coms/conditions/Condition.vue.d.ts +1 -10
- package/esm/coms/conditions/Index.vue.d.ts +1 -10
- package/esm/coms/controls/Code.vue.d.ts +15 -15
- package/esm/coms/controls/Compare.vue.d.ts +5 -5
- 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 +4 -15
- 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 +8 -3
- package/esm/coms/layouts/Container.vue.d.ts +11 -6
- package/esm/coms/layouts/Desc.vue.d.ts +2 -0
- package/esm/coms/layouts/Row.vue.d.ts +8 -13
- 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/Progress.vue.d.ts +4 -16
- package/esm/coms/progresses/SocketProgress.vue.d.ts +9 -13
- package/esm/coms/progresses/index.d.ts +1 -1
- package/esm/coms/tables/Index.vue.d.ts +14 -0
- package/esm/coms/tables/Table.vue.d.ts +1 -1
- package/esm/coms/tabs/Tab.vue.d.ts +2 -11
- package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
- package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
- package/esm/drivers/builders/types/index.d.ts +2 -0
- 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/excels/ExcelFactory.d.ts +1 -1
- package/esm/drivers/helpers/implements/ArrayHelper.d.ts +1 -2
- package/esm/drivers/helpers/implements/DomHelper.d.ts +1 -1
- 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 +3 -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/{helpers/time-helper.d.ts → drivers/util/implements/TimeUtil.d.ts} +30 -24
- package/esm/drivers/util/implements/TreeUtil.d.ts +56 -0
- package/esm/{helpers/type-helper.d.ts → drivers/util/implements/TypeUtil.d.ts} +9 -7
- package/esm/{helpers/url-helper.d.ts → drivers/util/implements/UrlUtil.d.ts} +23 -29
- package/esm/drivers/util/index.d.ts +24 -0
- package/esm/drivers/utilities/@types/DragEvent.d.ts +11 -0
- package/esm/drivers/utilities/@types/DragOptions.d.ts +28 -0
- package/esm/drivers/utilities/@types/Position.d.ts +15 -0
- package/esm/drivers/utilities/@types/Rect.d.ts +10 -0
- package/esm/drivers/utilities/@types/index.d.ts +5 -0
- package/esm/drivers/utilities/IUtility.d.ts +4 -0
- package/esm/drivers/utilities/Utility.d.ts +5 -0
- package/esm/drivers/utilities/UtilityFactory.d.ts +43 -0
- package/esm/drivers/utilities/implement/AffixUtility.d.ts +11 -0
- package/esm/drivers/utilities/implement/DeltaUtility.d.ts +11 -0
- package/esm/drivers/utilities/implement/EventUtility.d.ts +73 -0
- package/esm/drivers/utilities/implement/KeyboardUtility.d.ts +74 -0
- package/esm/drivers/utilities/implement/MouseUtility.d.ts +25 -0
- package/esm/drivers/utilities/implement/RandomUtility.d.ts +41 -0
- package/esm/drivers/utilities/implement/SaveUtility.d.ts +16 -0
- package/esm/drivers/utilities/index.d.ts +9 -0
- package/esm/factorying/Factories.d.ts +13 -5
- package/esm/factorying/Factory.d.ts +4 -7
- package/esm/factorying/{Helpers.d.ts → Helps.d.ts} +2 -2
- package/esm/factorying/IFactory.d.ts +6 -2
- package/esm/factorying/Utils.d.ts +29 -0
- package/esm/factorying/index.d.ts +7 -2
- package/esm/helpers/DictionaryHelper.d.ts +6 -0
- package/esm/main.d.ts +1 -1
- package/esm/svcs/@types/Dictionary.d.ts +4 -0
- package/esm/svcs/implement/ConfigSvc.d.ts +1 -1
- package/esm/svcs/implement/DriverSvc.d.ts +4 -0
- package/esm/svcs/implement/I18nSvc.d.ts +1 -1
- package/esm/svcs/index.d.ts +2 -3
- package/esm/utilities/MathUtility.d.ts +35 -0
- package/package.json +9 -9
- package/esm/coms/Code.vue.d.ts +0 -41
- package/esm/coms/Compare.vue.d.ts +0 -40
- package/esm/coms/Container.vue.d.ts +0 -23
- package/esm/coms/RichText.vue.d.ts +0 -24
- package/esm/coms/Row.vue.d.ts +0 -21
- package/esm/coms/types/CodeEmit.d.ts +0 -23
- package/esm/coms/types/CodeProps.d.ts +0 -18
- package/esm/coms/types/RichTextOptions.d.ts +0 -14
- package/esm/coms/types/RichTextProps.d.ts +0 -12
- package/esm/coms/types/RowProps.d.ts +0 -14
- package/esm/drivers/IDriver.d.ts +0 -10
- package/esm/drivers/cdns/implements/BootCdn.d.ts +0 -12
- package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +0 -15
- package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +0 -21
- package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +0 -12
- package/esm/drivers/factories/DriverFactory.d.ts +0 -64
- package/esm/drivers/factories/Factory.d.ts +0 -18
- package/esm/drivers/factories/IFactory.d.ts +0 -18
- package/esm/drivers/factories/index.d.ts +0 -42
- package/esm/drivers/providers/implements/StorageHelper.d.ts +0 -34
- package/esm/helpers/ScriptHelper.d.ts +0 -19
- package/esm/helpers/array-helper.d.ts +0 -97
- package/esm/helpers/component-helper.d.ts +0 -18
- package/esm/helpers/cookie-helper.d.ts +0 -6
- package/esm/helpers/dictionary-helper.d.ts +0 -18
- package/esm/helpers/dom-helper.d.ts +0 -86
- package/esm/helpers/event-helper.d.ts +0 -30
- package/esm/helpers/file-helper.d.ts +0 -22
- package/esm/helpers/html-helper.d.ts +0 -10
- package/esm/helpers/i18n-helper.d.ts +0 -14
- package/esm/helpers/image-helper.d.ts +0 -10
- package/esm/helpers/json-helper.d.ts +0 -39
- package/esm/helpers/math-helper.d.ts +0 -46
- package/esm/helpers/micro-helper.d.ts +0 -10
- package/esm/helpers/mount-helper.d.ts +0 -14
- package/esm/helpers/object-helper.d.ts +0 -38
- package/esm/helpers/script-helper.d.ts +0 -31
- package/esm/helpers/scroll-helper.d.ts +0 -14
- package/esm/helpers/sign-helper.d.ts +0 -14
- package/esm/helpers/storage-helper.d.ts +0 -34
- package/esm/helpers/string-helper.d.ts +0 -94
- package/esm/helpers/task-helper.d.ts +0 -26
- package/esm/helpers/tree-helper.d.ts +0 -54
- package/esm/plugins/HtmlTransform.d.ts +0 -6
- package/esm/plugins/types/IMessager.d.ts +0 -34
- package/esm/plugins/types/index.d.ts +0 -7
- package/esm/services/ConfigService.d.ts +0 -66
- package/esm/services/DriverService.d.ts +0 -36
- package/esm/services/EnvService.d.ts +0 -14
- package/esm/services/LogService.d.ts +0 -19
- package/esm/services/SettingService.d.ts +0 -42
- package/esm/services/SocketService.d.ts +0 -23
- package/esm/services/UserService.d.ts +0 -47
- package/esm/services/index.d.ts +0 -15
- package/esm/services/types/IMessage.d.ts +0 -14
- package/esm/services/types/IMessager.d.ts +0 -34
- package/esm/services/types/index.d.ts +0 -2
- package/esm/servs/ConfigServ.d.ts +0 -66
- package/esm/servs/DriverServ.d.ts +0 -36
- package/esm/servs/EnvServ.d.ts +0 -14
- package/esm/servs/IServ.d.ts +0 -6
- package/esm/servs/LogServ.d.ts +0 -19
- package/esm/servs/Serv.d.ts +0 -4
- package/esm/servs/ServFactory.d.ts +0 -11
- package/esm/servs/SettingServ.d.ts +0 -42
- package/esm/servs/SocketServ.d.ts +0 -38
- package/esm/servs/UserServ.d.ts +0 -47
- package/esm/servs/implement/ConfigServ.d.ts +0 -66
- package/esm/servs/implement/DriverServ.d.ts +0 -36
- package/esm/servs/implement/EnvServ.d.ts +0 -14
- package/esm/servs/implement/LogServ.d.ts +0 -19
- package/esm/servs/implement/SettingServ.d.ts +0 -42
- package/esm/servs/implement/SocketServ.d.ts +0 -38
- package/esm/servs/implement/UserServ.d.ts +0 -47
- package/esm/servs/index.d.ts +0 -15
- package/esm/stores/config.d.ts +0 -63
- package/esm/stores/driver.d.ts +0 -37
- package/esm/stores/env.d.ts +0 -12
- package/esm/stores/index.d.ts +0 -8
- package/esm/stores/log.d.ts +0 -20
- package/esm/stores/setting.d.ts +0 -43
- package/esm/stores/socket.d.ts +0 -27
- package/esm/stores/user.d.ts +0 -40
- package/esm/types/CreateOptions.d.ts +0 -18
@@ -0,0 +1,118 @@
|
|
1
|
+
import { Position } from "../../utilities";
|
2
|
+
import Util from "../Util";
|
3
|
+
/**
|
4
|
+
* Dom帮助类
|
5
|
+
*/
|
6
|
+
declare class DomUtil extends Util {
|
7
|
+
type: string;
|
8
|
+
/**
|
9
|
+
* 根据字符串Ascii码得到固定颜色字典
|
10
|
+
*/
|
11
|
+
getColors(values: string[]): object;
|
12
|
+
/**
|
13
|
+
* 获取样式名
|
14
|
+
*/
|
15
|
+
getClass(...args: any[]): string;
|
16
|
+
/**
|
17
|
+
* 添加类
|
18
|
+
*/
|
19
|
+
addClass: (dom: Element, cls: string, choice?: any) => void;
|
20
|
+
/**
|
21
|
+
* 删除类
|
22
|
+
*/
|
23
|
+
removeClass: (selector: string | Element, className: string, except?: Element) => void;
|
24
|
+
/**
|
25
|
+
* 根据计算后的样式进行DOM过滤
|
26
|
+
*/
|
27
|
+
filterStyle(doms: HTMLElement[], fn: (style: CSSStyleDeclaration) => boolean): HTMLElement[];
|
28
|
+
/**
|
29
|
+
* 添加样式
|
30
|
+
*/
|
31
|
+
addStyle(dom: HTMLElement, prop: string, value: string): void;
|
32
|
+
/**
|
33
|
+
* 查找兄弟节点
|
34
|
+
*/
|
35
|
+
siblings(dom: HTMLElement): HTMLElement[];
|
36
|
+
/**
|
37
|
+
* 查找指定父节点
|
38
|
+
*/
|
39
|
+
parentUntil(dom: HTMLElement, cls: string): HTMLElement;
|
40
|
+
/**
|
41
|
+
* 查找第一个绝对定位的元素或backdrop元素,否则使用html元素
|
42
|
+
*/
|
43
|
+
parentAbsolute(dom: HTMLElement): HTMLElement;
|
44
|
+
/**
|
45
|
+
* 查找孩子节点
|
46
|
+
*/
|
47
|
+
find(dom: Element, cls: string): Element;
|
48
|
+
/**
|
49
|
+
* 获取dom宽度或高度
|
50
|
+
*/
|
51
|
+
private getWidthOrHeight;
|
52
|
+
/**
|
53
|
+
* 统计所有控件宽度,含外边距
|
54
|
+
*/
|
55
|
+
getWidth(value: Element | Element[]): number;
|
56
|
+
/**
|
57
|
+
* 获取元素可用宽度(移除内填充)
|
58
|
+
*/
|
59
|
+
getAvailableWidth(value: Element | Element[]): number;
|
60
|
+
/**
|
61
|
+
* 统计所有非固定定位控件高度,含内填充和外边距
|
62
|
+
*/
|
63
|
+
getHeight(value: Element | Element[]): number;
|
64
|
+
/**
|
65
|
+
* 获取元素可用高度(移除内填充)
|
66
|
+
*/
|
67
|
+
getAvailableHeight(value: Element | Element[]): number;
|
68
|
+
/**
|
69
|
+
* 获取指定元素在视口内的位置
|
70
|
+
*/
|
71
|
+
getViewportStyle(target: Element, title: string, subMenu: string, viewport: Element, position: string): any;
|
72
|
+
/**
|
73
|
+
* 获取指定选择器最大的索引
|
74
|
+
*/
|
75
|
+
getMaxIndex(selector: string): number;
|
76
|
+
/**
|
77
|
+
* 判断当前鼠标位置是否在指定范围之内
|
78
|
+
*/
|
79
|
+
inRange(event: Position, x: number, y: number, width: number, height: number): boolean;
|
80
|
+
/**
|
81
|
+
* 创建指定标签的dom,并设置内容
|
82
|
+
*/
|
83
|
+
create(name: string, cls?: string, html?: string): HTMLElement;
|
84
|
+
/**
|
85
|
+
* 不存在时创建dom,并自动追加到文档
|
86
|
+
*/
|
87
|
+
createIfAbsent(name: string, cls: string, html?: string): HTMLElement;
|
88
|
+
/**
|
89
|
+
* 根据路径获取标签(无src)
|
90
|
+
*/
|
91
|
+
createEmptyByUrl: (url: string) => HTMLElement;
|
92
|
+
/**
|
93
|
+
* 根据路径获取待加载的元素,同时包含Url
|
94
|
+
*/
|
95
|
+
createByUrl: (url: string) => HTMLElement;
|
96
|
+
/**
|
97
|
+
* 根据路径获取元素
|
98
|
+
* VIP:已废弃,不能用改方法判断资源是否加载完毕,因为可能只是脚本创建,资源还未加载完毕
|
99
|
+
*/
|
100
|
+
getByUrl: (url: string) => HTMLElement;
|
101
|
+
/**
|
102
|
+
* 获取行内标签,如: style(非link)
|
103
|
+
*/
|
104
|
+
getInlineTagByUrl(url: string): string;
|
105
|
+
/**
|
106
|
+
* 获取资源标签,如: link
|
107
|
+
*/
|
108
|
+
getTagByUrl(url: string): string;
|
109
|
+
/**
|
110
|
+
* 获取文本宽度
|
111
|
+
*/
|
112
|
+
getTextWidth(value: string): number;
|
113
|
+
/**
|
114
|
+
* 判断选择器内容是否溢出
|
115
|
+
*/
|
116
|
+
isEllipsis: (selector: string) => boolean;
|
117
|
+
}
|
118
|
+
export default DomUtil;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 事件帮助类
|
4
|
+
*/
|
5
|
+
declare class EventUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 批量绑定事件,执行指定处理函数
|
9
|
+
*/
|
10
|
+
bind: (events: any[], dom: any, func: Function) => void;
|
11
|
+
/**
|
12
|
+
* 批量绑定事件,执行指定处理函数
|
13
|
+
*/
|
14
|
+
unbind: (events: any[], dom: any, func: Function) => void;
|
15
|
+
/**
|
16
|
+
* 绑定点击处理函数
|
17
|
+
*/
|
18
|
+
click: (dom: any, func: Function) => void;
|
19
|
+
/**
|
20
|
+
* 解除点击监听
|
21
|
+
*/
|
22
|
+
unclick: (dom: any, func: Function) => void;
|
23
|
+
/**
|
24
|
+
* 绑定滚动处理函数
|
25
|
+
*/
|
26
|
+
scroll: (dom: any, func: Function) => void;
|
27
|
+
/**
|
28
|
+
* 移除滚动处理函数,防止内存泄漏
|
29
|
+
*/
|
30
|
+
unscroll: (dom: any, func: Function) => void;
|
31
|
+
}
|
32
|
+
export default EventUtil;
|
@@ -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;
|
@@ -1,66 +1,72 @@
|
|
1
|
+
import Util from "../Util";
|
1
2
|
/**
|
2
3
|
* 时间帮助类
|
3
4
|
*/
|
4
|
-
declare class
|
5
|
+
declare class TimeUtil extends Util {
|
6
|
+
type: string;
|
5
7
|
/**
|
6
8
|
* 获取相对于1970年1月1日的时间戳(ms),不同时区结果相同
|
7
9
|
*/
|
8
|
-
|
10
|
+
getTimestamp: (value?: any) => number;
|
9
11
|
/**
|
10
12
|
* 根据字符串获取可对比的时间
|
11
13
|
*/
|
12
|
-
|
14
|
+
getTime: (value?: any) => Date;
|
13
15
|
/**
|
14
16
|
* 格式化时间
|
15
17
|
*/
|
16
|
-
|
18
|
+
format: (value: number, format: string) => string;
|
17
19
|
/**
|
18
|
-
*
|
20
|
+
* 对时间值进行时间格式化
|
19
21
|
*/
|
20
|
-
|
22
|
+
formatSecondTime: (value: any) => string;
|
21
23
|
/**
|
22
|
-
*
|
24
|
+
* 对时间值进行时间格式化
|
23
25
|
*/
|
24
|
-
|
26
|
+
formatMillisecondTime: (value: string) => string;
|
25
27
|
/**
|
26
|
-
*
|
28
|
+
* 格式化成24小时时间格式
|
27
29
|
*/
|
28
|
-
|
30
|
+
formatTime: (value: any) => string;
|
29
31
|
/**
|
30
|
-
*
|
32
|
+
* 对时间值进行日期格式化
|
31
33
|
*/
|
32
|
-
|
34
|
+
formatDate: (value: any) => string;
|
33
35
|
/**
|
34
|
-
*
|
36
|
+
* 格式化时间
|
35
37
|
*/
|
36
|
-
|
38
|
+
formatDateTime: (value: number) => string;
|
37
39
|
/**
|
38
|
-
*
|
40
|
+
* 获取当前日期时间的字符串
|
39
41
|
*/
|
40
|
-
|
42
|
+
getDateTimeString: () => string;
|
41
43
|
/**
|
42
|
-
*
|
44
|
+
* 获取当前时间的字符串
|
45
|
+
*/
|
46
|
+
getDateString: () => string;
|
47
|
+
/**
|
48
|
+
* 获取当前时间的字符串
|
43
49
|
*/
|
44
|
-
|
50
|
+
getTimeString: () => string;
|
45
51
|
/**
|
46
52
|
* 添加天数
|
47
53
|
*/
|
48
|
-
|
54
|
+
addDays: (value: any, days: number) => Date;
|
49
55
|
/**
|
50
56
|
* 添加月份
|
51
57
|
*/
|
52
|
-
|
58
|
+
addMonths: (value: any, months: number) => Date;
|
53
59
|
/**
|
54
60
|
* 添加小时
|
55
61
|
*/
|
56
|
-
|
62
|
+
addHours: (value: any, hours: number) => Date;
|
57
63
|
/**
|
58
64
|
* 判断指定时间是否是周末
|
59
65
|
*/
|
60
|
-
|
66
|
+
isWeekend: (value: any) => boolean;
|
61
67
|
/**
|
62
68
|
* 把中国时间,转换为当地时间
|
63
69
|
*/
|
64
|
-
|
70
|
+
localeTime: (time: any) => Date;
|
65
71
|
}
|
66
|
-
export default
|
72
|
+
export default TimeUtil;
|