提交 0d0e2b84 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 ba73d4da
......@@ -184,7 +184,7 @@ export default class ${srfclassname('${ctrl.codeName}')}Base extends Vue impleme
</#list>
</#if>
<#if ctrl.getPSAppViewLogics?? && ctrl.getPSAppViewLogics()??>
<#if ctrl.getControlType() != 'PANEL' && ctrl.getPSAppViewLogics?? && ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getLogicTrigger() == "CUSTOM" || logic.getLogicTrigger() == "CTRLEVENT">
......@@ -193,7 +193,7 @@ ${P.getLogicCode(logic, "LOGIC.vue").code}
</#list>
</#if>
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#if ctrl.getControlType() != 'PANEL' && ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as uiAction>
<#if !uiAction.getPSAppDataEntity()??>
${P.getLogicCode(uiAction, "LOGIC.vue").code}
......
......@@ -126,6 +126,20 @@ import UIService from '@/uiservice/ui-service';
*/
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>
/**
* 初始化布局
*
......@@ -369,7 +383,7 @@ import UIService from '@/uiservice/ui-service';
this.computedUIData(newVal);
this.layoutData = Util.deepCopy(newVal);
this.computeButtonState(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.panelLogic('');
this.$forceUpdate();
}
}
......@@ -411,27 +425,6 @@ import UIService from '@/uiservice/ui-service';
}
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public uiAction(row: any, tag: any, $event: any) {
<#if ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getPSAppViewUIAction().getPSUIAction()??>
<#assign action = logic.getPSAppViewUIAction().getPSUIAction()>
if(Object.is('${action.getUIActionTag()}', tag)) {
this.${logic.getName()}(row, tag, $event);
}
</#if>
</#list>
</#if>
}
/**
* 打开编辑数据视图
*
......@@ -496,7 +489,7 @@ import UIService from '@/uiservice/ui-service';
this.layoutData[name] = value;
this.layoutModelDetails[name].setData(value);
this.panelLogic(name);
this.panelEditItemChange(data, name, name);
this.panelEditItemChange(this.data, name, value);
}
/**
......@@ -534,6 +527,84 @@ import UIService from '@/uiservice/ui-service';
</#if>
}
/**
* 获取按钮行为xData
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public getButtonXData(name: string): any {
let xData = 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.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;
}
/**
* 处理按钮点击
*
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleButtonClick(name: string, $event?: any) {
const datas: any[] = [this.layoutData];
const xData: any = this.getButtonXData(name);
const paramJO: any = {};
const contextJO: any = {};
const _this: any = this;
<#list ctrl.getAllPSPanelItems() as panelItem>
<#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
if (Object.is(name, '${panelItem.name}')) {
<#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
const curUIService: ${srfclassname('${curAppEntity.codeName}')}UIService = new ${srfclassname('${curAppEntity.codeName}')}UIService();
curUIService.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
</#if>
}
</#if>
</#list>
}
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
<#list ctrl.getPSUIActions() as uiAction>
<#if !P.exists("importService", uiAction.getFullCodeName(), "")>
<#if !(uiAction.getPSAppDataEntity?? && uiAction.getPSAppDataEntity()??) || (uiAction.getPSAppDataEntity?? && uiAction.getPSAppDataEntity()?? && uiAction.getUIActionMode?? && (uiAction.getUIActionMode() == 'SYS' || uiAction.getUIActionMode() == 'CUSTOM'))>
<@viewLayoutPanelUIAction item=uiAction />
</#if>
</#if>
</#list>
</#if>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册