workdesktop-ai 1.0.0
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/CHANGELOG.md +62 -0
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/dist/index.esm.js +6531 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +11 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/src/components/buttons/ApiButton.vue.d.ts +96 -0
- package/dist/types/src/components/buttons/ConfirmButton.vue.d.ts +131 -0
- package/dist/types/src/components/buttons/DialogButton.vue.d.ts +107 -0
- package/dist/types/src/components/buttons/DrawerButton.vue.d.ts +118 -0
- package/dist/types/src/components/buttons/PromptButton.vue.d.ts +140 -0
- package/dist/types/src/components/buttons/RouteButton.vue.d.ts +84 -0
- package/dist/types/src/components/buttons/TipsButton.vue.d.ts +64 -0
- package/dist/types/src/components/buttons/useApiAction.d.ts +20 -0
- package/dist/types/src/components/common/props.d.ts +85 -0
- package/dist/types/src/components/containers/Dialog.vue.d.ts +112 -0
- package/dist/types/src/components/containers/Drawer.vue.d.ts +119 -0
- package/dist/types/src/components/containers/Iframe.vue.d.ts +44 -0
- package/dist/types/src/components/containers/SearchPanel.vue.d.ts +152 -0
- package/dist/types/src/components/containers/containerContext.d.ts +15 -0
- package/dist/types/src/components/containers/useContainerController.d.ts +19 -0
- package/dist/types/src/components/data/datagrid/DataGrid.vue.d.ts +335 -0
- package/dist/types/src/components/data/datagrid/useColumnSettings.d.ts +48 -0
- package/dist/types/src/components/data/editable-table/EditableTable.vue.d.ts +306 -0
- package/dist/types/src/components/form/data-form/DataForm.vue.d.ts +311 -0
- package/dist/types/src/components/index.d.ts +27 -0
- package/dist/types/src/components/inputs/AutoComplete.vue.d.ts +157 -0
- package/dist/types/src/components/inputs/CheckboxList.vue.d.ts +141 -0
- package/dist/types/src/components/inputs/RadioList.vue.d.ts +141 -0
- package/dist/types/src/components/inputs/Select.vue.d.ts +166 -0
- package/dist/types/src/components/inputs/Switch.vue.d.ts +116 -0
- package/dist/types/src/components/inputs/useOptionsLoader.d.ts +29 -0
- package/dist/types/src/components/styles/Panel.vue.d.ts +41 -0
- package/dist/types/src/components/styles/Tips.vue.d.ts +60 -0
- package/dist/types/src/components/upload/ImageUpload.vue.d.ts +176 -0
- package/dist/types/src/components/upload/Upload.vue.d.ts +235 -0
- package/dist/types/src/components/utils/Viewer.vue.d.ts +131 -0
- package/dist/types/src/index.d.ts +20 -0
- package/dist/types/src/lib/composables/useConfig.d.ts +19 -0
- package/dist/types/src/lib/composables/useDataGrid.d.ts +54 -0
- package/dist/types/src/lib/composables/useEventBus.d.ts +16 -0
- package/dist/types/src/lib/composables/useGlobalState.d.ts +5 -0
- package/dist/types/src/lib/composables/useRequest.d.ts +42 -0
- package/dist/types/src/lib/configs/default-config.d.ts +6 -0
- package/dist/types/src/lib/core/config.d.ts +28 -0
- package/dist/types/src/lib/core/http.d.ts +83 -0
- package/dist/types/src/lib/core/linkage.d.ts +48 -0
- package/dist/types/src/lib/core/theme.d.ts +6 -0
- package/dist/types/src/lib/core/utils.d.ts +28 -0
- package/dist/types/src/lib/install.d.ts +11 -0
- package/dist/types/src/types/config.d.ts +109 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/package.json +68 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ApiResult } from '../core/http';
|
|
2
|
+
import type { ReqOptions } from '../../types/config';
|
|
3
|
+
/**
|
|
4
|
+
* useRequest(PRD 5.3)
|
|
5
|
+
* 封装请求逻辑,返回 data/loading/error + 请求方法。
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const { data, loading, run } = useRequest<User[]>('/api/users', {
|
|
9
|
+
* method: 'post',
|
|
10
|
+
* immediate: false,
|
|
11
|
+
* reqConfig: { showTips: false }
|
|
12
|
+
* })
|
|
13
|
+
* run({ page: 1 })
|
|
14
|
+
*/
|
|
15
|
+
export interface UseRequestOptions {
|
|
16
|
+
/** 请求方法,默认 post */
|
|
17
|
+
method?: 'get' | 'post' | 'put' | 'delete';
|
|
18
|
+
/** 是否立即自动请求,默认 true */
|
|
19
|
+
immediate?: boolean;
|
|
20
|
+
/** 自动请求时的初始参数 */
|
|
21
|
+
initialParams?: any;
|
|
22
|
+
/** 请求级覆盖项(透传给 http) */
|
|
23
|
+
reqOptions?: ReqOptions;
|
|
24
|
+
/** 成功回调(data 为解封后的业务数据) */
|
|
25
|
+
onSuccess?: (data: any, result: ApiResult) => void;
|
|
26
|
+
/** 业务失败回调 */
|
|
27
|
+
onFail?: (result: ApiResult) => void;
|
|
28
|
+
/** 异常回调 */
|
|
29
|
+
onError?: (error: any) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function useRequest<T = any>(api: string | (() => string), options?: UseRequestOptions): {
|
|
32
|
+
data: import("vue").Ref<any, any> extends T | null ? import("vue").ShallowRef<null, null> | (T extends T & import("vue").Ref<any, any> ? import("@vue/shared").IfAny<T, import("vue").ShallowRef<T, T>, T> : import("vue").ShallowRef<T, T>) : import("vue").ShallowRef<T | null, T | null>;
|
|
33
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
34
|
+
error: import("vue").ShallowRef<Error | null, Error | null>;
|
|
35
|
+
run: (params?: any) => Promise<ApiResult<T> | null>;
|
|
36
|
+
refresh: () => Promise<ApiResult<T> | null>;
|
|
37
|
+
abort: () => void;
|
|
38
|
+
};
|
|
39
|
+
/** 工具:解包可能为 ref 的值 */
|
|
40
|
+
export declare function unrefValue<T>(v: T | {
|
|
41
|
+
value: T;
|
|
42
|
+
}): T;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DeepPartial, WorkDesktopConfig } from '../../types/config';
|
|
2
|
+
/**
|
|
3
|
+
* 增量合并到全局层。库 install 时与运行时 setGlobalConfig 共用。
|
|
4
|
+
* 返回 merge 后的有效配置。
|
|
5
|
+
*/
|
|
6
|
+
export declare function setGlobalConfig(partial?: DeepPartial<WorkDesktopConfig>): WorkDesktopConfig;
|
|
7
|
+
/**
|
|
8
|
+
* 读取当前全局层(含默认层 merge 结果)
|
|
9
|
+
*/
|
|
10
|
+
export declare function getGlobalConfig(): WorkDesktopConfig;
|
|
11
|
+
/**
|
|
12
|
+
* 恢复默认层
|
|
13
|
+
*/
|
|
14
|
+
export declare function resetConfig(): WorkDesktopConfig;
|
|
15
|
+
/**
|
|
16
|
+
* 合并本地层(组件 props / 组件级配置),产出最终配置。
|
|
17
|
+
* 优先级:localProps > globalConfig > defaultConfig
|
|
18
|
+
*/
|
|
19
|
+
export declare function mergeConfig(local?: DeepPartial<WorkDesktopConfig> | Record<string, any>): WorkDesktopConfig;
|
|
20
|
+
/**
|
|
21
|
+
* 取某组件类型的全局默认配置(page.componentDefault[PascalName])
|
|
22
|
+
*/
|
|
23
|
+
export declare function getComponentDefault(componentName: string): Record<string, any>;
|
|
24
|
+
/**
|
|
25
|
+
* 库初始化:合并双入口配置(npm app.use 参数 + window.workDesktopConfig)
|
|
26
|
+
* 两条入口汇入同一套 merge 逻辑,行为一致(PRD 8.2)
|
|
27
|
+
*/
|
|
28
|
+
export declare function initConfig(useConfig?: DeepPartial<WorkDesktopConfig>): WorkDesktopConfig;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { ReqOptions } from '../../types/config';
|
|
3
|
+
/**
|
|
4
|
+
* HTTP 请求模块(PRD 5.1 / 第 7 章)
|
|
5
|
+
*
|
|
6
|
+
* 响应处理流程:
|
|
7
|
+
* 1. 请求前显示 loading(可配置)
|
|
8
|
+
* 2. 响应到达,按 resConfig 解封:取 code/message/data
|
|
9
|
+
* 3. code 匹配成功码 → apiSuccess + 成功提示
|
|
10
|
+
* 4. code 不匹配 → apiFail + 失败提示(业务失败 resolve,不 reject)
|
|
11
|
+
* 5. 网络异常 → apiException + 异常提示(reject)
|
|
12
|
+
* 6. 请求完成 → apiAfter + 关闭 loading
|
|
13
|
+
*/
|
|
14
|
+
export type ApiEventType = 'apiBefore' | 'apiSuccess' | 'apiFail' | 'apiException' | 'apiAfter';
|
|
15
|
+
export interface ApiEventPayload {
|
|
16
|
+
type: ApiEventType;
|
|
17
|
+
url?: string;
|
|
18
|
+
method?: string;
|
|
19
|
+
params?: any;
|
|
20
|
+
/** 解封后的业务数据 */
|
|
21
|
+
data?: any;
|
|
22
|
+
code?: number | string;
|
|
23
|
+
message?: string;
|
|
24
|
+
error?: any;
|
|
25
|
+
/** 原始响应 */
|
|
26
|
+
raw?: any;
|
|
27
|
+
}
|
|
28
|
+
export type ApiEventHandler = (payload: ApiEventPayload) => void;
|
|
29
|
+
/** 业务失败时 resolve 的结果(PRD 7.4:不抛异常,组件据此感知) */
|
|
30
|
+
export interface ApiResult<T = any> {
|
|
31
|
+
success: boolean;
|
|
32
|
+
data: T | null;
|
|
33
|
+
code?: number | string;
|
|
34
|
+
message?: string;
|
|
35
|
+
raw?: any;
|
|
36
|
+
}
|
|
37
|
+
type Listener = ApiEventHandler;
|
|
38
|
+
/**
|
|
39
|
+
* WorkDesktop HTTP 客户端
|
|
40
|
+
*/
|
|
41
|
+
declare class WorkDesktopHttp {
|
|
42
|
+
private axiosInstance;
|
|
43
|
+
private listeners;
|
|
44
|
+
/** 组件/实例级配置覆盖(request.create 使用) */
|
|
45
|
+
private instanceConfig;
|
|
46
|
+
private loadingInstance;
|
|
47
|
+
private loadingCount;
|
|
48
|
+
constructor(axiosConfig?: AxiosRequestConfig);
|
|
49
|
+
/**
|
|
50
|
+
* 创建绑定组件级配置的实例(PRD 5.1)
|
|
51
|
+
*/
|
|
52
|
+
create(componentReqConfig?: DeepPartialConfig): WorkDesktopHttp;
|
|
53
|
+
on(handler: Listener): () => void;
|
|
54
|
+
off(handler: Listener): void;
|
|
55
|
+
private emit;
|
|
56
|
+
/**
|
|
57
|
+
* 取有效配置:全局配置 + 实例级覆盖
|
|
58
|
+
*/
|
|
59
|
+
private resolveConfig;
|
|
60
|
+
private openLoading;
|
|
61
|
+
private closeLoading;
|
|
62
|
+
/**
|
|
63
|
+
* 核心请求方法
|
|
64
|
+
* 返回 Promise<ApiResult<T>>:业务失败也 resolve(success=false),仅网络异常 reject
|
|
65
|
+
*/
|
|
66
|
+
request<T = any>(config: AxiosRequestConfig, reqOptions?: ReqOptions): Promise<ApiResult<T>>;
|
|
67
|
+
/**
|
|
68
|
+
* 解封响应体:按 resConfig 取 code/message/data
|
|
69
|
+
*/
|
|
70
|
+
private unpack;
|
|
71
|
+
private checkSuccess;
|
|
72
|
+
private buildUrl;
|
|
73
|
+
get<T = any>(url: string, params?: any, reqOptions?: ReqOptions): Promise<ApiResult<T>>;
|
|
74
|
+
post<T = any>(url: string, data?: any, reqOptions?: ReqOptions): Promise<ApiResult<T>>;
|
|
75
|
+
put<T = any>(url: string, data?: any, reqOptions?: ReqOptions): Promise<ApiResult<T>>;
|
|
76
|
+
delete<T = any>(url: string, params?: any, reqOptions?: ReqOptions): Promise<ApiResult<T>>;
|
|
77
|
+
}
|
|
78
|
+
type DeepPartialConfig = Record<string, any>;
|
|
79
|
+
/**
|
|
80
|
+
* 全局单例(脱离组件直接调用,PRD 5.1)
|
|
81
|
+
*/
|
|
82
|
+
export declare const request: WorkDesktopHttp;
|
|
83
|
+
export default request;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 声明式联动注册中心(PRD 6.2)
|
|
3
|
+
*
|
|
4
|
+
* filter 分组机制:所有参与联动的组件有通用 prop `filter`(默认 '')。
|
|
5
|
+
* 联动只在 filter 相同的组件之间发生。
|
|
6
|
+
*
|
|
7
|
+
* DataGrid 挂载时按 filter 注册到注册中心;
|
|
8
|
+
* DataForm / ApiButton / Dialog / Drawer 等动作完成后,
|
|
9
|
+
* 调用 refreshDataGrid(headRefreshDatagrid, selfFilter) 刷新目标。
|
|
10
|
+
*/
|
|
11
|
+
export interface DataGridInstance {
|
|
12
|
+
/** 组件 filter 分组标识 */
|
|
13
|
+
filter: string;
|
|
14
|
+
/** 刷新当前页数据 */
|
|
15
|
+
refresh: () => any;
|
|
16
|
+
/** 带搜索参数查询(重置到第一页,合并搜索条件) */
|
|
17
|
+
search?: (params?: Record<string, any>) => any;
|
|
18
|
+
/** 清空搜索条件并刷新 */
|
|
19
|
+
resetSearch?: () => any;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 注册 DataGrid 实例,返回注销函数(组件 onUnmounted 调用)
|
|
23
|
+
*/
|
|
24
|
+
export declare function registerDataGrid(instance: DataGridInstance): () => void;
|
|
25
|
+
/**
|
|
26
|
+
* 刷新目标 DataGrid
|
|
27
|
+
* @param headRefreshDatagrid true=刷同 filter 组;字符串=定向刷该 filter 组
|
|
28
|
+
* @param selfFilter 发起组件自身 filter
|
|
29
|
+
* @returns 被刷新的实例数量
|
|
30
|
+
*/
|
|
31
|
+
export declare function refreshDataGrid(headRefreshDatagrid: boolean | string | undefined, selfFilter?: string): number;
|
|
32
|
+
/**
|
|
33
|
+
* 获取某 filter 组的 DataGrid 实例(事件联动 / 自定义逻辑用)
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDataGrids(filter?: string): DataGridInstance[];
|
|
36
|
+
/**
|
|
37
|
+
* SearchPanel 联动:带搜索参数刷新目标 DataGrid(重置到第一页)
|
|
38
|
+
* @param params 搜索表单值
|
|
39
|
+
*/
|
|
40
|
+
export declare function searchDataGrid(params: Record<string, any> | undefined, headRefreshDatagrid: boolean | string | undefined, selfFilter?: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* SearchPanel 重置联动:清空目标 DataGrid 搜索条件并刷新
|
|
43
|
+
*/
|
|
44
|
+
export declare function resetSearchDataGrid(headRefreshDatagrid: boolean | string | undefined, selfFilter?: string): number;
|
|
45
|
+
/**
|
|
46
|
+
* 仅供测试 / 调试:清空注册中心
|
|
47
|
+
*/
|
|
48
|
+
export declare function clearLinkageRegistry(): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用工具函数
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 判断是否为普通对象(用于 deep merge)
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPlainObject(value: unknown): value is Record<string, any>;
|
|
8
|
+
/**
|
|
9
|
+
* deep merge:对象深合并;数组覆盖;基本类型后者覆盖前者
|
|
10
|
+
* 与 lodash.merge 语义一致:从左到右,后者优先级高
|
|
11
|
+
*/
|
|
12
|
+
export declare function deepMerge<T = any>(...sources: any[]): T;
|
|
13
|
+
/**
|
|
14
|
+
* 按路径取对象值,如 getValue(obj, 'a.b.c')
|
|
15
|
+
*/
|
|
16
|
+
export declare function getValueByPath(obj: any, path: string): any;
|
|
17
|
+
export declare function uniqueId(prefix?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* 安全 JSON parse(localStorage 用)
|
|
20
|
+
*/
|
|
21
|
+
export declare function safeJsonParse<T>(text: string | null, fallback: T): T;
|
|
22
|
+
/**
|
|
23
|
+
* 防抖
|
|
24
|
+
*/
|
|
25
|
+
export declare function debounce<F extends (...args: any[]) => any>(fn: F, wait?: number): {
|
|
26
|
+
(this: unknown, ...args: Parameters<F>): void;
|
|
27
|
+
cancel(): void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue 插件入口(PRD 8.2 双入口)
|
|
3
|
+
*
|
|
4
|
+
* npm:app.use(WorkDesktop, config)
|
|
5
|
+
* script:window.workDesktopConfig 配置 + window.WorkDesktop 自动安装
|
|
6
|
+
*/
|
|
7
|
+
import type { Plugin } from 'vue';
|
|
8
|
+
declare const install: Plugin['install'];
|
|
9
|
+
declare const WorkDesktop: Plugin;
|
|
10
|
+
export default WorkDesktop;
|
|
11
|
+
export { install };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkDesktop 全局配置类型(PRD 5.2)
|
|
3
|
+
*/
|
|
4
|
+
export type DeepPartial<T> = {
|
|
5
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
6
|
+
};
|
|
7
|
+
export interface RequestLoadingConfig {
|
|
8
|
+
enable: boolean;
|
|
9
|
+
props?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
export interface PageParamConfig {
|
|
12
|
+
/** 当前页字段名,默认 'currentPage' */
|
|
13
|
+
pageField: string;
|
|
14
|
+
/** 每页条数字段名,默认 'pageSize' */
|
|
15
|
+
sizeField: string;
|
|
16
|
+
/** 搜索条件外层字段名,默认 'param' */
|
|
17
|
+
searchField: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TransformConfig {
|
|
20
|
+
/** 请求拦截器(加 token 等),返回处理后的 axios config */
|
|
21
|
+
requestInterceptor?: (config: any) => any;
|
|
22
|
+
/** 响应拦截器 */
|
|
23
|
+
responseInterceptor?: (response: any) => any;
|
|
24
|
+
}
|
|
25
|
+
export interface RequestConfig {
|
|
26
|
+
/** 接口地址前缀 */
|
|
27
|
+
urlPrefix: string;
|
|
28
|
+
/** 网络异常是否抛出 */
|
|
29
|
+
throwException: boolean;
|
|
30
|
+
loading: RequestLoadingConfig;
|
|
31
|
+
/** 透传给 axios 的配置(headers、timeout、withCredentials 等) */
|
|
32
|
+
axiosConfig: Record<string, any>;
|
|
33
|
+
pageParam: PageParamConfig;
|
|
34
|
+
transform: TransformConfig;
|
|
35
|
+
}
|
|
36
|
+
export interface ResponsePropsConfig {
|
|
37
|
+
codeName: string;
|
|
38
|
+
messageName: string;
|
|
39
|
+
dataName: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ResponseListConfig {
|
|
42
|
+
listName: string;
|
|
43
|
+
totalName: string;
|
|
44
|
+
pageSizeName: string;
|
|
45
|
+
currentPageName: string;
|
|
46
|
+
}
|
|
47
|
+
export interface TipsConfig {
|
|
48
|
+
/** 提示类型:success/warning/error/info/message/notify/none */
|
|
49
|
+
tipsType: string;
|
|
50
|
+
/** 是否显示提示 */
|
|
51
|
+
showTips?: boolean;
|
|
52
|
+
/** 透传给 ElMessage/ElNotification 的属性 */
|
|
53
|
+
props?: Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
export interface ResponseConfig {
|
|
56
|
+
props: ResponsePropsConfig;
|
|
57
|
+
/** code >= successCode 视为成功(负数为失败) */
|
|
58
|
+
successCode: number;
|
|
59
|
+
list: ResponseListConfig;
|
|
60
|
+
success: TipsConfig;
|
|
61
|
+
fail: TipsConfig;
|
|
62
|
+
exception: TipsConfig;
|
|
63
|
+
complete: {
|
|
64
|
+
tipsType: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface PagerConfig {
|
|
68
|
+
size: number;
|
|
69
|
+
pageSizes: number[];
|
|
70
|
+
pageSize: number;
|
|
71
|
+
layout: string;
|
|
72
|
+
hideOnSinglePage: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface PageConfig {
|
|
75
|
+
/** 全局尺寸:large/default/small */
|
|
76
|
+
global: {
|
|
77
|
+
size: string;
|
|
78
|
+
};
|
|
79
|
+
/** 按组件类型的默认配置,key 为组件 PascalName,如 WdDatagrid */
|
|
80
|
+
componentDefault: Record<string, any>;
|
|
81
|
+
pager: PagerConfig;
|
|
82
|
+
}
|
|
83
|
+
export interface ThemeConfig {
|
|
84
|
+
/** 语义令牌覆盖(primary/success/warning/danger/info) */
|
|
85
|
+
colors?: Record<string, string>;
|
|
86
|
+
/** CSS 变量覆盖(--wd-* / --el-*),优先级高于 colors */
|
|
87
|
+
cssVars?: Record<string, string>;
|
|
88
|
+
}
|
|
89
|
+
export interface WorkDesktopConfig {
|
|
90
|
+
page: PageConfig;
|
|
91
|
+
request: RequestConfig;
|
|
92
|
+
response: ResponseConfig;
|
|
93
|
+
theme: ThemeConfig;
|
|
94
|
+
}
|
|
95
|
+
/** 请求级覆盖项(PRD 5.1 reqOptions) */
|
|
96
|
+
export interface ReqOptions {
|
|
97
|
+
/** 是否显示 loading */
|
|
98
|
+
showLoading?: boolean;
|
|
99
|
+
/** 是否显示提示 */
|
|
100
|
+
showTips?: boolean;
|
|
101
|
+
/** 提示配置覆盖 */
|
|
102
|
+
tipsConfig?: Partial<Record<'success' | 'fail' | 'exception', TipsConfig>>;
|
|
103
|
+
/** 透传给 axios 的单次配置 */
|
|
104
|
+
axiosConfig?: Record<string, any>;
|
|
105
|
+
/** AbortSignal,用于中断 */
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
/** 是否列表请求(影响封包分页参数与解封列表结构),由调用方组件控制,http 不强制 */
|
|
108
|
+
[key: string]: any;
|
|
109
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workdesktop-ai",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "WorkDesktop 企业级 Vue3 组件库(基于 ElementPlus,HTML 模板渲染友好、AI 编码友好)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.umd.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.esm.js",
|
|
13
|
+
"require": "./dist/index.umd.js"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/style.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"CHANGELOG.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "vite build && npm run build:types",
|
|
26
|
+
"build:lib": "vite build",
|
|
27
|
+
"build:types": "vue-tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
28
|
+
"typecheck": "vue-tsc --noEmit",
|
|
29
|
+
"preview": "vite preview",
|
|
30
|
+
"docs:dev": "vite --config docs/vite.config.ts",
|
|
31
|
+
"docs:build": "vite build --config docs/vite.config.ts",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"test:coverage": "vitest run --coverage"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"vue3",
|
|
38
|
+
"element-plus",
|
|
39
|
+
"component-library",
|
|
40
|
+
"workdesktop",
|
|
41
|
+
"datagrid",
|
|
42
|
+
"dataform"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@element-plus/icons-vue": "^2.0.0",
|
|
47
|
+
"element-plus": "^2.5.0",
|
|
48
|
+
"vue": "^3.3.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"axios": "^1.7.7"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@element-plus/icons-vue": "^2.3.1",
|
|
55
|
+
"@types/node": "^22.7.0",
|
|
56
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
|
57
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
58
|
+
"@vue/test-utils": "^2.5.0",
|
|
59
|
+
"element-plus": "^2.8.4",
|
|
60
|
+
"happy-dom": "^20.14.0",
|
|
61
|
+
"typescript": "~5.6.2",
|
|
62
|
+
"vite": "^5.4.8",
|
|
63
|
+
"vitest": "^2.1.9",
|
|
64
|
+
"vue": "^3.5.10",
|
|
65
|
+
"vue-router": "^4.6.4",
|
|
66
|
+
"vue-tsc": "^2.1.6"
|
|
67
|
+
}
|
|
68
|
+
}
|