diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f11b3f0e1320e5a4dfc8cc60dd473d4c39a9026..5c324faff6f660285723a8082c64cc59103c294e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - 表单容器类(表单分组、表单分页、表单成员分页、表单关系界面分页),适配状态属性loading(是否显示loading状态) - 面板容器类(分页面板、面板容器(视图内容)、面板容器(视图头部)、分割容器),新增状态属性loading(是否显示loading状态),并新增控制器能力startLoading(开始加载中)和endLoading(结束加载中) +- 门户部件支持绘制器逻辑配置 ### Changed diff --git a/src/control/dashboard/portlet/portlet-layout/portlet-layout.scss b/src/control/dashboard/portlet/portlet-layout/portlet-layout.scss index 3b74b08178f5e1997f51569365e443c708973fee..2905050f31439679f68586066b8912dfc82b2cc4 100644 --- a/src/control/dashboard/portlet/portlet-layout/portlet-layout.scss +++ b/src/control/dashboard/portlet/portlet-layout/portlet-layout.scss @@ -77,6 +77,26 @@ $portlet-layout: ( position: relative; } + @include when(custom) { + position: relative; + + @include e(left){ + z-index: 1; + } + + @include e(right){ + z-index: 1; + } + + @include e(bg) { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + } + height: getCssVar('portlet-layout','header-height'); padding: getCssVar('portlet-layout','header-padding'); margin: getCssVar('portlet-layout','header-margin'); diff --git a/src/control/dashboard/portlet/portlet-layout/portlet-layout.tsx b/src/control/dashboard/portlet/portlet-layout/portlet-layout.tsx index a8c29c316f1f52222c61da0dbd7df5743fba1d8e..5e072258472bf43199c738ee44e4af3d11cff97d 100644 --- a/src/control/dashboard/portlet/portlet-layout/portlet-layout.tsx +++ b/src/control/dashboard/portlet/portlet-layout/portlet-layout.tsx @@ -1,7 +1,8 @@ +// eslint-disable no-unneeded-ternary import { useNamespace } from '@ibiz-template/vue3-util'; import { computed, defineComponent, PropType } from 'vue'; -import { IUIActionGroupDetail } from '@ibiz/model-core'; -import { PortletPartController } from '@ibiz-template/runtime'; +import { IControlRender, IUIActionGroupDetail } from '@ibiz/model-core'; +import { PortletPartController, ScriptFactory } from '@ibiz-template/runtime'; import { showTitle } from '@ibiz-template/core'; import './portlet-layout.scss'; @@ -64,6 +65,54 @@ export const PortletLayout = defineComponent({ }); }; + // 部件绘制器 + const controlRenders = c.dashboard.model.controlRenders; + + // 头部绘制器 + const header = controlRenders?.find( + item => `dashboard_${item.id}` === `${c.model.name}_header`, + ); + + // 头部标题绘制器 + const headerCaption = controlRenders?.find( + item => `dashboard_${item.id}` === `${c.model.name}_header_caption`, + ); + + // 头部背景绘制器 + const headerBg = controlRenders?.find( + item => `dashboard_${item.id}` === `${c.model.name}_header_bg`, + ); + + // 头部行为组绘制器 + const headerAction = controlRenders?.find( + item => `dashboard_${item.id}` === `${c.model.name}_header_action`, + ); + + // 渲染绘制器内容 + const renderContent = (model: IControlRender) => { + if (model.renderType === 'LAYOUTPANEL_MODEL' && model.layoutPanelModel) { + const htmlCode = ScriptFactory.execScriptFn( + { + params: c.params, + context: c.context, + }, + model.layoutPanelModel, + { isAsync: false }, + ) as string; + return
; + } + if (model.renderType === 'LAYOUTPANEL' && model.layoutPanel) { + return ( +