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