import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
<#if appde??>
import ${srfclassname('${appde.getCodeName()}')}Service from '@/service/${srffilepath2(appde.getCodeName())}/${srffilepath2(appde.getCodeName())}-service';
</#if>
import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.getCodeName())}-${ctrl.getControlType()?lower_case}-model';
<#if import_block??>${import_block}</#if>

/**
 * ${srfclassname('${ctrl.codeName}')} 部件服务对象
 *
 * @export
 * @class ${srfclassname('${ctrl.codeName}')}Service
 */
export default class ${srfclassname('${ctrl.codeName}')}Service extends ControlService {
<#if appde??>

    /**
     * ${de.getLogicName()}服务对象
     *
     * @type {${srfclassname('${appde.getCodeName()}')}Service}
     * @memberof ${srfclassname('${ctrl.codeName}')}Service
     */
    public appEntityService: ${srfclassname('${appde.getCodeName()}')}Service = new ${srfclassname('${appde.getCodeName()}')}Service({ $store: this.getStore() });
</#if>
<#if view.isPSDEView()??>

    /**
     * 设置从数据模式
     *
     * @type {boolean}
     * @memberof ${srfclassname('${ctrl.codeName}')}Service
     */
    public setTempMode(){
        this.isTempMode = <#if view.getTempMode?? && view.getTempMode()?? && view.getTempMode() == 2>true<#else>false</#if>;
    }
</#if>

    /**
     * Creates an instance of ${srfclassname('${ctrl.codeName}')}Service.
     * 
     * @param {*} [opts={}]
     * @memberof ${srfclassname('${ctrl.codeName}')}Service
     */
    constructor(opts: any = {}) {
        super(opts);
        this.model = new ${srfclassname('${ctrl.codeName}')}Model();
    }