This commit is contained in:
ln1778 2024-06-20 15:45:55 +08:00
parent 8b59b759e8
commit 448333bf63
1 changed files with 8 additions and 8 deletions

View File

@ -17,15 +17,19 @@ const DEFAULT_DICT_OPTIONS = {
* @property {Array.<DictMeta>} _dictMetas 字典元数据数组
*/
export default class Dict {
constructor() {
constructor(props) {
this.owner = null
this.label = {}
this.type = {}
this.raw={}
this.apiurl="/api/sysdict/get_dict";
if(props){
this.apiurl=props;
}else{
this.apiurl="/api/sysdict/get_dict";
}
}
init(options,url) {
init(options) {
return new Promise((r)=>{
let params=Object.assign([],options);
if (options instanceof Array) {
@ -36,11 +40,7 @@ export default class Dict {
if (opts.types === undefined) {
r();
throw new Error('need dict types')
}
if(url){
this.apiurl=url;
}
}
getRequest(params,this.apiurl).then((res)=>{
if(res&&res.datas){
const response=res.datas;