修复BUG:

1.修复settings中上传文件的bug;
2.优化字典展示
This commit is contained in:
猿小天
2023-12-01 17:31:37 +08:00
parent 5729aeb521
commit 197714e845
2 changed files with 11 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ import { FastCrud, useTypes } from '@fast-crud/fast-crud';
const { getType } = useTypes(); const { getType } = useTypes();
import '@fast-crud/fast-crud/dist/style.css'; import '@fast-crud/fast-crud/dist/style.css';
import { setLogger } from '@fast-crud/fast-crud'; import { setLogger } from '@fast-crud/fast-crud';
import { getBaseURL } from '/@/utils/baseUrl';
// element // element
import ui from '@fast-crud/ui-element'; import ui from '@fast-crud/ui-element';
import { request } from '/@/utils/service'; import { request } from '/@/utils/service';

View File

@@ -1,11 +1,16 @@
import { toRaw } from 'vue'; import { toRaw } from 'vue';
import { DictionaryStore } from '/@/stores/dictionary'; import { DictionaryStore } from '/@/stores/dictionary';
/** /**
* @method 获取指定name字典 * @method 获取指定name字典
*/ */
export const dictionary = (name: string) => { export const dictionary = (name: string,key:string|number|undefined) => {
const dict = DictionaryStore() const dict = DictionaryStore()
const dictionary = toRaw(dict.data) const dictionary = toRaw(dict.data)
return dictionary[name] if(key!=undefined){
} const obj = dictionary[name].find((item:any) => item.value === key)
return obj?obj.label:''
}else{
return dictionary[name]
}
}