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.
Files changed (56) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +21 -0
  3. package/README.md +214 -0
  4. package/dist/index.esm.js +6531 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/index.umd.js +11 -0
  7. package/dist/index.umd.js.map +1 -0
  8. package/dist/style.css +1 -0
  9. package/dist/types/src/components/buttons/ApiButton.vue.d.ts +96 -0
  10. package/dist/types/src/components/buttons/ConfirmButton.vue.d.ts +131 -0
  11. package/dist/types/src/components/buttons/DialogButton.vue.d.ts +107 -0
  12. package/dist/types/src/components/buttons/DrawerButton.vue.d.ts +118 -0
  13. package/dist/types/src/components/buttons/PromptButton.vue.d.ts +140 -0
  14. package/dist/types/src/components/buttons/RouteButton.vue.d.ts +84 -0
  15. package/dist/types/src/components/buttons/TipsButton.vue.d.ts +64 -0
  16. package/dist/types/src/components/buttons/useApiAction.d.ts +20 -0
  17. package/dist/types/src/components/common/props.d.ts +85 -0
  18. package/dist/types/src/components/containers/Dialog.vue.d.ts +112 -0
  19. package/dist/types/src/components/containers/Drawer.vue.d.ts +119 -0
  20. package/dist/types/src/components/containers/Iframe.vue.d.ts +44 -0
  21. package/dist/types/src/components/containers/SearchPanel.vue.d.ts +152 -0
  22. package/dist/types/src/components/containers/containerContext.d.ts +15 -0
  23. package/dist/types/src/components/containers/useContainerController.d.ts +19 -0
  24. package/dist/types/src/components/data/datagrid/DataGrid.vue.d.ts +335 -0
  25. package/dist/types/src/components/data/datagrid/useColumnSettings.d.ts +48 -0
  26. package/dist/types/src/components/data/editable-table/EditableTable.vue.d.ts +306 -0
  27. package/dist/types/src/components/form/data-form/DataForm.vue.d.ts +311 -0
  28. package/dist/types/src/components/index.d.ts +27 -0
  29. package/dist/types/src/components/inputs/AutoComplete.vue.d.ts +157 -0
  30. package/dist/types/src/components/inputs/CheckboxList.vue.d.ts +141 -0
  31. package/dist/types/src/components/inputs/RadioList.vue.d.ts +141 -0
  32. package/dist/types/src/components/inputs/Select.vue.d.ts +166 -0
  33. package/dist/types/src/components/inputs/Switch.vue.d.ts +116 -0
  34. package/dist/types/src/components/inputs/useOptionsLoader.d.ts +29 -0
  35. package/dist/types/src/components/styles/Panel.vue.d.ts +41 -0
  36. package/dist/types/src/components/styles/Tips.vue.d.ts +60 -0
  37. package/dist/types/src/components/upload/ImageUpload.vue.d.ts +176 -0
  38. package/dist/types/src/components/upload/Upload.vue.d.ts +235 -0
  39. package/dist/types/src/components/utils/Viewer.vue.d.ts +131 -0
  40. package/dist/types/src/index.d.ts +20 -0
  41. package/dist/types/src/lib/composables/useConfig.d.ts +19 -0
  42. package/dist/types/src/lib/composables/useDataGrid.d.ts +54 -0
  43. package/dist/types/src/lib/composables/useEventBus.d.ts +16 -0
  44. package/dist/types/src/lib/composables/useGlobalState.d.ts +5 -0
  45. package/dist/types/src/lib/composables/useRequest.d.ts +42 -0
  46. package/dist/types/src/lib/configs/default-config.d.ts +6 -0
  47. package/dist/types/src/lib/core/config.d.ts +28 -0
  48. package/dist/types/src/lib/core/http.d.ts +83 -0
  49. package/dist/types/src/lib/core/linkage.d.ts +48 -0
  50. package/dist/types/src/lib/core/theme.d.ts +6 -0
  51. package/dist/types/src/lib/core/utils.d.ts +28 -0
  52. package/dist/types/src/lib/install.d.ts +11 -0
  53. package/dist/types/src/types/config.d.ts +109 -0
  54. package/dist/types/src/types/index.d.ts +4 -0
  55. package/dist/types/vite.config.d.ts +2 -0
  56. package/package.json +68 -0
@@ -0,0 +1,176 @@
1
+ import type { UploadInstance } from 'element-plus';
2
+ import type { PropType } from 'vue';
3
+ declare function clearFiles(): void;
4
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ /** 上传地址 */
6
+ api: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ /** 后端删除地址 */
11
+ deleteApi: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ /** 删除请求方法 */
16
+ deleteMethod: {
17
+ type: PropType<"get" | "post" | "put" | "delete">;
18
+ default: string;
19
+ };
20
+ /** 删除主键字段 */
21
+ primaryKey: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ /** 最大图片数量,超限隐藏加号 */
26
+ maxCount: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ /** 缩略图尺寸(px) */
31
+ thumbnailSize: {
32
+ type: NumberConstructor;
33
+ default: number;
34
+ };
35
+ /** 是否点击缩略图大图预览(集成 Viewer) */
36
+ preview: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
40
+ /** 接收类型,默认 image/* */
41
+ accept: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ /** 单图大小限制(MB) */
46
+ maxSize: {
47
+ type: NumberConstructor;
48
+ default: number;
49
+ };
50
+ /** 提示文案 */
51
+ tip: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ /** v-model:已上传图片地址数组 */
56
+ modelValue: {
57
+ type: PropType<string[]>;
58
+ default: () => never[];
59
+ };
60
+ headRefreshDatagrid: {
61
+ type: PropType<boolean | string>;
62
+ default: boolean;
63
+ };
64
+ filter: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ }>, {
69
+ clearFiles: typeof clearFiles;
70
+ uploadRef: import("vue").Ref<UploadInstance | undefined, UploadInstance | undefined>;
71
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
72
+ success: (...args: any[]) => void;
73
+ error: (...args: any[]) => void;
74
+ apiBefore: (...args: any[]) => void;
75
+ apiSuccess: (...args: any[]) => void;
76
+ apiFail: (...args: any[]) => void;
77
+ apiException: (...args: any[]) => void;
78
+ apiAfter: (...args: any[]) => void;
79
+ "update:modelValue": (...args: any[]) => void;
80
+ change: (...args: any[]) => void;
81
+ "delete-success": (...args: any[]) => void;
82
+ preview: (...args: any[]) => void;
83
+ exceed: (...args: any[]) => void;
84
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
85
+ /** 上传地址 */
86
+ api: {
87
+ type: StringConstructor;
88
+ default: string;
89
+ };
90
+ /** 后端删除地址 */
91
+ deleteApi: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ /** 删除请求方法 */
96
+ deleteMethod: {
97
+ type: PropType<"get" | "post" | "put" | "delete">;
98
+ default: string;
99
+ };
100
+ /** 删除主键字段 */
101
+ primaryKey: {
102
+ type: StringConstructor;
103
+ default: string;
104
+ };
105
+ /** 最大图片数量,超限隐藏加号 */
106
+ maxCount: {
107
+ type: NumberConstructor;
108
+ default: number;
109
+ };
110
+ /** 缩略图尺寸(px) */
111
+ thumbnailSize: {
112
+ type: NumberConstructor;
113
+ default: number;
114
+ };
115
+ /** 是否点击缩略图大图预览(集成 Viewer) */
116
+ preview: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ /** 接收类型,默认 image/* */
121
+ accept: {
122
+ type: StringConstructor;
123
+ default: string;
124
+ };
125
+ /** 单图大小限制(MB) */
126
+ maxSize: {
127
+ type: NumberConstructor;
128
+ default: number;
129
+ };
130
+ /** 提示文案 */
131
+ tip: {
132
+ type: StringConstructor;
133
+ default: string;
134
+ };
135
+ /** v-model:已上传图片地址数组 */
136
+ modelValue: {
137
+ type: PropType<string[]>;
138
+ default: () => never[];
139
+ };
140
+ headRefreshDatagrid: {
141
+ type: PropType<boolean | string>;
142
+ default: boolean;
143
+ };
144
+ filter: {
145
+ type: StringConstructor;
146
+ default: string;
147
+ };
148
+ }>> & Readonly<{
149
+ onSuccess?: ((...args: any[]) => any) | undefined;
150
+ onError?: ((...args: any[]) => any) | undefined;
151
+ onApiBefore?: ((...args: any[]) => any) | undefined;
152
+ onApiSuccess?: ((...args: any[]) => any) | undefined;
153
+ onApiFail?: ((...args: any[]) => any) | undefined;
154
+ onApiException?: ((...args: any[]) => any) | undefined;
155
+ onApiAfter?: ((...args: any[]) => any) | undefined;
156
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
157
+ onChange?: ((...args: any[]) => any) | undefined;
158
+ "onDelete-success"?: ((...args: any[]) => any) | undefined;
159
+ onPreview?: ((...args: any[]) => any) | undefined;
160
+ onExceed?: ((...args: any[]) => any) | undefined;
161
+ }>, {
162
+ filter: string;
163
+ api: string;
164
+ modelValue: string[];
165
+ headRefreshDatagrid: string | boolean;
166
+ deleteApi: string;
167
+ deleteMethod: "delete" | "get" | "post" | "put";
168
+ primaryKey: string;
169
+ accept: string;
170
+ maxSize: number;
171
+ preview: boolean;
172
+ tip: string;
173
+ maxCount: number;
174
+ thumbnailSize: number;
175
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
176
+ export default _default;
@@ -0,0 +1,235 @@
1
+ import type { UploadInstance, UploadUserFile } from 'element-plus';
2
+ import type { PropType } from 'vue';
3
+ /** 手动触发上传(auto-upload=false) */
4
+ declare function submitUpload(): void;
5
+ declare function clearFiles(): void;
6
+ /** 追加外部文件记录(如表单回显) */
7
+ declare function addFile(file: UploadUserFile): void;
8
+ declare var __VLS_7: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_7) => any;
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ /** 上传地址(走全局 urlPrefix 拼接;为空则 el-upload 不真正提交,由外部接管) */
14
+ api: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ /** 后端删除地址 */
19
+ deleteApi: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ /** 删除请求方法 */
24
+ deleteMethod: {
25
+ type: PropType<"get" | "post" | "put" | "delete">;
26
+ default: string;
27
+ };
28
+ /** 删除时取文件记录的主键字段名 */
29
+ primaryKey: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ /** 手动提交按钮文案(auto-upload=false 时显示) */
34
+ submitButtonText: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ /** 选择按钮文案(默认插槽未提供时) */
39
+ buttonText: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ accept: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ limit: {
48
+ type: NumberConstructor;
49
+ default: undefined;
50
+ };
51
+ multiple: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ autoUpload: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ /** 上传字段名 */
60
+ name: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
64
+ /** 附加表单数据 */
65
+ data: {
66
+ type: PropType<Record<string, any>>;
67
+ default: () => {};
68
+ };
69
+ disabled: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ showFileList: {
74
+ type: BooleanConstructor;
75
+ default: boolean;
76
+ };
77
+ /** 文件大小限制(MB),0 不限制 */
78
+ maxSize: {
79
+ type: NumberConstructor;
80
+ default: number;
81
+ };
82
+ /** v-model 绑定的已上传文件列表(含后端返回记录) */
83
+ modelValue: {
84
+ type: PropType<UploadUserFile[]>;
85
+ default: () => never[];
86
+ };
87
+ headRefreshDatagrid: {
88
+ type: PropType<boolean | string>;
89
+ default: boolean;
90
+ };
91
+ filter: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ }>, {
96
+ submitUpload: typeof submitUpload;
97
+ clearFiles: typeof clearFiles;
98
+ addFile: typeof addFile;
99
+ uploadRef: import("vue").Ref<UploadInstance | undefined, UploadInstance | undefined>;
100
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
101
+ success: (...args: any[]) => void;
102
+ error: (...args: any[]) => void;
103
+ apiBefore: (...args: any[]) => void;
104
+ apiSuccess: (...args: any[]) => void;
105
+ apiFail: (...args: any[]) => void;
106
+ apiException: (...args: any[]) => void;
107
+ apiAfter: (...args: any[]) => void;
108
+ "update:modelValue": (...args: any[]) => void;
109
+ change: (...args: any[]) => void;
110
+ "delete-success": (...args: any[]) => void;
111
+ preview: (...args: any[]) => void;
112
+ exceed: (...args: any[]) => void;
113
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
114
+ /** 上传地址(走全局 urlPrefix 拼接;为空则 el-upload 不真正提交,由外部接管) */
115
+ api: {
116
+ type: StringConstructor;
117
+ default: string;
118
+ };
119
+ /** 后端删除地址 */
120
+ deleteApi: {
121
+ type: StringConstructor;
122
+ default: string;
123
+ };
124
+ /** 删除请求方法 */
125
+ deleteMethod: {
126
+ type: PropType<"get" | "post" | "put" | "delete">;
127
+ default: string;
128
+ };
129
+ /** 删除时取文件记录的主键字段名 */
130
+ primaryKey: {
131
+ type: StringConstructor;
132
+ default: string;
133
+ };
134
+ /** 手动提交按钮文案(auto-upload=false 时显示) */
135
+ submitButtonText: {
136
+ type: StringConstructor;
137
+ default: string;
138
+ };
139
+ /** 选择按钮文案(默认插槽未提供时) */
140
+ buttonText: {
141
+ type: StringConstructor;
142
+ default: string;
143
+ };
144
+ accept: {
145
+ type: StringConstructor;
146
+ default: string;
147
+ };
148
+ limit: {
149
+ type: NumberConstructor;
150
+ default: undefined;
151
+ };
152
+ multiple: {
153
+ type: BooleanConstructor;
154
+ default: boolean;
155
+ };
156
+ autoUpload: {
157
+ type: BooleanConstructor;
158
+ default: boolean;
159
+ };
160
+ /** 上传字段名 */
161
+ name: {
162
+ type: StringConstructor;
163
+ default: string;
164
+ };
165
+ /** 附加表单数据 */
166
+ data: {
167
+ type: PropType<Record<string, any>>;
168
+ default: () => {};
169
+ };
170
+ disabled: {
171
+ type: BooleanConstructor;
172
+ default: boolean;
173
+ };
174
+ showFileList: {
175
+ type: BooleanConstructor;
176
+ default: boolean;
177
+ };
178
+ /** 文件大小限制(MB),0 不限制 */
179
+ maxSize: {
180
+ type: NumberConstructor;
181
+ default: number;
182
+ };
183
+ /** v-model 绑定的已上传文件列表(含后端返回记录) */
184
+ modelValue: {
185
+ type: PropType<UploadUserFile[]>;
186
+ default: () => never[];
187
+ };
188
+ headRefreshDatagrid: {
189
+ type: PropType<boolean | string>;
190
+ default: boolean;
191
+ };
192
+ filter: {
193
+ type: StringConstructor;
194
+ default: string;
195
+ };
196
+ }>> & Readonly<{
197
+ onSuccess?: ((...args: any[]) => any) | undefined;
198
+ onError?: ((...args: any[]) => any) | undefined;
199
+ onApiBefore?: ((...args: any[]) => any) | undefined;
200
+ onApiSuccess?: ((...args: any[]) => any) | undefined;
201
+ onApiFail?: ((...args: any[]) => any) | undefined;
202
+ onApiException?: ((...args: any[]) => any) | undefined;
203
+ onApiAfter?: ((...args: any[]) => any) | undefined;
204
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
205
+ onChange?: ((...args: any[]) => any) | undefined;
206
+ "onDelete-success"?: ((...args: any[]) => any) | undefined;
207
+ onPreview?: ((...args: any[]) => any) | undefined;
208
+ onExceed?: ((...args: any[]) => any) | undefined;
209
+ }>, {
210
+ data: Record<string, any>;
211
+ disabled: boolean;
212
+ name: string;
213
+ filter: string;
214
+ api: string;
215
+ modelValue: UploadUserFile[];
216
+ headRefreshDatagrid: string | boolean;
217
+ multiple: boolean;
218
+ deleteApi: string;
219
+ deleteMethod: "delete" | "get" | "post" | "put";
220
+ primaryKey: string;
221
+ submitButtonText: string;
222
+ buttonText: string;
223
+ accept: string;
224
+ limit: number;
225
+ autoUpload: boolean;
226
+ showFileList: boolean;
227
+ maxSize: number;
228
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
229
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
230
+ export default _default;
231
+ type __VLS_WithSlots<T, S> = T & {
232
+ new (): {
233
+ $slots: S;
234
+ };
235
+ };
@@ -0,0 +1,131 @@
1
+ import type { PropType } from 'vue';
2
+ declare function zoomIn(): void;
3
+ declare function zoomOut(): void;
4
+ declare function rotateLeft(): void;
5
+ declare function rotateRight(): void;
6
+ declare function close(): void;
7
+ /** 外部打开(与 v-model 等价的命令式入口) */
8
+ declare function open(src?: string | string[]): void;
9
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ /** 预览源:单个地址或地址数组(图片数组支持轮播) */
11
+ src: {
12
+ type: PropType<string | string[]>;
13
+ default: string;
14
+ };
15
+ /** 内容类型;缺省按 src 后缀推断 */
16
+ type: {
17
+ type: PropType<"image" | "pdf" | "doc">;
18
+ default: undefined;
19
+ };
20
+ /** 是否显示(v-model) */
21
+ modelValue: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ /** 初始缩放比例 */
26
+ zoom: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ /** 初始旋转角度 */
31
+ rotate: {
32
+ type: NumberConstructor;
33
+ default: number;
34
+ };
35
+ /** 初始页码/图片索引(从 1 开始) */
36
+ page: {
37
+ type: NumberConstructor;
38
+ default: number;
39
+ };
40
+ /** 缩放步长 */
41
+ zoomStep: {
42
+ type: NumberConstructor;
43
+ default: number;
44
+ };
45
+ /** 最小/最大缩放 */
46
+ minZoom: {
47
+ type: NumberConstructor;
48
+ default: number;
49
+ };
50
+ maxZoom: {
51
+ type: NumberConstructor;
52
+ default: number;
53
+ };
54
+ }>, {
55
+ open: typeof open;
56
+ close: typeof close;
57
+ zoomIn: typeof zoomIn;
58
+ zoomOut: typeof zoomOut;
59
+ rotateLeft: typeof rotateLeft;
60
+ rotateRight: typeof rotateRight;
61
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
62
+ close: (...args: any[]) => void;
63
+ "page-change": (...args: any[]) => void;
64
+ "update:modelValue": (...args: any[]) => void;
65
+ open: (...args: any[]) => void;
66
+ "zoom-change": (...args: any[]) => void;
67
+ "rotate-change": (...args: any[]) => void;
68
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
69
+ /** 预览源:单个地址或地址数组(图片数组支持轮播) */
70
+ src: {
71
+ type: PropType<string | string[]>;
72
+ default: string;
73
+ };
74
+ /** 内容类型;缺省按 src 后缀推断 */
75
+ type: {
76
+ type: PropType<"image" | "pdf" | "doc">;
77
+ default: undefined;
78
+ };
79
+ /** 是否显示(v-model) */
80
+ modelValue: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ /** 初始缩放比例 */
85
+ zoom: {
86
+ type: NumberConstructor;
87
+ default: number;
88
+ };
89
+ /** 初始旋转角度 */
90
+ rotate: {
91
+ type: NumberConstructor;
92
+ default: number;
93
+ };
94
+ /** 初始页码/图片索引(从 1 开始) */
95
+ page: {
96
+ type: NumberConstructor;
97
+ default: number;
98
+ };
99
+ /** 缩放步长 */
100
+ zoomStep: {
101
+ type: NumberConstructor;
102
+ default: number;
103
+ };
104
+ /** 最小/最大缩放 */
105
+ minZoom: {
106
+ type: NumberConstructor;
107
+ default: number;
108
+ };
109
+ maxZoom: {
110
+ type: NumberConstructor;
111
+ default: number;
112
+ };
113
+ }>> & Readonly<{
114
+ onClose?: ((...args: any[]) => any) | undefined;
115
+ "onPage-change"?: ((...args: any[]) => any) | undefined;
116
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
117
+ onOpen?: ((...args: any[]) => any) | undefined;
118
+ "onZoom-change"?: ((...args: any[]) => any) | undefined;
119
+ "onRotate-change"?: ((...args: any[]) => any) | undefined;
120
+ }>, {
121
+ type: "image" | "pdf" | "doc";
122
+ page: number;
123
+ modelValue: boolean;
124
+ src: string | string[];
125
+ zoom: number;
126
+ rotate: number;
127
+ zoomStep: number;
128
+ minZoom: number;
129
+ maxZoom: number;
130
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
131
+ export default _default;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WorkDesktop 组件库主入口
3
+ *
4
+ * ESM:import WorkDesktop from 'workdesktop-ai'
5
+ * UMD:window.WorkDesktop(script 标签,配合 window.workDesktopConfig)
6
+ */
7
+ import './styles/index.css';
8
+ export { default as WorkDesktop, default } from './lib/install';
9
+ export * from './components';
10
+ export { initConfig, setGlobalConfig, getGlobalConfig, resetConfig, mergeConfig, getComponentDefault } from './lib/core/config';
11
+ export { request, default as http } from './lib/core/http';
12
+ export type { ApiResult, ApiEventPayload, ApiEventType, ApiEventHandler } from './lib/core/http';
13
+ export { registerDataGrid, refreshDataGrid, searchDataGrid, resetSearchDataGrid, getDataGrids, clearLinkageRegistry } from './lib/core/linkage';
14
+ export { useRequest } from './lib/composables/useRequest';
15
+ export { useDataGrid } from './lib/composables/useDataGrid';
16
+ export { useConfig, useGlobalConfig } from './lib/composables/useConfig';
17
+ export { useEventBus } from './lib/composables/useEventBus';
18
+ export { useGlobalState } from './lib/composables/useGlobalState';
19
+ export { deepMerge } from './lib/core/utils';
20
+ export type * from './types';
@@ -0,0 +1,19 @@
1
+ import type { WorkDesktopConfig } from '../../types/config';
2
+ /**
3
+ * useConfig(PRD 5.3 / 5.2)
4
+ *
5
+ * 组件内合并三级配置:全局 componentDefault[组件名] → 本地 props。
6
+ * 全局配置在组件 onMounted 时读取一次并缓存(运行中改配置只影响新挂载组件)。
7
+ *
8
+ * 返回一个响应式 ref,merge 后的组件配置对象:
9
+ * componentDefault 的值作为默认,props 中非 undefined 的值覆盖。
10
+ *
11
+ * @example
12
+ * const cfg = useConfig('WdDatagrid', props)
13
+ * cfg.value.withPager
14
+ */
15
+ export declare function useConfig<T extends Record<string, any> = Record<string, any>>(componentName?: string, props?: T): import("vue").Ref<any, any> extends T ? 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, T>;
16
+ /**
17
+ * 非响应式:直接取当前全局 WorkDesktopConfig
18
+ */
19
+ export declare function useGlobalConfig(): WorkDesktopConfig;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * useDataGrid(PRD 5.3)
3
+ * DataGrid 状态管理:分页 / 搜索 / 选中 / 请求
4
+ *
5
+ * @example
6
+ * const grid = useDataGrid({ pageSize: 20 })
7
+ * grid.fetchData()
8
+ */
9
+ export interface UseDataGridOptions {
10
+ /** 数据接口地址 */
11
+ api?: string;
12
+ /** 请求方法,默认 post */
13
+ apiMethod?: 'get' | 'post' | 'put' | 'delete';
14
+ /** 固定请求参数 */
15
+ apiParam?: Record<string, any>;
16
+ /** 初始每页条数 */
17
+ pageSize?: number;
18
+ /** 是否自动请求 */
19
+ immediate?: boolean;
20
+ /** 请求级覆盖 */
21
+ reqOptions?: import('../../types/config').ReqOptions;
22
+ /** 请求成功回调(解封后的列表结果) */
23
+ onLoaded?: (result: {
24
+ list: any[];
25
+ total: number;
26
+ }) => void;
27
+ }
28
+ export interface ListData {
29
+ list: any[];
30
+ total: number;
31
+ pageSize: number;
32
+ currentPage: number;
33
+ }
34
+ export declare function useDataGrid(options?: UseDataGridOptions): {
35
+ currentPage: import("vue").Ref<number, number>;
36
+ page: import("vue").Ref<number, number>;
37
+ pageSize: import("vue").Ref<number, number>;
38
+ total: import("vue").Ref<number, number>;
39
+ list: import("vue").ShallowRef<any[], any[]>;
40
+ loading: import("vue").Ref<boolean, boolean>;
41
+ searchParams: Record<string, any>;
42
+ selection: import("vue").Ref<any[], any[]>;
43
+ fetchData: (extra?: Record<string, any>) => Promise<ListData>;
44
+ refresh: () => Promise<ListData>;
45
+ reset: () => Promise<ListData>;
46
+ search: (params?: Record<string, any>) => Promise<ListData>;
47
+ onChangeCurrentpage: (value: number) => Promise<ListData>;
48
+ onChangePagesize: (value: number) => Promise<ListData>;
49
+ setSelection: (rows: any[]) => void;
50
+ getSelection: () => any[];
51
+ clearSelection: () => void;
52
+ buildParams: (extra?: Record<string, any>) => Record<string, any>;
53
+ };
54
+ export type DataGridController = ReturnType<typeof useDataGrid>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 轻量事件总线(PRD 5.3 / 6.3)
3
+ * 跨组件事件联动。组件卸载自动 off。
4
+ */
5
+ type Handler = (payload?: any) => void;
6
+ declare function emit(event: string, payload?: any): void;
7
+ declare function off(event: string, handler: Handler): void;
8
+ declare function clear(event?: string): void;
9
+ export declare function useEventBus(): {
10
+ emit: typeof emit;
11
+ on: (event: string, handler: Handler) => () => void;
12
+ off: typeof off;
13
+ clear: typeof clear;
14
+ };
15
+ export type EventBus = ReturnType<typeof useEventBus>;
16
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function useGlobalState<T extends object = Record<string, any>>(key: string, initial?: T): {
2
+ state: T;
3
+ set: (partial: Partial<T> | ((prev: T) => Partial<T>)) => void;
4
+ reset: () => void;
5
+ };