exportExcel支持自定义表头
This commit is contained in:
parent
28b44dd68c
commit
96637ffac8
|
|
@ -1,12 +1,13 @@
|
|||
import { AsyncContext } from "../store/AsyncRowStore";
|
||||
import { EntityDict } from "./Entity";
|
||||
export declare type Exportation<ED extends EntityDict, T extends keyof ED, K extends string> = {
|
||||
export declare type Exportation<ED extends EntityDict, T extends keyof ED> = {
|
||||
name: string;
|
||||
id: string;
|
||||
entity: T;
|
||||
projection: ED[T]['Selection']['data'];
|
||||
headers: K[];
|
||||
fn: (data: ED[T]['Schema']) => Partial<Record<K, string | number | boolean | null>>;
|
||||
headers?: string[];
|
||||
makeHeaders?: (dataList: Partial<ED[T]['Schema']>[]) => string[];
|
||||
fn: (data: ED[T]['Schema']) => Partial<Record<string, string | number | boolean | null>>;
|
||||
};
|
||||
export declare type Importation<ED extends EntityDict, T extends keyof ED, K extends string> = {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ import { AsyncContext } from "../store/AsyncRowStore";
|
|||
import { SyncContext } from "../store/SyncRowStore";
|
||||
import { EntityDict } from "./Entity";
|
||||
|
||||
export type Exportation<ED extends EntityDict, T extends keyof ED, K extends string> = {
|
||||
export type Exportation<ED extends EntityDict, T extends keyof ED> = {
|
||||
name: string;
|
||||
id: string;
|
||||
entity: T;
|
||||
projection: ED[T]['Selection']['data'];
|
||||
headers: K[];
|
||||
fn: (data: ED[T]['Schema']) => Partial<Record<K, string | number | boolean | null>>;
|
||||
headers?: string[];
|
||||
makeHeaders?: (dataList: Partial<ED[T]['Schema']>[]) => string[];
|
||||
fn: (data: ED[T]['Schema']) => Partial<Record<string, string | number | boolean | null>>;
|
||||
};
|
||||
|
||||
export type Importation<ED extends EntityDict, T extends keyof ED, K extends string> = {
|
||||
|
|
@ -17,5 +18,5 @@ export type Importation<ED extends EntityDict, T extends keyof ED, K extends str
|
|||
entity: T;
|
||||
headers: K[];
|
||||
// 解析过程中如果出错,请抛出OakImportDataParseException异常
|
||||
fn: (data: Partial<Record<K, string | number | boolean>>[], context: AsyncContext<ED>, option?: Record<string, any> ) => Promise<ED[T]['CreateMulti']['data']>;
|
||||
fn: (data: Partial<Record<K, string | number | boolean>>[], context: AsyncContext<ED>, option?: Record<string, any>) => Promise<ED[T]['CreateMulti']['data']>;
|
||||
};
|
||||
Loading…
Reference in New Issue