提交 73ad28b6 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 e0d319cd
...@@ -318,6 +318,20 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -318,6 +318,20 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
*/ */
public layoutData:any = {}; public layoutData:any = {};
/**
* 视图布局部件
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public layoutCtrls: any[] = [
<#if view.getPSViewLayoutPanel().getPSControls?? && view.getPSViewLayoutPanel().getPSControls()??>
<#list view.getPSViewLayoutPanel().getPSControls() as control>
'${control.getControlType()}',
</#list>
</#if>
];
/** /**
* 视图布局面板模型对象 * 视图布局面板模型对象
* *
...@@ -433,7 +447,7 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -433,7 +447,7 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
</#list> </#list>
}; };
/** /**
* 视图布局面板项模型对象 * 视图布局面板项模型对象
* *
* @public * @public
...@@ -616,6 +630,68 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -616,6 +630,68 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
this.layoutData[$event.name] = $event.value; this.layoutData[$event.name] = $event.value;
} }
/**
* 获取按钮行为xData
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public getButtonXData(name: string): any {
let xData = null;
let xDataControl: any = null;
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.name) {
parentLayoutModel = pLayoutModel;
if (parentLayoutModel.dataRegionType == 'SINGLEDATA' || parentLayoutModel.dataRegionType == 'MULTIDATA') {
dataArea = parentLayoutModel;
}
}
})
if (!dataArea && parentLayoutModel) {
dataArea = getDataArea(parentLayoutModel);
}
return dataArea;
}
xData = getDataArea(curLayoutModel);
// 获取激活部件
if (!xData && this.layoutCtrls.length > 0) {
const getActionCtrl = (cLayoutModel: any) => {
let actionCtrl = null;
let parentLayoutModel = null;
Object.values(this.layoutModelDetails).forEach((pLayoutModel: any) => {
if (pLayoutModel.name == cLayoutModel.name) {
parentLayoutModel = pLayoutModel;
actionCtrl= parentLayoutModel.details.find((ctrlName: string) => {
return this.layoutCtrls.indexOf(ctrlName) !== -1;
})
}
})
if (!actionCtrl && parentLayoutModel) {
actionCtrl = getActionCtrl(parentLayoutModel);
}
return actionCtrl;
}
xData = getActionCtrl(curLayoutModel);
}
}
// 获取当前视图
if (!xData) {
xData = this;
}
return xData;
}
/** /**
* 处理按钮点击 * 处理按钮点击
* *
...@@ -623,10 +699,10 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -623,10 +699,10 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public handleButtonClick(name: string, $event?: any) { public handleButtonClick(name: string, $event?: any) {
let datas: any[] = [this.layoutData]; const datas: any[] = [this.layoutData];
let xData: any = null; const xData: any = this.getButtonXData(name);
let paramJO: any = {}; const paramJO: any = {};
let contextJO: any = {}; const contextJO: any = {};
const _this: any = this; const _this: any = this;
<#list view.getPSViewLayoutPanel().getAllPSPanelItems() as panelItem> <#list view.getPSViewLayoutPanel().getAllPSPanelItems() as panelItem>
<#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??> <#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册