提交 30c0271a 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 046ef750
......@@ -102,120 +102,19 @@ import UIService from '@/uiservice/ui-service';
public appUIService:UIService = new UIService();
</#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 = {};
/**
* 视图布局顶级成员名称
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public rootLayoutDetailNames: string[] = <@compress single_line=true>[
<#if ctrl.getRootPSPanelItems?? && ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as panelItem>
'${panelItem.name}'<#if panelItem_has_next>,</#if>
</#list>
</#if>
];</@compress>
/**
* 初始化布局
*
* @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;
}
<#assign panelItems = ctrl.getAllPSPanelItems()>
<#assign type='ITEMLAYOUT' />
<#assign item=ctrl />
<@getLayoutItemModel panelItems type view item/>
</#assign>
/**
* 初始化布局项
*
* @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);
}
}
}
}
}
/**
* 视图布局面板项模型对象
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public layoutItems:any = {
<#if ctrl.getAllPSPanelItems()??>
<#assign panelItems = ctrl.getAllPSPanelItems() />
<#assign type='ITEMLAYOUT' />
<@getLayoutItemModel panelItems type view />
</#if>
};
<#assign item=ctrl>
<#assign rootPanelItems=null />
<#if ctrl.getRootPSPanelItems?? && ctrl.getRootPSPanelItems()??>
<#assign rootPanelItems=ctrl.getRootPSPanelItems()>
</#if>
<@initLayout rootPanelItems item/>
</#assign>
/**
* 监听数据对象
......@@ -333,20 +232,6 @@ import UIService from '@/uiservice/ui-service';
this.panelEditItemChange(name, value);
}
/**
* 计算按钮权限状态
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public computeButtonAuthState() {
Object.values(this.layoutModelDetails).forEach((layoutModel: any) => {
if (layoutModel.itemType == 'BUTTON') {
layoutModel.computeActionAuthState();
}
})
}
/**
* 面板编辑项值变化后续操作
*
......@@ -368,26 +253,11 @@ import UIService from '@/uiservice/ui-service';
}
}
/**
* 面板逻辑
*
* @public
* @params name 改变项名称
* @params index 多数据容器下标
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelLogic(name: string, index?: number): void {
if (name && (index || index === 0)) {
<#noparse>name = name.replace(`_${index}`,"");</#noparse>
}
<#list ctrl.getAllPSPanelItems() as panelItem>
<@getPanelItemLogic panelItem />
</#list>
}
<#if ctrl.getAllPSPanelItems()??>
<#assign panelItems = ctrl.getAllPSPanelItems() />
<#assign item = ctrl />
<@panelDynamicLogic panelItems item />
<@handleButtonClick panelItems item />
</#if>
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册