dbweb-common
Version:
用`yarn add dbweb-common`安装,不要忘记修改`angular.json`里的 `architect\build\options\assets`,加上
72 lines (71 loc) • 1.87 kB
TypeScript
import { CurrentApiService, ProjectService, ElementsService, IElement } from 'dbweb-core';
import { MatSnackBar } from '@angular/material';
interface ImportField {
Name: string;
Alias: string;
Type: string;
MaxLength: number;
Style: string;
PrimaryKey: boolean;
Remark: string;
}
interface MapField {
Name: string;
Style: string;
MapName: string;
Value: string;
Remark: string;
}
export interface DoImportResult {
TaskInfoURL: string;
TaskInfoSign: string;
BrowseTaskElement: IElement;
}
export interface ImportInfo {
TableName: string;
TableTotal: number;
TableCanRemove: number;
Fields: ImportField[];
NullIden: string;
}
export interface RemoveTableDataResult {
Total: number;
CanRemove: number;
}
export declare class ImportService {
private api;
private prj;
private eles;
private snackBar;
step: 'select-file' | 'upload' | 'setting' | 'done';
tableName: string;
tableTotal: number;
tableCanRemove: number;
fields: ImportField[];
file: File;
uploadProgress: number;
serverTempFileName: string;
firstHead: boolean;
format: 'CSV' | 'TXT';
encoding: 'UTF8' | 'GBK';
nullIden: string;
previewData: {
Have: boolean;
Title: string[];
Rows: string[][];
Error: string;
};
mapFields: MapField[];
taskInfoURL: string;
constructor(api: CurrentApiService, prj: ProjectService, eles: ElementsService, snackBar: MatSnackBar);
init(): void;
GetImportInfo(): import("rxjs").Observable<ImportInfo>;
mustFields(): string[];
primaryKeyFields(): string[];
fileType(): string;
upload(): void;
refreshPreview(): void;
doImport(): void;
removeTableData(): void;
}
export {};