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

update:更新

上级 26be0fac
...@@ -8,6 +8,8 @@ import { UIActionContext } from "@/logic/ui-logic"; ...@@ -8,6 +8,8 @@ import { UIActionContext } from "@/logic/ui-logic";
import { LogicReturnType } from "@/logic/const/logic-return-type"; import { LogicReturnType } from "@/logic/const/logic-return-type";
import { UILogicParamType } from "@/logic/const/ui-logic-param-type"; import { UILogicParamType } from "@/logic/const/ui-logic-param-type";
import { Util } from "@/utils"; import { Util } from "@/utils";
import { AppMessageBox } from "@/utils/app-message-box/app-message-box";
import { Subject } from "rxjs";
<#if item.getPSDEUILogicNodes?? && item.getPSDEUILogicNodes()??> <#if item.getPSDEUILogicNodes?? && item.getPSDEUILogicNodes()??>
<#list item.getPSDEUILogicNodes() as logicNode> <#list item.getPSDEUILogicNodes() as logicNode>
<#if logicNode.getLogicNodeType() == 'DELOGIC' && logicNode.getDstPSAppDELogic?? && logicNode.getDstPSAppDELogic()?? && logicNode.getDstPSAppDELogic().getPSAppDataEntity?? && logicNode.getDstPSAppDELogic().getPSAppDataEntity()??> <#if logicNode.getLogicNodeType() == 'DELOGIC' && logicNode.getDstPSAppDELogic?? && logicNode.getDstPSAppDELogic()?? && logicNode.getDstPSAppDELogic().getPSAppDataEntity?? && logicNode.getDstPSAppDELogic().getPSAppDataEntity()??>
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
if (Object.is(dstParam.logicParamType, UILogicParamType.entityParam)) { if (Object.is(dstParam.logicParamType, UILogicParamType.entityParam)) {
const tempContext = getTempContext(dstParam.getReal()); const tempContext = getTempContext(dstParam.getReal());
const res = await service['${logicNode.getDstPSAppDEAction().codeName}'](tempContext, dstParam.getReal() ? dstParam.getReal() : {}); const res = await service['${logicNode.getDstPSAppDEAction().codeName}'](tempContext, dstParam.getReal() ? dstParam.getReal() : {});
if (res && res.ok && res.data) { if (res && res.status === 200 && res.data) {
if (retParam) { if (retParam) {
retParam.bind(res.data); retParam.bind(res.data);
} }
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
if (resArray && resArray.length > 0) { if (resArray && resArray.length > 0) {
const resultArray: any[] = []; const resultArray: any[] = [];
resArray.forEach((res: any) => { resArray.forEach((res: any) => {
if (res && res.ok && res.data) { if (res && res.status === 200 && res.data) {
resultArray.push(res.data); resultArray.push(res.data);
} }
}) })
...@@ -319,7 +319,7 @@ ...@@ -319,7 +319,7 @@
try { try {
const service: any = await window.entityServiceRegister.getService('${logicNode.getDstPSAppDataEntity().getCodeName()?lower_case}'); const service: any = await window.entityServiceRegister.getService('${logicNode.getDstPSAppDataEntity().getCodeName()?lower_case}');
const res = await service['${logicNode.getDstPSAppDEDataSet().codeName}'](actionContext.context, dstParam.getReal() ? dstParam.getReal() : {}); const res = await service['${logicNode.getDstPSAppDEDataSet().codeName}'](actionContext.context, dstParam.getReal() ? dstParam.getReal() : {});
if (res && res.ok && res.data) { if (res && res.status === 200 && res.data) {
// 返回值绑定逻辑参数对象 // 返回值绑定逻辑参数对象
<#if logicNode.getRetPSDEUILogicParam?? && logicNode.getRetPSDEUILogicParam()??> <#if logicNode.getRetPSDEUILogicParam?? && logicNode.getRetPSDEUILogicParam()??>
const retParam = actionContext.getParam('${logicNode.getRetPSDEUILogicParam().codeName}'); const retParam = actionContext.getParam('${logicNode.getRetPSDEUILogicParam().codeName}');
...@@ -409,7 +409,6 @@ ...@@ -409,7 +409,6 @@
<#-- START: 消息弹窗节点 --> <#-- START: 消息弹窗节点 -->
<#macro msgBoxNode logicNode> <#macro msgBoxNode logicNode>
// TODO 等待补充
return new Promise<void>((resolve: any) => { return new Promise<void>((resolve: any) => {
const msgBoxParam: any = actionContext.getParam('<#if logicNode.getMsgBoxParam?? && logicNode.getMsgBoxParam()??>${logicNode.getMsgBoxParam().codeName}</#if>'); const msgBoxParam: any = actionContext.getParam('<#if logicNode.getMsgBoxParam?? && logicNode.getMsgBoxParam()??>${logicNode.getMsgBoxParam().codeName}</#if>');
const data = msgBoxParam ? msgBoxParam.getReal() : {}; const data = msgBoxParam ? msgBoxParam.getReal() : {};
...@@ -423,13 +422,27 @@ ...@@ -423,13 +422,27 @@
mask: true, mask: true,
maskClosable: true maskClosable: true
}; };
// TODO 支持具体弹窗 const subject: Subject<any> | null = AppMessageBox.getInstance().open(options);
// const subject: Subject<any> | null = AppMessageBoxService.getInstance().open(options); if (subject) {
// const subscription = subject?.subscribe((result: any) => { const handleResponse = (result: any) => {
// resolve(this.handleResponse(logicNode, actionContext, options, result)); <#if logicNode.getButtonsType() == 'YESNO' || logicNode.getButtonsType() == 'YESNOCANCEL' || logicNode.getButtonsType() == 'OK' || logicNode.getButtonsType() == 'OKCANCEL'>
// subscription!.unsubscribe(); if (msgBoxParam) {
// subject.complete(); msgBoxParam.bind(result);
// }) }
actionContext.bindLastReturnParam(result);
return true;
<#else>
throw new Error('${logicNode.getButtonsType()}未实现');
</#if>
}
const subscription = subject.subscribe((result: any) => {
resolve(handleResponse(result));
subscription!.unsubscribe();
subject.complete();
});
} else {
resolve(true);
}
}); });
</#macro> </#macro>
<#-- END: 消息弹窗节点 --> <#-- END: 消息弹窗节点 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册