import { Subject } from 'rxjs';
import { DashboardViewBase } from '@/studio-core';
import HRArchivesService from '@/service/hrarchives/hrarchives-service';
import HRArchivesAuthService from '@/authservice/hrarchives/hrarchives-auth-service';
import PortalViewEngine from '@engine/view/portal-view-engine';
import HRArchivesUIService from '@/uiservice/hrarchives/hrarchives-ui-service';

/**
 * 档案看板视图基类
 *
 * @export
 * @class HRArchivesV_004Base
 * @extends {DashboardViewBase}
 */
export class HRArchivesV_004Base extends DashboardViewBase {
    /**
     * 视图对应应用实体名称
     *
     * @protected
     * @type {string}
     * @memberof HRArchivesV_004Base
     */
    protected appDeName: string = 'hrarchives';

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

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

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

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


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

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

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


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


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

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

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


}