@sunny-base-web/effects 0.0.1 → 0.2.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 (55) hide show
  1. package/dist/effects.css +1 -1
  2. package/dist/index.d.ts +1035 -0
  3. package/dist/index.js +13 -1
  4. package/dist/index.mjs +172814 -1639
  5. package/package.json +17 -9
  6. package/dist/@effects/src/access/accessible.d.ts +0 -1
  7. package/dist/@effects/src/access/accessible.d.ts.map +0 -1
  8. package/dist/@effects/src/api/core/index.d.ts +0 -28
  9. package/dist/@effects/src/api/core/index.d.ts.map +0 -1
  10. package/dist/@effects/src/api/request.d.ts +0 -15
  11. package/dist/@effects/src/api/request.d.ts.map +0 -1
  12. package/dist/@effects/src/api/user/index.d.ts +0 -13
  13. package/dist/@effects/src/api/user/index.d.ts.map +0 -1
  14. package/dist/@effects/src/config.d.ts +0 -97
  15. package/dist/@effects/src/config.d.ts.map +0 -1
  16. package/dist/@effects/src/index.d.ts +0 -8
  17. package/dist/@effects/src/index.d.ts.map +0 -1
  18. package/dist/@effects/src/layouts/basic-layout/header/breadcrumb.d.ts +0 -3
  19. package/dist/@effects/src/layouts/basic-layout/header/breadcrumb.d.ts.map +0 -1
  20. package/dist/@effects/src/layouts/basic-layout/header/language-toggle.d.ts +0 -3
  21. package/dist/@effects/src/layouts/basic-layout/header/language-toggle.d.ts.map +0 -1
  22. package/dist/@effects/src/layouts/basic-layout/header/search.d.ts +0 -6
  23. package/dist/@effects/src/layouts/basic-layout/header/search.d.ts.map +0 -1
  24. package/dist/@effects/src/layouts/basic-layout/header/theme-toggle.d.ts +0 -3
  25. package/dist/@effects/src/layouts/basic-layout/header/theme-toggle.d.ts.map +0 -1
  26. package/dist/@effects/src/layouts/basic-layout/index.d.ts +0 -60
  27. package/dist/@effects/src/layouts/basic-layout/index.d.ts.map +0 -1
  28. package/dist/@effects/src/layouts/basic-layout/menu-item.d.ts +0 -6
  29. package/dist/@effects/src/layouts/basic-layout/menu-item.d.ts.map +0 -1
  30. package/dist/@effects/src/layouts/basic-layout/tabbar/index.d.ts +0 -3
  31. package/dist/@effects/src/layouts/basic-layout/tabbar/index.d.ts.map +0 -1
  32. package/dist/@effects/src/layouts/index.d.ts +0 -2
  33. package/dist/@effects/src/layouts/index.d.ts.map +0 -1
  34. package/dist/@effects/src/login/index.d.ts +0 -77
  35. package/dist/@effects/src/login/index.d.ts.map +0 -1
  36. package/dist/@effects/src/request/src/index.d.ts +0 -3
  37. package/dist/@effects/src/request/src/index.d.ts.map +0 -1
  38. package/dist/@effects/src/request/src/request-client/index.d.ts +0 -4
  39. package/dist/@effects/src/request/src/request-client/index.d.ts.map +0 -1
  40. package/dist/@effects/src/request/src/request-client/modules/downloader.d.ts +0 -23
  41. package/dist/@effects/src/request/src/request-client/modules/downloader.d.ts.map +0 -1
  42. package/dist/@effects/src/request/src/request-client/modules/interceptor.d.ts +0 -10
  43. package/dist/@effects/src/request/src/request-client/modules/interceptor.d.ts.map +0 -1
  44. package/dist/@effects/src/request/src/request-client/modules/sse.d.ts +0 -19
  45. package/dist/@effects/src/request/src/request-client/modules/sse.d.ts.map +0 -1
  46. package/dist/@effects/src/request/src/request-client/modules/uploader.d.ts +0 -11
  47. package/dist/@effects/src/request/src/request-client/modules/uploader.d.ts.map +0 -1
  48. package/dist/@effects/src/request/src/request-client/preset-interceptors.d.ts +0 -19
  49. package/dist/@effects/src/request/src/request-client/preset-interceptors.d.ts.map +0 -1
  50. package/dist/@effects/src/request/src/request-client/request-client.d.ts +0 -48
  51. package/dist/@effects/src/request/src/request-client/request-client.d.ts.map +0 -1
  52. package/dist/@effects/src/request/src/request-client/types.d.ts +0 -51
  53. package/dist/@effects/src/request/src/request-client/types.d.ts.map +0 -1
  54. package/dist/@effects/src/utils/encryption.d.ts +0 -2
  55. package/dist/@effects/src/utils/encryption.d.ts.map +0 -1
@@ -0,0 +1,1035 @@
1
+ import { App } from 'vue';
2
+ import { AxiosInstance } from 'axios';
3
+ import { AxiosRequestConfig } from 'axios';
4
+ import { AxiosResponse } from 'axios';
5
+ import { BusinessSearchAdapter } from '../../../@ui/src/index.ts';
6
+ import { ComponentOptionsMixin } from 'vue';
7
+ import { ComponentProvideOptions } from 'vue';
8
+ import { ComputedRef } from 'vue';
9
+ import { CreateAxiosDefaults } from 'axios';
10
+ import { CreateComponentPublicInstanceWithMixins } from 'vue';
11
+ import { DefineComponent } from 'vue';
12
+ import { DefineSetupFnComponent } from 'vue';
13
+ import { ExtractPropTypes } from 'vue';
14
+ import { FavoriteItem } from '@sunny-base-web/stores';
15
+ import { FavoriteState } from '@sunny-base-web/stores';
16
+ import { FormApi } from '../../../@ui/src/index.ts';
17
+ import { FormCommonConfig } from '../../../@ui/src/index.ts';
18
+ import { FormSchema } from '../../../../../@ui/src/index.ts';
19
+ import { GlobalComponents } from 'vue';
20
+ import { GlobalDirectives } from 'vue';
21
+ import { InjectionKey } from 'vue';
22
+ import { InternalAxiosRequestConfig } from 'axios';
23
+ import { PiniaCustomStateProperties } from 'pinia';
24
+ import { PublicProps } from 'vue';
25
+ import { Ref } from 'vue';
26
+ import { RendererElement } from 'vue';
27
+ import { RendererNode } from 'vue';
28
+ import { Store } from 'pinia';
29
+ import { VNode } from 'vue';
30
+ import { VxeGridApi } from '../../../@ui/src/data/query-grid/api';
31
+ import { VxeGridProps } from 'vxe-table';
32
+
33
+ /**
34
+ * 添加收藏菜单
35
+ */
36
+ export declare function addFavorite(params: AddFavoriteParams): Promise<ResponseResult<void>>;
37
+
38
+ /**
39
+ * 添加收藏菜单参数
40
+ */
41
+ export declare interface AddFavoriteParams {
42
+ assQuickentry: {
43
+ nResourceid: number;
44
+ cCreateuser: string;
45
+ };
46
+ }
47
+
48
+ /**
49
+ * 新增表单配置
50
+ */
51
+ export declare const addFormSchema: FormSchema[];
52
+
53
+ export declare const authenticateResponseInterceptor: ({ client, doReAuthenticate, doRefreshToken, enableRefreshToken, formatToken, }: {
54
+ client: RequestClient;
55
+ doReAuthenticate: () => Promise<void>;
56
+ doRefreshToken: () => Promise<string>;
57
+ enableRefreshToken: boolean;
58
+ formatToken: (token: string) => null | string;
59
+ }) => ResponseInterceptorConfig;
60
+
61
+ /**
62
+ * 基础请求客户端
63
+ * 未配置拦截器等复杂逻辑,用于特殊场景
64
+ */
65
+ export declare const baseRequestClient: RequestClient;
66
+
67
+ export declare const BasicLayout: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
68
+ rootLayoutRef: CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes< {
69
+ hasSider: {
70
+ type: BooleanConstructor;
71
+ };
72
+ }>> & Readonly<{}>, {
73
+ classNames: ComputedRef<(string | {
74
+ [x: string]: number | true;
75
+ })[]>;
76
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
77
+ hasSider: boolean;
78
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
79
+ P: {};
80
+ B: {};
81
+ D: {};
82
+ C: {};
83
+ M: {};
84
+ Defaults: {};
85
+ }, Readonly<ExtractPropTypes< {
86
+ hasSider: {
87
+ type: BooleanConstructor;
88
+ };
89
+ }>> & Readonly<{}>, {
90
+ classNames: ComputedRef<(string | {
91
+ [x: string]: number | true;
92
+ })[]>;
93
+ }, {}, {}, {}, {
94
+ hasSider: boolean;
95
+ }> | null;
96
+ innerLayoutRef: CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes< {
97
+ hasSider: {
98
+ type: BooleanConstructor;
99
+ };
100
+ }>> & Readonly<{}>, {
101
+ classNames: ComputedRef<(string | {
102
+ [x: string]: number | true;
103
+ })[]>;
104
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
105
+ hasSider: boolean;
106
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
107
+ P: {};
108
+ B: {};
109
+ D: {};
110
+ C: {};
111
+ M: {};
112
+ Defaults: {};
113
+ }, Readonly<ExtractPropTypes< {
114
+ hasSider: {
115
+ type: BooleanConstructor;
116
+ };
117
+ }>> & Readonly<{}>, {
118
+ classNames: ComputedRef<(string | {
119
+ [x: string]: number | true;
120
+ })[]>;
121
+ }, {}, {}, {}, {
122
+ hasSider: boolean;
123
+ }> | null;
124
+ }, any>;
125
+
126
+ /**
127
+ * 业务码响应拦截器
128
+ * 处理后端返回的业务错误码(如 530 登录超时)
129
+ */
130
+ export declare const businessCodeResponseInterceptor: ({ businessCodes, onBusinessError, }: {
131
+ /**
132
+ * 需要特殊处理的业务错误码列表
133
+ * @default [530]
134
+ */
135
+ businessCodes?: number[];
136
+ /**
137
+ * 业务错误码处理回调
138
+ */
139
+ onBusinessError: (code: number, message: string) => Promise<void> | void;
140
+ }) => ResponseInterceptorConfig;
141
+
142
+ /**
143
+ * 创建 @effects 插件实例
144
+ * 在 Vue 应用入口文件 (main.ts/bootstrap.ts) 中使用 app.use() 安装
145
+ *
146
+ * @param config 全局配置对象
147
+ * @returns Vue 插件对象
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * app.use(createEffects({
152
+ * apiPrefix: '/crm',
153
+ * ssoUrl: 'http://crm.example.com'
154
+ * }))
155
+ * ```
156
+ */
157
+ export declare const createEffects: (config: EffectsConfig) => {
158
+ install(app: App): void;
159
+ };
160
+
161
+ export declare const Dashboard: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
162
+
163
+ /**
164
+ * 数据字典表单VO
165
+ */
166
+ export declare interface DataDictionaryFormVO {
167
+ cXuhao: string;
168
+ cName: string;
169
+ cSign: string;
170
+ nOrder?: number;
171
+ metaItems?: MetaItem[];
172
+ }
173
+
174
+ export declare const DataDictionaryQuery: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
175
+
176
+ /**
177
+ * 数据字典查询参数
178
+ */
179
+ export declare interface DataDictionaryQueryParams {
180
+ pageNo: number;
181
+ pageSize: number;
182
+ authDict: {
183
+ cSign?: string;
184
+ cXuhao?: string;
185
+ cName?: string;
186
+ nParent: number;
187
+ };
188
+ }
189
+
190
+ /**
191
+ * 数据字典VO
192
+ */
193
+ export declare interface DataDictionaryVO {
194
+ id: string;
195
+ cXuhao: string;
196
+ cName: string;
197
+ cSign: string;
198
+ dCreate: string;
199
+ cCreateName: string;
200
+ nOrder: number;
201
+ }
202
+
203
+ /**
204
+ * 默认的 BusinessSearch API 适配器
205
+ * Default BusinessSearch API adapter
206
+ *
207
+ * 职责:
208
+ * 1. 调用后端接口获取数据
209
+ * 2. 将后端格式转换成组件需要的格式
210
+ *
211
+ * 适配的后端接口:
212
+ * - 加载配置: POST /core/assDialog/openInit
213
+ * - 搜索数据: POST /core/assDialog/selectForPageCommon
214
+ */
215
+ export declare const defaultBusinessSearchAdapter: BusinessSearchAdapter;
216
+
217
+ /**
218
+ * 默认表单配置
219
+ */
220
+ export declare const defaultFormConfig: FormCommonConfig;
221
+
222
+ export declare const defaultResponseInterceptor: ({ codeField, dataField, successCode, }: {
223
+ /** 响应数据中代表访问结果的字段名 */
224
+ codeField: string;
225
+ /** 响应数据中装载实际数据的字段名,或者提供一个函数从响应数据中解析需要返回的数据 */
226
+ dataField: ((response: any) => any) | string;
227
+ /** 当codeField所指定的字段值与successCode相同时,代表接口访问成功。如果提供一个函数,则返回true代表接口访问成功 */
228
+ successCode: ((code: any) => boolean) | number | string;
229
+ }) => ResponseInterceptorConfig;
230
+
231
+ declare type DownloadRequestConfig = {
232
+ /**
233
+ * 定义期望获得的数据类型。
234
+ * raw: 原始的AxiosResponse,包括headers、status等。
235
+ * body: 只返回响应数据的BODY部分(Blob)
236
+ */
237
+ responseReturn?: 'body' | 'raw';
238
+ } & Omit<RequestClientConfig, 'responseReturn'>;
239
+
240
+ /**
241
+ * Vue 依赖注入的 Key
242
+ * 用于在组件内部通过 inject 获取配置对象
243
+ */
244
+ export declare const EFFECTS_CONFIG_KEY: InjectionKey<EffectsConfig>;
245
+
246
+ /**
247
+ * @effects 包的全局配置接口
248
+ * 用于在应用启动时注入通用配置,避免在每个组件中重复传参
249
+ */
250
+ export declare interface EffectsConfig {
251
+ /**
252
+ * API 请求前缀
253
+ * @example '/crm' -> 请求地址变为 /crm/login
254
+ */
255
+ apiPrefix?: string;
256
+ /**
257
+ * 单点登录 (SSO) 的服务地址参数
258
+ * 通常用于拼接在 SSO 登录链接的 service 参数中
259
+ * @example 'http://crm.example.com'
260
+ */
261
+ ssoUrl?: string;
262
+ /**
263
+ * 当前语言环境
264
+ * @example 'zh-CN'
265
+ */
266
+ locale?: string;
267
+ /**
268
+ * 语言切换回调
269
+ * @param locale 新的语言代码
270
+ */
271
+ onLocaleChange?: (locale: string) => void | Promise<void>;
272
+ /**
273
+ * 是否启用 Refresh Token
274
+ */
275
+ enableRefreshToken?: boolean;
276
+ /**
277
+ * RSA 公钥
278
+ */
279
+ publicKey?: string;
280
+ /**
281
+ * 头部配置
282
+ */
283
+ header?: {
284
+ height: number;
285
+ };
286
+ /**
287
+ * 应用配置
288
+ */
289
+ app?: {
290
+ name: string;
291
+ loginPath?: string;
292
+ };
293
+ /**
294
+ * Logo 配置
295
+ */
296
+ logo?: {
297
+ enable: boolean;
298
+ fit?: string;
299
+ source: string;
300
+ };
301
+ /**
302
+ * 侧边栏配置
303
+ */
304
+ sidebar?: {
305
+ width: number;
306
+ };
307
+ }
308
+
309
+ export declare const errorMessageResponseInterceptor: (makeErrorMessage?: MakeErrorMessageFn) => ResponseInterceptorConfig;
310
+
311
+ declare type ExtendOptions<T = any> = {
312
+ /**
313
+ * 参数序列化方式。预置的有
314
+ * - brackets: ids[]=1&ids[]=2&ids[]=3
315
+ * - comma: ids=1,2,3
316
+ * - indices: ids[0]=1&ids[1]=2&ids[2]=3
317
+ * - repeat: ids=1&ids=2&ids=3
318
+ */
319
+ paramsSerializer?: 'brackets' | 'comma' | 'indices' | 'repeat' | AxiosRequestConfig<T>['paramsSerializer'];
320
+ /**
321
+ * 响应数据的返回方式。
322
+ * - raw: 原始的AxiosResponse,包括headers、status等,不做是否成功请求的检查。
323
+ * - body: 返回响应数据的BODY部分(只会根据status检查请求是否成功,忽略对code的判断,这种情况下应由调用方检查请求是否成功)。
324
+ * - data: 解构响应的BODY数据,只返回其中的data节点数据(会检查status和code是否为成功状态)。
325
+ */
326
+ responseReturn?: 'body' | 'data' | 'raw';
327
+ };
328
+
329
+ export { FavoriteItem }
330
+
331
+ export declare function fetchUserInfo(data?: any): Promise<ResponseResult<any>>;
332
+
333
+ declare class FileDownloader {
334
+ private client;
335
+ constructor(client: RequestClient);
336
+ /**
337
+ * 下载文件
338
+ * @param url 文件的完整链接
339
+ * @param config 配置信息,可选。
340
+ * @returns 如果config.responseReturn为'body',则返回Blob(默认),否则返回RequestResponse<Blob>
341
+ */
342
+ download<T = Blob>(url: string, config?: DownloadRequestConfig): Promise<T>;
343
+ }
344
+
345
+ declare class FileUploader {
346
+ private client;
347
+ constructor(client: RequestClient);
348
+ upload<T = any>(url: string, data: Record<string, any> & {
349
+ file: Blob | File;
350
+ }, config?: RequestClientConfig): Promise<T>;
351
+ }
352
+
353
+ /**
354
+ * 获取所有系统设置
355
+ */
356
+ export declare function findAllSettings(): Promise<{
357
+ result: SysSettingItem[];
358
+ }>;
359
+
360
+ /**
361
+ * 查询所有静态前端国际化配置
362
+ */
363
+ export declare function findAllStaticFrontI18n(data: any): Promise<any>;
364
+
365
+ declare interface FormItem {
366
+ components: string;
367
+ label: string;
368
+ fieldName: string;
369
+ componentProps: any;
370
+ hidden: boolean;
371
+ rules: string | null;
372
+ colSpan: number;
373
+ defaultValue: string | number | boolean | null;
374
+ order: number;
375
+ dependencies?: any;
376
+ }
377
+
378
+ /**
379
+ * 获取登录类型
380
+ */
381
+ export declare function getEnterStrategy(data?: any): Promise<ResponseResult<LoginStrategyResult>>;
382
+
383
+ /**
384
+ * 根据字段配置项构建options
385
+ * @param {*} resource
386
+ */
387
+ export declare function getOptionsForSelectType(item: any): any;
388
+
389
+ export declare function getResourceByParIdOrModnumb({ parId, modnumb }: {
390
+ parId?: string;
391
+ modnumb?: string;
392
+ }): Promise<any> | undefined;
393
+
394
+ /**
395
+ * 获取滑动验证码
396
+ */
397
+ export declare function getSlideVerificationCode(data: any): Promise<any>;
398
+
399
+ /**
400
+ * 全局配置对象,用于在非 Vue 组件环境(如 API 请求)中访问配置
401
+ */
402
+ export declare let globalConfig: EffectsConfig;
403
+
404
+ export declare interface HttpResponse<T = any> {
405
+ /**
406
+ * 0 表示成功 其他表示失败
407
+ * 0 means success, others means fail
408
+ */
409
+ code: number;
410
+ data: T;
411
+ message: string;
412
+ }
413
+
414
+ /**
415
+ * 构建按钮a-button配置项
416
+ * @param {*} resource
417
+ */
418
+ export declare function initButtonItem(data: any): {
419
+ label: any;
420
+ handle: any;
421
+ icon: any;
422
+ class: any;
423
+ order: any;
424
+ loading: boolean;
425
+ size: string;
426
+ nButtonid: any;
427
+ cEvent: any;
428
+ cSubArea: any;
429
+ name: any;
430
+ code: any;
431
+ };
432
+
433
+ /**
434
+ * 构建表单form-item配置项
435
+ * @param {*} resource
436
+ */
437
+ export declare function initFormItem(data: any): FormItem;
438
+
439
+ export declare function initResourceConstructor(result: any): {
440
+ resFieldList: Record<string, any[]>;
441
+ resButtonList: Record<string, any[]>;
442
+ resColumnList: Record<string, any[]>;
443
+ resMenu: any;
444
+ };
445
+
446
+ /**
447
+ * 构建表格vxe-column配置项
448
+ * @param {*} resource
449
+ */
450
+ export declare function initVxeColumn(data: any): any;
451
+
452
+ declare class InterceptorManager {
453
+ private axiosInstance;
454
+ constructor(instance: AxiosInstance);
455
+ addRequestInterceptor({ fulfilled, rejected, }?: RequestInterceptorConfig): void;
456
+ addResponseInterceptor<T = any>({ fulfilled, rejected, }?: ResponseInterceptorConfig<T>): void;
457
+ }
458
+
459
+ export declare const Login: DefineComponent<ExtractPropTypes< {
460
+ bg01: {
461
+ type: StringConstructor;
462
+ default: string;
463
+ };
464
+ bg02: {
465
+ type: StringConstructor;
466
+ default: string;
467
+ };
468
+ logo: {
469
+ type: StringConstructor;
470
+ default: string;
471
+ };
472
+ slogen01: {
473
+ type: StringConstructor;
474
+ default: string;
475
+ };
476
+ slogen02: {
477
+ type: StringConstructor;
478
+ default: string;
479
+ };
480
+ slogen03: {
481
+ type: StringConstructor;
482
+ default: string;
483
+ };
484
+ ssoUrl: {
485
+ type: StringConstructor;
486
+ default: string;
487
+ };
488
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
489
+ login: (...args: any[]) => void;
490
+ }, string, PublicProps, Readonly<ExtractPropTypes< {
491
+ bg01: {
492
+ type: StringConstructor;
493
+ default: string;
494
+ };
495
+ bg02: {
496
+ type: StringConstructor;
497
+ default: string;
498
+ };
499
+ logo: {
500
+ type: StringConstructor;
501
+ default: string;
502
+ };
503
+ slogen01: {
504
+ type: StringConstructor;
505
+ default: string;
506
+ };
507
+ slogen02: {
508
+ type: StringConstructor;
509
+ default: string;
510
+ };
511
+ slogen03: {
512
+ type: StringConstructor;
513
+ default: string;
514
+ };
515
+ ssoUrl: {
516
+ type: StringConstructor;
517
+ default: string;
518
+ };
519
+ }>> & Readonly<{
520
+ onLogin?: ((...args: any[]) => any) | undefined;
521
+ }>, {
522
+ bg01: string;
523
+ bg02: string;
524
+ logo: string;
525
+ slogen01: string;
526
+ slogen02: string;
527
+ slogen03: string;
528
+ ssoUrl: string;
529
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
530
+ loginFormRef: any;
531
+ pwdInputRef: any;
532
+ verifyPopoverRef: HTMLDivElement;
533
+ }, HTMLDivElement>;
534
+
535
+ export declare function login(data: LoginParams): Promise<ResponseResult<LoginResult>>;
536
+
537
+ export declare interface LoginParams {
538
+ username: string;
539
+ password: string;
540
+ macAddress?: string;
541
+ cVerificationCode?: string;
542
+ systemSign?: string;
543
+ }
544
+
545
+ export declare interface LoginResult {
546
+ token: string;
547
+ }
548
+
549
+ export declare interface LoginStrategyResult {
550
+ loginStrategy: string;
551
+ }
552
+
553
+ export declare type MakeErrorMessageFn = (message: string, error: any) => void;
554
+
555
+ /**
556
+ * 额外属性表格列配置
557
+ */
558
+ export declare const metaGridColumns: VxeGridProps<MetaItem>['columns'];
559
+
560
+ /**
561
+ * 额外属性表格校验规则
562
+ */
563
+ export declare const metaGridEditRules: {
564
+ key: {
565
+ required: boolean;
566
+ message: string;
567
+ }[];
568
+ };
569
+
570
+ /**
571
+ * 额外属性项
572
+ */
573
+ export declare interface MetaItem {
574
+ key: string;
575
+ value: string;
576
+ }
577
+
578
+ export declare const OperationLogQuery: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
579
+
580
+ /**
581
+ * 操作日志查询参数
582
+ */
583
+ export declare interface OperationLogQueryParams {
584
+ pageNo: number;
585
+ pageSize: number;
586
+ assUserOperationLog: {
587
+ cModname?: string;
588
+ cSystem?: string;
589
+ cDanju?: string;
590
+ cUser?: string;
591
+ dCreatelist?: string[];
592
+ };
593
+ }
594
+
595
+ /**
596
+ * 操作日志VO
597
+ */
598
+ export declare interface OperationLogVO {
599
+ cModname: string;
600
+ cDanju: string;
601
+ cDongzuo: string;
602
+ cUser: string;
603
+ cUsername: string;
604
+ dCreate: string;
605
+ cSystem: string;
606
+ cUrl: string;
607
+ cMethod: string;
608
+ nSecond: number;
609
+ }
610
+
611
+ /**
612
+ * 查询数据字典
613
+ */
614
+ export declare function queryByXuhao(data: any): Promise<any>;
615
+
616
+ /**
617
+ * 查询当前用户收藏的菜单
618
+ */
619
+ export declare function queryFavorites(params: QueryFavoritesParams): Promise<ResponseResult<FavoriteItem[]>>;
620
+
621
+ /**
622
+ * 查询收藏菜单参数
623
+ */
624
+ export declare interface QueryFavoritesParams {
625
+ cCreateuser: string;
626
+ }
627
+
628
+ export declare function refreshTokenApi(): Promise<any>;
629
+
630
+ /**
631
+ * 删除收藏菜单
632
+ */
633
+ export declare function removeFavorite(params: RemoveFavoriteParams): Promise<ResponseResult<void>>;
634
+
635
+ /**
636
+ * 删除收藏菜单参数
637
+ */
638
+ export declare interface RemoveFavoriteParams {
639
+ nResourceid: number;
640
+ cCreateuser: string;
641
+ }
642
+
643
+ export declare class RequestClient {
644
+ addRequestInterceptor: InterceptorManager['addRequestInterceptor'];
645
+ addResponseInterceptor: InterceptorManager['addResponseInterceptor'];
646
+ download: FileDownloader['download'];
647
+ readonly instance: AxiosInstance;
648
+ isRefreshing: boolean;
649
+ postSSE: SSE['postSSE'];
650
+ refreshTokenQueue: ((token: string) => void)[];
651
+ requestSSE: SSE['requestSSE'];
652
+ upload: FileUploader['upload'];
653
+ /**
654
+ * 构造函数,用于创建Axios实例
655
+ * @param options - Axios请求配置,可选
656
+ */
657
+ constructor(options?: RequestClientOptions);
658
+ /**
659
+ * DELETE请求方法
660
+ */
661
+ delete<T = any>(url: string, config?: RequestClientConfig): Promise<T>;
662
+ /**
663
+ * GET请求方法
664
+ */
665
+ get<T = any>(url: string, config?: RequestClientConfig): Promise<T>;
666
+ /**
667
+ * 获取基础URL
668
+ */
669
+ getBaseUrl(): string | undefined;
670
+ /**
671
+ * POST请求方法
672
+ */
673
+ post<T = any>(url: string, data?: any, config?: RequestClientConfig): Promise<T>;
674
+ /**
675
+ * PUT请求方法
676
+ */
677
+ put<T = any>(url: string, data?: any, config?: RequestClientConfig): Promise<T>;
678
+ /**
679
+ * 通用的请求方法
680
+ */
681
+ request<T>(url: string, config: RequestClientConfig): Promise<T>;
682
+ }
683
+
684
+ /**
685
+ * 导出的默认请求客户端实例
686
+ *
687
+ * 配置:
688
+ * - responseReturn: 'data' (直接返回 response.data.data,即业务数据部分)
689
+ * - baseURL: 默认为空,由请求拦截器中的 globalConfig.apiPrefix 动态决定
690
+ */
691
+ export declare const requestClient: RequestClient;
692
+
693
+ export declare type RequestClientConfig<T = any> = AxiosRequestConfig<T> & ExtendOptions<T>;
694
+
695
+ export declare type RequestClientOptions = CreateAxiosDefaults & ExtendOptions;
696
+
697
+ export declare type RequestContentType = 'application/json;charset=utf-8' | 'application/octet-stream;charset=utf-8' | 'application/x-www-form-urlencoded;charset=utf-8' | 'multipart/form-data;charset=utf-8';
698
+
699
+ export declare interface RequestInterceptorConfig {
700
+ fulfilled?: (config: ExtendOptions & InternalAxiosRequestConfig) => (ExtendOptions & InternalAxiosRequestConfig<any>) | Promise<ExtendOptions & InternalAxiosRequestConfig<any>>;
701
+ rejected?: (error: any) => any;
702
+ }
703
+
704
+ export declare type RequestResponse<T = any> = AxiosResponse<T> & {
705
+ config: RequestClientConfig<T>;
706
+ };
707
+
708
+ /**
709
+ * 资源配置
710
+ */
711
+ export declare const resourceConfig: {
712
+ resourceId: string;
713
+ nResourceid: number;
714
+ };
715
+
716
+ export declare const ResourceManagement: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
717
+ constructionSeletor: CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {
718
+ editableBaseData: {
719
+ moduleInfo: any;
720
+ activeName: string;
721
+ contentHeight: number;
722
+ resourceData: {};
723
+ };
724
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
725
+ P: {};
726
+ B: {};
727
+ D: {};
728
+ C: {};
729
+ M: {};
730
+ Defaults: {};
731
+ }, Readonly<{}> & Readonly<{}>, {
732
+ editableBaseData: {
733
+ moduleInfo: any;
734
+ activeName: string;
735
+ contentHeight: number;
736
+ resourceData: {};
737
+ };
738
+ }, {}, {}, {}, {}> | null;
739
+ }, HTMLDivElement>;
740
+
741
+ export declare interface ResponseInterceptorConfig<T = any> {
742
+ fulfilled?: (response: RequestResponse<T>) => Promise<RequestResponse> | RequestResponse;
743
+ rejected?: (error: any) => any;
744
+ }
745
+
746
+ export declare interface ResponseResult<T = any> {
747
+ success: boolean;
748
+ message: string;
749
+ code: number;
750
+ result: T;
751
+ timestamp: number;
752
+ }
753
+
754
+ /**
755
+ * 保存所有系统设置
756
+ */
757
+ export declare function saveAllSettings(settings: SysSettingItem[]): Promise<any>;
758
+
759
+ /**
760
+ * 搜索表单配置
761
+ */
762
+ export declare const searchFormSchema: FormSchema[];
763
+
764
+ /**
765
+ * 导出查询方案 API 实例
766
+ */
767
+ export declare const searchPlanApi: {
768
+ findAllByResourceid: (data: any) => Promise<any>;
769
+ findSearchPlanColsByPlanId: (data: any) => Promise<any>;
770
+ insert: (data: any) => Promise<any>;
771
+ update: (data: any) => Promise<any>;
772
+ del: (data: any) => Promise<any>;
773
+ findDefSearchPlan: (data: any) => Promise<any>;
774
+ };
775
+
776
+ /**
777
+ * 初始化业务表单配置
778
+ *
779
+ * @description
780
+ * 在应用入口调用此函数,初始化表单相关的业务配置。
781
+ * 传入的配置会与默认配置合并,自定义配置优先。
782
+ *
783
+ * @example
784
+ * ```typescript
785
+ * // apps/web/src/bootstrap.ts
786
+ * import { setupBusinessForm } from '@sunny-base-web/effects';
787
+ *
788
+ * // 方式1:使用默认配置(适用于标准业务系统)
789
+ * setupBusinessForm();
790
+ *
791
+ * // 方式2:覆盖部分配置
792
+ * setupBusinessForm({
793
+ * config: {
794
+ * businessSearchAdapter: {
795
+ * // 只覆盖 loadConfig,search 仍使用默认实现
796
+ * loadConfig: async (cNum) => {
797
+ * return myCustomApi.loadConfig(cNum);
798
+ * },
799
+ * },
800
+ * },
801
+ * });
802
+ *
803
+ * // 方式3:完全自定义(适用于非标准业务系统)
804
+ * setupBusinessForm({
805
+ * config: {
806
+ * businessSearchAdapter: {
807
+ * loadConfig: async (cNum) => {
808
+ * const res = await myApi.getConfig(cNum);
809
+ * // 完全自定义转换逻辑
810
+ * return {
811
+ * title: res.title,
812
+ * formSchema: res.fields,
813
+ * tableColumns: res.columns,
814
+ * };
815
+ * },
816
+ * search: async (params) => {
817
+ * const res = await myApi.search(params);
818
+ * return {
819
+ * records: res.data,
820
+ * total: res.count,
821
+ * };
822
+ * },
823
+ * },
824
+ * },
825
+ * defineRules: {
826
+ * phone: (value) => /^1[3-9]\d{9}$/.test(value) || '请输入正确的手机号',
827
+ * },
828
+ * });
829
+ * ```
830
+ */
831
+ export declare function setupBusinessForm(options?: SetupBusinessFormOptions): void;
832
+
833
+ /**
834
+ * setupBusinessForm 选项类型
835
+ */
836
+ export declare interface SetupBusinessFormOptions {
837
+ /**
838
+ * 自定义配置(会与默认配置合并,自定义配置优先)
839
+ */
840
+ config?: Partial<FormCommonConfig>;
841
+ /**
842
+ * 自定义验证规则
843
+ */
844
+ defineRules?: Record<string, any>;
845
+ }
846
+
847
+ /**
848
+ * SSE模块
849
+ */
850
+ declare class SSE {
851
+ private client;
852
+ constructor(client: RequestClient);
853
+ postSSE(url: string, data?: any, requestOptions?: SseRequestOptions): Promise<void>;
854
+ /**
855
+ * SSE请求方法
856
+ * @param url - 请求URL
857
+ * @param data - 请求数据
858
+ * @param requestOptions - SSE请求选项
859
+ */
860
+ requestSSE(url: string, data?: any, requestOptions?: SseRequestOptions): Promise<void>;
861
+ }
862
+
863
+ /**
864
+ * SSE 请求选项
865
+ */
866
+ export declare interface SseRequestOptions extends RequestInit {
867
+ onMessage?: (message: string) => void;
868
+ onEnd?: () => void;
869
+ }
870
+
871
+ /**
872
+ * 系统设置项
873
+ */
874
+ export declare interface SysSettingItem {
875
+ cNum: string;
876
+ cValue: string;
877
+ nickName?: string;
878
+ type?: string;
879
+ hintMsg?: string;
880
+ }
881
+
882
+ export declare const SystemSetting: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
883
+
884
+ /**
885
+ * 系统设置类型定义
886
+ */
887
+ /**
888
+ * 系统设置表单数据
889
+ */
890
+ export declare interface SystemSettingForm {
891
+ /** 初始密码 */
892
+ initialPassword: string;
893
+ /** 弱密码列表 */
894
+ weakPasswords: string[];
895
+ /** 子级菜单图标显示 */
896
+ showSubMenuIcon: boolean;
897
+ /** 智能体是否显示 */
898
+ showAgent: boolean;
899
+ /** 智能体地址 */
900
+ agentUrl: string;
901
+ /** 智能体 Token */
902
+ agentToken: string;
903
+ }
904
+
905
+ /**
906
+ * 表格列配置
907
+ */
908
+ export declare const tableColumns: VxeGridProps<OperationLogVO>['columns'];
909
+
910
+ /**
911
+ * Composition API Hook: 获取全局配置
912
+ * 在组件 setup() 中调用此方法获取配置信息
913
+ *
914
+ * @returns EffectsConfig 配置对象
915
+ */
916
+ export declare const useEffectsConfig: () => EffectsConfig;
917
+
918
+ /**
919
+ * 收藏功能 Composable
920
+ * 封装收藏相关的 API 调用和 Store 更新逻辑
921
+ */
922
+ export declare function useFavorite(): {
923
+ favoriteStore: Store<"core-favorite", FavoriteState, {
924
+ hasFavorites: (state: {
925
+ favorites: {
926
+ nResourceid: number;
927
+ cModname: string;
928
+ cIcon?: string | undefined;
929
+ cUrl?: string | undefined;
930
+ cCreateuser?: string | undefined;
931
+ }[];
932
+ loading: boolean;
933
+ adding: boolean;
934
+ } & PiniaCustomStateProperties<FavoriteState>) => boolean;
935
+ isFavorited: (state: {
936
+ favorites: {
937
+ nResourceid: number;
938
+ cModname: string;
939
+ cIcon?: string | undefined;
940
+ cUrl?: string | undefined;
941
+ cCreateuser?: string | undefined;
942
+ }[];
943
+ loading: boolean;
944
+ adding: boolean;
945
+ } & PiniaCustomStateProperties<FavoriteState>) => (nResourceid: number) => boolean;
946
+ }, {
947
+ setFavorites(favorites: FavoriteItem[]): void;
948
+ addFavoriteToList(item: FavoriteItem): void;
949
+ removeFavoriteFromList(nResourceid: number): void;
950
+ setLoading(loading: boolean): void;
951
+ setAdding(adding: boolean): void;
952
+ resetState(): void;
953
+ }>;
954
+ findResourceIdByPath: (path: string) => number | null;
955
+ fetchFavorites: () => Promise<void>;
956
+ addCurrentPage: (currentPath: string) => Promise<{
957
+ success: boolean;
958
+ message: string;
959
+ }>;
960
+ removeFavoriteItem: (nResourceid: number) => Promise<{
961
+ success: boolean;
962
+ message: string;
963
+ }>;
964
+ };
965
+
966
+ /**
967
+ * 列表页通用配置
968
+ * @param options 配置选项
969
+ */
970
+ export declare function useList<T>(options: {
971
+ /**
972
+ * 表单配置
973
+ */
974
+ searchFormSchema: any[];
975
+ /**
976
+ * 表格列配置
977
+ */
978
+ tableColumns: any[];
979
+ /**
980
+ * 表格数据类型
981
+ */
982
+ dataType?: new () => T;
983
+ /**
984
+ * 资源配置
985
+ */
986
+ resourceConfig: {
987
+ resourceId: string;
988
+ nResourceid: number;
989
+ };
990
+ /**
991
+ * 表格查询函数
992
+ */
993
+ queryFunction: (params: any) => Promise<any>;
994
+ }): {
995
+ QueryForm: DefineComponent< {}, () => VNode<RendererNode, RendererElement, {
996
+ [key: string]: any;
997
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
998
+ formApi: FormApi;
999
+ Grid: DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, PublicProps>;
1000
+ gridApi: VxeGridApi;
1001
+ submitting: Ref<boolean, boolean>;
1002
+ handleGlobalEnter: (e: KeyboardEvent) => void;
1003
+ searchPlanList: Ref<never[], never[]>;
1004
+ currentSearchPlan: Ref<undefined, undefined>;
1005
+ resourceId: string;
1006
+ nResourceid: number;
1007
+ handleSearchPlanSearch: (formValues: any) => Promise<void>;
1008
+ handleDefaultPlanLoaded: (formValues: any) => Promise<void>;
1009
+ };
1010
+
1011
+ /**
1012
+ * 查询方案 API 实现
1013
+ * 所有模块通用的查询方案 API 配置
1014
+ */
1015
+ export declare const useSearchPlanApi: () => {
1016
+ findAllByResourceid: (data: any) => Promise<any>;
1017
+ findSearchPlanColsByPlanId: (data: any) => Promise<any>;
1018
+ insert: (data: any) => Promise<any>;
1019
+ update: (data: any) => Promise<any>;
1020
+ del: (data: any) => Promise<any>;
1021
+ findDefSearchPlan: (data: any) => Promise<any>;
1022
+ };
1023
+
1024
+ /**
1025
+ * 弱密码项
1026
+ */
1027
+ export declare interface WeakPasswordItem {
1028
+ id: string;
1029
+ password: string;
1030
+ }
1031
+
1032
+
1033
+ export * from "axios";
1034
+
1035
+ export { }