import { Subject } from 'rxjs';
import { UIActionTool, ViewTool } from '@/utils';
import { DashboardViewBase } from '@/studio-core';
import Res_supplierService from '@/service/res-supplier/res-supplier-service';
import Res_supplierAuthService from '@/authservice/res-supplier/res-supplier-auth-service';
import PortalViewEngine from '@engine/view/portal-view-engine';
import Res_supplierUIService from '@/uiservice/res-supplier/res-supplier-ui-service';

/**
 * 概览视图基类
 *
 * @export
 * @class Res_supplierMasterSummaryViewBase
 * @extends {DashboardViewBase}
 */
export class Res_supplierMasterSummaryViewBase extends DashboardViewBase {
    /**
     * 视图对应应用实体名称
     *
     * @protected
     * @type {string}
     * @memberof Res_supplierMasterSummaryViewBase
     */
    protected appDeName: string = 'res_supplier';

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

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

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

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

    /**
     * 是否显示信息栏
     *
     * @memberof Res_supplierMasterSummaryViewBase
     */
    isShowDataInfoBar = true;

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

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


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

    /**
     * 视图名称
     *
     * @protected
     * @type {string}
     * @memberof Res_supplierMasterSummaryViewBase
     */ 
    protected viewName:string = "res_supplierMasterSummaryView";


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


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

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

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


}