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