@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
87 lines (86 loc) • 2.2 kB
TypeScript
export interface EmptyValue {
isEmpty?: 1001 | 1002 | null;
compare?: SearchComparisonOperator;
}
export interface StringValue extends EmptyValue {
value: string;
relation?: SearchRelation;
}
export interface DatetimeValue extends EmptyValue {
interval: boolean;
value?: string | null;
rangeValue?: string | null;
}
export interface NumberValue extends EmptyValue {
begin: number | null;
end: number | null;
interval: boolean;
value: number | null;
}
export type EnumValue = StringValue;
export interface BooleanValue extends EmptyValue {
value: boolean | null;
}
export interface EnumFieldOptions {
data: Record<string, any>[];
textField: string;
valueField: string;
}
export interface BooleanFieldOptions {
trueText: string;
falseText: string;
}
export interface DatetimeOptions {
showTime: boolean;
format: string;
valueFormat: string;
}
export interface NumbericOptions {
precision?: number;
thousand?: string;
}
export type SearchFieldOptions = EnumFieldOptions | BooleanFieldOptions | DatetimeOptions | NumbericOptions;
export type SearchFieldValueType = StringValue | DatetimeValue | NumberValue | EnumValue | BooleanValue;
export interface SearchField {
/**
* 搜索字段的标识
*/
field: string;
/**
* 搜索字段的显示名称
*/
title: string;
/** 搜索字段的数据类型,用于判断是否显示比较运算符 */
dataType: string;
options?: Partial<SearchFieldOptions> | null;
value?: SearchFieldValueType | null;
}
export declare enum SearchComparisonOperator {
Equal = 0,
NotEqual = 1,
Greater = 2,
GreaterEqual = 3,
Less = 4,
LessEqual = 5,
Contains = 6,
NotContains = 9,
IsEmpty = 12,
IsNotEmpty = 13
}
export declare enum SearchRelation {
Empty = 0,
And = 1,
Or = 2
}
export declare const searchComparisonOperatorListForString: {
label: string;
value: SearchComparisonOperator;
}[];
export interface SearchCondition {
compare: SearchComparisonOperator;
filterField: string;
lbracket: string;
rbracket: string;
relation: SearchRelation;
value: any;
}