import { Http,Util } from '@/utils';
import EntityService from '../entity-service';



/**
 * 功能位置类型服务对象基类
 *
 * @export
 * @class EAMLocationTypeServiceBase
 * @extends {EntityServie}
 */
export default class EAMLocationTypeServiceBase extends EntityService {

    /**
     * Creates an instance of  EAMLocationTypeServiceBase.
     * 
     * @param {*} [opts={}]
     * @memberof  EAMLocationTypeServiceBase
     */
    constructor(opts: any = {}) {
        super(opts);
    }

    /**
     * 初始化基础数据
     *
     * @memberof EAMLocationTypeServiceBase
     */
    public initBasicData(){
        this.APPLYDEKEY ='eamlocationtype';
        this.APPDEKEY = 'eamlocationtypeid';
        this.APPDENAME = 'eamlocationtypes';
        this.APPDETEXT = 'eamlocationtypename';
        this.APPNAME = 'assetmanagement';
        this.SYSTEMNAME = 'ibizassetmanagement';
    }

// 实体接口

    /**
     * Select接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EAMLocationTypeServiceBase
     */
    public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
            return Http.getInstance().get(`/eamlocationtypes/${context.eamlocationtype}/select`,isloading);
    }

    /**
     * FetchDefault接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EAMLocationTypeServiceBase
     */
    public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let tempData:any = JSON.parse(JSON.stringify(data));
        return Http.getInstance().get(`/eamlocationtypes/select`,tempData,isloading);
    }
}