perf: 【ANTD】优化一些 todo 提到的问题
This commit is contained in:
@@ -14,11 +14,11 @@ import { useDictStore } from '#/store';
|
||||
type ColorType = 'error' | 'info' | 'success' | 'warning';
|
||||
|
||||
export interface DictDataType {
|
||||
dictType: string;
|
||||
dictType?: string;
|
||||
label: string;
|
||||
value: boolean | number | string;
|
||||
colorType: ColorType;
|
||||
cssClass: string;
|
||||
colorType?: ColorType;
|
||||
cssClass?: string;
|
||||
}
|
||||
|
||||
export interface NumberDictDataType extends DictDataType {
|
||||
@@ -62,11 +62,10 @@ function getDictObj(dictType: string, value: any) {
|
||||
* @param valueType 字典值类型,默认 string 类型
|
||||
* @returns 字典数组
|
||||
*/
|
||||
// TODO @puhui999:貌似可以定义一个类型?不使用 any[]
|
||||
function getDictOptions(
|
||||
dictType: string,
|
||||
valueType: 'boolean' | 'number' | 'string' = 'string',
|
||||
): any[] {
|
||||
): DictDataType[] {
|
||||
const dictStore = useDictStore();
|
||||
const dictOpts = dictStore.getDictOptions(dictType);
|
||||
const dictOptions: DefaultOptionType = [];
|
||||
|
||||
Reference in New Issue
Block a user