25 lines
728 B
TypeScript
25 lines
728 B
TypeScript
|
|
export interface getDictionaryOptions {
|
|||
|
|
/** appKey,默认 DICTIONARY_APP_KEY_ENUM.DEFAULT(0bb989ecada5470c87635018ece9f327) */
|
|||
|
|
appKey?: string;
|
|||
|
|
/** 要获取的字典 */
|
|||
|
|
dictValue: string;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export interface DictionaryItem {
|
|||
|
|
/** label */
|
|||
|
|
dictLabel: string;
|
|||
|
|
/** value */
|
|||
|
|
dictValue: string;
|
|||
|
|
/** 子级 */
|
|||
|
|
children: DictionaryItem[];
|
|||
|
|
[key: string]: any;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export type getDictionaryFunction = (options: getDictionaryOptions) => Promise<DictionaryItem[]>;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取数据字典
|
|||
|
|
*/
|
|||
|
|
export default function useDictionary(returnType: "array"): [boolean, getDictionaryFunction];
|
|||
|
|
export default function useDictionary(returnType?: "object"): { loading: boolean; getDictionary: getDictionaryFunction };
|