@kengic/vue 0.27.2-beta.1 → 0.27.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kengic-vue.js +8483 -6575
- package/dist/src/component/KgWarehouse/KgWarehouse.hooks.d.ts +1 -7
- package/dist/src/project/src/components/Application/src/useAppContext.d.ts +9 -0
- package/dist/src/project/src/components/index.d.ts +1 -0
- package/dist/src/project/src/hooks/component/useFormItem.d.ts +2 -0
- package/dist/src/project/src/hooks/component/usePageContext.d.ts +10 -0
- package/dist/src/project/src/hooks/core/onMountedOrActivated.d.ts +1 -0
- package/dist/src/project/src/hooks/core/useAttrs.d.ts +9 -0
- package/dist/src/project/src/hooks/core/useContext.d.ts +11 -0
- package/dist/src/project/src/hooks/core/useRefs.d.ts +2 -0
- package/dist/src/project/src/hooks/core/useTimeout.d.ts +10 -0
- package/dist/src/project/src/hooks/event/useBreakpoint.d.ts +22 -0
- package/dist/src/project/src/hooks/event/useEventListener.d.ts +14 -0
- package/dist/src/project/src/hooks/event/useIntersectionObserver.d.ts +13 -0
- package/dist/src/project/src/hooks/event/useScrollTo.d.ts +10 -0
- package/dist/src/project/src/hooks/event/useWindowSizeFn.d.ts +7 -0
- package/dist/src/project/src/hooks/index.d.ts +20 -0
- package/dist/src/project/src/hooks/jeecg/useAdaptiveWidth.d.ts +18 -0
- package/dist/src/project/src/hooks/web/useAppInject.d.ts +3 -0
- package/dist/src/project/src/hooks/web/useContentHeight.d.ts +24 -0
- package/dist/src/project/src/hooks/web/useCopyToClipboard.d.ts +10 -0
- package/dist/src/project/src/hooks/web/useDesign.d.ts +4 -0
- package/dist/src/project/src/hooks/web/usePage.d.ts +10 -0
- package/dist/src/project/src/hooks/web/usePagination.d.ts +7 -0
- package/dist/src/project/src/hooks/web/useWebSocket.d.ts +18 -0
- package/dist/src/project/src/index.d.ts +3 -8
- package/dist/src/project/src/layouts/default/content/useContentContext.d.ts +9 -0
- package/dist/src/project/src/layouts/default/content/useContentViewHeight.d.ts +7 -0
- package/dist/src/project/src/layouts/index.d.ts +2 -0
- package/dist/src/project/src/router/constant2.d.ts +3 -0
- package/dist/src/project/src/router/index.d.ts +2 -0
- package/dist/src/project/src/settings/index.d.ts +1 -0
- package/dist/src/project/src/settings/projectSetting.d.ts +3 -0
- package/dist/src/project/src/utils/auth/index.d.ts +19 -0
- package/dist/src/project/src/utils/bem.d.ts +15 -0
- package/dist/src/project/src/utils/color.d.ts +29 -0
- package/dist/src/project/src/utils/common/compUtils.d.ts +87 -0
- package/dist/src/project/src/utils/common/functionUtils.d.ts +6 -0
- package/dist/src/project/src/utils/dateUtil.d.ts +4 -0
- package/dist/src/project/src/utils/domUtils.d.ts +28 -0
- package/dist/src/project/src/utils/encryption/signMd5Utils.d.ts +29 -0
- package/dist/src/project/src/utils/event/index.d.ts +3 -0
- package/dist/src/project/src/utils/factory/createAsyncComponent.d.ts +9 -0
- package/dist/src/project/src/utils/file/base64Conver.d.ts +4 -0
- package/dist/src/project/src/utils/file/download.d.ts +9 -0
- package/dist/src/project/src/utils/helper/treeHelper.d.ts +34 -0
- package/dist/src/project/src/utils/helper/tsxHelper.d.ts +13 -0
- package/dist/src/project/src/utils/index.d.ts +26 -0
- package/dist/src/project/src/utils/index.index.d.ts +42 -0
- package/dist/src/project/src/utils/is.d.ts +17 -0
- package/dist/src/project/src/utils/mitt.d.ts +26 -0
- package/dist/src/project/src/utils/props.d.ts +68 -0
- package/dist/src/project/src/utils/uuid.d.ts +2 -0
- package/package.json +4 -1
@@ -1,5 +1,4 @@
|
|
1
1
|
import { IRemoveEventListener } from '@kengic/core.core';
|
2
|
-
import { Pinia } from 'pinia';
|
3
2
|
import { ComputedRef } from 'vue';
|
4
3
|
import { IKgWarehouseOnMountedEventListener } from './KgWarehouse.event';
|
5
4
|
import { IKgWarehouseStore } from './KgWarehouse.store';
|
@@ -20,9 +19,4 @@ export declare type IUseKgWarehouse = {
|
|
20
19
|
*/
|
21
20
|
warehouse: ComputedRef<IKgWarehouseStore['getWarehouse']>;
|
22
21
|
};
|
23
|
-
|
24
|
-
* 在某些地方调用时(比如在路由守卫中), pinia 尚未设置, 此时需要手动传入 pinia 实例.
|
25
|
-
*
|
26
|
-
* @param pinia
|
27
|
-
*/
|
28
|
-
export declare function useKgWarehouse(pinia?: Pinia): IUseKgWarehouse;
|
22
|
+
export declare function useKgWarehouse(): IUseKgWarehouse;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
export interface AppProviderContextProps {
|
3
|
+
prefixCls: Ref<string>;
|
4
|
+
isMobile: Ref<boolean>;
|
5
|
+
}
|
6
|
+
export declare function createAppProviderContext(context: AppProviderContextProps): {
|
7
|
+
state: any;
|
8
|
+
};
|
9
|
+
export declare function useAppProviderContext(): AppProviderContextProps;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
2
|
+
export interface PageContextProps {
|
3
|
+
contentHeight: ComputedRef<number>;
|
4
|
+
pageHeight: Ref<number>;
|
5
|
+
setPageHeight: (height: number) => Promise<void>;
|
6
|
+
}
|
7
|
+
export declare function createPageContext(context: PageContextProps): {
|
8
|
+
state: any;
|
9
|
+
};
|
10
|
+
export declare function usePageContext(): PageContextProps;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function onMountedOrActivated(hook: Fn): void;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { Ref } from 'vue';
|
2
|
+
interface Params {
|
3
|
+
excludeListeners?: boolean;
|
4
|
+
excludeKeys?: string[];
|
5
|
+
excludeDefaultKeys?: boolean;
|
6
|
+
}
|
7
|
+
export declare function entries<T>(obj: Recordable<T>): [string, T][];
|
8
|
+
export declare function useAttrs(params?: Params): Ref<Recordable> | {};
|
9
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { InjectionKey } from 'vue';
|
2
|
+
export interface CreateContextOptions {
|
3
|
+
readonly?: boolean;
|
4
|
+
createProvider?: boolean;
|
5
|
+
native?: boolean;
|
6
|
+
}
|
7
|
+
export declare function createContext<T>(context: any, key?: InjectionKey<T>, options?: CreateContextOptions): {
|
8
|
+
state: any;
|
9
|
+
};
|
10
|
+
export declare function useContext<T>(key: InjectionKey<T>, native?: boolean): T;
|
11
|
+
export declare function useContext<T>(key: InjectionKey<T>, defaultValue?: any, native?: boolean): T;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare function useTimeoutFn(handle: Fn<any>, wait: number, native?: boolean): {
|
2
|
+
readyRef: import("vue").Ref<boolean>;
|
3
|
+
stop: () => void;
|
4
|
+
start: () => void;
|
5
|
+
};
|
6
|
+
export declare function useTimeoutRef(wait: number): {
|
7
|
+
readyRef: import("vue").Ref<boolean>;
|
8
|
+
stop: () => void;
|
9
|
+
start: () => void;
|
10
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ComputedRef } from 'vue';
|
2
|
+
import { screenEnum, sizeEnum } from '../../enums';
|
3
|
+
export interface CreateCallbackParams {
|
4
|
+
screen: ComputedRef<sizeEnum | undefined>;
|
5
|
+
width: ComputedRef<number>;
|
6
|
+
realWidth: ComputedRef<number>;
|
7
|
+
screenEnum: typeof screenEnum;
|
8
|
+
screenMap: Map<sizeEnum, number>;
|
9
|
+
sizeEnum: typeof sizeEnum;
|
10
|
+
}
|
11
|
+
export declare function useBreakpoint(): {
|
12
|
+
screenRef: ComputedRef<sizeEnum | undefined>;
|
13
|
+
widthRef: ComputedRef<number>;
|
14
|
+
screenEnum: typeof screenEnum;
|
15
|
+
realWidthRef: ComputedRef<number>;
|
16
|
+
};
|
17
|
+
export declare function createBreakpointListen(fn?: (opt: CreateCallbackParams) => void): {
|
18
|
+
screenRef: ComputedRef<sizeEnum | undefined>;
|
19
|
+
screenEnum: typeof screenEnum;
|
20
|
+
widthRef: ComputedRef<number>;
|
21
|
+
realWidthRef: ComputedRef<number>;
|
22
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { Ref } from 'vue';
|
2
|
+
export declare type RemoveEventFn = () => void;
|
3
|
+
export interface UseEventParams {
|
4
|
+
el?: Element | Ref<Element | undefined> | Window | any;
|
5
|
+
name: string;
|
6
|
+
listener: EventListener;
|
7
|
+
options?: boolean | AddEventListenerOptions;
|
8
|
+
autoRemove?: boolean;
|
9
|
+
isDebounce?: boolean;
|
10
|
+
wait?: number;
|
11
|
+
}
|
12
|
+
export declare function useEventListener({ el, name, listener, options, autoRemove, isDebounce, wait }: UseEventParams): {
|
13
|
+
removeEvent: RemoveEventFn;
|
14
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
interface IntersectionObserverProps {
|
3
|
+
target: Ref<Element | null | undefined>;
|
4
|
+
root?: Ref<any>;
|
5
|
+
onIntersect: IntersectionObserverCallback;
|
6
|
+
rootMargin?: string;
|
7
|
+
threshold?: number;
|
8
|
+
}
|
9
|
+
export declare function useIntersectionObserver({ target, root, onIntersect, rootMargin, threshold }: IntersectionObserverProps): {
|
10
|
+
observer: Ref<Nullable<IntersectionObserver>>;
|
11
|
+
stop: () => void;
|
12
|
+
};
|
13
|
+
export {};
|
@@ -1,2 +1,22 @@
|
|
1
|
+
export * from './component/usePageContext';
|
2
|
+
export * from './component/useFormItem';
|
3
|
+
export * from './core/onMountedOrActivated';
|
4
|
+
export * from './core/useAttrs';
|
5
|
+
export * from './core/useContext';
|
6
|
+
export * from './core/useRefs';
|
7
|
+
export * from './core/useTimeout';
|
8
|
+
export * from './event/useBreakpoint';
|
9
|
+
export * from './event/useEventListener';
|
10
|
+
export * from './event/useIntersectionObserver';
|
11
|
+
export * from './event/useScrollTo';
|
12
|
+
export * from './event/useWindowSizeFn';
|
13
|
+
export * from './jeecg/useAdaptiveWidth';
|
1
14
|
export * from './setting/index';
|
15
|
+
export * from './web/useAppInject';
|
16
|
+
export * from './web/useContentHeight';
|
17
|
+
export * from './web/useCopyToClipboard';
|
18
|
+
export * from './web/useDesign';
|
2
19
|
export * from './web/useI18n';
|
20
|
+
export * from './web/usePage';
|
21
|
+
export * from './web/usePagination';
|
22
|
+
export * from './web/useWebSocket';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
declare type configType = Record<string, string | number>;
|
2
|
+
/**
|
3
|
+
* 自适应宽度
|
4
|
+
*
|
5
|
+
* @param widthConfig 宽度配置,可参考 defWidthConfig 配置
|
6
|
+
* @param assign 是否合并默认配置
|
7
|
+
* @param debounce 去抖毫秒数
|
8
|
+
*/
|
9
|
+
export declare function useAdaptiveWidth(widthConfig?: configType, assign?: boolean, debounce?: number): {
|
10
|
+
adaptiveWidth: import("vue").Ref<string | number | undefined>;
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* 抽屉自适应宽度
|
14
|
+
*/
|
15
|
+
export declare function useDrawerAdaptiveWidth(): {
|
16
|
+
adaptiveWidth: import("vue").Ref<string | number | undefined>;
|
17
|
+
};
|
18
|
+
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
2
|
+
export interface CompensationHeight {
|
3
|
+
useLayoutFooter: boolean;
|
4
|
+
elements?: Ref[];
|
5
|
+
}
|
6
|
+
declare type Upward = number | string | null | undefined;
|
7
|
+
/**
|
8
|
+
* 动态计算内容高度,根据锚点dom最下坐标到屏幕最下坐标,根据传入dom的高度、padding、margin等值进行动态计算
|
9
|
+
* 最终获取合适的内容高度
|
10
|
+
*
|
11
|
+
* @param flag 用于开启计算的响应式标识
|
12
|
+
* @param anchorRef 锚点组件 Ref<ElRef | ComponentRef>
|
13
|
+
* @param subtractHeightRefs 待减去高度的组件列表 Ref<ElRef | ComponentRef>
|
14
|
+
* @param substractSpaceRefs 待减去空闲空间(margins/paddings)的组件列表 Ref<ElRef | ComponentRef>
|
15
|
+
* @param offsetHeightRef 计算偏移的响应式高度,计算高度时将直接减去此值
|
16
|
+
* @param upwardSpace 向上递归减去空闲空间的 层级 或 直到指定class为止 数值为2代表向上递归两次|数值为ant-layout表示向上递归直到碰见.ant-layout为止
|
17
|
+
* @returns 响应式高度
|
18
|
+
*/
|
19
|
+
export declare function useContentHeight(flag: ComputedRef<Boolean>, anchorRef: Ref, subtractHeightRefs: Ref[], substractSpaceRefs: Ref[], upwardSpace?: Ref<Upward> | ComputedRef<Upward> | Upward, offsetHeightRef?: Ref<number>): {
|
20
|
+
redoHeight: () => void;
|
21
|
+
setCompensation: (params: CompensationHeight) => void;
|
22
|
+
contentHeight: Ref<Nullable<number>>;
|
23
|
+
};
|
24
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
interface Options {
|
2
|
+
target?: HTMLElement;
|
3
|
+
}
|
4
|
+
export declare function useCopyToClipboard(initial?: string): {
|
5
|
+
clipboardRef: import("vue").Ref<string>;
|
6
|
+
isSuccessRef: import("vue").Ref<boolean>;
|
7
|
+
copiedRef: import("vue").Ref<boolean>;
|
8
|
+
};
|
9
|
+
export declare function copyTextToClipboard(input: string, { target }?: Options): boolean;
|
10
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { RouteLocationRaw, Router } from 'vue-router';
|
2
|
+
import { PageEnum } from '../../enums/pageEnum';
|
3
|
+
export declare type RouteLocationRawEx = Omit<RouteLocationRaw, 'path'> & {
|
4
|
+
path: PageEnum;
|
5
|
+
};
|
6
|
+
export declare function useGo(_router?: Router): (opt?: PageEnum | RouteLocationRawEx | string, isReplace?: boolean) => void;
|
7
|
+
/**
|
8
|
+
* @description: redo current page
|
9
|
+
*/
|
10
|
+
export declare const useRedo: (_router?: Router) => () => Promise<boolean>;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Ref } from 'vue';
|
2
|
+
export declare function usePagination<T = any>(list: Ref<T[]>, pageSize: number): {
|
3
|
+
setCurrentPage: (page: number) => void;
|
4
|
+
getTotal: import("vue").ComputedRef<number>;
|
5
|
+
setPageSize: (pageSize: number) => void;
|
6
|
+
getPaginationList: import("vue").ComputedRef<T[]>;
|
7
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { WebSocketResult } from '@vueuse/core';
|
2
|
+
/**
|
3
|
+
* 开启 WebSocket 链接,全局只需执行一次
|
4
|
+
* @param url
|
5
|
+
*/
|
6
|
+
export declare function connectWebSocket(url: string): void;
|
7
|
+
/**
|
8
|
+
* 添加 WebSocket 消息监听
|
9
|
+
* @param callback
|
10
|
+
*/
|
11
|
+
export declare function onWebSocket(callback: (data: object) => any): void;
|
12
|
+
/**
|
13
|
+
* 解除 WebSocket 消息监听
|
14
|
+
*
|
15
|
+
* @param callback
|
16
|
+
*/
|
17
|
+
export declare function offWebSocket(callback: (data: object) => any): void;
|
18
|
+
export declare function useMyWebSocket(): WebSocketResult<any>;
|
@@ -2,14 +2,9 @@ export * from './api';
|
|
2
2
|
export * from './components';
|
3
3
|
export * from './enums';
|
4
4
|
export * from './hooks';
|
5
|
+
export * from './layouts';
|
5
6
|
export * from './locales';
|
7
|
+
export * from './router';
|
6
8
|
export * from './settings';
|
7
9
|
export * from './store';
|
8
|
-
export * from './
|
9
|
-
export * from './utils/cache/index';
|
10
|
-
export * from './utils/cache/memory';
|
11
|
-
export * from './utils/cache/persistent';
|
12
|
-
export * from './utils/cache/storageCache';
|
13
|
-
export * from './utils/cipher';
|
14
|
-
export * from './utils/env';
|
15
|
-
export * from './utils/propTypes';
|
10
|
+
export * from './utils';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
2
|
+
export interface ContentContextProps {
|
3
|
+
contentHeight: ComputedRef<number>;
|
4
|
+
setPageHeight: (height: number) => Promise<void>;
|
5
|
+
}
|
6
|
+
export declare function createContentContext(context: ContentContextProps): {
|
7
|
+
state: any;
|
8
|
+
};
|
9
|
+
export declare function useContentContext(): ContentContextProps;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare function useLayoutHeight(): {
|
2
|
+
headerHeightRef: import("vue").Ref<number>;
|
3
|
+
footerHeightRef: import("vue").Ref<number>;
|
4
|
+
setHeaderHeight: (val: any) => void;
|
5
|
+
setFooterHeight: (val: any) => void;
|
6
|
+
};
|
7
|
+
export declare function useContentViewHeight(): void;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { BasicKeys } from '../cache/persistent';
|
2
|
+
/**
|
3
|
+
* 获取token
|
4
|
+
*/
|
5
|
+
export declare function getToken(): string;
|
6
|
+
/**
|
7
|
+
* 获取租户id
|
8
|
+
*/
|
9
|
+
export declare function getTenantId(): string;
|
10
|
+
export declare function getAuthCache<T>(key: BasicKeys): T;
|
11
|
+
export declare function setAuthCache(key: BasicKeys, value: any): void;
|
12
|
+
/**
|
13
|
+
* 移除缓存中的某个属性
|
14
|
+
* @param key
|
15
|
+
* @update:移除缓存中的某个属性
|
16
|
+
* @updateBy:lsq
|
17
|
+
* @updateDate:2021-09-07
|
18
|
+
*/
|
19
|
+
export declare function removeAuthCache<T>(key: BasicKeys): T;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
declare type Mod = string | {
|
2
|
+
[key: string]: any;
|
3
|
+
};
|
4
|
+
declare type Mods = Mod | Mod[];
|
5
|
+
/**
|
6
|
+
* bem helper
|
7
|
+
* b() // 'button'
|
8
|
+
* b('text') // 'button__text'
|
9
|
+
* b({ disabled }) // 'button button--disabled'
|
10
|
+
* b('text', { disabled }) // 'button__text button__text--disabled'
|
11
|
+
* b(['disabled', 'primary']) // 'button button--disabled button--primary'
|
12
|
+
*/
|
13
|
+
export declare function buildBEM(name: string): (el?: Mods, mods?: Mods) => Mods;
|
14
|
+
export declare function createBEM(name: string): ((el?: Mods | undefined, mods?: Mods | undefined) => Mods)[];
|
15
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* 判断是否 十六进制颜色值.
|
3
|
+
* 输入形式可为 #fff000 #f00
|
4
|
+
*
|
5
|
+
* @param String color 十六进制颜色值
|
6
|
+
* @return Boolean
|
7
|
+
*/
|
8
|
+
export declare function isHexColor(color: string): boolean;
|
9
|
+
/**
|
10
|
+
* Transform a HEX color to its RGB representation
|
11
|
+
* @param {string} hex The color to transform
|
12
|
+
* @returns The RGB representation of the passed color
|
13
|
+
*/
|
14
|
+
export declare function hexToRGB(hex: string): string;
|
15
|
+
export declare function colorIsDark(color: string): boolean | undefined;
|
16
|
+
/**
|
17
|
+
* Darkens a HEX color given the passed percentage
|
18
|
+
* @param {string} color The color to process
|
19
|
+
* @param {number} amount The amount to change the color by
|
20
|
+
* @returns {string} The HEX representation of the processed color
|
21
|
+
*/
|
22
|
+
export declare function darken(color: string, amount: number): string;
|
23
|
+
/**
|
24
|
+
* Lightens a 6 char HEX color according to the passed percentage
|
25
|
+
* @param {string} color The color to change
|
26
|
+
* @param {number} amount The amount to change the color by
|
27
|
+
* @returns {string} The processed color represented as HEX
|
28
|
+
*/
|
29
|
+
export declare function lighten(color: string, amount: number): string;
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/**
|
2
|
+
* 获取文件服务访问路径
|
3
|
+
* @param fileUrl 文件路径
|
4
|
+
* @param prefix (默认http) 文件路径前缀 http/https
|
5
|
+
*/
|
6
|
+
export declare const getFileAccessHttpUrl: (fileUrl: any, prefix?: string) => any;
|
7
|
+
/**
|
8
|
+
* 触发 window.resize
|
9
|
+
*/
|
10
|
+
export declare function triggerWindowResizeEvent(): void;
|
11
|
+
/**
|
12
|
+
* 获取随机数
|
13
|
+
* @param length 数字位数
|
14
|
+
*/
|
15
|
+
export declare const getRandom: (length?: number) => string;
|
16
|
+
/**
|
17
|
+
* 随机生成字符串
|
18
|
+
* @param length 字符串的长度
|
19
|
+
* @param chats 可选字符串区间(只会生成传入的字符串中的字符)
|
20
|
+
* @return string 生成的字符串
|
21
|
+
*/
|
22
|
+
export declare function randomString(length: number, chats?: string): string;
|
23
|
+
/**
|
24
|
+
* 将普通列表数据转化为tree结构
|
25
|
+
* @param array tree数据
|
26
|
+
* @param opt 配置参数
|
27
|
+
* @param startPid 父节点
|
28
|
+
*/
|
29
|
+
export declare const listToTree: (array: any, opt: any, startPid: any) => any;
|
30
|
+
/**
|
31
|
+
* 递归构建tree
|
32
|
+
* @param array
|
33
|
+
* @param startPid
|
34
|
+
* @param currentDept
|
35
|
+
* @param opt
|
36
|
+
* @returns {Array}
|
37
|
+
*/
|
38
|
+
export declare const toTree: (array: any, startPid: any, currentDept: any, opt: any) => any;
|
39
|
+
/**
|
40
|
+
* 简单实现防抖方法
|
41
|
+
*
|
42
|
+
* 防抖(debounce)函数在第一次触发给定的函数时,不立即执行函数,而是给出一个期限值(delay),比如100ms。
|
43
|
+
* 如果100ms内再次执行函数,就重新开始计时,直到计时结束后再真正执行函数。
|
44
|
+
* 这样做的好处是如果短时间内大量触发同一事件,只会执行一次函数。
|
45
|
+
*
|
46
|
+
* @param fn 要防抖的函数
|
47
|
+
* @param delay 防抖的毫秒数
|
48
|
+
* @returns {Function}
|
49
|
+
*/
|
50
|
+
export declare function simpleDebounce(fn: any, delay?: number): () => void;
|
51
|
+
/**
|
52
|
+
* 日期格式化
|
53
|
+
* @param date 日期
|
54
|
+
* @param block 格式化字符串
|
55
|
+
*/
|
56
|
+
export declare function dateFormat(date: any, block: any): any;
|
57
|
+
/**
|
58
|
+
* 如果值不存在就 push 进数组,反之不处理
|
59
|
+
* @param array 要操作的数据
|
60
|
+
* @param value 要添加的值
|
61
|
+
* @param key 可空,如果比较的是对象,可能存在地址不一样但值实际上是一样的情况,可以传此字段判断对象中唯一的字段,例如 id。不传则直接比较实际值
|
62
|
+
* @returns {boolean} 成功 push 返回 true,不处理返回 false
|
63
|
+
*/
|
64
|
+
export declare function pushIfNotExist(array: any, value: any, key?: any): boolean;
|
65
|
+
/**
|
66
|
+
* 过滤对象中为空的属性
|
67
|
+
* @param obj
|
68
|
+
* @returns {*}
|
69
|
+
*/
|
70
|
+
export declare function filterObj(obj: any): any;
|
71
|
+
/**
|
72
|
+
* 查找树结构
|
73
|
+
* @param treeList
|
74
|
+
* @param fn 查找方法
|
75
|
+
* @param childrenKey
|
76
|
+
*/
|
77
|
+
export declare function findTree(treeList: any[], fn: Fn, childrenKey?: string): any;
|
78
|
+
/**
|
79
|
+
* 【组件多了可能存在性能问题】获取弹窗div,将下拉框、日期等组件挂载到modal上,解决弹窗遮盖问题
|
80
|
+
* @param node
|
81
|
+
*/
|
82
|
+
export declare function getAutoScrollContainer(node: HTMLElement): HTMLElement | null;
|
83
|
+
/**
|
84
|
+
* 判断子菜单是否全部隐藏
|
85
|
+
* @param menuTreeItem
|
86
|
+
*/
|
87
|
+
export declare function checkChildrenHidden(menuTreeItem: any): any;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export interface ViewportOffsetResult {
|
2
|
+
left: number;
|
3
|
+
top: number;
|
4
|
+
right: number;
|
5
|
+
bottom: number;
|
6
|
+
rightIncludeBody: number;
|
7
|
+
bottomIncludeBody: number;
|
8
|
+
}
|
9
|
+
export declare function getBoundingClientRect(element: Element): DOMRect | number;
|
10
|
+
export declare function hasClass(el: Element, cls: string): boolean;
|
11
|
+
export declare function addClass(el: Element, cls: string): void;
|
12
|
+
export declare function removeClass(el: Element, cls: string): void;
|
13
|
+
/**
|
14
|
+
* Get the left and top offset of the current element
|
15
|
+
* left: the distance between the leftmost element and the left side of the document
|
16
|
+
* top: the distance from the top of the element to the top of the document
|
17
|
+
* right: the distance from the far right of the element to the right of the document
|
18
|
+
* bottom: the distance from the bottom of the element to the bottom of the document
|
19
|
+
* rightIncludeBody: the distance between the leftmost element and the right side of the document
|
20
|
+
* bottomIncludeBody: the distance from the bottom of the element to the bottom of the document
|
21
|
+
*
|
22
|
+
* @description:
|
23
|
+
*/
|
24
|
+
export declare function getViewportOffset(element: Element): ViewportOffsetResult;
|
25
|
+
export declare function hackCss(attr: string, value: string): any;
|
26
|
+
export declare function on(element: Element | HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject): void;
|
27
|
+
export declare function off(element: Element | HTMLElement | Document | Window, event: string, handler: Fn): void;
|
28
|
+
export declare function once(el: HTMLElement, event: string, fn: EventListener): void;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare class signMd5Utils {
|
2
|
+
/**
|
3
|
+
* json参数升序
|
4
|
+
* @param jsonObj 发送参数
|
5
|
+
*/
|
6
|
+
static sortAsc(jsonObj: any): {};
|
7
|
+
/**
|
8
|
+
* @param url 请求的url,应该包含请求参数(url的?后面的参数)
|
9
|
+
* @param requestParams 请求参数(POST的JSON参数)
|
10
|
+
* @returns {string} 获取签名
|
11
|
+
*/
|
12
|
+
static getSign(url: any, requestParams: any): string;
|
13
|
+
/**
|
14
|
+
* @param url 请求的url
|
15
|
+
* @returns {{}} 将url中请求参数组装成json对象(url的?后面的参数)
|
16
|
+
*/
|
17
|
+
static parseQueryString(url: any): {};
|
18
|
+
/**
|
19
|
+
* @returns {*} 将两个对象合并成一个
|
20
|
+
*/
|
21
|
+
static mergeObject(objectOne: any, objectTwo: any): any;
|
22
|
+
static urlEncode(param: any, key: any, encode: any): string;
|
23
|
+
/**
|
24
|
+
* 接口签名用 生成header中的时间戳
|
25
|
+
* @returns {number}
|
26
|
+
*/
|
27
|
+
static getTimestamp(): number;
|
28
|
+
static myIsNaN(value: any): boolean;
|
29
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
interface Options {
|
2
|
+
size?: 'default' | 'small' | 'large';
|
3
|
+
delay?: number;
|
4
|
+
timeout?: number;
|
5
|
+
loading?: boolean;
|
6
|
+
retry?: boolean;
|
7
|
+
}
|
8
|
+
export declare function createAsyncComponent(loader: Fn, options?: Options): new () => import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
9
|
+
export {};
|