halo-fe 1.0.24 → 1.0.26
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -1
- package/dist/assets/{liquidjs-B8dqQyVv.js → liquidjs-C2HVw1Ra.js} +82 -81
- package/dist/main.js +4888 -4397
- package/dist/style.css +1 -1
- package/esm/@types/CreateFeOptions.d.ts +4 -0
- package/esm/coms/@types/PagerEmit.d.ts +11 -0
- package/esm/coms/@types/PagerProps.d.ts +18 -0
- package/esm/coms/@types/SocketProgressProps.d.ts +31 -0
- package/esm/coms/@types/TabProps.d.ts +11 -0
- package/esm/coms/@types/TableEmit.d.ts +10 -0
- package/esm/coms/@types/TableProps.d.ts +34 -0
- package/esm/coms/@types/index.d.ts +7 -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/@types/CodeIntelli.d.ts +6 -0
- package/esm/coms/controls/@types/CodeProps.d.ts +31 -2
- package/esm/coms/controls/@types/Range.d.ts +1 -1
- package/esm/coms/controls/Code.vue.d.ts +16 -28
- 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 +7 -8
- package/esm/coms/pagers/Index.vue.d.ts +9 -0
- package/esm/coms/pagers/index.d.ts +2 -0
- package/esm/coms/progresses/Circle.vue.d.ts +2 -0
- package/esm/coms/progresses/Index.vue.d.ts +9 -0
- package/esm/coms/progresses/SocketProgress.vue.d.ts +7 -9
- package/esm/coms/progresses/Spinner.vue.d.ts +20 -0
- package/esm/coms/progresses/index.d.ts +3 -2
- package/esm/coms/tables/Index.vue.d.ts +33 -0
- package/esm/coms/tabs/Tab.vue.d.ts +2 -2
- package/esm/coms/tabs/TabPane.vue.d.ts +1 -1
- package/esm/drivers/@types/IOpen.d.ts +1 -1
- package/esm/drivers/builders/BuilderFactory.d.ts +1 -1
- package/esm/drivers/cdns/Cdn.d.ts +7 -9
- package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
- package/esm/drivers/cdns/ICdn.d.ts +2 -11
- package/esm/drivers/encoders/Encoder.d.ts +1 -1
- package/esm/drivers/encoders/EncoderFactory.d.ts +3 -2
- package/esm/drivers/encoders/IEncoder.d.ts +2 -5
- package/esm/drivers/encoders/implement/Base64Encoder.d.ts +1 -1
- package/esm/drivers/encoders/implement/UrlEncoder.d.ts +7 -0
- package/esm/drivers/excels/Excel.d.ts +1 -1
- package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
- package/esm/drivers/excels/implements/XlsxExcel.d.ts +1 -1
- package/esm/drivers/explainers/ExplainerFactory.d.ts +2 -2
- package/esm/drivers/features/FeatureFactory.d.ts +2 -2
- package/esm/drivers/features/IFeature.d.ts +2 -6
- package/esm/drivers/features/implements/ExpressionFeature.d.ts +1 -1
- package/esm/drivers/features/implements/I18NFeature.d.ts +1 -1
- package/esm/drivers/features/implements/SortFeature.d.ts +1 -1
- package/esm/drivers/hashers/Hasher.d.ts +1 -1
- package/esm/drivers/hashers/HasherFactory.d.ts +2 -2
- package/esm/drivers/hashers/IHasher.d.ts +2 -5
- package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
- package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
- package/esm/drivers/https/Http.d.ts +22 -7
- package/esm/drivers/https/HttpFactory.d.ts +2 -7
- package/esm/drivers/https/IHttp.d.ts +16 -12
- package/esm/drivers/https/entities/HttpModel.d.ts +12 -0
- package/esm/drivers/https/entities/HttpResponse.d.ts +5 -1
- package/esm/drivers/https/implements/DefaultHttp.d.ts +1 -1
- package/esm/drivers/https/implements/HaloHttp.d.ts +2 -10
- package/esm/drivers/https/implements/MkHttp.d.ts +2 -3
- package/esm/drivers/i18ns/I18n.d.ts +1 -1
- package/esm/drivers/i18ns/I18nFactory.d.ts +1 -1
- package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +1 -1
- package/esm/drivers/index.d.ts +52 -1
- package/esm/drivers/messengers/MessengerFactory.d.ts +2 -2
- package/esm/drivers/providers/IProvider.d.ts +19 -15
- package/esm/drivers/providers/Provider.d.ts +11 -9
- package/esm/drivers/providers/ProviderFactory.d.ts +5 -9
- package/esm/drivers/providers/implements/CookieProvider.d.ts +8 -8
- package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +20 -10
- package/esm/drivers/providers/implements/StorageProvider.d.ts +8 -8
- package/esm/drivers/signers/ISigner.d.ts +1 -1
- package/esm/drivers/signers/Signer.d.ts +1 -1
- package/esm/drivers/signers/SignerFactory.d.ts +2 -2
- package/esm/drivers/signers/implements/DefaultSigner.d.ts +1 -1
- package/esm/drivers/sockets/@types/SubscribedWindow.d.ts +16 -0
- package/esm/drivers/sockets/@types/index.d.ts +2 -0
- package/esm/drivers/sockets/ISocket.d.ts +39 -0
- package/esm/drivers/sockets/Socket.d.ts +17 -0
- package/esm/drivers/sockets/SocketFactory.d.ts +13 -0
- package/esm/drivers/sockets/entities/SocketProgress.d.ts +34 -0
- package/esm/drivers/sockets/entities/SocketResponse.d.ts +26 -0
- package/esm/drivers/sockets/entities/index.d.ts +3 -0
- package/esm/drivers/sockets/implement/DefaultSocket.d.ts +37 -0
- package/esm/drivers/sockets/index.d.ts +4 -0
- package/esm/drivers/ssos/ISso.d.ts +1 -1
- package/esm/drivers/ssos/Sso.d.ts +1 -1
- package/esm/drivers/ssos/SsoFactory.d.ts +2 -2
- package/esm/drivers/ssos/implements/AnonymousSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/BearerSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/NioSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/SecretSso.d.ts +1 -1
- package/esm/drivers/ssos/implements/WeiXinSso.d.ts +1 -1
- package/esm/drivers/tasks/ITask.d.ts +10 -3
- package/esm/drivers/tasks/Task.d.ts +2 -1
- package/esm/drivers/tasks/TaskFactory.d.ts +2 -2
- package/esm/drivers/tasks/implement/MemoryTask.d.ts +5 -3
- package/esm/drivers/templates/TemplateFactory.d.ts +2 -2
- 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 +58 -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/drivers/utilities/IUtility.d.ts +3 -0
- package/esm/drivers/utilities/Utility.d.ts +3 -0
- package/esm/drivers/utilities/UtilityFactory.d.ts +6 -6
- package/esm/drivers/utilities/implement/EventUtility.d.ts +3 -6
- package/esm/drivers/utilities/implement/SaveUtility.d.ts +48 -3
- package/esm/drivers/videos/VideoFactory.d.ts +2 -2
- package/esm/drivers/voices/VoiceFactory.d.ts +2 -2
- package/esm/factory/Factories.d.ts +99 -0
- package/esm/factory/Factory.d.ts +41 -0
- package/esm/factory/IFactory.d.ts +40 -0
- package/esm/factory/Utils.d.ts +29 -0
- package/esm/factory/index.d.ts +4 -0
- package/esm/factorying/Factories.d.ts +9 -5
- package/esm/factorying/Factory.d.ts +7 -10
- package/esm/factorying/IFactory.d.ts +7 -3
- package/esm/factorying/Utils.d.ts +24 -9
- package/esm/factorying/index.d.ts +7 -2
- package/esm/main.d.ts +1 -2
- package/esm/repos/Repo.d.ts +5 -0
- package/esm/repos/RepoFactory.d.ts +20 -1
- package/esm/repos/implements/PageRepo.d.ts +30 -0
- package/esm/repos/implements/QueryRepo.d.ts +64 -0
- package/esm/repos/implements/SettingRepo.d.ts +1 -0
- package/esm/repos/index.d.ts +10 -1
- package/esm/svcs/SvcFactory.d.ts +1 -1
- package/esm/svcs/implement/ConfigSvc.d.ts +8 -8
- package/esm/svcs/implement/DriverSvc.d.ts +1 -35
- package/esm/svcs/index.d.ts +6 -17
- package/package.json +10 -10
@@ -1,5 +1,5 @@
|
|
1
1
|
import ISso from "./ISso";
|
2
|
-
import Factory from "../../
|
2
|
+
import Factory from "../../factory/Factory";
|
3
3
|
/**
|
4
4
|
* SSO工厂类
|
5
5
|
*/
|
@@ -7,7 +7,7 @@ declare class SsoFactory extends Factory<ISso> {
|
|
7
7
|
/**
|
8
8
|
* 获取实例
|
9
9
|
*/
|
10
|
-
|
10
|
+
open(): void;
|
11
11
|
/**
|
12
12
|
* 获取指定SSO实例
|
13
13
|
*/
|
@@ -3,6 +3,9 @@ import { IDriver, IDispose } from "../@types";
|
|
3
3
|
* 任务接口
|
4
4
|
*/
|
5
5
|
interface ITask extends IDriver, IDispose {
|
6
|
+
/**
|
7
|
+
* 任务并发数量限制
|
8
|
+
*/
|
6
9
|
taskLimit: number;
|
7
10
|
/**
|
8
11
|
* 多线程执行任务,会在主线程空闲时按顺序执行
|
@@ -11,14 +14,18 @@ interface ITask extends IDriver, IDispose {
|
|
11
14
|
/**
|
12
15
|
* 按照频控去执行任务
|
13
16
|
*/
|
14
|
-
|
17
|
+
frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
15
18
|
/**
|
16
19
|
* 按照并发数量控制多个任务执行
|
17
20
|
* handler不能直接放置promise,因为promise被传递前的实例化过程就会执行内部方法
|
18
|
-
* 场景:通过并发数为1
|
21
|
+
* 场景:通过并发数为1,控制不通类库在并发加载时,define函数冲突问题
|
19
22
|
* 注意:是相同时间的并发数控制,不是1s内的并发数控制
|
20
23
|
*/
|
21
|
-
concurrent<T>(handler: () => Promise<T
|
24
|
+
concurrent<T>(handler: () => Promise<T>, limit?: number): Promise<T>;
|
25
|
+
/**
|
26
|
+
* 事件防抖: time ms没重复触发才执行指定操作
|
27
|
+
*/
|
28
|
+
debounce(fn: (args: any) => Promise<void>, time: number, args?: any): void;
|
22
29
|
/**
|
23
30
|
* 每间隔指定时间执行指定任务
|
24
31
|
*/
|
@@ -6,8 +6,9 @@ declare abstract class Task implements ITask {
|
|
6
6
|
type: string;
|
7
7
|
taskLimit: number;
|
8
8
|
abstract execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
9
|
-
abstract
|
9
|
+
abstract frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
10
10
|
abstract concurrent<T>(handler: () => Promise<T>): Promise<T>;
|
11
|
+
abstract debounce(fn: (args: any) => Promise<void>, time: number, args?: any): void;
|
11
12
|
abstract interval(ms: number, task: () => void): void;
|
12
13
|
abstract dispose(): void;
|
13
14
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import Factory from "../../
|
1
|
+
import Factory from "../../factory/Factory";
|
2
2
|
import ITask from "./ITask";
|
3
3
|
/**
|
4
4
|
* 任务工厂类
|
5
5
|
*/
|
6
6
|
declare class TaskFactory extends Factory<ITask> {
|
7
|
-
|
7
|
+
open(): void;
|
8
8
|
}
|
9
9
|
export default TaskFactory;
|
@@ -6,22 +6,24 @@ declare class MemoryTask extends Task {
|
|
6
6
|
type: string;
|
7
7
|
intervalTimeout: any;
|
8
8
|
execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
9
|
-
|
9
|
+
frequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
10
10
|
/**
|
11
11
|
* 待执行的任务队列
|
12
12
|
*/
|
13
13
|
tasks: (() => Promise<any>)[];
|
14
|
-
taskLimit: number;
|
15
14
|
taskExecuting: number;
|
16
15
|
taskResolves: ((value: any) => void)[];
|
17
16
|
/**
|
18
17
|
* 相同时间的并发数控制,不是1s内的并发数控制
|
19
18
|
*/
|
20
|
-
concurrent<T>(handler: () => Promise<T
|
19
|
+
concurrent<T>(handler: () => Promise<T>, limit?: number): Promise<T>;
|
21
20
|
/**
|
22
21
|
* 按照并发执行
|
23
22
|
*/
|
24
23
|
private run;
|
24
|
+
lastDebounceTime: number;
|
25
|
+
lastDebounceTimeout: any;
|
26
|
+
debounce: (fn: (args: any) => Promise<void>, time: number, args?: any) => void;
|
25
27
|
interval(ms: number, task: () => void): void;
|
26
28
|
dispose(): void;
|
27
29
|
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import Factory from "../../
|
1
|
+
import Factory from "../../factory/Factory";
|
2
2
|
import ITemplate from "./ITemplate";
|
3
3
|
/**
|
4
4
|
* 模板工厂
|
5
5
|
*/
|
6
6
|
declare class TemplateFactory extends Factory<ITemplate> {
|
7
|
-
|
7
|
+
open(): void;
|
8
8
|
}
|
9
9
|
export default TemplateFactory;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import Factory from "../../factory/Factory";
|
2
|
+
import IUtil from "./IUtil";
|
3
|
+
import { ArrayUtil, BrowserUtil, ComponentUtil, DictionaryUtil, DomUtil, EventUtil, FileUtil, HtmlUtil, ImageUtil, JsonUtil, MathUtil, MicroUtil, MountUtil, ObjectUtil, ScrollUtil, SignUtil, StringUtil, TaskUtil, TimeUtil, TreeUtil, TypeUtil, UrlUtil } from "./";
|
4
|
+
/**
|
5
|
+
* 帮助类工厂
|
6
|
+
*/
|
7
|
+
declare class UtilFactory extends Factory<IUtil> {
|
8
|
+
open(): void;
|
9
|
+
get array(): ArrayUtil;
|
10
|
+
get browser(): BrowserUtil;
|
11
|
+
get component(): ComponentUtil;
|
12
|
+
get dom(): DomUtil;
|
13
|
+
get dictionary(): DictionaryUtil;
|
14
|
+
get event(): EventUtil;
|
15
|
+
get file(): FileUtil;
|
16
|
+
get html(): HtmlUtil;
|
17
|
+
get image(): ImageUtil;
|
18
|
+
get json(): JsonUtil;
|
19
|
+
get math(): MathUtil;
|
20
|
+
get mount(): MountUtil;
|
21
|
+
get object(): ObjectUtil;
|
22
|
+
get micro(): MicroUtil;
|
23
|
+
get scroll(): ScrollUtil;
|
24
|
+
get string(): StringUtil;
|
25
|
+
get task(): TaskUtil;
|
26
|
+
get type(): TypeUtil;
|
27
|
+
get time(): TimeUtil;
|
28
|
+
get tree(): TreeUtil;
|
29
|
+
get url(): UrlUtil;
|
30
|
+
get sign(): SignUtil;
|
31
|
+
}
|
32
|
+
export default UtilFactory;
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 数组帮助类
|
4
|
+
*/
|
5
|
+
declare class ArrayUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 获取指定数组分成每片指定长度后的集合
|
9
|
+
*/
|
10
|
+
getChunks: (entities: any[], size: number) => any[][];
|
11
|
+
/**
|
12
|
+
* 获取分成指定片数量后的集合
|
13
|
+
*/
|
14
|
+
getChunksByCount(entities: any[], count: number): any[][];
|
15
|
+
/**
|
16
|
+
* 获取指定开始位置的指定数量的集合
|
17
|
+
*/
|
18
|
+
getRange(entities: any[], index: number, count?: number): any[];
|
19
|
+
/**
|
20
|
+
* 获取最后length个元素
|
21
|
+
*/
|
22
|
+
getLast(entities: string[], length: number): string[];
|
23
|
+
/**
|
24
|
+
* 取两个集合的交集
|
25
|
+
*/
|
26
|
+
intersect: (arr1: any[], arr2: any[]) => any[];
|
27
|
+
/**
|
28
|
+
* 排除指定元素(差集)
|
29
|
+
*/
|
30
|
+
except: (from: any[], target: any[] | any, equals?: (a: any, b: any) => boolean) => any[];
|
31
|
+
/**
|
32
|
+
* 求最大值,数据类型的比较函数要自己转换为数值类型
|
33
|
+
*/
|
34
|
+
max: (entities: any[], fn: Function) => any;
|
35
|
+
/**
|
36
|
+
* 求最小值,数据类型的比较函数要自己转换为数值类型
|
37
|
+
*/
|
38
|
+
min: (entities: any[], fn: Function) => any;
|
39
|
+
/**
|
40
|
+
* 求平均值
|
41
|
+
*/
|
42
|
+
avg: (entities: any[], fn: Function, digits?: number) => number;
|
43
|
+
/**
|
44
|
+
* 求和
|
45
|
+
*/
|
46
|
+
sum: (entities: any[], fn: Function, digits?: number) => number;
|
47
|
+
/**
|
48
|
+
* 是否包含
|
49
|
+
*/
|
50
|
+
contains: (arr: any[], element: any) => boolean;
|
51
|
+
/**
|
52
|
+
* 判断指定集合中的指定属性的值,是否包含关键词
|
53
|
+
*/
|
54
|
+
filterContains: (arr: any[], props: string[], keywords: string) => any[];
|
55
|
+
/**
|
56
|
+
* 判断2个数组是否每个元素都相同
|
57
|
+
*/
|
58
|
+
same: (arr1: any[], arr2: any[]) => boolean;
|
59
|
+
/**
|
60
|
+
* 对数组元素根据指定函数进行去重,并返回去重后的值的新数组 n=>n.value
|
61
|
+
*/
|
62
|
+
distinct: (entities: any[], selector: Function) => any[];
|
63
|
+
/**
|
64
|
+
* 创建集合
|
65
|
+
*/
|
66
|
+
from(entities: any): any[];
|
67
|
+
/**
|
68
|
+
* 连接值构建成新数组,重复项也会自动构建,不存在的值,会自动创建为一个新项
|
69
|
+
*/
|
70
|
+
fromValues: (arrValues: any[], arr: any[], propertyValue: string, propertyText: string) => any[];
|
71
|
+
/**
|
72
|
+
* 分割指定字符串为数组,字符串为空,返回空数组
|
73
|
+
* @param input
|
74
|
+
* @param split
|
75
|
+
* @param element 转换后添加的默认元素
|
76
|
+
*/
|
77
|
+
split: (input: string, split: string, element?: any) => any[];
|
78
|
+
/**
|
79
|
+
* 合并多个数组中的每一项到新的二维数组中,没值的元素被有值的元素代替
|
80
|
+
*/
|
81
|
+
combine: (...args: any[]) => any[];
|
82
|
+
/**
|
83
|
+
* 在指定元素前插入新元素,返回插入元素的索引
|
84
|
+
*/
|
85
|
+
insert: (entities: object[], selectedRow: object, row: object) => number;
|
86
|
+
/**
|
87
|
+
* 在指定元素后插入新元素,返回插入元素的索引
|
88
|
+
*/
|
89
|
+
append: (entities: object[], selectedRow: object, row: object) => number;
|
90
|
+
/**
|
91
|
+
* 不存在某元素时才添加某元素
|
92
|
+
*/
|
93
|
+
pushIfNotExist: (entities: any[], element: any) => void;
|
94
|
+
/**
|
95
|
+
* 把集合创建成另一个集合
|
96
|
+
*/
|
97
|
+
create<T>(entities: any[], handler: (entity: any, i: number) => T): T[];
|
98
|
+
/**
|
99
|
+
* 删除执行数组中的指定对象或者集合
|
100
|
+
*/
|
101
|
+
remove: (entities: any[], elements: any[] | any) => void;
|
102
|
+
/**
|
103
|
+
* 删除指定元素,并返回删除后的字符串
|
104
|
+
*/
|
105
|
+
removeIndex: (str: string, index: number, split: string) => string;
|
106
|
+
/**
|
107
|
+
* 按照指定函数对数组排序
|
108
|
+
*/
|
109
|
+
orderBy: (entities: any[], orderByFns: Function | Function[], order?: "asc" | "desc" | null) => any[];
|
110
|
+
/**
|
111
|
+
* 分组,封装成字典而不是集合,大数据场景速度提升百倍
|
112
|
+
*/
|
113
|
+
groupBy: (entities: any[], keyHandler: (entity: any) => any, valueHandler?: (item: any[]) => any) => object;
|
114
|
+
/**
|
115
|
+
* 分组
|
116
|
+
*/
|
117
|
+
groupByArray: (entities: any[], keyFn: (item: any) => any) => any[];
|
118
|
+
/**
|
119
|
+
* 替换指定元素为新元素,不存在则添加
|
120
|
+
*/
|
121
|
+
replaceOrAdd(entities: any[], selectFn: (value: any) => boolean, replacement: any): void;
|
122
|
+
}
|
123
|
+
export default ArrayUtil;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 组件帮助类
|
4
|
+
*/
|
5
|
+
declare class ComponentUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 根据动态加载的组件对象,得到组件集合
|
9
|
+
*/
|
10
|
+
getComponents(components: object, replace: string, prefix?: string): object;
|
11
|
+
/**
|
12
|
+
* 获取部分自定义组件名称
|
13
|
+
*/
|
14
|
+
getName: (url: string, prefix: string) => string;
|
15
|
+
/**
|
16
|
+
* 检测异步控件是否加载完毕
|
17
|
+
*/
|
18
|
+
detectLoaded(ref: any, cb: Function): void;
|
19
|
+
}
|
20
|
+
export default ComponentUtil;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import Util from "../Util";
|
2
|
+
/**
|
3
|
+
* 字典帮助类
|
4
|
+
*/
|
5
|
+
declare class DictionaryUtil extends Util {
|
6
|
+
type: string;
|
7
|
+
/**
|
8
|
+
* 从指定字典中提取忽略大小写的key的值
|
9
|
+
*/
|
10
|
+
getValueIgnoreCase<T>(key: string, value: {
|
11
|
+
[key: string]: T;
|
12
|
+
}): T;
|
13
|
+
/**
|
14
|
+
* 对字典进行排序,并得到新字典
|
15
|
+
*/
|
16
|
+
sort(obj: object): any;
|
17
|
+
/**
|
18
|
+
* 连接字典
|
19
|
+
*/
|
20
|
+
join(obj: object, valueHandler?: (value: string) => string, delimiter?: string, join?: string): string;
|
21
|
+
/**
|
22
|
+
* 把字典转换成数组
|
23
|
+
*/
|
24
|
+
toList(entity: {
|
25
|
+
[key: string]: any[];
|
26
|
+
}, valueHandler: (entity: {
|
27
|
+
key: string;
|
28
|
+
value: any;
|
29
|
+
}) => void): {
|
30
|
+
key: string;
|
31
|
+
value: any[];
|
32
|
+
}[];
|
33
|
+
/**
|
34
|
+
* 判断字典是否包含值
|
35
|
+
*/
|
36
|
+
containsValue(dic: {
|
37
|
+
[key: string]: any;
|
38
|
+
}, value: any): boolean;
|
39
|
+
}
|
40
|
+
export default DictionaryUtil;
|
@@ -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, fn: Function) => void;
|
11
|
+
/**
|
12
|
+
* 批量绑定事件,执行指定处理函数
|
13
|
+
*/
|
14
|
+
unbind: (events: any[], dom: any, fn: Function) => void;
|
15
|
+
/**
|
16
|
+
* 绑定点击处理函数
|
17
|
+
*/
|
18
|
+
click: (dom: any, fn: Function) => void;
|
19
|
+
/**
|
20
|
+
* 解除点击监听
|
21
|
+
*/
|
22
|
+
unclick: (dom: any, fn: Function) => void;
|
23
|
+
/**
|
24
|
+
* 绑定滚动处理函数
|
25
|
+
*/
|
26
|
+
scroll: (dom: any, fn: Function) => void;
|
27
|
+
/**
|
28
|
+
* 移除滚动处理函数,防止内存泄漏
|
29
|
+
*/
|
30
|
+
unscroll: (dom: any, fn: 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;
|