Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
fc974eca
提交
fc974eca
编写于
11月 08, 2022
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
a82ec25e
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
259 行增加
和
7 行删除
+259
-7
CONTROL-BASE.vue.ftl
@CONTROL/面板/CONTROL-BASE.vue.ftl
+259
-7
未找到文件。
@CONTROL/面板/CONTROL-BASE.vue.ftl
浏览文件 @
fc974eca
...
@@ -11,7 +11,7 @@ import UIService from '@/uiservice/ui-service';
...
@@ -11,7 +11,7 @@ import UIService from '@/uiservice/ui-service';
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
</#ibizinclude>
<#ibizinclude>
<#ibizinclude>
../../@MACRO/
PANEL
.ftl
../../@MACRO/
VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_LOGIC
.ftl
</#ibizinclude>
</#ibizinclude>
/**
/**
* 接口实现
* 接口实现
...
@@ -102,6 +102,30 @@ import UIService from '@/uiservice/ui-service';
...
@@ -102,6 +102,30 @@ import UIService from '@/uiservice/ui-service';
public appUIService:UIService = new UIService();
public appUIService:UIService = new UIService();
</#if>
</#if>
/**
* 视图布局是否加载
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public isLayoutLoadding: boolean = false;
/**
* 视图布局数据
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public layoutData:any = {};
/**
* 视图布局面板模型对象
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public layoutModelDetails:any = {};
/**
/**
* 视图布局顶级成员名称
* 视图布局顶级成员名称
*
*
...
@@ -116,7 +140,68 @@ import UIService from '@/uiservice/ui-service';
...
@@ -116,7 +140,68 @@ import UIService from '@/uiservice/ui-service';
</#if>
</#if>
];</@compress>
];</@compress>
<#-- <@panelBase ctrl> -->
/**
* 初始化布局
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public async initLayout() {
if (this.rootLayoutDetailNames.length > 0) {
for (let i = 0; i < this.rootLayoutDetailNames.length; i++) {
const name = this.rootLayoutDetailNames[i];
const rootItem = this.layoutItems[name];
if (!rootItem) {
return;
}
await this.initLayoutItem(rootItem);
}
}
return true;
}
/**
* 初始化布局项
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public async initLayoutItem(layoutModelItem: any, index: number = 0) {
const { name } = layoutModelItem;
const layoutModelDetail = Util.getLayoutItemInstance(layoutModelItem);
if (!index) {
await layoutModelDetail.load(this.context, this.viewparams);
this.$set(this.layoutModelDetails, name, layoutModelDetail);
this.$set(this.layoutData, name, layoutModelDetail.getData());
} else {
layoutModelDetail.setIndex(index);
await layoutModelDetail.load(this.context, this.viewparams);
<#noparse>this.$set(this.layoutModelDetails, `${name}_${index}`, layoutModelDetail);</#noparse>
<#noparse>this.$set(this.layoutData, `${name}_${index}`, layoutModelDetail.getData());</#noparse>
}
if (layoutModelDetail && layoutModelDetail.details) {
if (layoutModelDetail.dataRegionType === 'MULTIDATA') {
const multiData = layoutModelDetail.getData();
if (multiData && multiData.length > 0) {
for (let i = 0; i < multiData.length; i++) {
for (let j = 0; j < layoutModelDetail.details.length; j++) {
const key = layoutModelDetail.details[j];
if (this.layoutItems[key]) {
await this.initLayoutItem(this.layoutItems[key], i);
}
}
}
}
} else {
for (let i = 0; i < layoutModelDetail.details.length; i++) {
const key = layoutModelDetail.details[i];
if (this.layoutItems[key]) {
await this.initLayoutItem(this.layoutItems[key],index);
}
}
}
}
}
/**
/**
* 视图布局面板项模型对象
* 视图布局面板项模型对象
...
@@ -126,7 +211,145 @@ import UIService from '@/uiservice/ui-service';
...
@@ -126,7 +211,145 @@ import UIService from '@/uiservice/ui-service';
*/
*/
public layoutItems:any = {
public layoutItems:any = {
<#list ctrl.getAllPSPanelItems() as panelItem>
<#list ctrl.getAllPSPanelItems() as panelItem>
<@getPanelItem panelItem 'ITEMLAYOUT' />
<#assign detail>
name: '${panelItem.getName()}',
type: 'ITEMLAYOUT',
caption: '${panelItem.getCaption()}',
<#if panelItem.getTitleBarCloseMode?? && panelItem.getTitleBarCloseMode()??>titleBarCloseMode: ${panelItem.getTitleBarCloseMode()},</#if>
isShowCaption: <#if panelItem.isShowCaption?? && panelItem.isShowCaption()??>${panelItem.isShowCaption()?c}</#if>,
sysCss: '<#if panelItem.getPSSysCss?? && panelItem.getPSSysCss()??>${panelItem.getPSSysCss().getCssName()}</#if>',
itemType: '${panelItem.getItemType()}',
itemStyle: '${panelItem.getItemStyle()}',
<#if panelItem.getPSSysImage?? && panelItem.getPSSysImage()??>sysImage:{
iconcls: '<#if panelItem.getPSSysImage().getCssClass?? && panelItem.getPSSysImage().getCssClass()??>${panelItem.getPSSysImage().getCssClass()}</#if>',
imagePath:'<#if panelItem.getPSSysImage().getImagePath?? && panelItem.getPSSysImage().getImagePath()??>${panelItem.getPSSysImage().getImagePath()}</#if>',
rawContent: '<#if panelItem.getPSSysImage().getRawContent?? && panelItem.getPSSysImage().getRawContent()??>${panelItem.getPSSysImage().getRawContent()}</#if>'
},</#if>
visible: <#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??>false<#else>true</#if>,
disabled: false,
layout:'<#if panelItem.getPSLayout?? && panelItem.getPSLayout()?? && panelItem.getPSLayout().getLayout?? && panelItem.getPSLayout().getLayout()??>${panelItem.getPSLayout().getLayout()}</#if>',
layoutPos:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getLayoutPos?? && panelItem.getPSLayoutPos().getLayoutPos()??>${panelItem.getPSLayoutPos().getLayoutPos()}</#if>',
layoutHeight:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHeight?? && panelItem.getPSLayoutPos().getHeight()??>${panelItem.getPSLayoutPos().getHeight()}<#else>0</#if>,
heightMode:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHeightMode?? && panelItem.getPSLayoutPos().getHeightMode()??>${panelItem.getPSLayoutPos().getHeightMode()}</#if>',
layoutWidth:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getWidth?? && panelItem.getPSLayoutPos().getWidth()??>${panelItem.getPSLayoutPos().getWidth()}<#else>0</#if>,
widthMode:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getWidthMode?? && panelItem.getPSLayoutPos().getWidthMode()??>${panelItem.getPSLayoutPos().getWidthMode()}</#if>',
spacingBottom:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingBottom?? && panelItem.getPSLayoutPos().getSpacingBottom()??>${panelItem.getPSLayoutPos().getSpacingBottom()}</#if>',
spacingLeft:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingLeft?? && panelItem.getPSLayoutPos().getSpacingLeft()??>${panelItem.getPSLayoutPos().getSpacingLeft()}</#if>',
spacingRight:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingRight?? && panelItem.getPSLayoutPos().getSpacingRight()??>${panelItem.getPSLayoutPos().getSpacingRight()}</#if>',
spacingTop:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getSpacingTop?? && panelItem.getPSLayoutPos().getSpacingTop()??>${panelItem.getPSLayoutPos().getSpacingTop()}</#if>',
hAlignSelf:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getHAlignSelf?? && panelItem.getPSLayoutPos().getHAlignSelf()??>${panelItem.getPSLayoutPos().getHAlignSelf()}</#if>',
vAlignSelf:'<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getVAlignSelf?? && panelItem.getPSLayoutPos().getVAlignSelf()??>${panelItem.getPSLayoutPos().getVAlignSelf()}</#if>',
flexGrow:<#if panelItem.getPSLayoutPos?? && panelItem.getPSLayoutPos()?? && panelItem.getPSLayoutPos().getGrow?? && panelItem.getPSLayoutPos().getGrow()??>${panelItem.getPSLayoutPos().getGrow()}<#else>0</#if>,
flexParams:{align:'<#if panelItem.getFlexAlign?? && panelItem.getFlexAlign()??>${panelItem.getFlexAlign()}</#if>',dir:'<#if panelItem.getFlexDir?? && panelItem.getFlexDir()??>${panelItem.getFlexDir()}</#if>',vAlign:'<#if panelItem.getFlexVAlign?? && panelItem.getFlexVAlign()??>${panelItem.getFlexVAlign()}</#if>'},
<#if panelItem.getParentPSPanelItem?? && panelItem.getParentPSPanelItem()??>
parentName: '${panelItem.getParentPSPanelItem().getName()}',
</#if>
panel: this
</#assign>
<#if panelItem.getItemType() == 'CONTAINER'>
<@compress single_line=true>${panelItem.name}:{ ${detail}
<#if panelItem.getPSPanelItems()??>,
details:[<#list panelItem.getPSPanelItems() as childPanelItem>'${childPanelItem.getName()}'<#if childPanelItem_has_next>,</#if></#list>]
</#if>
<#if panelItem.getDataRegionType()??>,
dataRegionType: '${panelItem.getDataRegionType()}'
</#if>
<#if panelItem.getDataSourceType()??>,
dataSourceType: '${panelItem.getDataSourceType()}'
</#if>
<#if panelItem.getPSAppDataEntity?? && panelItem.getPSAppDataEntity()??>,
appDataEntityCodeName: '${panelItem.getPSAppDataEntity().getCodeName()?lower_case}'
</#if>
<#if panelItem.getPSAppDEMethod?? && panelItem.getPSAppDEMethod()??>,
appDEMethodCodeName: '${panelItem.getPSAppDEMethod().getCodeName()}'
</#if>
}<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'RAWITEM'>
<#assign rawItem>
viewType: '${view.getViewType()}',
predefinedType: '${panelItem.getPSRawItem().getPredefinedType()}',
contentType: '${panelItem.getPSRawItem().getContentType()}',
contentStyle: '${panelItem.getPSRawItem().getCssStyle()}',
rawContent: '<#if panelItem.getRawContent?? && panelItem.getRawContent()??>${panelItem.getRawContent()}</#if>',
htmlContent: '<#if panelItem.getHtmlContent?? && panelItem.getHtmlContent()??>${panelItem.getHtmlContent()}</#if>',
<#if panelItem.getPSRawItem().getRenderMode?? && panelItem.getPSRawItem().getRenderMode()??>
renderMode: '${panelItem.getPSRawItem().getRenderMode()}',
</#if>
<#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getWrapMode?? && panelItem.getPSRawItem().getWrapMode()??>
wrapMode:'${panelItem.getPSRawItem().getWrapMode()}',
</#if>
<#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getVAlign?? && panelItem.getPSRawItem().getVAlign()??>
vAlign:'${panelItem.getPSRawItem().getVAlign()}',
</#if>
<#if panelItem.getPSRawItem()?? && panelItem.getPSRawItem().getHAlign?? && panelItem.getPSRawItem().getHAlign()??>
hAlign:'${panelItem.getPSRawItem().getHAlign()}',
</#if>
</#assign>
<@compress single_line=true>${panelItem.name}:{ ${detail}, ${rawItem} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'FIELD'>
<#assign field>
<#if panelItem.getFieldStates?? && panelItem.getFieldStates()??>
fieldState: '${panelItem.getFieldStates()}',
</#if>
<#if panelItem.getPSEditor?? && panelItem.getPSEditor()??>
<#if panelItem.getPSEditor().getPredefinedType?? && panelItem.getPSEditor().getPredefinedType()??>
predefinedType: '${panelItem.getPSEditor().getPredefinedType()}',
</#if>
<#if panelItem.getPSEditor().getRenderMode?? && panelItem.getPSEditor().getRenderMode()??>
renderMode: '${panelItem.getPSEditor().getRenderMode()}',
</#if>
</#if>
<#if panelItem.getViewFieldName?? && panelItem.getViewFieldName()??>
dataItemName:'${panelItem.getViewFieldName()}',
</#if>
<#if panelItem.getEditorType?? && panelItem.getEditorType()?? && (panelItem.getEditorType() == "SPAN")>
<#if panelItem.getPSEditor?? && panelItem.getPSEditor()??>
<#assign panelEditor = panelItem.getPSEditor() />
<#if panelEditor.getWrapMode?? && panelEditor.getWrapMode()??>
wrapMode:'${panelEditor.getWrapMode()}',
</#if>
<#if panelEditor.getVAlign?? && panelEditor.getVAlign()??>
vAlign:'${panelEditor.getVAlign()}',
</#if>
<#if panelEditor.getHAlign?? && panelEditor.getHAlign()??>
hAlign:'${panelEditor.getHAlign()}',
</#if>
</#if>
</#if>
</#assign>
<@compress single_line=true>${panelItem.name}:{ ${detail}, ${field} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'CONTROL'>
<@compress single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'BUTTON'>
<#assign button>
<#if panelItem.getButtonStyle?? && panelItem.getButtonStyle()??>
buttonStyle: '${panelItem.getButtonStyle()}',
</#if>
<#if panelItem.getBorderStyle?? && panelItem.getBorderStyle()??>
borderStyle: '${panelItem.getBorderStyle()}',
</#if>
iconAlign: '${panelItem.getIconAlign()}',
<#if panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
<#if panelItem.getPSUIAction().getPredefinedType?? && panelItem.getPSUIAction().getPredefinedType()??>
predefinedType: '${panelItem.getPSUIAction().getPredefinedType()}',
</#if>
</#if>
<#if panelItem.getRenderMode?? && panelItem.getRenderMode()??>
renderMode: '${panelItem.getRenderMode()}',
</#if>
</#assign>
<@compress single_line=true>${panelItem.name}:{ ${detail}, ${button} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'USERCONTROL'>
<@compress single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'TABPANEL'>
<@compress single_line=true>${panelItem.name}:{ ${detail}<#if panelItem.getPSPanelTabPages()??>,
details:[<#list panelItem.getPSPanelTabPages() as tabpage>'${tabpage.getName()}'<#if tabpage_has_next>,</#if></#list>]</#if> }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'CTRLPOS'>
<@compress single_line=true>${panelItem.name}:{ ${detail} }<#if panelItem_has_next>,</#if></@compress>
<#elseif panelItem.getItemType() == 'TABPAGE'>
<@compress single_line=true>${panelItem.name}:{ ${detail}<#if panelItem.getPSPanelItems()??>,
details:[<#list panelItem.getPSPanelItems() as childPanelItem>'${childPanelItem.getName()}'<#if childPanelItem_has_next>,</#if></#list>]</#if>}<#if panelItem_has_next>,</#if></@compress>
</#if>
</#list>
</#list>
};
};
...
@@ -321,9 +544,9 @@ import UIService from '@/uiservice/ui-service';
...
@@ -321,9 +544,9 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
*/
public panelLogic(name: string): void {
public panelLogic(name: string): void {
<#
-- <#list ctrl.getAllPSPanelItems() as panelItem
>
<#
if P.getPartCode(item,'PANEL_LOGIC').code?length gt 0
>
<@panelItemLogic panelItem>
${P.getPartCode(item,'PANEL_LOGIC').code}
</#
list> --
>
</#
if
>
}
}
/**
/**
...
@@ -334,7 +557,36 @@ import UIService from '@/uiservice/ui-service';
...
@@ -334,7 +557,36 @@ import UIService from '@/uiservice/ui-service';
*/
*/
public getButtonXData(name: string): any {
public getButtonXData(name: string): any {
let xData = null;
let xData = null;
<#-- <@xData /> -->
let curLayoutModel = null;
Object.values(this.layoutModelDetails).forEach((layoutModel: any) => {
if (layoutModel.name == name) {
curLayoutModel = layoutModel;
}
})
// 获取数据容器
if (curLayoutModel) {
const getDataArea = (cLayoutModel: any): any => {
let dataArea = null;
let parentLayoutModel = null;
Object.values(this.layoutModelDetails).forEach((pLayoutModel: any) => {
if (pLayoutModel.name == cLayoutModel.parentName) {
parentLayoutModel = pLayoutModel;
if (parentLayoutModel.dataRegionType == 'SINGLEDATA' || parentLayoutModel.dataRegionType == 'MULTIDATA') {
dataArea = parentLayoutModel;
}
}
})
if (!dataArea && parentLayoutModel) {
dataArea = getDataArea(parentLayoutModel);
}
return dataArea;
}
xData = getDataArea(curLayoutModel);
}
// 获取当前视图
if (!xData) {
xData = this;
}
return xData;
return xData;
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录