<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_sysportlet4_toolbarModels.tbitem3.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem3.disabled" class=' deepskyblueToolBar' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem3' }, $event)">
                      <i class='fa fa-file-text-o'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem3.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem3.tip')}}</div>
          </tooltip>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.deuiaction2.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.deuiaction2.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'deuiaction2' }, $event)">
                      <i class='fa fa-save'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.deuiaction2.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.deuiaction2.tip')}}</div>
          </tooltip>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem4.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem4.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem4' }, $event)">
                      
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem4.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem4.tip')}}</div>
          </tooltip>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem6.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem6.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem6' }, $event)">
                      
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem6.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem6.tip')}}</div>
          </tooltip>
          <span class='seperator'>|</span>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem8.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem8.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem8' }, $event)">
                      
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem8.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem8.tip')}}</div>
          </tooltip>
          <span class='seperator'>|</span>
          <tooltip :transfer="true" :max-width="600">
              <app-export-excel :item="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem13" :caption="$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem13.caption')" @exportexcel="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem13' }, $event)"></app-export-excel>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem13.tip')}}</div>
          </tooltip>
          <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.deuiaction1.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.deuiaction1.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'deuiaction1' }, $event)">
                      <i class='fa fa-upload'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.deuiaction1.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.deuiaction1.tip')}}</div>
          </tooltip>
          <span class='seperator'>|</span>
          <dropdown v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem16.visabled" trigger='click'>
              <tooltip :transfer="true" :max-width="600">
                      <i-button class=''>
                          <i class=''></i>
                          <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem16.caption')}}</span>
                          <icon type="ios-arrow-down"></icon>
                      </i-button>
                  <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem16.tip')}}</div>
              </tooltip>
              <dropdown-menu slot='list'>
                  <dropdown-item>
                      <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem21.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem21.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem21' }, $event)">
                      <i class='fa fa-download'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem21.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem21.tip')}}</div>
          </tooltip>
          
          
                  </dropdown-item>
                  <dropdown-item>
                      <tooltip :transfer="true" :max-width="600">
                  <i-button v-show="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem23.visabled" :disabled="dashboardviewdashboard_sysportlet4_toolbarModels.tbitem23.disabled" class='' v-loading:i-button @click="dashboard_sysportlet4_toolbar_click({ tag: 'tbitem23' }, $event)">
                      <i class='fa fa-upload'></i>
                      <span class='caption'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem23.caption')}}</span>
                  </i-button>
              <div slot='content'>{{$t('entities.ibizorder.dashboardviewdashboard_sysportlet4_toolbar_toolbar.tbitem23.tip')}}</div>
          </tooltip>
          
          
                  </dropdown-item>
              </dropdown-menu>
          </dropdown>
      </div>
        </div>
    </div>
</template>
<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;

    /**
     * 视图状态事件
     *
     * @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(this.$store);

    /**
     * dashboard_sysportlet4_toolbar 部件 click 事件
     *
     * @param {*} [args={}]
     * @param {*} $event
     * @memberof PortalComponentsToolBase
     */
    public dashboard_sysportlet4_toolbar_click($event: any, $event2?: any) {
        if (Object.is($event.tag, 'tbitem3')) {
            this.dashboard_sysportlet4_toolbar_tbitem3_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction2')) {
            this.dashboard_sysportlet4_toolbar_deuiaction2_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem4')) {
            this.dashboard_sysportlet4_toolbar_tbitem4_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem6')) {
            this.dashboard_sysportlet4_toolbar_tbitem6_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction3')) {
            this.dashboard_sysportlet4_toolbar_deuiaction3_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem24')) {
            this.dashboard_sysportlet4_toolbar_tbitem24_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem25')) {
            this.dashboard_sysportlet4_toolbar_tbitem25_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem8')) {
            this.dashboard_sysportlet4_toolbar_tbitem8_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem13')) {
            this.dashboard_sysportlet4_toolbar_tbitem13_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'deuiaction1')) {
            this.dashboard_sysportlet4_toolbar_deuiaction1_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem11')) {
            this.dashboard_sysportlet4_toolbar_tbitem11_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem21')) {
            this.dashboard_sysportlet4_toolbar_tbitem21_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
        if (Object.is($event.tag, 'tbitem23')) {
            this.dashboard_sysportlet4_toolbar_tbitem23_click(null, 'dashboard_sysportlet4_toolbar', $event2);
        }
    }
    

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem3_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.New(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_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.Save(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem4_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_sysportlet4_toolbar_tbitem6_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.Copy(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_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.ToggleFilter(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem24_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_sysportlet4_toolbar_tbitem25_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_sysportlet4_toolbar_tbitem8_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_sysportlet4_toolbar_tbitem13_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.ExportExcel(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_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.ImportExcel(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem11_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.Print(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem21_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.ExportModel(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 逻辑事件
     *
     * @param {*} [params={}]
     * @param {*} [tag]
     * @param {*} [$event]
     * @memberof 
     */
    public dashboard_sysportlet4_toolbar_tbitem23_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.Import(datas, contextJO,paramJO,  $event, xData,this,"IBIZOrder");
    }

    /**
     * 新建
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
         const _this: any = this;
        if (_this.newdata && _this.newdata instanceof Function) {
            const data: any = {};
            _this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
        } else {
            _this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在，请添加!' });
        }
    }
    /**
     * 保存
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Save(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().then((response: any) => {
                if (!response || response.status !== 200) {
                    return;
                }
                _this.$emit('viewdataschange', [{ ...response.data }]);
            });
        } 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 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 }], 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 Copy(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 });
            }
            if(!params) params = {};
            Object.assign(params,{copymode:true});
            _this.opendata([{ ...data }], params, $event, xData);
        } else {
            Object.assign(this.viewparams,{copymode:true});
        }
    }
    /**
     * 过滤
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        if (_this.hasOwnProperty('isExpandSearchForm')) {
            _this.isExpandSearchForm = !_this.isExpandSearchForm;
        }
    }
    /**
     * 行编辑
     *
     * @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 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 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} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
            return ;
        }
        xData.exportExcel($event.exportparms);
    }
    /**
     * 导入
     *
     * @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 parentContext:any = {};
        let parentViewParam:any = {};
        const _this: any = actionContext;
        const _args: any[] = Util.deepCopy(args);
        const actionTarget: string | null = 'NONE';
        if(_this.context){
            parentContext = _this.context;
        }
        if(_this.viewparams){
            parentViewParam = _this.viewparams;
        }
        context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
        data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
        context = Object.assign({},actionContext.context,context);
        let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
        Object.assign(data,parentObj);
        Object.assign(context,parentObj);
        const openPopupApp = (url: string) => {
            window.open(url, '_blank');
            return null;
        }
        const url = `../../ibizutil/uploaddedataview.jsp?srfdeid=`;
        openPopupApp(url);
    }

    /**
     * 打印
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        let _this:any = this;
        if (!xData || !(xData.print instanceof Function) || !$event) {
            return ;
        }
        xData.print();
    }
    /**
     * 导出数据模型
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public ExportModel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        this.$Notice.error({ title: '错误', desc: '导出数据模型未支持' });
    }
    /**
     * 数据导入
     *
     * @param {any[]} args 当前数据
     * @param {any} contextJO 行为附加上下文
     * @param {*} [params] 附加参数
     * @param {*} [$event] 事件源
     * @param {*} [xData]  执行行为所需当前部件
     * @param {*} [actionContext]  执行行为上下文
     * @memberof IBIZOrderDashboardViewBase
     */
    public Import(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
        const _this: any = this;
        if (!xData || !(xData.importExcel instanceof Function) || !$event) {
            return ;
        }
        xData.importExcel(params);
    }

    /**
     * 关闭视图
     *
     * @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 {number}
     * @memberof PortalComponentsToolBase
     */
    public portletType: string = 'toolbar';

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


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

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

        deuiaction2: { name: 'deuiaction2', actiontarget: 'NONE', caption: '保存', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Save', target: '' } },

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

        tbitem6: { name: 'tbitem6', actiontarget: 'NONE', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },

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

        tbitem9: {  name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
        tbitem13: { name: 'tbitem13', actiontarget: 'NONE', caption: '导出', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }  },

        deuiaction1: { name: 'deuiaction1', actiontarget: 'NONE', caption: '导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ImportExcel', target: 'NONE' } },

        tbitem10: {  name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
        tbitem16: { name: 'tbitem16', caption: '其它', disabled: false, type: 'ITEMS', visabled: true, dataaccaction: '', uiaction: { } }, 
 tbitem21: { name: 'tbitem21', actiontarget: 'NONE', caption: '导出数据模型', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportModel', target: '' } },

 tbitem23: { name: 'tbitem23', actiontarget: 'NONE', caption: '数据导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Import', target: '' } },


    };


    /**
     * 是否自适应大小
     *
     * @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 '200px';
        }
    }

    /**
     * 刷新
     *
     * @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(_this.$store);
        if(_this.uiactionModel){
            ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
        }
    }

}
</script>

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

