import { Subject } from 'rxjs';
import { DashboardViewBase } from '@/studio-core';
import EAMApplyService from '@/service/eamapply/eamapply-service';
import EAMApplyAuthService from '@/authservice/eamapply/eamapply-auth-service';
import PortalViewEngine from '@engine/view/portal-view-engine';
import EAMApplyUIService from '@/uiservice/eamapply/eamapply-ui-service';

/**
 * 维护申请主信息看板视图基类
 *
 * @export
 * @class EAMApplySummaryViewBase
 * @extends {DashboardViewBase}
 */
export class EAMApplySummaryViewBase extends DashboardViewBase {
    /**
     * 视图对应应用实体名称
     *
     * @protected
     * @type {string}
     * @memberof EAMApplySummaryViewBase
     */
    protected appDeName: string = 'eamapply';

    /**
     * 应用实体主键
     *
     * @protected
     * @type {string}
     * @memberof EAMApplySummaryViewBase
     */
    protected appDeKey: string = 'eamapplyid';

    /**
     * 应用实体主信息
     *
     * @protected
     * @type {string}
     * @memberof EAMApplySummaryViewBase
     */
    protected appDeMajor: string = 'eamapplyname';

    /**
     * 实体服务对象
     *
     * @type {EAMApplyService}
     * @memberof EAMApplySummaryViewBase
     */
    protected appEntityService: EAMApplyService = new EAMApplyService;

    /**
     * 实体权限服务对象
     *
     * @type EAMApplyUIService
     * @memberof EAMApplySummaryViewBase
     */
    public appUIService: EAMApplyUIService = new EAMApplyUIService(this.$store);


    /**
     * 计数器服务对象集合
     *
     * @protected
     * @type {Array<*>}
     * @memberof EAMApplySummaryViewBase
     */    
    protected counterServiceArray: Array<any> = [];

    /**
     * 视图模型数据
     *
     * @protected
     * @type {*}
     * @memberof EAMApplySummaryViewBase
     */
    protected model: any = {
        srfCaption: 'entities.eamapply.views.summaryview.caption',
        srfTitle: 'entities.eamapply.views.summaryview.title',
        srfSubTitle: 'entities.eamapply.views.summaryview.subtitle',
        dataInfo: ''
    }

    /**
     * 容器模型
     *
     * @protected
     * @type {*}
     * @memberof EAMApplySummaryViewBase
     */
    protected containerModel: any = {
        view_dashboard: { name: 'dashboard', type: 'DASHBOARD' },
    };


	/**
     * 视图唯一标识
     *
     * @protected
     * @type {string}
     * @memberof ViewBase
     */
	protected viewtag: string = '7a8816b602f7aa58d702cb0743841f59';


    /**
     * 视图引擎
     *
     * @public
     * @type {Engine}
     * @memberof EAMApplySummaryViewBase
     */
    public engine: PortalViewEngine = new PortalViewEngine();

    /**
     * 引擎初始化
     *
     * @public
     * @memberof EAMApplySummaryViewBase
     */
    public engineInit(): void {
        this.engine.init({
            view: this,
            dashboard: this.$refs.dashboard,
            keyPSDEField: 'eamapply',
            majorPSDEField: 'eamapplyname',
            isLoadDefault: true,
        });
    }

    /**
     * dashboard 部件 load 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof EAMApplySummaryViewBase
     */
    public dashboard_load($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('dashboard', 'load', $event);
    }


}