提交 c14293cb 编写于 作者: Mosher's avatar Mosher

update:更新

上级 561ea91a
...@@ -5,6 +5,7 @@ TARGET=PSAPPDEUILOGIC ...@@ -5,6 +5,7 @@ TARGET=PSAPPDEUILOGIC
../@MACRO/ui-logic-node.txt ../@MACRO/ui-logic-node.txt
</#ibizinclude> </#ibizinclude>
import { UIActionContext } from "@/logic/ui-logic"; import { UIActionContext } from "@/logic/ui-logic";
import { LogicReturnType } from "@/logic/const/logic-return-type";
/** /**
* ${item.name} * ${item.name}
* *
...@@ -43,24 +44,24 @@ export default class ${srfclassname('${item.getCodeName()}')}UILogicBase { ...@@ -43,24 +44,24 @@ export default class ${srfclassname('${item.getCodeName()}')}UILogicBase {
{ {
name: '${logicParam.name}', name: '${logicParam.name}',
codeName: '${logicParam.codeName}', codeName: '${logicParam.codeName}',
activeContainerParam: <#if logicParam.isActiveContainerParam?? && logicParam.isActiveContainerParam()>true<#else>false</#if>, <#if logicParam.isActiveContainerParam?? && logicParam.isActiveContainerParam()>activeContainerParam: true,</#if>
activeCtrlParam: <#if logicParam.isActiveCtrlParam?? && logicParam.isActiveCtrlParam()>true<#else>false</#if>, <#if logicParam.isActiveCtrlParam?? && logicParam.isActiveCtrlParam()>activeCtrlParam: true,</#if>
activeViewParam: <#if logicParam.isActiveViewParam?? && logicParam.isActiveViewParam()>true<#else>false</#if>, <#if logicParam.isActiveViewParam?? && logicParam.isActiveViewParam()>activeViewParam: true,</#if>
appGlobalParam: <#if logicParam.isAppGlobalParam?? && logicParam.isAppGlobalParam()>true<#else>false</#if>, <#if logicParam.isAppGlobalParam?? && logicParam.isAppGlobalParam()>appGlobalParam: true,</#if>
applicationParam: <#if logicParam.isApplicationParam?? && logicParam.isApplicationParam()>true<#else>false</#if>, <#if logicParam.isApplicationParam?? && logicParam.isApplicationParam()>applicationParam: true,</#if>
ctrlParam: <#if logicParam.isCtrlParam?? && logicParam.isCtrlParam()>true<#else>false</#if>, <#if logicParam.isCtrlParam?? && logicParam.isCtrlParam()>ctrlParam: true,</#if>
default: <#if logicParam.isDefault?? && logicParam.isDefault()>true<#else>false</#if>, <#if logicParam.isDefault?? && logicParam.isDefault()>default: true,</#if>
entityParam: <#if logicParam.isEntityParam?? && logicParam.isEntityParam()>true<#else>false</#if>, <#if logicParam.isEntityParam?? && logicParam.isEntityParam()>entityParam: true,</#if>
entityListParam: <#if logicParam.isEntityListParam?? && logicParam.isEntityListParam()>true<#else>false</#if>, <#if logicParam.isEntityListParam?? && logicParam.isEntityListParam()>entityListParam: true,</#if>
entityPageParam: <#if logicParam.isEntityPageParam?? && logicParam.isEntityPageParam()>true<#else>false</#if>, <#if logicParam.isEntityPageParam?? && logicParam.isEntityPageParam()>entityPageParam: true,</#if>
filterParam: <#if logicParam.isFilterParam?? && logicParam.isFilterParam()>true<#else>false</#if>, <#if logicParam.isFilterParam?? && logicParam.isFilterParam()>filterParam: true,</#if>
navContextParam: <#if logicParam.isNavContextParam?? && logicParam.isNavContextParam()>true<#else>false</#if>, <#if logicParam.isNavContextParam?? && logicParam.isNavContextParam()>navContextParam: true,</#if>
simpleParam: <#if logicParam.isSimpleParam?? && logicParam.isSimpleParam()>true<#else>false</#if>, <#if logicParam.isSimpleParam?? && logicParam.isSimpleParam()>simpleParam: true,</#if>
simpleListParam: <#if logicParam.isSimpleListParam?? && logicParam.isSimpleListParam()>true<#else>false</#if>, <#if logicParam.isSimpleListParam?? && logicParam.isSimpleListParam()>simpleListParam: true,</#if>
routeViewSessionParam: <#if logicParam.isRouteViewSessionParam?? && logicParam.isRouteViewSessionParam()>true<#else>false</#if>, <#if logicParam.isRouteViewSessionParam?? && logicParam.isRouteViewSessionParam()>routeViewSessionParam: true,</#if>
viewNavDataParam: <#if logicParam.isViewNavDataParam?? && logicParam.isViewNavDataParam()>true<#else>false</#if>, <#if logicParam.isViewNavDataParam?? && logicParam.isViewNavDataParam()>viewNavDataParam: true,</#if>
viewSessionParam: <#if logicParam.isViewSessionParam?? && logicParam.isViewSessionParam()>true<#else>false</#if>, <#if logicParam.isViewSessionParam?? && logicParam.isViewSessionParam()>viewSessionParam: true,</#if>
lastReturnParam: <#if logicParam.isLastReturnParam?? && logicParam.isLastReturnParam()>true<#else>false</#if> <#if logicParam.isLastReturnParam?? && logicParam.isLastReturnParam()>lastReturnParam: true</#if>
}, },
</#list> </#list>
</#if> </#if>
......
...@@ -36,7 +36,20 @@ ...@@ -36,7 +36,20 @@
<#-- START: 拷贝参数节点 --> <#-- START: 拷贝参数节点 -->
<#macro copyParamNode logicNode> <#macro copyParamNode logicNode>
// TODO 等待补充 <#if logicNode.getDstPSDEUILogicParam?? && logicNode.getDstPSDEUILogicParam()?? && logicNode.getSrcPSDEUILogicParam?? && logicNode.getSrcPSDEUILogicParam()??>
try {
// 源数据
const srcParam:any = actionContext.getParam('${logicNode.getSrcPSDEUILogicParam().codeName}');
// 目标数据
const dstParam: any = actionContext.getParam('${logicNode.getDstPSDEUILogicParam().codeName}');
srcParam.copyTo(dstParam);
actionContext.bindLastReturnParam(null);
} catch (error: any) {
throw new Error(`逻辑参数 ${logicNode.getDstPSDEUILogicParam().name} <#noparse>${error ## error.message ? error.message : '发生未知错误!'}`</#noparse>);
}
<#else>
throw new Error('操作参数或者源参数缺失!');
</#if>
console.log('已完成执行 ${logicNode.name} 节点'); console.log('已完成执行 ${logicNode.name} 节点');
</#macro> </#macro>
<#-- END: 拷贝参数节点 --> <#-- END: 拷贝参数节点 -->
...@@ -83,7 +96,11 @@ ...@@ -83,7 +96,11 @@
<#-- START: 行为处理节点 --> <#-- START: 行为处理节点 -->
<#macro deActionNode logicNode> <#macro deActionNode logicNode>
// TODO 等待补充 const dstParam = actionContext.getParam('<#if logicNode.getDstPSDEUILogicParam?? && logicNode.getDstPSDEUILogicParam()??>${logicNode.getDstPSDEUILogicParam().codeName}</#if>');
if (!Object.is(dstParam.logicParamType, UILogicParamType.entityListParam) && !Object.is(dstParam.logicParamType, UILogicParamType.entityParam)) {
throw new Error(`实体行为操作参数只能为数据对象变量类型或者数据对象列表类型`);
}
const retParam = actionContext.getParam('<#if logicNode.getRetPSDEUILogicParam?? && logicNode.getRetPSDEUILogicParam()??>${logicNode.getRetPSDEUILogicParam().codeName}</#if>');
console.log('已完成执行 ${logicNode.name} 节点'); console.log('已完成执行 ${logicNode.name} 节点');
</#macro> </#macro>
<#-- END: 行为处理节点 --> <#-- END: 行为处理节点 -->
...@@ -179,7 +196,23 @@ ...@@ -179,7 +196,23 @@
<#-- START: 结束节点 --> <#-- START: 结束节点 -->
<#macro endNode logicNode> <#macro endNode logicNode>
// TODO 等待补充 const strReturnType: string = '<#if logicNode.getReturnType?? && logicNode.getReturnType()??>${logicNode.getReturnType()}</#if>';
if (Object.is(strReturnType, LogicReturnType.NONEVALUE) || Object.is(strReturnType, LogicReturnType.NULLVALUE)) {
actionContext.setResult(null);
} else if (Object.is(strReturnType, LogicReturnType.SRCVALUE)) {
actionContext.setResult('<#if logicNode.getRawValue?? && logicNode.getRawValue()??>${logicNode.getRawValue()}</#if>');
} else if (Object.is(strReturnType, LogicReturnType.BREAK)) {
actionContext.setResult(LogicReturnType.BREAK);
} else if (Object.is(strReturnType, LogicReturnType.LOGICPARAM) || Object.is(strReturnType, LogicReturnType.LOGICPARAMFIELD)) {
const returnParam = actionContext.getParam('<#if logicNode.getReturnParam?? && logicNode.getReturnParam()??>${logicNode.getReturnParam().codeName}</#if>');
if (Object.is(strReturnType, LogicReturnType.LOGICPARAM)) {
actionContext.setResult(returnParam.getReal());
} else {
actionContext.setResult(returnParam.get('<#if logicNode.getDstFieldName?? && logicNode.getDstFieldName()??>${logicNode.getDstFieldName()}</#if>'));
}
} else {
<#noparse>throw new Error(`无法识别的返回值类型${strReturnType}`);</#noparse>
}
console.log('已完成执行 ${logicNode.name} 节点'); console.log('已完成执行 ${logicNode.name} 节点');
</#macro> </#macro>
<#-- END: 结束节点 --> <#-- END: 结束节点 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册