fastlion-amis
Version:
一种MIS页面生成工具
167 lines (166 loc) • 6.34 kB
TypeScript
import React from 'react';
import { RendererProps } from '../../../../factory';
import { BaseSchema, SchemaApi } from '../../../../Schema';
import { Action, SchemaNode } from '../../../../types';
import { IScopedContext } from '../../../../Scoped';
import { ILionTableStore } from '../../../../store/liontable';
import { RendererEnv } from '../../../../env';
import './style/baseCss/popover.css';
import './style/baseCss/index.css';
import './components/MainExport/MainExport.css';
import './scss/toolbar.scss';
import './scss/table.scss';
import './scss/tbody.scss';
import './scss/fixTbody.scss';
interface LionTableState {
fixLeft: number;
tableBody: any;
fixColumns: any[];
selectList: any;
SonList: any;
checkAll: boolean;
loading: boolean;
pageData: any[];
totalSize: number;
pageSize: number;
page: number;
wrapper: number;
_container_height: any;
table_height: any;
storageSource: any;
pageSelectList: any;
colHideList: any;
hasFetch: boolean;
ModalProps: any;
printType?: string;
surfaceItemWidth: number;
colSpan: number;
primaryElevae: number;
subordinateElevae: number;
}
interface ColumnObject {
label?: string;
name?: string;
group?: Array<any>;
hideLabel?: boolean;
hiddenOn?: string;
[propName: string]: any;
}
export interface LionTestTableSchema extends BaseSchema {
type: 'lion-table';
filter?: any;
headerToolbar: Array<any>;
bulkActions: Array<any>;
primaryField?: string;
columns: Array<ColumnObject>;
api?: SchemaApi;
list_columns: Array<ColumnObject>;
source: string;
checkbox: boolean;
detailTableField?: string;
style?: any;
subTableTitle?: string;
width?: number;
totalTab?: {
key: number;
totalNum: string | number;
};
setTotalNum?: (key: string | number, totalNum: number, tableName: string) => void;
onAction?: (e: React.UIEvent<any> | void, action: Action, ctx: object, throwErrors: boolean, delegate?: IScopedContext) => any;
subSchemaApi?: SchemaApi;
isDialogMode?: boolean;
initFetch?: boolean;
keepItemSelectionOnPageChange?: boolean;
perPageAvailable?: number[];
perPage?: number;
}
interface LionTestTableContextSchema {
env?: RendererEnv;
handleAction?: Function;
primaryField?: string;
subSchemaApi?: SchemaApi;
render?: (region: string, node: SchemaNode, props?: any) => JSX.Element;
subTableTitle?: string;
}
export declare const LionTestTableContext: React.Context<LionTestTableContextSchema>;
export interface LionTestTableProps extends RendererProps, Omit<LionTestTableSchema, 'type' | 'className' | 'data'> {
store: ILionTableStore;
}
export declare class LionTestTable extends React.Component<LionTestTableProps, LionTableState> {
static contextType: React.Context<IScopedContext>;
constructor(props: LionTestTableProps, context: IScopedContext);
static defaultProps: Partial<LionTestTableProps>;
_uploadRef: any;
get baseUrl(): any;
get uiWorker(): Worker;
get dataWorker(): Worker;
get dataSource(): any[];
_bindRef: (ref: any) => void;
receiveMessage(content: any): void;
get checkList(): object[];
get record_ids(): string;
get ids(): string;
get leftTableWidth(): number;
get rightTableWidth(): number;
calcSubordinateSize(columns: any): any;
get surfaceWidth(): any;
initSource(paramsField: any): void;
requestFilterSource: (paramsField: any, isFilter: boolean | undefined, load: 'ui' | 'data', asynsUpdateState?: any) => void;
initScrollShadow(target?: any): void;
onCheckAllChange: (e: any, isClear?: boolean | undefined) => void;
handleSectionChange: (e: React.MouseEvent, current: string, isClear: boolean) => void;
handleMasterChange: (e: any, current: any) => void;
extractDataSource(data: any, willUpdateState?: any): void;
generateUI(willUpdateState?: any): void;
generatePageConfig(data: any, willUpdateState?: any): void;
handleScroll: (e: any) => void;
showTotal: () => string;
handleOpenCol: (primaryField: string) => void;
handleAddClass: (arr: any, tabIndex: number) => void;
handleTrMouseOver: (e: any) => void;
handleTrMouseOut: (e: any) => void;
handleRemoveClass: (arr: any) => void;
handlePageSizeChange: (page: number, pageSize: number) => void;
MonitorPageChanges: (e: any) => void;
calcHeight(): {
_container_height: any;
table_height: number;
};
MonitorTableChanges: (e?: any) => void;
handleFilterParams(value: any): void;
reloadTarget(reload: string, ctx: any, callBack?: () => void): void;
closeTarget(target: string): void;
reload(subPath: string, query: any, ctx: any): void;
receive(value: any, subPath: any): void;
doAction(query: any, ctx: any): void;
handleAction: (e: React.UIEvent<any> | void, action: Action, ctx: any, callBack?: (() => void) | undefined, throwErrors?: boolean, delegate?: IScopedContext | undefined) => Promise<any>;
/**
* Jay
* 标签、文件打印
*/
renderPrint(ctx: {
items: any[];
selectedItems: any[];
ids: string;
primaryField: string;
}, schema?: any, isFilePrint?: boolean): JSX.Element;
renderToolBars(toolBars: any, type: string): [element: JSX.Element, aligh?: "left" | "right" | undefined][];
renderHeaderToolbars(): JSX.Element;
renderTable(): JSX.Element[];
renderFixLeftTable(): JSX.Element[];
renderFixRightTable(): JSX.Element[];
renderTableContainer(): JSX.Element;
renderTableWrapper(): JSX.Element;
renderTableFixWrapper(): JSX.Element;
renderPagination(): JSX.Element;
renderUniversalDialog(): JSX.Element;
componentDidMount(): void;
handleDialogClose(confirmd: any): void;
handleDialogConfirm(values: object[], action: Action, ctx: any, components: Array<any>): void;
componentDidUpdate(prevProp: any, prevState: any): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export declare class LionTestTableRenderer extends LionTestTable {
}
export {};