This commit is contained in:
parent
8b59b759e8
commit
448333bf63
12
dict/Dict.js
12
dict/Dict.js
|
@ -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={}
|
||||
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) {
|
||||
|
@ -37,10 +41,6 @@ export default class Dict {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue