@fmdeui/fmui 1.0.4 → 1.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/es/utils/arrayOperation.d.ts +23 -0
- package/es/utils/auto-update.d.ts +11 -0
- package/es/utils/base64Conver.d.ts +30 -0
- package/es/utils/data-signature.d.ts +17 -0
- package/es/utils/download.d.ts +46 -0
- package/es/utils/exportExcel.d.ts +12 -0
- package/es/utils/flowLoading.d.ts +19 -0
- package/es/utils/fontts/font-awesome.d.ts +1 -0
- package/es/utils/fontts/font_2298093_rnp72ifj3ba.d.ts +1 -0
- package/es/utils/formRule.d.ts +36 -0
- package/es/utils/formValidate.d.ts +21 -0
- package/es/utils/formatTime.d.ts +37 -0
- package/es/utils/getStyleSheets.d.ts +12 -0
- package/es/utils/gpsConvertor.d.ts +30 -0
- package/es/utils/index.d.ts +23 -0
- package/es/utils/json-utils.d.ts +6 -0
- package/es/utils/loading.d.ts +4 -0
- package/es/utils/md5Signature.d.ts +1 -0
- package/es/utils/mitt.d.ts +4 -0
- package/es/utils/request.d.ts +53 -0
- package/es/utils/saulVModel.d.ts +4 -0
- package/es/utils/setIconfont.d.ts +12 -0
- package/es/utils/signalR.d.ts +3 -0
- package/es/utils/storage.d.ts +27 -0
- package/es/utils/theme.d.ts +13 -0
- package/es/utils/toolsValidate.d.ts +148 -0
- package/es/utils/watermark.d.ts +10 -0
- package/index.js +1 -1
- package/index.min.js +1 -1
- package/index.min.mjs +1 -1
- package/index.mjs +1 -1
- package/lib/utils/arrayOperation.d.ts +23 -0
- package/lib/utils/auto-update.d.ts +11 -0
- package/lib/utils/base64Conver.d.ts +30 -0
- package/lib/utils/data-signature.d.ts +17 -0
- package/lib/utils/download.d.ts +46 -0
- package/lib/utils/exportExcel.d.ts +12 -0
- package/lib/utils/flowLoading.d.ts +19 -0
- package/lib/utils/fontts/font-awesome.d.ts +1 -0
- package/lib/utils/fontts/font_2298093_rnp72ifj3ba.d.ts +1 -0
- package/lib/utils/formRule.d.ts +36 -0
- package/lib/utils/formValidate.d.ts +21 -0
- package/lib/utils/formatTime.d.ts +37 -0
- package/lib/utils/getStyleSheets.d.ts +12 -0
- package/lib/utils/gpsConvertor.d.ts +30 -0
- package/lib/utils/index.d.ts +23 -0
- package/lib/utils/json-utils.d.ts +6 -0
- package/lib/utils/loading.d.ts +4 -0
- package/lib/utils/md5Signature.d.ts +1 -0
- package/lib/utils/mitt.d.ts +4 -0
- package/lib/utils/request.d.ts +53 -0
- package/lib/utils/saulVModel.d.ts +4 -0
- package/lib/utils/setIconfont.d.ts +12 -0
- package/lib/utils/signalR.d.ts +3 -0
- package/lib/utils/storage.d.ts +27 -0
- package/lib/utils/theme.d.ts +13 -0
- package/lib/utils/toolsValidate.d.ts +148 -0
- package/lib/utils/watermark.d.ts +10 -0
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/lib/{make-installer.css → component.css} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断两数组字符串是否相同(用于按钮权限验证),数组字符串中存在相同时会自动去重(按钮权限标识不会重复)
|
|
3
|
+
* @param news 新数据
|
|
4
|
+
* @param old 源数据
|
|
5
|
+
* @returns 两数组相同返回 `true`,反之则反
|
|
6
|
+
*/
|
|
7
|
+
export declare function judgementSameArr(newArr: unknown[] | string[], oldArr: string[]): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 判断两个对象是否相同
|
|
10
|
+
* @param a 要比较的对象一
|
|
11
|
+
* @param b 要比较的对象二
|
|
12
|
+
* @returns 相同返回 true,反之则反
|
|
13
|
+
*/
|
|
14
|
+
export declare function isObjectValueEqual<T extends Record<string, any>>(a: T, b: T): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 数组、数组对象去重
|
|
17
|
+
* 支持普通数组和对象数组去重,类型安全,且兼容原有所有调用方式
|
|
18
|
+
* @param arr 数组内容
|
|
19
|
+
* @param attr 需要去重的键值(数组对象)
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeDuplicate<T>(arr: T[], attr?: string): T[];
|
|
23
|
+
export declare const clone: <T>(value: T) => T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*通过监听当前页面的JS的SRC来判断当前网页是否有更新
|
|
3
|
+
*使用方法 main.js import checkUpdate from "/@/utils/auto-update";
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 定时器定时检测是否更新,有更新则执行回调函数
|
|
7
|
+
* @param callbackFn
|
|
8
|
+
* @param interval
|
|
9
|
+
*/
|
|
10
|
+
declare function checkUpdateInterval(callbackFn: any, interval?: number): void;
|
|
11
|
+
export default checkUpdateInterval;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: base64 to blob
|
|
3
|
+
*/
|
|
4
|
+
export declare function dataURLtoBlob(base64Buf: string): Blob;
|
|
5
|
+
/**
|
|
6
|
+
* img url to base64
|
|
7
|
+
* @param url
|
|
8
|
+
*/
|
|
9
|
+
export declare function urlToBase64(url: string, mineType?: string): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* File转Base64
|
|
12
|
+
* @param file
|
|
13
|
+
*/
|
|
14
|
+
export declare function fileToBase64(file: Blob): Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Base64转File
|
|
17
|
+
* @param dataURL {String} base64
|
|
18
|
+
* @param fileName {String} 文件名
|
|
19
|
+
* @param mimeType {String} [可选]文件类型,默认为base64中的类型
|
|
20
|
+
* @returns {File}
|
|
21
|
+
*/
|
|
22
|
+
export declare function base64ToFile(dataURL: string, fileName: string, mimeType?: null): File;
|
|
23
|
+
/**
|
|
24
|
+
* Blob转File
|
|
25
|
+
* @param blob {Blob} blob
|
|
26
|
+
* @param fileName {String} 文件名
|
|
27
|
+
* @param mimeType {String} 文件类型
|
|
28
|
+
* @return {File}
|
|
29
|
+
*/
|
|
30
|
+
export declare function blobToFile(blob: Blob, fileName: string, mimeType?: string): File;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 生成 KSort 签名
|
|
3
|
+
* @param appId APP_ID
|
|
4
|
+
* @param appKey APP_KEY
|
|
5
|
+
* @param command 命令
|
|
6
|
+
* @param data 数据
|
|
7
|
+
* @param timestamp 时间戳(可选)
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function signatureByKSort(appId: string, appKey: string, command: string, data: any, timestamp?: number | null): {
|
|
11
|
+
app_id: string;
|
|
12
|
+
app_key: string;
|
|
13
|
+
command: string;
|
|
14
|
+
data: string;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
signature: any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* Download online pictures
|
|
4
|
+
* @param url
|
|
5
|
+
* @param filename
|
|
6
|
+
* @param mime
|
|
7
|
+
* @param bom
|
|
8
|
+
*/
|
|
9
|
+
export declare function downloadByOnlineUrl(url: string, filename: string, mime?: string, bom?: BlobPart): void;
|
|
10
|
+
/**
|
|
11
|
+
* Download pictures based on base64
|
|
12
|
+
* @param buf
|
|
13
|
+
* @param filename
|
|
14
|
+
* @param mime
|
|
15
|
+
* @param bom
|
|
16
|
+
*/
|
|
17
|
+
export declare function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart): void;
|
|
18
|
+
/**
|
|
19
|
+
* Download according to the background interface file stream
|
|
20
|
+
* @param {*} data
|
|
21
|
+
* @param {*} filename
|
|
22
|
+
* @param {*} mime
|
|
23
|
+
* @param {*} bom
|
|
24
|
+
*/
|
|
25
|
+
export declare function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart): void;
|
|
26
|
+
/**
|
|
27
|
+
* Download file according to file address
|
|
28
|
+
* @param {*} sUrl
|
|
29
|
+
*/
|
|
30
|
+
export declare function downloadByUrl({ url, target, fileName }: {
|
|
31
|
+
url: string;
|
|
32
|
+
target?: string;
|
|
33
|
+
fileName?: string;
|
|
34
|
+
}): boolean;
|
|
35
|
+
export declare function openWindow(url: string, opt?: {
|
|
36
|
+
target?: string | string;
|
|
37
|
+
noopener?: boolean;
|
|
38
|
+
noreferrer?: boolean;
|
|
39
|
+
}): void;
|
|
40
|
+
export declare function getFileName(headers: RawAxiosResponseHeaders | AxiosResponseHeaders): any;
|
|
41
|
+
/**
|
|
42
|
+
* 文件流下载
|
|
43
|
+
* @param res
|
|
44
|
+
* @param fileName 文件名
|
|
45
|
+
*/
|
|
46
|
+
export declare function downloadStreamFile(res: any, fileName?: string | undefined): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmptyObjectType } from 'fmdeui-fmui/es/types';
|
|
2
|
+
/**
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {Object} json 服务端发过来的数据
|
|
5
|
+
* @param {String} name 导出Excel文件名字
|
|
6
|
+
|
|
7
|
+
* @param {String} titleArr 导出Excel表头
|
|
8
|
+
|
|
9
|
+
* @param {String} sheetName 导出sheetName名字
|
|
10
|
+
* @return:
|
|
11
|
+
**/
|
|
12
|
+
export declare function exportExcel(jsonarr: Array<EmptyObjectType>, name: string, header: Array<EmptyObjectType>, sheetName: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Ref } from 'vue';
|
|
2
|
+
import { LoadingOptions } from 'element-plus/es/components/loading/src/types';
|
|
3
|
+
interface LoadingController {
|
|
4
|
+
step: (text: string | Ref<string>) => LoadingController;
|
|
5
|
+
end: () => void;
|
|
6
|
+
}
|
|
7
|
+
type CustomLoadingOptions = Omit<LoadingOptions, 'text'> & {
|
|
8
|
+
text?: string | Ref<string>;
|
|
9
|
+
spinner?: string | Component;
|
|
10
|
+
};
|
|
11
|
+
declare class FlowLoadingManager {
|
|
12
|
+
private instance;
|
|
13
|
+
start(options?: string | Ref<string> | CustomLoadingOptions): LoadingController;
|
|
14
|
+
private normalizeOptions;
|
|
15
|
+
private validateConfig;
|
|
16
|
+
private createController;
|
|
17
|
+
}
|
|
18
|
+
export declare const flowLoading: FlowLoadingManager;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fontAwesomeClassList: Array<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const iconfonntClassList: Array<string>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FormItemRule } from 'element-plus';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { Arrayable } from 'element-plus/es/utils';
|
|
4
|
+
export declare function useFormRulePresets(): {
|
|
5
|
+
required: (label?: string, trigger?: FormItemRule["trigger"]) => FormItemRule;
|
|
6
|
+
requiredIf: (required?: boolean, label?: string, trigger?: FormItemRule["trigger"]) => FormItemRule;
|
|
7
|
+
validatorIf: (shouldError: () => boolean, formRef?: Ref<any>, label?: string) => {
|
|
8
|
+
validator: (_: any, __: any, callback: (error?: Error) => void) => void;
|
|
9
|
+
trigger: readonly ["blur", "change"];
|
|
10
|
+
};
|
|
11
|
+
maxLen: (len: number, label?: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
12
|
+
minLen: (len: number, label?: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
13
|
+
pattern: (re: RegExp, msg: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
14
|
+
validator: (fn: (value: any) => true | string | Promise<true | string>, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
15
|
+
phone: () => FormItemRule;
|
|
16
|
+
idCard: () => FormItemRule;
|
|
17
|
+
email: () => FormItemRule;
|
|
18
|
+
digits: (label?: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
19
|
+
intRange: (min: number, max: number, label?: string) => FormItemRule;
|
|
20
|
+
confirmSame: (getOther: () => any, label?: string) => FormItemRule;
|
|
21
|
+
dateAfterToday: (label?: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
22
|
+
dateBeforeToday: (label?: string, trigger?: Arrayable<string> | undefined) => FormItemRule;
|
|
23
|
+
numberPrecision: (maxIntDigits: number | null, maxFracDigits: number | null, label?: string) => FormItemRule;
|
|
24
|
+
validateRequired: (value: any, fieldName?: string) => boolean;
|
|
25
|
+
validateNumber: (value: any, fieldName?: string) => boolean;
|
|
26
|
+
validateIntRange: (value: any, min: number, max: number, fieldName?: string) => boolean;
|
|
27
|
+
validateChinese: (value: any, fieldName?: string) => boolean;
|
|
28
|
+
validateLength: (value: any, maxLength: number, fieldName?: string) => boolean;
|
|
29
|
+
validateEmail: (value: any, fieldName?: string) => boolean;
|
|
30
|
+
validatePhone: (value: any, fieldName?: string) => boolean;
|
|
31
|
+
validateIdCard: (value: any, fieldName?: string) => boolean;
|
|
32
|
+
validatePattern: (value: any, pattern: RegExp, message: string) => boolean;
|
|
33
|
+
validateMultiple: (value: any, validators: Array<(value: any) => boolean>) => boolean;
|
|
34
|
+
validateField: (value: any, type: string, fieldName: string, options?: any) => boolean;
|
|
35
|
+
validateDecimalPrecision: (value: any, maxIntDigits: number, maxFracDigits: number, fieldName?: string) => boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FormInstance } from 'element-plus';
|
|
2
|
+
/**
|
|
3
|
+
* 表单验证并自动滚动到第一个错误字段
|
|
4
|
+
* @param formRef - Element Plus Form 实例的 ref
|
|
5
|
+
* @param options - 配置选项
|
|
6
|
+
* @returns Promise<boolean> - 验证是否通过
|
|
7
|
+
*/
|
|
8
|
+
export declare const validateFormWithScroll: (formRef: FormInstance | undefined, options?: {
|
|
9
|
+
showMessage?: boolean;
|
|
10
|
+
message?: string;
|
|
11
|
+
}) => Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* 表单验证并自动滚动到第一个错误字段(带回调方式)
|
|
14
|
+
* @param formRef - Element Plus Form 实例的 ref
|
|
15
|
+
* @param onSuccess - 验证成功后的回调
|
|
16
|
+
* @param options - 配置选项
|
|
17
|
+
*/
|
|
18
|
+
export declare const validateFormWithScrollCallback: (formRef: FormInstance | undefined, onSuccess: () => void | Promise<void>, options?: {
|
|
19
|
+
showMessage?: boolean;
|
|
20
|
+
message?: string;
|
|
21
|
+
}) => Promise<void>;
|
|
@@ -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, t?: Function): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
declare const initIconfont: {
|
|
8
|
+
ali: () => Promise<unknown>;
|
|
9
|
+
ele: () => Promise<unknown>;
|
|
10
|
+
awe: () => Promise<unknown>;
|
|
11
|
+
};
|
|
12
|
+
export default initIconfont;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WGS84转GCJ02(高德,腾讯)
|
|
3
|
+
* @param lng
|
|
4
|
+
* @param lat
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function wgs84ToGcj02(lng: number, lat: number): {
|
|
8
|
+
lng: number;
|
|
9
|
+
lat: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* GCJ02转BD09(百度)
|
|
13
|
+
* @param lng
|
|
14
|
+
* @param lat
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function gcj02ToBd09(lng: number, lat: number): {
|
|
18
|
+
lng: number;
|
|
19
|
+
lat: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* WGS84转BD09(百度)
|
|
23
|
+
* @param _lng
|
|
24
|
+
* @param _lat
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function wgs84ToBd09(_lng: number, _lat: number): {
|
|
28
|
+
lng: number;
|
|
29
|
+
lat: number;
|
|
30
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from './arrayOperation';
|
|
2
|
+
export * from './auto-update';
|
|
3
|
+
export * from './base64Conver';
|
|
4
|
+
export * from './data-signature';
|
|
5
|
+
export * from './download';
|
|
6
|
+
export * from './exportExcel';
|
|
7
|
+
export * from './flowLoading';
|
|
8
|
+
export * from './formatTime';
|
|
9
|
+
export * from './formRule';
|
|
10
|
+
export * from './formValidate';
|
|
11
|
+
export * from './getStyleSheets';
|
|
12
|
+
export * from './gpsConvertor';
|
|
13
|
+
export * from './json-utils';
|
|
14
|
+
export * from './loading';
|
|
15
|
+
export * from './md5Signature';
|
|
16
|
+
export * from './mitt';
|
|
17
|
+
export * from './request';
|
|
18
|
+
export * from './saulVModel';
|
|
19
|
+
export * from './setIconfont';
|
|
20
|
+
export * from './storage';
|
|
21
|
+
export * from './theme';
|
|
22
|
+
export * from './toolsValidate';
|
|
23
|
+
export * from './watermark';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function md5Signature(data: any): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
export interface CustomAxiosRequestConfig extends AxiosRequestConfig {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const service: AxiosInstance;
|
|
6
|
+
export declare const accessTokenKey = "access-token";
|
|
7
|
+
export declare const refreshAccessTokenKey = "x-access-token";
|
|
8
|
+
export declare const getToken: () => any;
|
|
9
|
+
export declare const getHeader: () => {
|
|
10
|
+
authorization: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const clearAccessTokens: () => void;
|
|
13
|
+
export declare const clearTokens: () => void;
|
|
14
|
+
export declare const axiosInstance: AxiosInstance;
|
|
15
|
+
export declare const cancelRequest: (url: string | string[]) => void;
|
|
16
|
+
export declare const cancelAllRequest: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* 参数处理
|
|
19
|
+
* @param {*} params 参数
|
|
20
|
+
*/
|
|
21
|
+
export declare function tansParams(params: any): string;
|
|
22
|
+
/**
|
|
23
|
+
* 解密 JWT token 的信息
|
|
24
|
+
* @param token jwt token 字符串
|
|
25
|
+
* @returns <any>object
|
|
26
|
+
*/
|
|
27
|
+
export declare function decryptJWT(token: string): any;
|
|
28
|
+
/**
|
|
29
|
+
* 将 JWT 时间戳转换成 Date
|
|
30
|
+
* @description 主要针对 `exp`,`iat`,`nbf`
|
|
31
|
+
* @param timestamp 时间戳
|
|
32
|
+
* @returns Date 对象
|
|
33
|
+
*/
|
|
34
|
+
export declare function getJWTDate(timestamp: number): Date;
|
|
35
|
+
/**
|
|
36
|
+
* Ajax请求,如果成功返回result字段,如果不成功提示错误信息
|
|
37
|
+
* @description Ajax请求
|
|
38
|
+
* @config AxiosRequestConfig 请求参数
|
|
39
|
+
* @returns 返回对象
|
|
40
|
+
*/
|
|
41
|
+
export declare function request2(config: AxiosRequestConfig<any>): any;
|
|
42
|
+
/**
|
|
43
|
+
* 使用新的令牌登录
|
|
44
|
+
* @param accessInfo
|
|
45
|
+
*/
|
|
46
|
+
export declare function reLoadLoginAccessToken(accessInfo: any): void;
|
|
47
|
+
/**
|
|
48
|
+
* 实现异步延迟
|
|
49
|
+
* @param delay 延迟时间(毫秒)
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
export declare function sleep(delay: number): Promise<unknown>;
|
|
53
|
+
export default service;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
declare const setIntroduction: {
|
|
9
|
+
cssCdn: () => void;
|
|
10
|
+
jsCdn: () => void;
|
|
11
|
+
};
|
|
12
|
+
export default setIntroduction;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* window.localStorage 浏览器永久缓存
|
|
3
|
+
* @method set 设置永久缓存
|
|
4
|
+
* @method get 获取永久缓存
|
|
5
|
+
* @method remove 移除永久缓存
|
|
6
|
+
* @method clear 移除全部永久缓存
|
|
7
|
+
*/
|
|
8
|
+
export declare const Local: {
|
|
9
|
+
setKey(key: string): string;
|
|
10
|
+
set<T>(key: string, val: T): void;
|
|
11
|
+
get(key: string): any;
|
|
12
|
+
remove(key: string): void;
|
|
13
|
+
clear(): void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* window.sessionStorage 浏览器临时缓存
|
|
17
|
+
* @method set 设置临时缓存
|
|
18
|
+
* @method get 获取临时缓存
|
|
19
|
+
* @method remove 移除临时缓存
|
|
20
|
+
* @method clear 移除全部临时缓存
|
|
21
|
+
*/
|
|
22
|
+
export declare const Session: {
|
|
23
|
+
set<T>(key: string, val: T): any;
|
|
24
|
+
get(key: string): any;
|
|
25
|
+
remove(key: string): any;
|
|
26
|
+
clear(): void;
|
|
27
|
+
};
|
|
@@ -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: any, g: any, b: any) => string;
|
|
11
|
+
getDarkColor: (color: string, level: number) => string;
|
|
12
|
+
getLightColor: (color: string, level: number) => string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 验证百分比(不可以小数)
|
|
3
|
+
* @param val 当前值字符串
|
|
4
|
+
* @returns 返回处理后的字符串
|
|
5
|
+
*/
|
|
6
|
+
export declare function verifyNumberPercentage(val: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* 验证百分比(可以小数)
|
|
9
|
+
* @param val 当前值字符串
|
|
10
|
+
* @returns 返回处理后的字符串
|
|
11
|
+
*/
|
|
12
|
+
export declare function verifyNumberPercentageFloat(val: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 小数或整数(不可以负数)
|
|
15
|
+
* @param val 当前值字符串
|
|
16
|
+
* @returns 返回处理后的字符串
|
|
17
|
+
*/
|
|
18
|
+
export declare function verifyNumberIntegerAndFloat(val: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* 正整数验证
|
|
21
|
+
* @param val 当前值字符串
|
|
22
|
+
* @returns 返回处理后的字符串
|
|
23
|
+
*/
|
|
24
|
+
export declare function verifiyNumberInteger(val: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* 去掉中文及空格
|
|
27
|
+
* @param val 当前值字符串
|
|
28
|
+
* @returns 返回处理后的字符串
|
|
29
|
+
*/
|
|
30
|
+
export declare function verifyCnAndSpace(val: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* 去掉英文及空格
|
|
33
|
+
* @param val 当前值字符串
|
|
34
|
+
* @returns 返回处理后的字符串
|
|
35
|
+
*/
|
|
36
|
+
export declare function verifyEnAndSpace(val: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* 禁止输入空格
|
|
39
|
+
* @param val 当前值字符串
|
|
40
|
+
* @returns 返回处理后的字符串
|
|
41
|
+
*/
|
|
42
|
+
export declare function verifyAndSpace(val: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* 金额用 `,` 区分开
|
|
45
|
+
* @param val 当前值字符串
|
|
46
|
+
* @returns 返回处理后的字符串
|
|
47
|
+
*/
|
|
48
|
+
export declare function verifyNumberComma(val: string): any;
|
|
49
|
+
/**
|
|
50
|
+
* 匹配文字变色(搜索时)
|
|
51
|
+
* @param val 当前值字符串
|
|
52
|
+
* @param text 要处理的字符串值
|
|
53
|
+
* @param color 搜索到时字体高亮颜色
|
|
54
|
+
* @returns 返回处理后的字符串
|
|
55
|
+
*/
|
|
56
|
+
export declare function verifyTextColor(val: string, text?: string, color?: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* 数字转中文大写
|
|
59
|
+
* @param val 当前值字符串
|
|
60
|
+
* @param unit 默认:仟佰拾亿仟佰拾万仟佰拾元角分
|
|
61
|
+
* @returns 返回处理后的字符串
|
|
62
|
+
*/
|
|
63
|
+
export declare function verifyNumberCnUppercase(val: any, unit?: string, v?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* 手机号码
|
|
66
|
+
* @param val 当前值字符串
|
|
67
|
+
* @returns 返回 true: 手机号码正确
|
|
68
|
+
*/
|
|
69
|
+
export declare function verifyPhone(val: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* 国内电话号码
|
|
72
|
+
* @param val 当前值字符串
|
|
73
|
+
* @returns 返回 true: 国内电话号码正确
|
|
74
|
+
*/
|
|
75
|
+
export declare function verifyTelPhone(val: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 登录账号 (字母开头,允许5-16字节,允许字母数字下划线)
|
|
78
|
+
* @param val 当前值字符串
|
|
79
|
+
* @returns 返回 true: 登录账号正确
|
|
80
|
+
*/
|
|
81
|
+
export declare function verifyAccount(val: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 密码 (以字母开头,长度在6~16之间,只能包含字母、数字和下划线)
|
|
84
|
+
* @param val 当前值字符串
|
|
85
|
+
* @returns 返回 true: 密码正确
|
|
86
|
+
*/
|
|
87
|
+
export declare function verifyPassword(val: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 强密码 (字母+数字+特殊字符,长度在6-16之间)
|
|
90
|
+
* @param val 当前值字符串
|
|
91
|
+
* @returns 返回 true: 强密码正确
|
|
92
|
+
*/
|
|
93
|
+
export declare function verifyPasswordPowerful(val: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 密码强度
|
|
96
|
+
* @param val 当前值字符串
|
|
97
|
+
* @description 弱:纯数字,纯字母,纯特殊字符
|
|
98
|
+
* @description 中:字母+数字,字母+特殊字符,数字+特殊字符
|
|
99
|
+
* @description 强:字母+数字+特殊字符
|
|
100
|
+
* @returns 返回处理后的字符串:弱、中、强
|
|
101
|
+
*/
|
|
102
|
+
export declare function verifyPasswordStrength(val: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* IP地址
|
|
105
|
+
* @param val 当前值字符串
|
|
106
|
+
* @returns 返回 true: IP地址正确
|
|
107
|
+
*/
|
|
108
|
+
export declare function verifyIPAddress(val: string): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 邮箱
|
|
111
|
+
* @param val 当前值字符串
|
|
112
|
+
* @returns 返回 true: 邮箱正确
|
|
113
|
+
*/
|
|
114
|
+
export declare function verifyEmail(val: string): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 身份证
|
|
117
|
+
* @param val 当前值字符串
|
|
118
|
+
* @returns 返回 true: 身份证正确
|
|
119
|
+
*/
|
|
120
|
+
export declare function verifyIdCard(val: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* 姓名
|
|
123
|
+
* @param val 当前值字符串
|
|
124
|
+
* @returns 返回 true: 姓名正确
|
|
125
|
+
*/
|
|
126
|
+
export declare function verifyFullName(val: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 邮政编码
|
|
129
|
+
* @param val 当前值字符串
|
|
130
|
+
* @returns 返回 true: 邮政编码正确
|
|
131
|
+
*/
|
|
132
|
+
export declare function verifyPostalCode(val: string): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* url 处理
|
|
135
|
+
* @param val 当前值字符串
|
|
136
|
+
* @returns 返回 true: url 正确
|
|
137
|
+
*/
|
|
138
|
+
export declare function verifyUrl(val: string): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* 车牌号
|
|
141
|
+
* @param val 当前值字符串
|
|
142
|
+
* @returns 返回 true:车牌号正确
|
|
143
|
+
*/
|
|
144
|
+
export declare function verifyCarNum(val: string): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* 解析身份证
|
|
147
|
+
*/
|
|
148
|
+
export declare function judgementIdCard(idCard: string): any;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.6 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pinia'), require('crypto-js'), require('xlsx-js-style'), require('element-plus'), require('vue'), require('@element-plus/icons-vue'), require('mitt'), require('axios'), require('js-cookie'), require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('vue-i18n'), require('exceljs'), require('lodash-es'), require('@vueuse/core'), require('vue-router'), require('nprogress')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'pinia', 'crypto-js', 'xlsx-js-style', 'element-plus', 'vue', '@element-plus/icons-vue', 'mitt', 'axios', 'js-cookie', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'vue-i18n', 'exceljs', 'lodash-es', '@vueuse/core', 'vue-router', 'nprogress'], factory) :
|