import { IPSAppView, IPSPanelContainer, IPSPanelItem, IPSPanelRawItem, IPSPanelTabPage, IPSPanelTabPanel, IPSSysCss, IPSSysPanelField, IPSViewLayoutPanel } from '@ibizstudio/runtime'; import { ModelTool, Util } from '@ibizstudio/runtime'; import Vue from 'vue'; import { Prop, Component } from 'vue-property-decorator'; import { PluginService } from '../../../../app-service/common-service/plugin-service'; import './app-default-view-layout.less'; /** * 视图基础布局 * * @export * @class AppDefaultViewLayout * @extends {Vue} */ @Component({}) export class AppDefaultViewLayout extends Vue { /** * 视图模型数据 * * @memberof AppDefaultViewLayout */ @Prop() declare viewInstance: IPSAppView; /** * 应用上下文 * * @memberof AppDefaultViewLayout */ @Prop() declare context: any; /** * 视图参数 * * @memberof AppDefaultViewLayout */ @Prop() declare viewparams: any; /** * 模型服务对象 * * @memberof AppDefaultViewLayout */ @Prop() modelService!: any; /** * 视图布局面板 * * @memberof AppDefaultViewLayout */ viewLayoutPanel?: IPSViewLayoutPanel | null; /** * 是否展示视图工具栏 * * @memberof AppDefaultViewLayout */ viewIsshowToolbar: boolean = false; /** * 视图模型数据 * * @memberof AppDefaultViewLayout */ @Prop() model!: any; /** * 是否显示标题栏 * * @readonly * @memberof AppDefaultViewLayout */ get showCaption() { if (this.viewInstance && this.$parent) { return this.viewInstance.showCaptionBar && !(this.$parent as any).noViewCaption } else { return true; } } /** * Vue生命周期,实例创建完成 * * @memberof AppDefaultViewLayout */ created(){ this.viewIsshowToolbar = ModelTool.findPSControlByType("TOOLBAR", this.viewInstance.getPSControls()) ? true : false; this.viewLayoutPanel = this.viewInstance.getPSViewLayoutPanel(); } /** * 绘制头部内容 * * @memberof AppDefaultViewLayout */ renderViewHeader(): any { return [ this.showCaption ? {this.$slots.captionInfo ? this.$slots.captionInfo : this.model.srfCaption} : null, this.viewIsshowToolbar ?
: null, ] } /** * 绘制内容 * * @memberof AppDefaultViewLayout */ renderContent() { let cardClass = { 'view-card': true, 'view-no-caption': !this.showCaption, 'view-no-toolbar': !this.viewIsshowToolbar, }; return (