UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

74 lines (73 loc) 4.53 kB
import { AxiosRequestConfig } from 'axios'; import Field, { FieldProps, Fields } from './Field'; import { DataToJSON, FieldType } from './enum'; import DataSet, { Group } from './DataSet'; import Record from './Record'; import { SubmitTypes, TransportTypes } from './Transport'; import { Lang } from '../locale-context/enum'; export declare function useNormal(dataToJSON: DataToJSON): boolean; export declare function useAll(dataToJSON: DataToJSON): boolean; export declare function useSelected(dataToJSON: DataToJSON): boolean; export declare function useCascade(dataToJSON: DataToJSON): boolean; export declare function useDirty(dataToJSON: DataToJSON): boolean; export declare function append(url: string, suffix?: object): string; export declare function getOrderFields(fields: Fields): Field[]; export declare function processToJSON(value: any): any; export declare const arrayMove: (array: Record[], from: number, to: number) => void; export declare function processValue(value: any, field?: Field, init?: boolean): any; export declare function processExportValue(value: any, field?: Field): any; /** * 实现如果名字是带有属性含义`.`找到能够导出的值 * @param dataItem 一行数据 * @param name 对应的fieldname * @param isBind 是否是从绑定获取值 */ export declare function getSplitValue(dataItem: any, name: string, isBind?: boolean): any; export declare function childrenInfoForDelete(json: {}, children: { [key: string]: DataSet; }): {}; export declare function sortTree(children: Record[], orderField: Field): Record[]; export declare function sliceTree(idField: any, parentField: any, allData: any, pageSize: any): never[]; export declare function checkParentByInsert({ parent }: DataSet): void; export declare function getBaseType(type: FieldType): FieldType; export declare function checkFieldType(value: any, field: Field): boolean; /** * 目前定义为服务端请求的方法 * @param url 导出地址 * @param data 导出传递参数 * @param method 默认post请求 */ export declare function doExport(url: any, data: any, method?: string): void; export declare function findBindFields(myField: Field, fields: Fields, excludeSelf?: boolean): Field[]; export declare function findBindField(myField: Field | string, fields: Fields, callback?: (field: Field) => boolean): Field | undefined; export declare function getFieldSorter(field: Field): (a: any, b: any) => number; export declare function generateRecordJSONData(array: object[], record: Record, dataToJSON: DataToJSON): void; export declare function prepareSubmitData(records: Record[], dataToJSON: DataToJSON): [object[], object[], object[]]; export declare function axiosConfigAdapter(type: TransportTypes, dataSet: DataSet, data?: any, params?: any, options?: object): AxiosRequestConfig; export declare function findRootParent(children: Record): any; export declare function prepareForSubmit(type: SubmitTypes, data: object[], configs: AxiosRequestConfig[], dataSet: DataSet): object[]; export declare function generateResponseData(item: any, dataKey?: string): object[]; export declare function getRecordValue(data: any, cb: (record: Record, fieldName: string) => boolean, fieldName?: string): any; export declare function processIntlField(name: string, fieldProps: FieldProps, callback: (name: string, props: FieldProps) => Field, dataSet?: DataSet): Field; export declare function findBindFieldBy(myField: Field, fields: Fields, prop: string): Field | undefined; export declare function processFieldValue(value: any, field: Field, defaultLang: Lang, showValueIfNotFound?: boolean): any; export declare function getLimit(limit: any, record: Record): any; export declare function adapterDataToJSON(isSelected?: boolean, noCascade?: boolean): DataToJSON | undefined; export declare function generateData(records: Record[]): { dirty: boolean; data: object[]; }; export declare function generateJSONData(ds: DataSet, records: Record[]): { dirty: boolean; data: object[]; }; export declare function isDirtyRecord(record: any): any; export declare function getSpliceRecord(records: Record[], inserts: Record[], fromRecord?: Record): Record | undefined; export declare function fixAxiosConfig(config: AxiosRequestConfig): AxiosRequestConfig; export declare function normalizeGroups(groups: string[], records: Record[]): Group[]; /** * * @param data 导出需要导出的数据 * @param excelname 导出表单的名字 */ export declare function exportExcel(data: any, excelName: any): void;