UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

301 lines (300 loc) 8.36 kB
export declare enum CascadeEnum { /** 同步选择 */ Both = "both", /** 包含上级 */ Up = "up", /** 包含下级 */ Down = "down", /** 仅选择自身 */ Disable = "disable" } export declare const cascadeItems: { value: CascadeEnum; text: string; }[]; export declare const DefaultDialogTitle = ""; export interface SearchParams { field: string; value: string; isNavigation: boolean; } export declare enum LookupDisplayType { List = "LIST", Tree = "TREELIST", ListList = "NAVLIST", TreeList = "NAVTREELIST", ListTree = "NAVLISTTREE" } export declare enum LoadTreeDataType { default = "default", all = "all", async = "async" } export interface PagerChangeParams { pageIndex?: number; pageSize?: number; isNavigation: boolean; } export type LookupIdValueType = string | number | null; export type ShouldContinueResult = { canOpen: boolean; message?: string; data?: any; } | boolean; export type CanSelectResult = { canSelect: boolean; message?: string; } | boolean; export type BeforeOpenDialogFunction = (params?: any) => Promise<ShouldContinueResult>; export type BeforeSubmitFunction = (params: any) => CanSelectResult; export type CallBackFunction = (items: any[], options: Record<string, any>) => Promise<any>; export declare const LOOKUP_ACTIVE_TAB = "__lookup_active_tab__"; export declare const LOOKUP_USER_DATA_ID = "__lookup_user_data_id__"; export declare enum LookupTabs { dataList = "datalist", favorite = "favorite" } export interface LookupPagination { enable?: boolean; sizeLimits?: number[]; size?: number; index?: number; showLimits?: boolean; total?: number; showGoto?: boolean; mode?: 'server' | 'client'; showPageInfo?: boolean; } export interface SearchField { value: string; label: string; isDefault?: boolean; } export interface NavigationOptions { data: any[]; columns: any[]; searchFields?: SearchField[]; idField: string; pagination?: LookupPagination; } export declare const DEFAULT_PAGINATION_OPTIONS: LookupPagination; export type TextChangedType = 'blur' | 'enter' | 'any'; export declare const F_LOOKUP_HTTP_SERVICE_TOKEN: unique symbol; export declare enum Compare { Equal = 0, NotEqual = 1, Greater = 2, GreaterOrEqual = 3, Less = 4, LessOrEqual = 5, Like = 6, LikeStartWith = 7, LikeEndWith = 8, NotLike = 9, NotLikeStartWith = 10, NotLikeEndWith = 11, Is = 12, IsNot = 13, In = 14, NotIn = 15 } export declare enum FilterRelation { Empty = 0, And = 1, Or = 2 } export declare enum ExpressValueType { Value = 0, Expression = 1, FrontExpress = "frontExpress" } export interface FilterCondition { filterField: string; value: string; lbracket?: string; rbracket?: string; relation?: FilterRelation; compare?: Compare; expresstype?: ExpressValueType; } export type LOAD_DATA_TYPE = 'all' | 'fav' | 'list' | 'nav' | 'search' | 'children' | 'navchildren' | 'textchange' | 'sort' | 'navsearch' | 'selected' | 'allChildren' | 'navAllChildren'; export interface SearchParam { searchField?: string; searchValue?: string; searchType?: string; category?: LOAD_DATA_TYPE; favoriteIds?: string[]; sortName?: string; sortOrder?: string; parentLayer?: number; parentPath?: string; layerNum?: number; parentId?: string; } export interface LookupRequestParams { pageIndex?: number; pageSize?: number; searchConditions?: Array<FilterCondition>; navSearchConditions?: Array<FilterCondition>; /** 查询参数 searchParam * category: 查询类型, * 'all'|'list'|'nav' | 'search' | 'children' | 'textchange' | 'sort' | 'navsearch' * |'fav'|'addFavorite'|'removeFavorite'|'updateFavorite'; * searchField?: 查询字段 * searchValue?: 关键字 * searchType: 'equal' | 'like' 查询方式 */ searchValue?: string; /** 自定义查询数据 */ customData?: any; /** * 树结构加载方式 * default: 内置取数; all: 加载所有; async:分层加载 */ loadTreeDataType?: 'loadall' | 'layerload' | 'default'; /** 构造完整树 */ enableFullTree?: boolean; /** 导航帮助对应关系条件 */ relationFilter?: Array<{ fieldName: string; fieldValue: any; }>; /** 已选择数据ID */ selectedInfo?: { selectedIds: string[]; selected: boolean; }; /** 树表帮助,获取所有子级数据时的所有选中的ID列表 */ parentsIds?: any[]; /** 左树右列表帮助,左树为分层分级码加载时,点击节点的分级码 */ navPathCode?: any; /** 将树结构数据转换为普通列表 */ treeToList?: boolean; navTreeToList?: boolean; /** 树结构分页取数 */ treePagination?: boolean; id?: string; } export interface DisplayInfo { valueField?: string; textField?: string; idField?: string; } export type ONLY_SELECT_LEAF = 'default' | 'yes' | 'no'; export interface TreeInfo { /** 数据加载方式: all, async */ loadDataType?: 'all' | 'async'; /** 分层方式: pathcode, parentId */ layerType?: 'pathcode' | 'parentId'; /** 数据中带有分级信息的字段 */ dataField?: string; /** 父ID字段 */ parentField?: string; /** 分级码字段 */ pathField?: string; /** 级数字段 */ layerField?: string; /** 是否明细字段 */ isDetailField?: string; /** * 只允许选择叶子节点 */ onlySelectLeaf?: boolean; /** 树结构数据是否已初始化完成 */ treeDataIsInit?: boolean; } export interface LookupHttpResult { /** 列信息 */ columns?: any[]; displayInfo?: DisplayInfo; displayType?: string; /** 数据列表 */ items?: any[]; navigation?: LookupHttpResult; /** 树分级信息 */ treeInfo?: TreeInfo; /** 分页信息 */ pageInfo?: { pageIndex: number; pageSize: number; pageList?: number[]; enablePager: boolean; }; /** 查询字段 */ searchFields?: { label: string; value: string; }[]; /** 已选择数据列表 */ selectedData?: any; /** 总记录数 */ total?: number; title?: string; idField?: string; relations?: Array<{ groupField: string; helpField: string; }>; flattenTreeNodes?: any[]; } export interface LookupHttpService { getData(uri: string, params: Partial<LookupRequestParams>): Promise<LookupHttpResult>; getSettings(id: string): Promise<any>; updateSettings(id: string, settings: any): Promise<any>; } export interface SearchInfo { field?: string; value?: any; type?: 'like' | 'equal' | ''; isNavigation?: boolean; } export interface QueryState extends SearchInfo { } export interface SearchState { navigation?: SearchInfo; default?: SearchInfo; } export interface PagerInfoSate { navigation?: LookupPagination; default: LookupPagination; } export type BeforeLoadData = (params: { data: LookupHttpResult; }) => Promise<LookupHttpResult>; export interface CascadeOptions { /** 是否启用级联控制 */ enable: boolean; /** 是否显示级联控制选项 */ showCascadeControl: boolean; /** 控制选项中允许的值 */ cascadeItems: { both: boolean; up: boolean; down: boolean; disable: boolean; }; /** 级联控制默认状态 */ defaultStatus: 'up' | 'down' | 'both' | 'disable'; } export interface LookupDialogOptions { /** 是否显示关闭按钮 */ showCloseButton?: boolean; /** 是否显示最大化按钮 */ showMaxButton?: boolean; /** 对话框宽度 */ width?: number; /** 显示名称 */ title: string; /** 对话框高度 */ height?: number; /** 对话框最小宽度 */ minWidth?: number; /** 对话框最小高度 */ minHeight?: number; draggable?: boolean; resizeable?: boolean; enableEsc?: boolean; rememberSize?: boolean; navigatorWidth?: number; } export declare const DEFAULT_LOOKUP_DIALOG_OPTIONS: Partial<LookupDialogOptions>;