<template>
<studio-view-style2 viewName="accountgradation" viewTitle="客户关系导航" class='detreeexpview account-gradation'>
    <view_treeexpbar 
                    :viewState="viewState"  
                    :viewparams="viewparams" 
                    :context="context" 
                    :viewUID="viewUID"
                    name="treeexpbar"  
                    ref='treeexpbar' 
                    @selectionchange="treeexpbar_selectionchange($event)"  
                    @activated="treeexpbar_activated($event)"  
                    @load="treeexpbar_load($event)"  
                    @closeview="closeView($event)">
                </view_treeexpbar>
</studio-view-style2>
</template>

<script lang='tsx'>
import { Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing, TreeExpViewBase } from '@/studio-core';
import AccountService from '@/service/account/account-service';

import TreeExpViewEngine from '@engine/view/tree-exp-view-engine';


/**
 * 客户关系导航视图基类
 *
 * @export
 * @class AccountGradationBase
 * @extends {TreeExpViewBase}
 */
@Component({})
@VueLifeCycleProcessing()
export default class AccountGradationBase extends TreeExpViewBase {

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


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

	/**
	 * 自定义视图导航上下文集合
	 *
     * @protected
	 * @type {*}
	 * @memberof AccountGradationBase
	 */
    protected customViewNavContexts: any = {
    };

	/**
	 * 自定义视图导航参数集合
	 *
     * @protected
	 * @type {*}
	 * @memberof AccountGradationBase
	 */
    protected customViewParams: any = {
    };

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

    /**
     * 容器模型
     *
     * @protected
     * @type {*}
     * @memberof AccountGradationBase
     */
    protected containerModel: any = {
        view_treeexpbar: { name: 'treeexpbar', type: 'TREEEXPBAR' },
    };


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

    /**
     * 引擎初始化
     *
     * @public
     * @memberof AccountGradationBase
     */
    public engineInit(): void {
        this.engine.init({
            view: this,
            treeexpbar: this.$refs.treeexpbar,
            keyPSDEField: 'account',
            majorPSDEField: 'accountname',
            isLoadDefault: true,
        });
    }

    /**
     * treeexpbar 部件 selectionchange 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof AccountGradationBase
     */
    public treeexpbar_selectionchange($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('treeexpbar', 'selectionchange', $event);
    }

    /**
     * treeexpbar 部件 activated 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof AccountGradationBase
     */
    public treeexpbar_activated($event: any, $event2?: any): void {
        this.engine.onCtrlEvent('treeexpbar', 'activated', $event);
    }

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

    /**
     * 打开新建数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof AccountGradation
     */
    public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
        let localContext:any = null;
        let localViewParam:any =null;
    this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
    }


    /**
     * 打开编辑数据视图
     *
     * @param {any[]} args
     * @param {*} [params]
     * @param {*} [fullargs]
     * @param {*} [$event]
     * @param {*} [xData]
     * @memberof AccountGradation
     */
    public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
        let localContext:any = null;
        let localViewParam:any =null;
    this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
    }



    /**
     * 视图唯一标识
     *
     * @type {string}
     * @memberof AccountGradation
     */
    public viewUID: string = 'base-account-gradation';


}
</script>

<style lang='less'>
@import './account-gradation.less';
</style>