///
import { IField, ISearchVO } from '@/common/types';
import { IPersonalFilter } from '../quick-search';
export declare type ILocalField = {
code: string;
name: string;
fieldType: IField['fieldType'];
defaultShow?: boolean;
noDisplay?: boolean;
};
declare type IChosenField = (IField | ILocalField) & {
value: any;
archive?: boolean;
};
export declare type IChosenFields = Map;
export declare type IBatchAction = undefined | 'edit' | 'delete';
export interface IssueSearchStoreProps {
getSystemFields: () => ILocalField[];
transformFilter: (chosenFields: IChosenFields) => any;
renderField?: (field: IChosenField, props: {
onChange: (v: any) => void;
value: any;
projectId?: string;
}) => React.ReactElement | React.FunctionComponent | null | void | false;
defaultChosenFields?: IChosenFields;
defaultSearchVO?: ISearchVO;
projectId?: string;
/** @default project */
menuType?: 'project' | 'org';
fieldConfigs?: {
[key: string]: any;
};
}
declare class IssueSearchStore {
query: () => void;
getSystemFields: () => ILocalField[];
renderField: IssueSearchStoreProps['renderField'];
transformFilter: (chosenFields: IChosenFields) => any;
defaultChosenFields?: IChosenFields;
defaultSearchVO?: ISearchVO;
projectId?: string;
fieldConfigs: {
[key: string]: any;
};
menuType: 'project' | 'org';
constructor({ getSystemFields, transformFilter, renderField, defaultChosenFields, defaultSearchVO, projectId, menuType, fieldConfigs, }: IssueSearchStoreProps);
setQuery(query: () => void): void;
myFilters: IPersonalFilter[];
get getMyFilters(): IPersonalFilter[];
setMyFilters(data: IPersonalFilter[]): void;
loadMyFilterList: () => Promise;
fields: IField[];
loadCustomFields(): Promise;
transformChosenFields(): void;
updateFilter(filter: {
[key: string]: any;
}): void;
setFields(fields: IField[]): void;
chosenFields: IChosenFields;
get chosenNotDisplayField(): IChosenField[];
initChosenFields(): void;
handleChosenFieldChange: (select: boolean, field: IField) => void;
getFilterValueByCode(code: string): any;
handleFilterChange: (code: string, value: any) => void;
get getAllFields(): (IField | ILocalField)[];
setFieldFilter: (code: string, v: any) => void;
setChosenFields(chosenFields: IChosenFields): void;
chooseAll(filteredFields: IField[]): void;
unChooseAll(): void;
clearAllFilter(): void;
getFieldCodeById(id: string): string | undefined;
get currentFilter(): IChosenField[];
getCustomFieldFilters: (filterNull?: boolean) => any;
get isHasFilter(): boolean;
get currentFlatFilter(): {
[key: string]: any;
};
batchAction: IBatchAction;
setBatchAction: (data: IBatchAction) => void;
overflowLine: boolean;
setOverflowLine: (data: boolean) => void;
folded: boolean | undefined;
setFolded: (data: boolean) => void;
}
export default IssueSearchStore;