<template>
    <div class='portlet portal-components-tool ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
        <p class='portlet-title'>
            <span>
            
            工具栏
            </span>
        </p>
        <el-divider class="divider"></el-divider>
        <div class="portlet-with-title">
        <!-- 测试 -->
              <div class='toolbar-container'>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction6.visabled" :disabled="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction6.disabled" class='' v-button-loading:i-button @click="dashboard_sysportlet8_toolbar_click({ tag: 'deuiaction6' }, $event)">
                      <i class='fa fa-refresh'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction6.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction6.tip')}}</div>
          </tooltip>
          <span class='seperator'>|</span>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction2.visabled" :disabled="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction2.disabled" class='' v-button-loading:i-button @click="dashboard_sysportlet8_toolbar_click({ tag: 'deuiaction2' }, $event)">
                      <i class='fa fa-edit'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction2.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction2.tip')}}</div>
          </tooltip>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction3.visabled" :disabled="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction3.disabled" class='' v-button-loading:i-button @click="dashboard_sysportlet8_toolbar_click({ tag: 'deuiaction3' }, $event)">
                      <i class='fa fa-remove'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction3.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction3.tip')}}</div>
          </tooltip>
          <span class='seperator'>|</span>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction7.visabled" :disabled="dashboardviewdashboard_sysportlet8_toolbarModels.deuiaction7.disabled" class='' v-button-loading:i-button @click="dashboard_sysportlet8_toolbar_click({ tag: 'deuiaction7' }, $event)">
                      <i class='fa fa-upload'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction7.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet8_toolbar_toolbar.deuiaction7.tip')}}</div>
          </tooltip>
      </div>
        </div>
    </div>
</template>
// 基于 @CONTROL/门户部件/CONTROL-BASE.vue.ftl 生成
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import PortalComponentsToolService from './portal-components-tool-portlet-service';

import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';


@Component({
    components: {
      
    }
})
export default class IBIZOrderPortalComponentsToolBase extends Vue implements ControlInterface {

    /**
     * 名称
     *
     * @type {string}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public name?: string;

    /**
     * 视图通讯对象
     *
     * @type {Subject<ViewState>}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public viewState!: Subject<ViewState>;

    /**
     * 应用上下文
     *
     * @type {*}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public context!: any;

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public viewparams!: any;

    /**
     * 视图操作参数
     *
     * @type {*}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public viewCtx!: any;

    /**
     * 视图状态事件
     *
     * @public
     * @type {(Subscription | undefined)}
     * @memberof PortalComponentsToolBase
     */
    public viewStateEvent: Subscription | undefined;

    /**
     * 获取部件类型
     *
     * @returns {string}
     * @memberof PortalComponentsToolBase
     */
    public getControlType(): string {
        return 'PORTLET'
    }



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

    /**
     * 建构部件服务对象
     *
     * @type {PortalComponentsToolService}
     * @memberof PortalComponentsToolBase
     */
    public service: PortalComponentsToolService = new PortalComponentsToolService({ $store: this.$store });

    /**
     * 实体服务对象
     *
     * @type {IBIZOrderService}
     * @memberof PortalComponentsToolBase
     */
    public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.$store });

    /**
     * 界面UI服务对象
     *
     * @type {IBIZOrderUIService}
     * @memberof PortalComponentsToolBase
     */  
    public appUIService:IBIZOrderUIService = new IBIZOrderUIService();

    /**
     * dashboard_sysportlet8_toolbar 部件 click 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof PortalComponentsToolBase
     */
    public dashboard_sysportlet8_toolbar_click($event: any, $event2?: any) {
        if (Object.is($event.tag, 'deuiaction5')) {
            this.dashboard_sysportlet8_toolbar_deuiaction5_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction6')) {
            this.dashboard_sysportlet8_toolbar_deuiaction6_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction4')) {
            this.dashboard_sysportlet8_toolbar_deuiaction4_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction2')) {
            this.dashboard_sysportlet8_toolbar_deuiaction2_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction1')) {
            this.dashboard_sysportlet8_toolbar_deuiaction1_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction3')) {
            this.dashboard_sysportlet8_toolbar_deuiaction3_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction7')) {
            this.dashboard_sysportlet8_toolbar_deuiaction7_click(null, 'dashboard_sysportlet8_toolbar', $event2);
        }
    }
    

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction5_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.ToggleRowEdit(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction6_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.Refresh(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction4_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.NewRow(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction2_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.Edit(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction1_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.SaveRow(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction3_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.Remove(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet8_toolbar_deuiaction7_click(params: any = {}, tag?: any, $event?: any) {
        // 参数
        // 取数
        let datas: any[] = [];
        let xData: any = null;
        // _this 指向容器对象
        const _this: any = this;
        let paramJO:any = {};
        let contextJO:any = {};
        xData = this;
        if (_this.getDatas && _this.getDatas instanceof Function) {
            datas = [..._this.getDatas()];
        }
        if(params){
          datas = [params];
        }
        // 界面行为
        this.ImportExcel(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 行编辑
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
    }
    /**
     * 刷新
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Refresh(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        if (xData && xData.refresh && xData.refresh instanceof Function) {
            xData.refresh(args);
        } else if (_this.refresh && _this.refresh instanceof Function) {
            _this.refresh(args);
        }
    }
    /**
     * 新建行
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        const data: any = {};
        if (_this.hasOwnProperty('newRow') && _this.newRow instanceof Function) {
            _this.newRow([{ ...data }], params, $event, xData);
        } else if(xData.newRow && xData.newRow instanceof Function) {
            xData.newRow([{ ...data }], params, $event, xData);
        }else{
            _this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在，请添加!' });
        }
    }
    /**
     * 编辑
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        if (args.length === 0) {
            return;
        }
        const _this: any = this;
        if (_this.opendata && _this.opendata instanceof Function) {
            const data: any = { };
            if (args.length > 0) {
                Object.assign(data, { ibizorder: args[0].ibizorder })
            }
            _this.opendata([{ ...data }], args, params, $event, xData);
        } else {
            _this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在，请添加!' });
        }
    }
    /**
     * 保存行
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public SaveRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        // 界面行为容器对象 _this
        const _this: any = this;
        if (xData && xData.save instanceof Function) {
            xData.save();
        } else if (_this.save && _this.save instanceof Function) {
            _this.save();
        }
    }
    /**
     * 删除
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        if (!xData || !(xData.remove instanceof Function)) {
            return ;
        }
        xData.remove(args);
    }

    /**
     * 导入
     *
     * @param {any[]} args 当前数据
     * @param {any} context 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @param {*} [srfParentDeName] 父实体名称
     * @returns {Promise<any>}
     */
    public async ImportExcel(args: any[], context:any = {}, params: any={}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?:string) {
        let data: any = {};
        let tempData: any = {};
        let tempContext: any = {};
        let tempViewParam: any = {};
        const _this: any = actionContext;
        const _args: any[] = Util.deepCopy(args);
        const actionTarget: string | null = 'NONE';
        tempContext = UIActionTool.handleContextParam(actionTarget, _args, context, params, tempContext);
        tempViewParam = UIActionTool.handleActionParam(actionTarget, _args, context, params, tempViewParam);
        Object.assign(context, tempContext);
        Object.assign(params, data);
        let parentObj:any = {
            srfparentdename: srfParentDeName ? srfParentDeName : null,
            srfparentkey: srfParentDeName ? context[srfParentDeName.toLowerCase()] : null
        };
        Object.assign(context, parentObj);
        const openPopupApp = (url: string) => {
            window.open(url, '_blank');
            return { ok: true, result: _args };
        }
        const url = `../../ibizutil/uploaddedataview.jsp?srfdeid=`;
        return openPopupApp(url);
    }


    /**
     * 关闭视图
     *
     * @param {any} args
     * @memberof PortalComponentsToolBase
     */
    public closeView(args: any): void {
        let _this: any = this;
        _this.$emit('closeview', [args]);
    }

    /**
     *  计数器刷新
     *
     * @memberof PortalComponentsToolBase
     */
    public counterRefresh(){
        const _this:any =this;
        if(_this.counterServiceArray && _this.counterServiceArray.length >0){
            _this.counterServiceArray.forEach((item:any) =>{
                if(item.refreshData && item.refreshData instanceof Function){
                    item.refreshData();
                }
            })
        }
    }



    /**
     * 长度
     *
     * @type {number}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public height?: number;

    /**
     * 宽度
     *
     * @type {number}
     * @memberof PortalComponentsToolBase
     */
    @Prop() public width?: number;

    /**
     * 门户部件类型
     *
     * @type {string}
     * @memberof PortalComponentsToolBase
     */
    public portletType: string = 'toolbar';

    /**
     * 部件类型
     *
     * @type {string}
     * @memberof PortalComponentsToolBase
     */
    public controlType: string = 'PORTLET';

    /**
     * 视图默认使用
     *
     * @type {string}
     * @memberof PortalComponentsToolBase
     */
    @Inject({from:'navModel',default: 'tab'})
    public navModel!:string;


    /**
     * 界面行为模型数据
     *
     * @memberof PortalComponentsToolBase
     */
    public uiactionModel: any = {
    }

        /**
     * 工具栏模型
     *
     * @type {*}
     * @memberof IBIZOrderDashboardView
     */
    public dashboardviewdashboard_sysportlet8_toolbarModels: any = {
        deuiaction6: { name: 'deuiaction6', actiontarget: 'NONE', caption: '刷新', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Refresh', target: '' } },

        seperator2: {  name: 'seperator2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
        deuiaction2: { name: 'deuiaction2', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },

        deuiaction3: { name: 'deuiaction3', actiontarget: 'NONE', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },

        seperator1: {  name: 'seperator1', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
        deuiaction7: { name: 'deuiaction7', actiontarget: 'NONE', caption: '前台调用', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ImportExcel', target: 'NONE' } },

    };


    /**
     * 是否自适应大小
     *
     * @returns {boolean}
     * @memberof PortalComponentsToolBase
     */
    @Prop({default: false})public isAdaptiveSize!: boolean;

    /**
     * 获取多项数据
     *
     * @returns {any[]}
     * @memberof PortalComponentsToolBase
     */
    public getDatas(): any[] {
        return [];
    }

    /**
     * 获取单项树
     *
     * @returns {*}
     * @memberof PortalComponentsToolBase
     */
    public getData(): any {
        return {};
    }

    /**
     * 获取高度
     *
     * @returns {any[]}
     * @memberof PortalComponentsToolBase
     */
    get getHeight(){
        if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
            if(this.height == 0){
                return 'auto';
            }else{
                return this.height+'px';
            }
        }else{
            return '300px';
        }
    }

    /**
     * 刷新
     *
     * @memberof PortalComponentsToolBase
     */
    public refresh(args?: any) {
    }

    /**
     * vue 生命周期
     *
     * @memberof PortalComponentsToolBase
     */
    public created() {
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     *  @memberof PortalComponentsToolBase
     */    
    public afterCreated(){
        if (this.viewState) {
            this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
                if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
                   this.calcUIActionAuthState(data);
                }
                if (!Object.is(tag, this.name)) {
                    return;
                }
                const refs: any = this.$refs;
                Object.keys(refs).forEach((_name: string) => {
                    this.viewState.next({ tag: _name, action: action, data: data });
                });
            });
        }
    }

    /**
     * vue 生命周期
     *
     * @memberof PortalComponentsToolBase
     */
    public destroyed() {
        this.afterDestroy();
    }

    /**
     * 执行destroyed后的逻辑
     *
     * @memberof PortalComponentsToolBase
     */
    public afterDestroy() {
        if (this.viewStateEvent) {
            this.viewStateEvent.unsubscribe();
        }
    }


    /**
     * 计算界面行为权限
     *
     * @memberof PortalComponentsToolBase
     */
    public calcUIActionAuthState(data:any = {}) {
        //  如果是操作栏，不计算权限
        if(this.portletType && Object.is('actionbar', this.portletType)) {
            return;
        }
        let _this: any = this;
        let uiservice: any = _this.appUIService ? _this.appUIService : new UIService();
        if(_this.uiactionModel){
            ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
        }
    }

}
</script>

<style lang='less'>
@import './portal-components-tool-portlet.less';
</style>

