提交 967fb401 编写于 作者: tony001's avatar tony001

update:更新

上级 75c0e799
......@@ -288,6 +288,20 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
</#if>
<#if view.getPSViewLayoutPanel()?? && !view.getPSViewLayoutPanel().isUseDefaultLayout() && view.getPSViewLayoutPanel().getAllPSPanelItems()??>
/**
* 视图布局顶级成员名称
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public rootLayoutDetailNames: string[] = <@compress single_line=true>[
<#ifview.getPSViewLayoutPanel().getRootPSPanelItems?? && view.getPSViewLayoutPanel().getRootPSPanelItems()??>
<#list view.getPSViewLayoutPanel().getRootPSPanelItems() as panelItem>
'${panelItem.name}'<#if panelItem_has_next>,</#if>
</#list>
</#if>
];</@compress>
/**
* 视图布局数据
*
......@@ -406,6 +420,65 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
</#list>
};
/**
* 初始化布局
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public async initLayout() {
if (this.rootLayoutDetailNames.length > 0) {
this.rootLayoutDetailNames.forEach(async (name: string) => {
const rootLayoutModelDetail = this.layoutModelDetails[name];
if (!rootLayoutModelDetail) {
return;
}
await this.initLayoutItem(rootLayoutModelDetail);
})
}
}
/**
* 初始化布局项
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public async initLayoutItem(layoutModelDetail: any, index: number = 0) {
const { name } = layoutModelDetail;
if (!index) {
await layoutModelDetail.load();
this.layoutData[name] = layoutModelDetail.getData();
} else {
const clonelayoutModelDetail = Util.deepCopy(layoutModelDetail);
clonelayoutModelDetail.setIndex(index);
await clonelayoutModelDetail.load();
this.layoutModelDetails.$set(`${name}_${index}`, clonelayoutModelDetail);
this.layoutData.$set(`${name}_${index}`, clonelayoutModelDetail.getData());
}
if (layoutModelDetail && layoutModelDetail.details) {
if (layoutModelDetail.dataRegionType === 'MULTIDATA') {
const multiData = layoutModelDetail.getData();
if (multiData && multiData.length > 0) {
multiData.forEach(async (data: any, index: number) => {
for (const key of layoutModelDetail.details) {
if (this.layoutModelDetails[key]) {
await this.initLayoutItem(this.layoutModelDetails[key], index);
}
}
})
}
} else {
for (const key of layoutModelDetail.details) {
if (this.layoutModelDetails[key]) {
await this.initLayoutItem(this.layoutModelDetails[key]);
}
}
}
}
}
/**
* 处理值改变
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册