<template>
<studio-view-style2 viewName="pricelevelpickupview" viewTitle="价目表数据选择视图" class='depickupview price-level-pickup-view'>
    <div class="content-container pickup-view">
                <view_pickupviewpanel 
                    :viewState="viewState"  
                    :viewparams="JSON.parse(JSON.stringify(viewparams))" 
                    :context="JSON.parse(JSON.stringify(context))" 
                    :isSingleSelect="isSingleSelect"
                    :selectedData="selectedData"
                    :isShowButton="isShowButton"
                    name="pickupviewpanel"  
                    ref='pickupviewpanel' 
                    @selectionchange="pickupviewpanel_selectionchange($event)"  
                    @activated="pickupviewpanel_activated($event)"  
                    @load="pickupviewpanel_load($event)"  
                    @closeview="closeView($event)">
                </view_pickupviewpanel>
            <card v-if="isShowButton" :dis-hover="true" :bordered="false" class="footer">
                <row :style="{ textAlign: 'right' }">
                    <i-button type="primary" :disabled="this.viewSelections.length > 0 ? false : true" @click="onClickOk">{{this.containerModel.view_okbtn.text}}</i-button>
                        &nbsp;&nbsp;
                    <i-button @click="onClickCancel">{{this.containerModel.view_cancelbtn.text}}</i-button>
                </row>
            </card>
        </div>
</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, PickupViewBase } from '@/studio-core';
import PriceLevelService from '@/service/price-level/price-level-service';

import PickupViewEngine from '@engine/view/pickup-view-engine';


/**
 * 价目表数据选择视图视图基类
 *
 * @export
 * @class PriceLevelPickupViewBase
 * @extends {PickupViewBase}
 */
@Component({})
@VueLifeCycleProcessing()
export default class PriceLevelPickupViewBase extends PickupViewBase {

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


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

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

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

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

    /**
     * 容器模型
     *
     * @protected
     * @type {*}
     * @memberof PriceLevelPickupViewBase
     */
    protected containerModel: any = {
        view_pickupviewpanel: { name: 'pickupviewpanel', type: 'PICKUPVIEWPANEL' },
        view_okbtn: { name: 'okbtn', type: 'button', text: '确定', disabled: true },
        view_cancelbtn: { name: 'cancelbtn', type: 'button', text: '取消', disabled: false },
        view_leftbtn: { name: 'leftbtn', type: 'button', text: '左移', disabled: true },
        view_rightbtn: { name: 'rightbtn', type: 'button', text: '右移', disabled: true },
        view_allleftbtn: { name: 'allleftbtn', type: 'button', text: '全部左移', disabled: true },
        view_allrightbtn: { name: 'allrightbtn', type: 'button', text: '全部右移', disabled: true },
    };


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

    /**
     * 引擎初始化
     *
     * @public
     * @memberof PriceLevelPickupViewBase
     */
    public engineInit(): void {
        this.engine.init({
            view: this,
            pickupviewpanel: this.$refs.pickupviewpanel,
            keyPSDEField: 'pricelevel',
            majorPSDEField: 'pricelevelname',
            isLoadDefault: true,
        });
    }

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

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

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


}
</script>

<style lang='less'>
@import './price-level-pickup-view.less';
</style>