hs-admin-ui 3.0.5 → 3.0.6
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/types/utils/arrayOperation.d.ts +21 -0
- package/dist/types/utils/authFunction.d.ts +18 -0
- package/dist/types/utils/build.d.ts +12 -0
- package/dist/types/utils/common.d.ts +9 -0
- package/dist/types/utils/commonFunction.d.ts +18 -0
- package/dist/types/utils/device_info.d.ts +14 -0
- package/dist/types/utils/download.d.ts +6 -0
- package/dist/types/utils/formatTime.d.ts +37 -0
- package/dist/types/utils/getDataType.d.ts +9 -0
- package/dist/types/utils/getStyleSheets.d.ts +11 -0
- package/dist/types/utils/index.d.ts +21 -0
- package/dist/types/utils/loading.d.ts +10 -0
- package/dist/types/utils/mitt.d.ts +3 -0
- package/dist/types/utils/other.d.ts +75 -0
- package/dist/types/utils/request/index.d.ts +2 -0
- package/dist/types/utils/request/interceptors/request/authorization.interceptor.d.ts +4 -0
- package/dist/types/utils/request/interceptors/request/index.d.ts +2 -0
- package/dist/types/utils/request/interceptors/request/result.type.interceptor.d.ts +4 -0
- package/dist/types/utils/request/interceptors/request/undefined-params-handler.interceptor.d.ts +13 -0
- package/dist/types/utils/request/interceptors/response/error-handler.interceptor.d.ts +4 -0
- package/dist/types/utils/request/interceptors/response/index.d.ts +2 -0
- package/dist/types/utils/request/request.d.ts +6 -0
- package/dist/types/utils/request2.d.ts +3 -0
- package/dist/types/utils/setIconfont.d.ts +11 -0
- package/dist/types/utils/showMessage.d.ts +6 -0
- package/dist/types/utils/showMessageBox.d.ts +6 -0
- package/dist/types/utils/showNotification.d.ts +6 -0
- package/dist/types/utils/showPopup/index.d.ts +35 -0
- package/dist/types/utils/storage.d.ts +84 -0
- package/dist/types/utils/theme.d.ts +13 -0
- package/dist/types/utils/toolsValidate.d.ts +149 -0
- package/dist/types/utils/watermark.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断两数组字符串是否相同(用于按钮权限验证),数组字符串中存在相同时会自动去重(按钮权限标识不会重复)
|
|
3
|
+
* @param news 新数据
|
|
4
|
+
* @param old 源数据
|
|
5
|
+
* @returns 两数组相同返回 `true`,反之则反
|
|
6
|
+
*/
|
|
7
|
+
export declare function judementSameArr(newArr: unknown[] | string[], oldArr: string[]): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 判断两个对象是否相同
|
|
10
|
+
* @param a 要比较的对象一
|
|
11
|
+
* @param b 要比较的对象二
|
|
12
|
+
* @returns 相同返回 true,反之则反
|
|
13
|
+
*/
|
|
14
|
+
export declare function isObjectValueEqual<T>(a: T, b: T): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 数组、数组对象去重
|
|
17
|
+
* @param arr 数组内容
|
|
18
|
+
* @param attr 需要去重的键值(数组对象)
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function removeDuplicate(arr: EmptyArrayType, attr?: any): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 单个权限验证
|
|
3
|
+
* @param value 权限值
|
|
4
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
5
|
+
*/
|
|
6
|
+
export declare function auth(value: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 多个权限验证,满足一个则为 true
|
|
9
|
+
* @param value 权限值
|
|
10
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
11
|
+
*/
|
|
12
|
+
export declare function auths(value: Array<string>): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 多个权限验证,全部满足则为 true
|
|
15
|
+
* @param value 权限值
|
|
16
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
17
|
+
*/
|
|
18
|
+
export declare function authAll(value: Array<string>): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* 打包相关
|
|
4
|
+
* 注意 prodUrl:使用的是 jsdelivr 还是 unpkg。它们的 path 可能不一致
|
|
5
|
+
* @description importToCDN https://github.com/mmf-fe/vite-plugin-cdn-import
|
|
6
|
+
* @description cdn 在线引入的 cdn 地址配置。path:https://www.jsdelivr.com/ || https://unpkg.com/
|
|
7
|
+
* @description external 打包时,过滤包导入。参考:https://rollupjs.org/configuration-options/#external
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildConfig: {
|
|
10
|
+
cdn(): Plugin<any>[];
|
|
11
|
+
external: string[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param oldObj 旧数据 建议传入深拷贝的数据
|
|
4
|
+
* @param newObj 新数据
|
|
5
|
+
* @param arr 需要额外添加的字段
|
|
6
|
+
* @returns 返回合并后的数据 oldObj
|
|
7
|
+
* oldObj 和 newObj 为两个对象,oldObj 为旧数据,newObj 为新数据,需要将 newObj 的数据合并到 oldObj 中根据 oldObj 中有的字段进行合并 如果字段为对象类型则递归合并。 arr 为向oldObj中额外添加的字段 且不为递归的数据中额外添加arr中的字段
|
|
8
|
+
*/
|
|
9
|
+
export declare function processData(oldObj: any, newObj: any, arr?: string[]): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const percentFormat: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
2
|
+
declare const dateFormatYMD: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
3
|
+
declare const dateFormatYMDHMS: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
4
|
+
declare const dateFormatHMS: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
5
|
+
declare const scaleFormat: (value?: string, scale?: number) => string;
|
|
6
|
+
declare const scale2Format: (value?: string) => string;
|
|
7
|
+
declare const copyText: (text: string) => Promise<unknown>;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
percentFormat: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
10
|
+
dateFormatYMD: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
11
|
+
dateFormatYMDHMS: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
12
|
+
dateFormatHMS: (row: EmptyArrayType<any>, column: number, cellValue: string) => string;
|
|
13
|
+
scaleFormat: (value?: string, scale?: number) => string;
|
|
14
|
+
scale2Format: (value?: string) => string;
|
|
15
|
+
copyText: (text: string) => Promise<unknown>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export { percentFormat, dateFormatYMD, dateFormatYMDHMS, dateFormatHMS, scaleFormat, scale2Format, copyText };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 时间日期转换
|
|
3
|
+
* @param date 当前时间,new Date() 格式
|
|
4
|
+
* @param format 需要转换的时间格式字符串
|
|
5
|
+
* @description format 字符串随意,如 `YYYY-mm、YYYY-mm-dd`
|
|
6
|
+
* @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ"
|
|
7
|
+
* @description format 星期:"YYYY-mm-dd HH:MM:SS WWW"
|
|
8
|
+
* @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ"
|
|
9
|
+
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
|
|
10
|
+
* @returns 返回拼接后的时间字符串
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDate(date: Date, format: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 获取当前日期是第几周
|
|
15
|
+
* @param dateTime 当前传入的日期值
|
|
16
|
+
* @returns 返回第几周数字值
|
|
17
|
+
*/
|
|
18
|
+
export declare function getWeek(dateTime: Date): number;
|
|
19
|
+
/**
|
|
20
|
+
* 将时间转换为 `几秒前`、`几分钟前`、`几小时前`、`几天前`
|
|
21
|
+
* @param param 当前时间,new Date() 格式或者字符串时间格式
|
|
22
|
+
* @param format 需要转换的时间格式字符串
|
|
23
|
+
* @description param 10秒: 10 * 1000
|
|
24
|
+
* @description param 1分: 60 * 1000
|
|
25
|
+
* @description param 1小时: 60 * 60 * 1000
|
|
26
|
+
* @description param 24小时:60 * 60 * 24 * 1000
|
|
27
|
+
* @description param 3天: 60 * 60* 24 * 1000 * 3
|
|
28
|
+
* @returns 返回拼接后的时间字符串
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatPast(param: string | Date, format?: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* 时间问候语
|
|
33
|
+
* @param param 当前时间,new Date() 格式
|
|
34
|
+
* @description param 调用 `formatAxis(new Date())` 输出 `上午好`
|
|
35
|
+
* @returns 返回拼接后的时间字符串
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatAxis(param: Date): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IFormData, ICustomData } from '../types';
|
|
2
|
+
|
|
3
|
+
type Data = Record<string, any>;
|
|
4
|
+
export declare function getDataType(data: Data): string;
|
|
5
|
+
/** form表单类型声明 */
|
|
6
|
+
export declare function getFormDataType(data: IFormData.Form): string | undefined;
|
|
7
|
+
/** table表格数据类型声明 */
|
|
8
|
+
export declare function getTableDataType(tables: ICustomData.Table[]): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取字体图标 `document.styleSheets`
|
|
3
|
+
* @method ali 获取阿里字体图标 `<i class="iconfont 图标类名"></i>`
|
|
4
|
+
* @method ele 获取 element plus 自带图标 `<i class="图标类名"></i>`
|
|
5
|
+
* @method ali 获取 fontawesome 的图标 `<i class="fa 图标类名"></i>`
|
|
6
|
+
*/
|
|
7
|
+
export declare const initIconfont: {
|
|
8
|
+
ali: () => Promise<unknown>;
|
|
9
|
+
ele: () => Promise<unknown>;
|
|
10
|
+
awe: () => Promise<unknown>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './arrayOperation';
|
|
2
|
+
export * from './authFunction';
|
|
3
|
+
export * from './commonFunction';
|
|
4
|
+
export * from './formatTime';
|
|
5
|
+
export * from './getDataType';
|
|
6
|
+
export * from './getStyleSheets';
|
|
7
|
+
export * from './loading';
|
|
8
|
+
export * from './mitt';
|
|
9
|
+
export * from './other';
|
|
10
|
+
export * from './request';
|
|
11
|
+
export * from './setIconfont';
|
|
12
|
+
export * from './showMessage';
|
|
13
|
+
export * from './showMessageBox';
|
|
14
|
+
export * from './showNotification';
|
|
15
|
+
export * from './showPopup';
|
|
16
|
+
export * from './storage';
|
|
17
|
+
export * from './theme';
|
|
18
|
+
export * from './toolsValidate';
|
|
19
|
+
export * from './watermark';
|
|
20
|
+
export * from './download';
|
|
21
|
+
export * from './common';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 导出全局注册 element plus svg 图标
|
|
5
|
+
* @param app vue 实例
|
|
6
|
+
* @description 使用:https://element-plus.gitee.io/zh-CN/component/icon.html
|
|
7
|
+
*/
|
|
8
|
+
export declare function elSvg(app: App): void;
|
|
9
|
+
/**
|
|
10
|
+
* 设置浏览器标题国际化
|
|
11
|
+
* @method const title = useTitle(); ==> title()
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTitle(Router?: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* 设置 自定义 tagsView 名称
|
|
16
|
+
* @param params 路由 query、params 中的 tagsViewName
|
|
17
|
+
* @returns 返回当前 tagsViewName 名称
|
|
18
|
+
*/
|
|
19
|
+
export declare function setTagsViewNameI18n(item: any): string;
|
|
20
|
+
/**
|
|
21
|
+
* 图片懒加载
|
|
22
|
+
* @param el dom 目标元素
|
|
23
|
+
* @param arr 列表数据
|
|
24
|
+
* @description data-xxx 属性用于存储页面或应用程序的私有自定义数据
|
|
25
|
+
*/
|
|
26
|
+
export declare const lazyImg: (el: string, arr: EmptyArrayType<any>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* 全局组件大小
|
|
29
|
+
* @returns 返回 `window.localStorage` 中读取的缓存值 `globalComponentSize`
|
|
30
|
+
*/
|
|
31
|
+
export declare const globalComponentSize: () => string;
|
|
32
|
+
/**
|
|
33
|
+
* 对象深克隆
|
|
34
|
+
* @param obj 源对象
|
|
35
|
+
* @returns 克隆后的对象
|
|
36
|
+
*/
|
|
37
|
+
export declare function deepClone(obj: EmptyObjectType): EmptyObjectType<any>;
|
|
38
|
+
/**
|
|
39
|
+
* 判断是否是移动端
|
|
40
|
+
*/
|
|
41
|
+
export declare function isMobile(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 判断数组对象中所有属性是否为空,为空则删除当前行对象
|
|
44
|
+
* @description @感谢大黄
|
|
45
|
+
* @param list 数组对象
|
|
46
|
+
* @returns 删除空值后的数组对象
|
|
47
|
+
*/
|
|
48
|
+
export declare function handleEmpty(list: EmptyArrayType): any[];
|
|
49
|
+
/**
|
|
50
|
+
* 打开外部链接
|
|
51
|
+
* @param val 当前点击项菜单
|
|
52
|
+
*/
|
|
53
|
+
export declare function handleOpenLink(val: RouteItem): void;
|
|
54
|
+
/**
|
|
55
|
+
* 统一批量导出
|
|
56
|
+
* @method elSvg 导出全局注册 element plus svg 图标
|
|
57
|
+
* @method useTitle 设置浏览器标题国际化
|
|
58
|
+
* @method setTagsViewNameI18n 设置 自定义 tagsView 名称、 自定义 tagsView 名称国际化
|
|
59
|
+
* @method lazyImg 图片懒加载
|
|
60
|
+
* @method globalComponentSize() element plus 全局组件大小
|
|
61
|
+
* @method deepClone 对象深克隆
|
|
62
|
+
* @method isMobile 判断是否是移动端
|
|
63
|
+
* @method handleEmpty 判断数组对象中所有属性是否为空,为空则删除当前行对象
|
|
64
|
+
*/
|
|
65
|
+
export declare const other: {
|
|
66
|
+
elSvg: (app: App) => void;
|
|
67
|
+
useTitle: (r?: any) => void;
|
|
68
|
+
setTagsViewNameI18n(route: RouteToFrom): string;
|
|
69
|
+
lazyImg: (el: string, arr: EmptyArrayType<any>) => void;
|
|
70
|
+
globalComponentSize: () => string;
|
|
71
|
+
deepClone: (obj: EmptyObjectType) => EmptyObjectType<any>;
|
|
72
|
+
isMobile: () => boolean;
|
|
73
|
+
handleEmpty: (list: EmptyArrayType<any>) => any[];
|
|
74
|
+
handleOpenLink: (val: RouteItem) => void;
|
|
75
|
+
};
|
package/dist/types/utils/request/interceptors/request/undefined-params-handler.interceptor.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICustomData } from '../../../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 拦截器:无效参数处理
|
|
5
|
+
*
|
|
6
|
+
* 处理掉 params / data 中无效的参数
|
|
7
|
+
*
|
|
8
|
+
* example: http://www.xxx.com?username=undefined&password=null
|
|
9
|
+
* example: http://www.xxx.com
|
|
10
|
+
* @type {Array}
|
|
11
|
+
*/
|
|
12
|
+
declare const undefinedParamsHandlerInterceptor: ((axiosConfig: ICustomData.ANY) => any)[];
|
|
13
|
+
export default undefinedParamsHandlerInterceptor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function setCssCdn(): false | undefined;
|
|
2
|
+
export declare function setJsCdn(): false | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* 批量设置字体图标、动态js
|
|
5
|
+
* @method cssCdn 动态批量设置字体图标
|
|
6
|
+
* @method jsCdn 动态批量设置第三方js
|
|
7
|
+
*/
|
|
8
|
+
export declare const setIntroduction: {
|
|
9
|
+
cssCdn: () => void;
|
|
10
|
+
jsCdn: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ICustomData } from '../../types';
|
|
2
|
+
import { VxeModalProps, VxeModalEventProps } from 'vxe-table';
|
|
3
|
+
import { Component, App } from 'vue';
|
|
4
|
+
|
|
5
|
+
export interface SUCCESS_TYPE {
|
|
6
|
+
type: 'cancel' | 'confirm' | ICustomData.ANY;
|
|
7
|
+
data: ICustomData.ANY;
|
|
8
|
+
close?: Function;
|
|
9
|
+
}
|
|
10
|
+
type Config = VxeModalProps & VxeModalEventProps & {
|
|
11
|
+
success?: (params: SUCCESS_TYPE | any) => void;
|
|
12
|
+
} & {
|
|
13
|
+
onReady?: Function;
|
|
14
|
+
};
|
|
15
|
+
interface OptionsDef {
|
|
16
|
+
width: number | string;
|
|
17
|
+
height: number | string;
|
|
18
|
+
/** 是否显示遮罩层 */
|
|
19
|
+
mask: boolean;
|
|
20
|
+
/** 是否允许点击遮罩层关闭窗口 */
|
|
21
|
+
maskClosable: boolean;
|
|
22
|
+
/** 在窗口关闭时销毁内容 */
|
|
23
|
+
destroyOnClose: boolean;
|
|
24
|
+
/** 是否允许按 Esc 键关闭窗口 */
|
|
25
|
+
escClosable: boolean;
|
|
26
|
+
/** 标题是否标显示最大化与还原按钮 */
|
|
27
|
+
showZoom: boolean;
|
|
28
|
+
/** 是否允许窗口边缘拖动调整窗口大小 */
|
|
29
|
+
resize: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function showPopup<T extends Component>(component: T, props: ICustomData.ANY, config: Config): void;
|
|
32
|
+
export declare const popupPlugin: {
|
|
33
|
+
install(app: App, options?: OptionsDef): void;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { ICustomData } from '../types';
|
|
4
|
+
import { default as localforage } from 'localforage';
|
|
5
|
+
|
|
6
|
+
export declare let NEXT_NAME: Ref<any>;
|
|
7
|
+
export declare let IS_DEV: Ref<any>;
|
|
8
|
+
/** 子项目当前路由信息 */
|
|
9
|
+
export declare let CurrentRoute: Ref< Ref<RouteLocationNormalizedLoaded> | undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* window.localStorage 浏览器永久缓存
|
|
12
|
+
* @method set 设置永久缓存
|
|
13
|
+
* @method get 获取永久缓存
|
|
14
|
+
* @method remove 移除永久缓存
|
|
15
|
+
* @method clear 移除全部永久缓存
|
|
16
|
+
*/
|
|
17
|
+
export declare const Local: {
|
|
18
|
+
setKey(key: string): string;
|
|
19
|
+
set<T>(key: string, val: T): void;
|
|
20
|
+
get<T_1 = any>(key: string): T_1;
|
|
21
|
+
remove(key: string): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* window.sessionStorage 浏览器临时缓存
|
|
26
|
+
* @method set 设置临时缓存
|
|
27
|
+
* @method get 获取临时缓存
|
|
28
|
+
* @method remove 移除临时缓存
|
|
29
|
+
* @method clear 移除全部临时缓存
|
|
30
|
+
*/
|
|
31
|
+
export declare const Session: {
|
|
32
|
+
set<T>(key: string, val: T): any;
|
|
33
|
+
get(key: string): any;
|
|
34
|
+
remove(key: string): any;
|
|
35
|
+
clear(): void;
|
|
36
|
+
};
|
|
37
|
+
declare class SystemStore {
|
|
38
|
+
store: typeof localforage;
|
|
39
|
+
constructor();
|
|
40
|
+
/** 查看 v2.4.3版本更新日志 */
|
|
41
|
+
setKey(key: string): string;
|
|
42
|
+
/** 设置永久缓存 */
|
|
43
|
+
set(key: string, value: ICustomData.ANY): Promise<any>;
|
|
44
|
+
/** 获取永久缓存 */
|
|
45
|
+
get<T = ICustomData.ANY>(key: string): Promise<T>;
|
|
46
|
+
/** 移除永久缓存 */
|
|
47
|
+
remove(key: string): Promise<void>;
|
|
48
|
+
/** 移除全部永久缓存 */
|
|
49
|
+
clear(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export declare const systemStore: SystemStore;
|
|
52
|
+
interface CustomeStoreConfig {
|
|
53
|
+
name: string;
|
|
54
|
+
storeName: string;
|
|
55
|
+
version: number;
|
|
56
|
+
description: string;
|
|
57
|
+
}
|
|
58
|
+
/** 自定配置缓存信息 */
|
|
59
|
+
export declare class CustomeStore {
|
|
60
|
+
store: typeof localforage;
|
|
61
|
+
constructor(option: CustomeStoreConfig);
|
|
62
|
+
/** 查看 v2.4.3版本更新日志 */
|
|
63
|
+
setKey(key: string): string;
|
|
64
|
+
/** 设置永久缓存 */
|
|
65
|
+
set(key: string, value: ICustomData.ANY): Promise<any>;
|
|
66
|
+
/** 获取永久缓存 */
|
|
67
|
+
get<T = ICustomData.ANY>(key: string): Promise<T>;
|
|
68
|
+
/** 移除永久缓存 */
|
|
69
|
+
remove(key: string): Promise<void>;
|
|
70
|
+
/** 移除全部永久缓存 */
|
|
71
|
+
clear(): Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
export declare function getConfig<T = ICustomData.ANY>({ mid, id, uid }: Record<'mid' | 'id', string> & {
|
|
74
|
+
uid?: string;
|
|
75
|
+
}, str?: string): Promise<T>;
|
|
76
|
+
export declare function setConfig({ mid, id, uid }: Record<'mid' | 'id', string> & {
|
|
77
|
+
uid?: string;
|
|
78
|
+
}, val: unknown, str?: string): Promise<unknown>;
|
|
79
|
+
/**删除缓存
|
|
80
|
+
* @param mid 菜单id
|
|
81
|
+
* @param uid 用户id
|
|
82
|
+
*/
|
|
83
|
+
export declare function removeConfig(mid: string, uid?: string): Promise<void>;
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 颜色转换函数
|
|
3
|
+
* @method hexToRgb hex 颜色转 rgb 颜色
|
|
4
|
+
* @method rgbToHex rgb 颜色转 Hex 颜色
|
|
5
|
+
* @method getDarkColor 加深颜色值
|
|
6
|
+
* @method getLightColor 变浅颜色值
|
|
7
|
+
*/
|
|
8
|
+
export declare function useChangeColor(): {
|
|
9
|
+
hexToRgb: (str: string) => any;
|
|
10
|
+
rgbToHex: (r: number, g: number, b: number) => string;
|
|
11
|
+
getDarkColor: (color: string, level: number) => string;
|
|
12
|
+
getLightColor: (color: string, level: number) => string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 2020.11.29 lyt 整理
|
|
3
|
+
* 工具类集合,适用于平时开发
|
|
4
|
+
* 新增多行注释信息,鼠标放到方法名即可查看
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 小数或整数(不可以负数)
|
|
8
|
+
* @param val 当前值字符串
|
|
9
|
+
* @returns 返回处理后的字符串
|
|
10
|
+
*/
|
|
11
|
+
export declare function verifyNumberIntegerAndFloat(val: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* 验证百分比(不可以小数)
|
|
14
|
+
* @param val 当前值字符串
|
|
15
|
+
* @returns 返回处理后的字符串
|
|
16
|
+
*/
|
|
17
|
+
export declare function verifyNumberPercentage(val: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* 验证百分比(可以小数)
|
|
20
|
+
* @param val 当前值字符串
|
|
21
|
+
* @returns 返回处理后的字符串
|
|
22
|
+
*/
|
|
23
|
+
export declare function verifyNumberPercentageFloat(val: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* 正整数验证
|
|
26
|
+
* @param val 当前值字符串
|
|
27
|
+
* @returns 返回处理后的字符串
|
|
28
|
+
*/
|
|
29
|
+
export declare function verifiyNumberInteger(val: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* 去掉中文及空格
|
|
32
|
+
* @param val 当前值字符串
|
|
33
|
+
* @returns 返回处理后的字符串
|
|
34
|
+
*/
|
|
35
|
+
export declare function verifyCnAndSpace(val: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* 去掉英文及空格
|
|
38
|
+
* @param val 当前值字符串
|
|
39
|
+
* @returns 返回处理后的字符串
|
|
40
|
+
*/
|
|
41
|
+
export declare function verifyEnAndSpace(val: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* 禁止输入空格
|
|
44
|
+
* @param val 当前值字符串
|
|
45
|
+
* @returns 返回处理后的字符串
|
|
46
|
+
*/
|
|
47
|
+
export declare function verifyAndSpace(val: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* 金额用 `,` 区分开
|
|
50
|
+
* @param val 当前值字符串
|
|
51
|
+
* @returns 返回处理后的字符串
|
|
52
|
+
*/
|
|
53
|
+
export declare function verifyNumberComma(val: string): any;
|
|
54
|
+
/**
|
|
55
|
+
* 匹配文字变色(搜索时)
|
|
56
|
+
* @param val 当前值字符串
|
|
57
|
+
* @param text 要处理的字符串值
|
|
58
|
+
* @param color 搜索到时字体高亮颜色
|
|
59
|
+
* @returns 返回处理后的字符串
|
|
60
|
+
*/
|
|
61
|
+
export declare function verifyTextColor(val: string, text?: string, color?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* 数字转中文大写
|
|
64
|
+
* @param val 当前值字符串
|
|
65
|
+
* @param unit 默认:仟佰拾亿仟佰拾万仟佰拾元角分
|
|
66
|
+
* @returns 返回处理后的字符串
|
|
67
|
+
*/
|
|
68
|
+
export declare function verifyNumberCnUppercase(val: any, unit?: string, v?: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* 手机号码
|
|
71
|
+
* @param val 当前值字符串
|
|
72
|
+
* @returns 返回 true: 手机号码正确
|
|
73
|
+
*/
|
|
74
|
+
export declare function verifyPhone(val: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 国内电话号码
|
|
77
|
+
* @param val 当前值字符串
|
|
78
|
+
* @returns 返回 true: 国内电话号码正确
|
|
79
|
+
*/
|
|
80
|
+
export declare function verifyTelPhone(val: string): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 登录账号 (字母开头,允许5-16字节,允许字母数字下划线)
|
|
83
|
+
* @param val 当前值字符串
|
|
84
|
+
* @returns 返回 true: 登录账号正确
|
|
85
|
+
*/
|
|
86
|
+
export declare function verifyAccount(val: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 密码 (以字母开头,长度在6~16之间,只能包含字母、数字和下划线)
|
|
89
|
+
* @param val 当前值字符串
|
|
90
|
+
* @returns 返回 true: 密码正确
|
|
91
|
+
*/
|
|
92
|
+
export declare function verifyPassword(val: string): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 强密码 (字母+数字+特殊字符,长度在6-16之间)
|
|
95
|
+
* @param val 当前值字符串
|
|
96
|
+
* @returns 返回 true: 强密码正确
|
|
97
|
+
*/
|
|
98
|
+
export declare function verifyPasswordPowerful(val: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* 密码强度
|
|
101
|
+
* @param val 当前值字符串
|
|
102
|
+
* @description 弱:纯数字,纯字母,纯特殊字符
|
|
103
|
+
* @description 中:字母+数字,字母+特殊字符,数字+特殊字符
|
|
104
|
+
* @description 强:字母+数字+特殊字符
|
|
105
|
+
* @returns 返回处理后的字符串:弱、中、强
|
|
106
|
+
*/
|
|
107
|
+
export declare function verifyPasswordStrength(val: string): string;
|
|
108
|
+
/**
|
|
109
|
+
* IP地址
|
|
110
|
+
* @param val 当前值字符串
|
|
111
|
+
* @returns 返回 true: IP地址正确
|
|
112
|
+
*/
|
|
113
|
+
export declare function verifyIPAddress(val: string): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* 邮箱
|
|
116
|
+
* @param val 当前值字符串
|
|
117
|
+
* @returns 返回 true: 邮箱正确
|
|
118
|
+
*/
|
|
119
|
+
export declare function verifyEmail(val: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* 身份证
|
|
122
|
+
* @param val 当前值字符串
|
|
123
|
+
* @returns 返回 true: 身份证正确
|
|
124
|
+
*/
|
|
125
|
+
export declare function verifyIdCard(val: string): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* 姓名
|
|
128
|
+
* @param val 当前值字符串
|
|
129
|
+
* @returns 返回 true: 姓名正确
|
|
130
|
+
*/
|
|
131
|
+
export declare function verifyFullName(val: string): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* 邮政编码
|
|
134
|
+
* @param val 当前值字符串
|
|
135
|
+
* @returns 返回 true: 邮政编码正确
|
|
136
|
+
*/
|
|
137
|
+
export declare function verifyPostalCode(val: string): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* url 处理
|
|
140
|
+
* @param val 当前值字符串
|
|
141
|
+
* @returns 返回 true: url 正确
|
|
142
|
+
*/
|
|
143
|
+
export declare function verifyUrl(val: string): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* 车牌号
|
|
146
|
+
* @param val 当前值字符串
|
|
147
|
+
* @returns 返回 true:车牌号正确
|
|
148
|
+
*/
|
|
149
|
+
export declare function verifyCarNum(val: string): boolean;
|