@fmdevui/fm-dev 1.0.4 → 1.0.5
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/README.md +1 -0
- package/es/core/api/base/index.d.ts +19 -0
- package/es/core/api/index.d.ts +4 -0
- package/es/core/api/login/index.d.ts +7 -0
- package/es/core/api/sys/index.d.ts +39 -0
- package/es/core/api/utils/request.d.ts +36 -0
- package/es/core/auth/index.d.ts +40 -0
- package/es/core/directive/authDirective.d.ts +8 -0
- package/es/core/directive/customDirective.d.ts +21 -0
- package/es/core/directive/index.d.ts +9 -0
- package/es/core/index.d.ts +5 -2
- package/es/core/stores/index.d.ts +6 -0
- package/es/core/stores/inpinia.d.ts +3 -0
- package/es/core/stores/keepAliveNames.d.ts +17 -0
- package/es/core/stores/requestOldRoutes.d.ts +9 -0
- package/es/core/stores/routesList.d.ts +14 -0
- package/es/core/stores/tagsViewRoutes.d.ts +11 -0
- package/es/core/stores/themeConfig.d.ts +5 -0
- package/es/core/stores/userInfo.d.ts +21 -0
- package/es/core/utils/array/index.d.ts +23 -0
- package/es/core/utils/base64/index.d.ts +30 -0
- package/es/core/utils/comm/commonFunction.d.ts +17 -0
- package/es/core/utils/comm/data-signature.d.ts +17 -0
- package/es/core/utils/comm/download.d.ts +46 -0
- package/es/core/utils/comm/formatTime.d.ts +37 -0
- package/es/core/utils/comm/idleTimeout.d.ts +45 -0
- package/es/core/utils/comm/index.d.ts +7 -0
- package/es/core/utils/comm/setIconfont.d.ts +12 -0
- package/es/core/utils/comm/signalR.d.ts +3 -0
- package/es/core/utils/comm/sysInfo.d.ts +2 -0
- package/es/core/utils/comm/theme.d.ts +13 -0
- package/es/core/utils/comm/toolsValidate.d.ts +148 -0
- package/es/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/es/core/utils/const/index.d.ts +11 -0
- package/es/core/utils/emit/index.d.ts +4 -0
- package/es/core/utils/index.d.ts +7 -0
- package/es/core/utils/other/index.d.ts +69 -0
- package/es/core/utils/storage/index.d.ts +27 -0
- package/es/core/utils/watermark/index.d.ts +10 -0
- package/es/index.mjs +23 -0
- package/es/packages/core/api/base/index.mjs +179 -0
- package/es/packages/core/api/index.mjs +4 -0
- package/es/packages/core/api/login/index.mjs +35 -0
- package/es/packages/core/api/sys/index.mjs +201 -0
- package/es/packages/core/api/types/global.d.mjs +1 -0
- package/es/packages/core/api/utils/request.mjs +173 -0
- package/es/packages/core/auth/index.mjs +34 -0
- package/es/packages/core/directive/authDirective.mjs +38 -0
- package/es/packages/core/directive/customDirective.mjs +147 -0
- package/es/packages/core/directive/index.mjs +10 -0
- package/es/packages/core/index.mjs +26 -0
- package/es/packages/core/stores/index.mjs +6 -0
- package/es/packages/core/stores/inpinia.mjs +5 -0
- package/es/packages/core/stores/keepAliveNames.mjs +29 -0
- package/es/packages/core/stores/requestOldRoutes.mjs +14 -0
- package/es/packages/core/stores/routesList.mjs +26 -0
- package/es/packages/core/stores/tagsViewRoutes.mjs +22 -0
- package/es/packages/core/stores/themeConfig.mjs +161 -0
- package/es/packages/core/stores/userInfo.mjs +156 -0
- package/es/packages/core/utils/array/index.mjs +59 -0
- package/es/packages/core/utils/base64/index.mjs +57 -0
- package/es/packages/core/utils/comm/calendar.mjs +785 -0
- package/es/packages/core/utils/comm/commonFunction.mjs +83 -0
- package/es/packages/core/utils/comm/data-signature.mjs +39 -0
- package/es/packages/core/utils/comm/download.mjs +78 -0
- package/es/packages/core/utils/comm/formatTime.mjs +110 -0
- package/es/packages/core/utils/comm/idleTimeout.mjs +124 -0
- package/es/packages/core/utils/comm/index.mjs +7 -0
- package/es/packages/core/utils/comm/setIconfont.mjs +36 -0
- package/es/packages/core/utils/comm/signalR.mjs +45 -0
- package/es/packages/core/utils/comm/sysInfo.mjs +54 -0
- package/es/packages/core/utils/comm/theme.mjs +54 -0
- package/es/packages/core/utils/comm/toolsValidate.mjs +140 -0
- package/es/packages/core/utils/comm/uploadfileurl.mjs +12 -0
- package/es/packages/core/utils/const/index.mjs +13 -0
- package/es/packages/core/utils/emit/index.mjs +5 -0
- package/es/packages/core/utils/index.mjs +13 -0
- package/es/packages/core/utils/other/index.mjs +137 -0
- package/es/packages/core/utils/storage/index.mjs +55 -0
- package/es/packages/core/utils/watermark/index.mjs +39 -0
- package/index.js +22990 -5106
- package/index.min.js +42 -10
- package/index.min.mjs +42 -10
- package/index.mjs +22916 -5104
- package/lib/core/api/base/index.d.ts +19 -0
- package/lib/core/api/index.d.ts +4 -0
- package/lib/core/api/login/index.d.ts +7 -0
- package/lib/core/api/sys/index.d.ts +39 -0
- package/lib/core/api/utils/request.d.ts +36 -0
- package/lib/core/auth/index.d.ts +40 -0
- package/lib/core/directive/authDirective.d.ts +8 -0
- package/lib/core/directive/customDirective.d.ts +21 -0
- package/lib/core/directive/index.d.ts +9 -0
- package/lib/core/index.d.ts +5 -2
- package/lib/core/stores/index.d.ts +6 -0
- package/lib/core/stores/inpinia.d.ts +3 -0
- package/lib/core/stores/keepAliveNames.d.ts +17 -0
- package/lib/core/stores/requestOldRoutes.d.ts +9 -0
- package/lib/core/stores/routesList.d.ts +14 -0
- package/lib/core/stores/tagsViewRoutes.d.ts +11 -0
- package/lib/core/stores/themeConfig.d.ts +5 -0
- package/lib/core/stores/userInfo.d.ts +21 -0
- package/lib/core/utils/array/index.d.ts +23 -0
- package/lib/core/utils/base64/index.d.ts +30 -0
- package/lib/core/utils/comm/commonFunction.d.ts +17 -0
- package/lib/core/utils/comm/data-signature.d.ts +17 -0
- package/lib/core/utils/comm/download.d.ts +46 -0
- package/lib/core/utils/comm/formatTime.d.ts +37 -0
- package/lib/core/utils/comm/idleTimeout.d.ts +45 -0
- package/lib/core/utils/comm/index.d.ts +7 -0
- package/lib/core/utils/comm/setIconfont.d.ts +12 -0
- package/lib/core/utils/comm/signalR.d.ts +3 -0
- package/lib/core/utils/comm/sysInfo.d.ts +2 -0
- package/lib/core/utils/comm/theme.d.ts +13 -0
- package/lib/core/utils/comm/toolsValidate.d.ts +148 -0
- package/lib/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/lib/core/utils/const/index.d.ts +11 -0
- package/lib/core/utils/emit/index.d.ts +4 -0
- package/lib/core/utils/index.d.ts +7 -0
- package/lib/core/utils/other/index.d.ts +69 -0
- package/lib/core/utils/storage/index.d.ts +27 -0
- package/lib/core/utils/watermark/index.d.ts +10 -0
- package/lib/index.js +111 -7
- package/lib/packages/core/api/base/index.js +181 -0
- package/lib/packages/core/api/index.js +26 -0
- package/lib/packages/core/api/login/index.js +37 -0
- package/lib/packages/core/api/sys/index.js +204 -0
- package/lib/packages/core/api/types/global.d.js +2 -0
- package/lib/packages/core/api/utils/request.js +190 -0
- package/lib/packages/core/auth/index.js +41 -0
- package/lib/packages/core/directive/authDirective.js +40 -0
- package/lib/packages/core/directive/customDirective.js +151 -0
- package/lib/packages/core/directive/index.js +12 -0
- package/lib/packages/core/index.js +114 -7
- package/lib/packages/core/stores/index.js +17 -0
- package/lib/packages/core/stores/inpinia.js +7 -0
- package/lib/packages/core/stores/keepAliveNames.js +31 -0
- package/lib/packages/core/stores/requestOldRoutes.js +16 -0
- package/lib/packages/core/stores/routesList.js +28 -0
- package/lib/packages/core/stores/tagsViewRoutes.js +24 -0
- package/lib/packages/core/stores/themeConfig.js +163 -0
- package/lib/packages/core/stores/userInfo.js +158 -0
- package/lib/packages/core/utils/array/index.js +64 -0
- package/lib/packages/core/utils/base64/index.js +63 -0
- package/lib/packages/core/utils/comm/calendar.js +789 -0
- package/lib/packages/core/utils/comm/commonFunction.js +87 -0
- package/lib/packages/core/utils/comm/data-signature.js +41 -0
- package/lib/packages/core/utils/comm/download.js +86 -0
- package/lib/packages/core/utils/comm/formatTime.js +115 -0
- package/lib/packages/core/utils/comm/idleTimeout.js +128 -0
- package/lib/packages/core/utils/comm/index.js +50 -0
- package/lib/packages/core/utils/comm/setIconfont.js +42 -0
- package/lib/packages/core/utils/comm/signalR.js +66 -0
- package/lib/packages/core/utils/comm/sysInfo.js +57 -0
- package/lib/packages/core/utils/comm/theme.js +56 -0
- package/lib/packages/core/utils/comm/toolsValidate.js +165 -0
- package/lib/packages/core/utils/comm/uploadfileurl.js +14 -0
- package/lib/packages/core/utils/const/index.js +15 -0
- package/lib/packages/core/utils/emit/index.js +9 -0
- package/lib/packages/core/utils/index.js +69 -0
- package/lib/packages/core/utils/other/index.js +149 -0
- package/lib/packages/core/utils/storage/index.js +58 -0
- package/lib/packages/core/utils/watermark/index.js +41 -0
- package/package.json +2 -2
- package/es/core/types/axios/index.d.ts +0 -11
- package/es/packages/core/types/axios/index.mjs +0 -2
- package/lib/core/types/axios/index.d.ts +0 -11
- package/lib/packages/core/types/axios/index.js +0 -28
package/README.md
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
export declare const useBaseApi: (module: string) => {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
request: <T>(config: AxiosRequestConfig<T>, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
5
|
+
pcomm: (data: any, action: string, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
6
|
+
gcomm: (params: any, action: string, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
7
|
+
page: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
8
|
+
detail: (id: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
9
|
+
dropdownData: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
10
|
+
add: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
11
|
+
update: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
12
|
+
setStatus: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
13
|
+
delete: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
14
|
+
batchDelete: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
15
|
+
exportData: (data: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
16
|
+
downloadTemplate: (cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
17
|
+
importData: (file: any, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
18
|
+
uploadFile: (params: any, action: string, cancel?: boolean) => Promise<AxiosResponse<any, any>>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
export declare function useLoginApi(): {
|
|
3
|
+
signIn: (data: object) => Promise< AxiosResponse<any, any>>;
|
|
4
|
+
loginPhonenumber: (data: object) => Promise< AxiosResponse<any, any>>;
|
|
5
|
+
getCaptcha: () => Promise< AxiosResponse<any, any>>;
|
|
6
|
+
signOut: (data: object) => Promise< AxiosResponse<any, any>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
export declare function useSysApi(): {
|
|
3
|
+
getSysInfo: (id: any) => Promise< AxiosResponse<any, any>>;
|
|
4
|
+
getSmPublicKey: () => Promise< AxiosResponse<any, any>>;
|
|
5
|
+
getMenuTree: () => Promise< AxiosResponse<any, any>>;
|
|
6
|
+
getMenuUserMenuList: () => Promise< AxiosResponse<any, any>>;
|
|
7
|
+
addUserMenu: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
8
|
+
setNoticeRead: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
9
|
+
getNoticeTitle: () => Promise< AxiosResponse<any, any>>;
|
|
10
|
+
getNoticeUnReadList: () => Promise< AxiosResponse<any, any>>;
|
|
11
|
+
NoticePageReceived: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
12
|
+
getUpgradeLastUnRead: () => Promise< AxiosResponse<any, any>>;
|
|
13
|
+
getUserInfo: () => Promise< AxiosResponse<any, any>>;
|
|
14
|
+
getUserRoleTableList: () => Promise< AxiosResponse<any, any>>;
|
|
15
|
+
getConstList: () => Promise< AxiosResponse<any, any>>;
|
|
16
|
+
getPosList: () => Promise< AxiosResponse<any, any>>;
|
|
17
|
+
getOwnRoleListById: (userid: any) => Promise< AxiosResponse<any, any>>;
|
|
18
|
+
getRoleList: () => Promise< AxiosResponse<any, any>>;
|
|
19
|
+
getSysOrgChildTreePidLevel: (pid: any, level: any) => Promise< AxiosResponse<any, any>>;
|
|
20
|
+
getOrgList: (params: any) => Promise< AxiosResponse<any, any>>;
|
|
21
|
+
getUserBaseInfo: () => Promise< AxiosResponse<any, any>>;
|
|
22
|
+
getOwnExtOrgListByid: (userid: any) => Promise< AxiosResponse<any, any>>;
|
|
23
|
+
getAllDictList: () => Promise< AxiosResponse<any, any>>;
|
|
24
|
+
verifyPwdExpirationTime: () => Promise< AxiosResponse<any, any>>;
|
|
25
|
+
changePwd: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
26
|
+
resetPwd: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
27
|
+
unlockLogin: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
28
|
+
changeToken: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
29
|
+
Logout: () => Promise< AxiosResponse<any, any>>;
|
|
30
|
+
unLockScreen: (password: any) => Promise< AxiosResponse<any, any>>;
|
|
31
|
+
getOnlineUserList: (data: any) => Promise< AxiosResponse<any, any>>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 包装 Promise 并返回 [Error, any]
|
|
35
|
+
* @param promise Promise 方法
|
|
36
|
+
* @param errorExt 自定义错误信息(拓展)
|
|
37
|
+
* @returns [Error, any]
|
|
38
|
+
*/
|
|
39
|
+
export declare function feature<T, U = Error>(promise: Promise<T>, errorExt?: object): Promise<[U, undefined] | [null, T]>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
export declare const service: AxiosInstance;
|
|
3
|
+
export declare const accessTokenKey: string;
|
|
4
|
+
export declare const refreshAccessTokenKey: string;
|
|
5
|
+
export declare const getToken: () => any;
|
|
6
|
+
export declare const clearTokens: () => void;
|
|
7
|
+
export declare const clearAccessTokens: () => void;
|
|
8
|
+
export declare const axiosInstance: AxiosInstance;
|
|
9
|
+
export declare const cancelRequest: (url: string | string[]) => void;
|
|
10
|
+
export declare const cancelAllRequest: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* 参数处理
|
|
13
|
+
* @param {*} params 参数
|
|
14
|
+
*/
|
|
15
|
+
export declare function tansParams(params: any): string;
|
|
16
|
+
/**
|
|
17
|
+
* 解密 JWT token 的信息
|
|
18
|
+
* @param token jwt token 字符串
|
|
19
|
+
* @returns <any>object
|
|
20
|
+
*/
|
|
21
|
+
export declare function decryptJWT(token: string): any;
|
|
22
|
+
/**
|
|
23
|
+
* 将 JWT 时间戳转换成 Date
|
|
24
|
+
* @description 主要针对 `exp`,`iat`,`nbf`
|
|
25
|
+
* @param timestamp 时间戳
|
|
26
|
+
* @returns Date 对象
|
|
27
|
+
*/
|
|
28
|
+
export declare function getJWTDate(timestamp: number): Date;
|
|
29
|
+
/**
|
|
30
|
+
* Ajax请求,如果成功返回result字段,如果不成功提示错误信息
|
|
31
|
+
* @description Ajax请求
|
|
32
|
+
* @config AxiosRequestConfig 请求参数
|
|
33
|
+
* @returns 返回对象
|
|
34
|
+
*/
|
|
35
|
+
export declare function request2(config: AxiosRequestConfig<any>): any;
|
|
36
|
+
export default service;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 单个权限验证
|
|
4
|
+
* @param value 权限值
|
|
5
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
6
|
+
*/
|
|
7
|
+
export declare function auth(value: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 多个权限验证,满足一个则为 true
|
|
10
|
+
* @param value 权限值
|
|
11
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
12
|
+
*/
|
|
13
|
+
export declare function auths(value: Array<string>): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 多个权限验证,全部满足则为 true
|
|
16
|
+
* @param value 权限值
|
|
17
|
+
* @returns 有权限,返回 `true`,反之则反
|
|
18
|
+
*/
|
|
19
|
+
export declare function authAll(value: Array<string>): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 单个权限验证,是否满足,返回VNode
|
|
22
|
+
* @param VNode 元素
|
|
23
|
+
* @param value 权限值
|
|
24
|
+
* @returns VNode
|
|
25
|
+
*/
|
|
26
|
+
export declare function hAuth<T extends VNode>(el: T, value: string): T;
|
|
27
|
+
/**
|
|
28
|
+
* 多个权限验证,判断是否满足一个,返回VNode
|
|
29
|
+
* @param VNode 元素
|
|
30
|
+
* @param value 权限值
|
|
31
|
+
* @returns VNode
|
|
32
|
+
*/
|
|
33
|
+
export declare function hAuths<T extends VNode>(el: T, value: Array<string>): T;
|
|
34
|
+
/**
|
|
35
|
+
* 多个权限验证,判断是否全部满足,返回VNode
|
|
36
|
+
* @param VNode 元素
|
|
37
|
+
* @param value 权限值
|
|
38
|
+
* @returns VNode
|
|
39
|
+
*/
|
|
40
|
+
export declare function hAuthAll<T extends VNode>(el: T, value: Array<string>): T;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 按钮波浪指令
|
|
4
|
+
* @directive 默认方式:v-waves,如 `<div v-waves></div>`
|
|
5
|
+
* @directive 参数方式:v-waves=" |light|red|orange|purple|green|teal",如 `<div v-waves="'light'"></div>`
|
|
6
|
+
*/
|
|
7
|
+
export declare function wavesDirective(app: App): void;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义拖动指令
|
|
10
|
+
* @description 使用方式:v-drag="[dragDom,dragHeader]",如 `<div v-drag="['.drag-container .el-dialog', '.drag-container .el-dialog__header']"></div>`
|
|
11
|
+
* @description dragDom 要拖动的元素,dragHeader 要拖动的 Header 位置
|
|
12
|
+
* @link 注意:https://github.com/element-plus/element-plus/issues/522
|
|
13
|
+
* @lick 参考:https://blog.csdn.net/weixin_46391323/article/details/105228020?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-10&spm=1001.2101.3001.4242
|
|
14
|
+
*/
|
|
15
|
+
export declare function dragDirective(app: App): void;
|
|
16
|
+
/**
|
|
17
|
+
* 防止重复点击提交按钮
|
|
18
|
+
* @directive 默认方式:v-reclick,如 `<el-button v-reclick></el-button>`
|
|
19
|
+
* @directive 参数方式:v-reclick="number",如 `<el-button v-reclick="500"></el-button>`
|
|
20
|
+
*/
|
|
21
|
+
export declare function reclickDirective(app: App): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 导出指令方法:v-xxx
|
|
4
|
+
* @methods authDirective 用户权限指令,用法:v-auth
|
|
5
|
+
* @methods wavesDirective 按钮波浪指令,用法:v-waves
|
|
6
|
+
* @methods dragDirective 自定义拖动指令,用法:v-drag
|
|
7
|
+
* @methods reclickDirective 重复按钮提交指令,用法:v-reclick
|
|
8
|
+
*/
|
|
9
|
+
export declare function directive(app: App): void;
|
package/es/core/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from './ui/login';
|
|
2
|
-
export
|
|
2
|
+
export * from './api';
|
|
3
|
+
export * from './directive';
|
|
3
4
|
export * from './locales';
|
|
4
|
-
export
|
|
5
|
+
export * from './stores';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export * from './auth';
|
|
5
8
|
export * from './types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KeepAliveNamesState } from '../types';
|
|
2
|
+
import { StoreDefinition } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* 路由缓存列表
|
|
5
|
+
* @methods setCacheKeepAlive 设置要缓存的路由 names(开启 Tagsview)
|
|
6
|
+
* @methods addCachedView 添加要缓存的路由 names(关闭 Tagsview)
|
|
7
|
+
* @methods delCachedView 删除要缓存的路由 names(关闭 Tagsview)
|
|
8
|
+
* @methods delOthersCachedViews 右键菜单`关闭其它`,删除要缓存的路由 names(关闭 Tagsview)
|
|
9
|
+
* @methods delAllCachedViews 右键菜单`全部关闭`,删除要缓存的路由 names(关闭 Tagsview)
|
|
10
|
+
*/
|
|
11
|
+
export declare const useKeepALiveNames: StoreDefinition<"keepALiveNames", KeepAliveNamesState, {}, {
|
|
12
|
+
setCacheKeepAlive(data: Array<string>): Promise<void>;
|
|
13
|
+
addCachedView(view: any): Promise<void>;
|
|
14
|
+
delCachedView(view: any): Promise<void>;
|
|
15
|
+
delOthersCachedViews(view: any): Promise<void>;
|
|
16
|
+
delAllCachedViews(): Promise<void>;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RequestOldRoutesState } from '../types';
|
|
2
|
+
import { StoreDefinition } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* 后端返回原始路由(未处理时)
|
|
5
|
+
* @methods setCacheKeepAlive 设置接口原始路由数据
|
|
6
|
+
*/
|
|
7
|
+
export declare const useRequestOldRoutes: StoreDefinition<"requestOldRoutes", RequestOldRoutesState, {}, {
|
|
8
|
+
setRequestOldRoutes(routes: Array<string>): Promise<void>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RoutesListState, RouteItem } from '../types';
|
|
2
|
+
import { StoreDefinition } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* 路由列表
|
|
5
|
+
* @methods setRoutesList 设置路由数据
|
|
6
|
+
* @methods setColumnsMenuHover 设置分栏布局菜单鼠标移入 boolean
|
|
7
|
+
* @methods setColumnsNavHover 设置分栏布局最左侧导航鼠标移入 boolean
|
|
8
|
+
*/
|
|
9
|
+
export declare const useRoutesList: StoreDefinition<"routesList", RoutesListState<any>, {}, {
|
|
10
|
+
setCurrentRoute(route: RouteItem): void;
|
|
11
|
+
setRoutesList(data: Array<string>): Promise<void>;
|
|
12
|
+
setColumnsMenuHover(bool: Boolean): Promise<void>;
|
|
13
|
+
setColumnsNavHover(bool: Boolean): Promise<void>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TagsViewRoutesState } from '../types';
|
|
2
|
+
import { StoreDefinition } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* TagsView 路由列表
|
|
5
|
+
* @methods setTagsViewRoutes 设置 TagsView 路由列表
|
|
6
|
+
* @methods setCurrenFullscreen 设置开启/关闭全屏时的 boolean 状态
|
|
7
|
+
*/
|
|
8
|
+
export declare const useTagsViewRoutes: StoreDefinition<"tagsViewRoutes", TagsViewRoutesState<any>, {}, {
|
|
9
|
+
setTagsViewRoutes(data: Array<string>): Promise<void>;
|
|
10
|
+
setCurrenFullscreen(bool: Boolean): void;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UserInfosState } from '../types';
|
|
2
|
+
import { StoreDefinition } from 'pinia';
|
|
3
|
+
/**
|
|
4
|
+
* 用户信息
|
|
5
|
+
* @methods setUserInfos 设置用户信息
|
|
6
|
+
*/
|
|
7
|
+
export declare const useUserInfo: StoreDefinition<"userInfo", UserInfosState<any>, {}, {
|
|
8
|
+
setUserInfos(): Promise<void>;
|
|
9
|
+
setConstList(): Promise<void>;
|
|
10
|
+
setDictList(): Promise<void>;
|
|
11
|
+
setUserTables(): Promise<void>;
|
|
12
|
+
getApiUserInfo(): Promise<unknown>;
|
|
13
|
+
getUserTableList(): Promise<unknown>;
|
|
14
|
+
getSysConstList(): Promise<unknown>;
|
|
15
|
+
getConstDataByTypeCode(typeCode: string): any;
|
|
16
|
+
getConstItemNameByType(typeCode: string, itemCode: string): any;
|
|
17
|
+
codeToName(code: any, type: any): any;
|
|
18
|
+
getDictDataByCode(dictTypeCode: string): any;
|
|
19
|
+
getDictItemByValue(dictTypeCode: string, value: string): any;
|
|
20
|
+
getDictItemByLabel(dictTypeCode: string, label: string): any;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EmptyArrayType } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* 判断两数组字符串是否相同(用于按钮权限验证),数组字符串中存在相同时会自动去重(按钮权限标识不会重复)
|
|
4
|
+
* @param news 新数据
|
|
5
|
+
* @param old 源数据
|
|
6
|
+
* @returns 两数组相同返回 `true`,反之则反
|
|
7
|
+
*/
|
|
8
|
+
export declare function judgementSameArr(newArr: unknown[] | string[], oldArr: string[]): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 判断两个对象是否相同
|
|
11
|
+
* @param a 要比较的对象一
|
|
12
|
+
* @param b 要比较的对象二
|
|
13
|
+
* @returns 相同返回 true,反之则反
|
|
14
|
+
*/
|
|
15
|
+
export declare function isObjectValueEqual<T>(a: T, b: T): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 数组、数组对象去重
|
|
18
|
+
* @param arr 数组内容
|
|
19
|
+
* @param attr 需要去重的键值(数组对象)
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeDuplicate(arr: EmptyArrayType, attr?: string): any;
|
|
23
|
+
export declare const clone: <T>(value: T) => T;
|
|
@@ -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
|
+
import { EmptyArrayType } from '../../types';
|
|
2
|
+
export default function (): {
|
|
3
|
+
percentFormat: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
4
|
+
dateFormatYMD: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
5
|
+
dateFormatYMDHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
6
|
+
dateFormatHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
7
|
+
scaleFormat: (value?: string, scale?: number) => string;
|
|
8
|
+
scale2Format: (value?: string) => string;
|
|
9
|
+
groupSeparator: (value: number, minimumFractionDigits?: number) => string;
|
|
10
|
+
copyText: (text: string) => Promise<unknown>;
|
|
11
|
+
removeHtmlSub: (value: string) => string;
|
|
12
|
+
removeHtml: (value: string) => string;
|
|
13
|
+
getEnumDesc: (key: any, lstEnum: any) => any;
|
|
14
|
+
appendQueryParams: (url: string, params: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}) => string;
|
|
17
|
+
};
|
|
@@ -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,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,45 @@
|
|
|
1
|
+
type IdleTimeoutConfig = {
|
|
2
|
+
/** 空闲超时时间(秒),默认30分钟 */
|
|
3
|
+
timeout?: number;
|
|
4
|
+
/** 用于设置最后活动时间的监听事件列表 */
|
|
5
|
+
events?: string[];
|
|
6
|
+
/** 登出回调函数,在超时发生时执行 */
|
|
7
|
+
onTimeout?: () => void;
|
|
8
|
+
/** 监听事件防抖间隔(毫秒),默认 200,设为0表示不启用防抖 */
|
|
9
|
+
debounceInterval?: number;
|
|
10
|
+
};
|
|
11
|
+
declare class IdleTimeoutManager {
|
|
12
|
+
private timerId;
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly debouncedReset;
|
|
15
|
+
/** 检查闲置超时时间间隔 */
|
|
16
|
+
private readonly checkTimeoutInterval;
|
|
17
|
+
constructor(config?: IdleTimeoutConfig);
|
|
18
|
+
private init;
|
|
19
|
+
private handleVisibilityChange;
|
|
20
|
+
/** 设置最后活动时间 */
|
|
21
|
+
setLastActivityTime(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 更新空闲超时时间
|
|
24
|
+
* @param timeout - 新的超时时间(毫秒)
|
|
25
|
+
*/
|
|
26
|
+
updateIdleTimeout(timeout: number): void;
|
|
27
|
+
/** 检查是否超时 */
|
|
28
|
+
checkTimeout(): void;
|
|
29
|
+
/** 销毁实例 */
|
|
30
|
+
destroy(): void;
|
|
31
|
+
/** 超时时执行 */
|
|
32
|
+
private timeOutExec;
|
|
33
|
+
}
|
|
34
|
+
/** 初始化函数(在应用启动时调用) */
|
|
35
|
+
export declare function initIdleTimeout(config?: IdleTimeoutConfig): IdleTimeoutManager;
|
|
36
|
+
/** 销毁函数(在需要时调用) */
|
|
37
|
+
export declare function destroyIdleTimeout(): void;
|
|
38
|
+
/** 更新空闲超时时间(毫秒) */
|
|
39
|
+
export declare function updateIdleTimeout(timeout: number): void;
|
|
40
|
+
declare global {
|
|
41
|
+
interface Window {
|
|
42
|
+
__IDLE_TIMEOUT__?: IdleTimeoutManager;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -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,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
|
+
};
|