@lovrabet/sdk 1.1.23 → 1.1.26
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.
|
@@ -20,9 +20,8 @@ export declare abstract class AbstractBaseModel implements BaseModelMethods {
|
|
|
20
20
|
create<T = any>(data: Record<string, any>): Promise<T>;
|
|
21
21
|
update<T = any>(id: string | number, data: Record<string, any>): Promise<T>;
|
|
22
22
|
delete(id: string | number): Promise<void>;
|
|
23
|
-
getDatasetList<T = any>(): Promise<T[]>;
|
|
24
23
|
getSelectOptions(params: SelectOptionsParams): Promise<SelectOption[]>;
|
|
25
|
-
|
|
24
|
+
excelExport<T = any>(params?: ListParams): Promise<T>;
|
|
26
25
|
getConfig(): ModelConfig;
|
|
27
26
|
getModelName(): string;
|
|
28
27
|
}
|
|
@@ -20,4 +20,9 @@ export declare class OpenApiModel extends AbstractBaseModel {
|
|
|
20
20
|
* @throws Error 当尝试调用 delete 时抛出错误
|
|
21
21
|
*/
|
|
22
22
|
delete(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* OpenAPI 模式暂不支持 excelExport 操作
|
|
25
|
+
* @throws Error 当尝试调用 excelExport 时抛出错误
|
|
26
|
+
*/
|
|
27
|
+
excelExport(params?: any): Promise<any>;
|
|
23
28
|
}
|
|
@@ -334,13 +334,6 @@ export interface BaseModelMethods {
|
|
|
334
334
|
* @throws Error OpenAPI 模式暂不支持此操作,仅 WebAPI 模式可用
|
|
335
335
|
*/
|
|
336
336
|
delete(id: string | number): Promise<void>;
|
|
337
|
-
/**
|
|
338
|
-
* 获取数据集列表
|
|
339
|
-
* @template T 返回数据的类型
|
|
340
|
-
* @returns 返回数据集列表
|
|
341
|
-
* @description 获取当前应用下的所有数据集列表,主要用于 OpenAPI 模式
|
|
342
|
-
*/
|
|
343
|
-
getDatasetList<T = any>(): Promise<T[]>;
|
|
344
337
|
/**
|
|
345
338
|
* 获取下拉选项
|
|
346
339
|
* @param params 字段映射参数,指定用作 value 和 label 的字段名
|
|
@@ -357,6 +350,27 @@ export interface BaseModelMethods {
|
|
|
357
350
|
* ```
|
|
358
351
|
*/
|
|
359
352
|
getSelectOptions(params: SelectOptionsParams): Promise<SelectOption[]>;
|
|
353
|
+
/**
|
|
354
|
+
* 导出数据为 Excel 文件
|
|
355
|
+
* @param params 查询参数(可选),与 getList 参数一致,用于按条件筛选导出数据
|
|
356
|
+
* @returns 返回导出文件的 URL 地址(字符串),可直接用于下载
|
|
357
|
+
* @description 导出当前数据集的数据为 Excel 文件(仅 WebAPI 模式支持)
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* // 导出所有数据
|
|
361
|
+
* const fileUrl = await model.excelExport();
|
|
362
|
+
* // fileUrl: "https://yuntoo-export-import.oss-cn-hangzhou.aliyuncs.com/xxx.xlsx?..."
|
|
363
|
+
* window.open(fileUrl, '_blank');
|
|
364
|
+
*
|
|
365
|
+
* // 按条件筛选导出
|
|
366
|
+
* const fileUrl = await model.excelExport({
|
|
367
|
+
* status: 'active',
|
|
368
|
+
* createTime: '2025-01-01'
|
|
369
|
+
* });
|
|
370
|
+
* window.open(fileUrl, '_blank');
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
excelExport<T = string>(params?: ListParams): Promise<T>;
|
|
360
374
|
}
|
|
361
375
|
/**
|
|
362
376
|
* 模型管理器接口
|