This commit is contained in:
parent
8b59b759e8
commit
448333bf63
16
dict/Dict.js
16
dict/Dict.js
|
@ -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={}
|
||||||
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)=>{
|
return new Promise((r)=>{
|
||||||
let params=Object.assign([],options);
|
let params=Object.assign([],options);
|
||||||
if (options instanceof Array) {
|
if (options instanceof Array) {
|
||||||
|
@ -36,11 +40,7 @@ export default class Dict {
|
||||||
if (opts.types === undefined) {
|
if (opts.types === undefined) {
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue