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



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

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

    /**
     * 初始化基础数据
     *
     * @memberof EAMLocationServiceBase
     */
    public initBasicData(){
        this.APPLYDEKEY ='eamlocation';
        this.APPDEKEY = 'eamlocationid';
        this.APPDENAME = 'eamlocations';
        this.APPDETEXT = 'eamlocationname';
        this.APPNAME = 'assetmanagement';
        this.SYSTEMNAME = 'ibizassetmanagement';
    }

// 实体接口

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

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