提交 cda320e6 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--门户部件高度设为0时,高度自适应

上级 b907f9a8
<#if ctrl.getPortletType() != 'CONTAINER'> <#if ctrl.getPortletType() != 'CONTAINER'>
<#ibizinclude>../@MACRO/CONTROL/LANGBASE.vue.ftl</#ibizinclude> <#ibizinclude>../@MACRO/CONTROL/LANGBASE.vue.ftl</#ibizinclude>
<template> <template>
<div class='portlet ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': isAdaptiveSize ? 'calc(100% - 16px)' : (height > 0 ? height+'px' :'${ctrl.getHeight()?c}px'),</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': isAdaptiveSize ? 'calc(100% - 16px)' : (width ? width+'px' :'${ctrl.getWidth()?c}px')</#if>}"> <div class='portlet ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': isAdaptiveSize ? 'calc(100% - 16px)' : (width ? width+'px' :'${ctrl.getWidth()?c}px')</#if>}">
<#if ctrl.getPortletType?? && ctrl.getPortletType()??><#t> <#if ctrl.getPortletType?? && ctrl.getPortletType()??><#t>
<#-- 视图 --> <#-- 视图 -->
<#if ctrl.getPortletType() == 'VIEW' && ctrl.getPortletPSAppView?? && ctrl.getPortletPSAppView()??><#t> <#if ctrl.getPortletType() == 'VIEW' && ctrl.getPortletPSAppView?? && ctrl.getPortletPSAppView()??><#t>
...@@ -271,6 +271,26 @@ import { Environment } from '@/environments/environment'; ...@@ -271,6 +271,26 @@ import { Environment } from '@/environments/environment';
return {}; return {};
} }
/**
* 获取高度
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
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{
<#if (ctrl.getHeight?? && ctrl.getHeight() gte 0)>
return ${ctrl.getHeight()?c};
</#if>
}
}
/** /**
* vue 生命周期 * vue 生命周期
* *
......
<#-- --> <#-- -->
<#if ctrl.getPortletType() != 'CONTAINER'> <#if ctrl.getPortletType() != 'CONTAINER'>
<#assign content> <#assign content>
<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)> <#if (ctrl.getHeight?? && ctrl.getHeight() gte 0)>
:height="${ctrl.getHeight()?c}" :height="${ctrl.getHeight()?c}"
</#if> </#if>
<#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)> <#if (ctrl.getWidth?? && ctrl.getWidth() gte 0)>
:width="${ctrl.getWidth()?c}" :width="${ctrl.getWidth()?c}"
</#if> </#if>
</#assign> </#assign>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册