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

update:更新

上级 e8e61d13
...@@ -16,15 +16,22 @@ ${front_block} ...@@ -16,15 +16,22 @@ ${front_block}
* @param {*} [actionContext] 执行行为上下文 * @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称 * @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>} * @returns {Promise<any>}
<#if item.getgetPSAppDataEntity?? && item.getPSAppDataEntity()??> <#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
* @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService * @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService
</#if> </#if>
*/ */
public async ${item.getFullCodeName()}(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) { public async ${item.getFullCodeName()}(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
<#if item.getUILogicAttachMode?? && item.getUILogicAttachMode()?? && item.getUILogicAttachMode() == 'REPLACE' && item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()??>
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()?? && item.getPSAppDEUILogic().getPSAppDataEntity?? && item.getPSAppDEUILogic.getPSAppDataEntity()?? && item.getPSAppDataEntity().codeName == item.getPSAppDEUILogic.getPSAppDataEntity().codeName>
return this.executeUILogic('${item.getPSAppDEUILogic().codeName}', args, context, params, $event, xData, actionContext, srfParentDeName);
<#elseif item.getPSAppDEUILogic().getPSAppDataEntity?? && item.getPSAppDEUILogic.getPSAppDataEntity()??>
return window.uiServiceRegister.getService('${item.getPSAppDEUILogic.getPSAppDataEntity().codeName}').executeUILogic('${item.getPSAppDEUILogic().codeName}', args, context, params, $event, xData, actionContext, srfParentDeName);
</#if>
<#else>
<#-- BEGIN: 数据目标: 单项数据 --> <#-- BEGIN: 数据目标: 单项数据 -->
<#if item.getActionTarget() == 'SINGLEDATA'> <#if item.getActionTarget() == 'SINGLEDATA'>
actionContext.$Notice.error({ title: '错误', desc: '不支持单项数据' }); actionContext.$Notice.error({ title: '错误', desc: '不支持单项数据' });
...@@ -589,6 +596,7 @@ ${front_block} ...@@ -589,6 +596,7 @@ ${front_block}
</#if> </#if>
<#-- END: 数据目标: 单项数据(主键),多项数据(主键),无数据 --> <#-- END: 数据目标: 单项数据(主键),多项数据(主键),无数据 -->
</#if> </#if>
</#if>
} }
</#if> </#if>
\ No newline at end of file
...@@ -16,14 +16,21 @@ ${backend_block} ...@@ -16,14 +16,21 @@ ${backend_block}
* @param {*} [actionContext] 执行行为上下文 * @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称 * @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>} * @returns {Promise<any>}
<#if item.getgetPSAppDataEntity?? && item.getPSAppDataEntity()??> <#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
* @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService * @memberof ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}UIService
</#if> </#if>
*/ */
public async ${item.getFullCodeName()}(args: any[],context:any = {}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){ public async ${item.getFullCodeName()}(args: any[],context:any = {}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
<#if item.render??> <#if item.render??>
${item.render.code} ${item.render.code}
<#else> <#else>
<#if item.getUILogicAttachMode?? && item.getUILogicAttachMode()?? && item.getUILogicAttachMode() == 'REPLACE' && item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()??>
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()?? && item.getPSAppDEUILogic().getPSAppDataEntity?? && item.getPSAppDEUILogic.getPSAppDataEntity()?? && item.getPSAppDataEntity().codeName == item.getPSAppDEUILogic.getPSAppDataEntity().codeName>
return this.executeUILogic('${item.getPSAppDEUILogic().codeName}', args, context, params, $event, xData, actionContext, srfParentDeName);
<#elseif item.getPSAppDEUILogic().getPSAppDataEntity?? && item.getPSAppDEUILogic.getPSAppDataEntity()??>
return window.uiServiceRegister.getService('${item.getPSAppDEUILogic.getPSAppDataEntity().codeName}').executeUILogic('${item.getPSAppDEUILogic().codeName}', args, context, params, $event, xData, actionContext, srfParentDeName);
</#if>
<#else>
<#-- BEGIN: 自定义确认 --> <#-- BEGIN: 自定义确认 -->
<#if item.getConfirmMsg?? && item.getConfirmMsg()??> <#if item.getConfirmMsg?? && item.getConfirmMsg()??>
let confirmResult:boolean = await new Promise((resolve: any, reject: any) => { let confirmResult:boolean = await new Promise((resolve: any, reject: any) => {
...@@ -215,6 +222,7 @@ ${backend_block} ...@@ -215,6 +222,7 @@ ${backend_block}
backend(); backend();
</#if> </#if>
</#if> </#if>
</#if>
</#if> </#if>
} }
</#if> </#if>
\ No newline at end of file
...@@ -42,11 +42,11 @@ export class EntityServiceRegister { ...@@ -42,11 +42,11 @@ export class EntityServiceRegister {
* @memberof EntityServiceRegister * @memberof EntityServiceRegister
*/ */
protected init(): void { protected init(): void {
<#if app.getAllPSAppDataEntities()??> <#if app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as curAppEntity> <#list app.getAllPSAppDataEntities() as curAppEntity>
this.allEntityService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/service/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-service')); this.allEntityService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/service/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-service'));
</#list> </#list>
</#if> </#if>
} }
/** /**
......
...@@ -36,6 +36,13 @@ import ${srfclassname('${appdeUIAction.getPSAppDataEntity().getCodeName()}')}Ser ...@@ -36,6 +36,13 @@ import ${srfclassname('${appdeUIAction.getPSAppDataEntity().getCodeName()}')}Ser
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#if de.getAllPSAppDEUILogics?? && de.getAllPSAppDEUILogics()??>
<#list de.getAllPSAppDEUILogics() as uiLogic>
<#if !P.exists("importService1", uiLogic.codeName, "")>
import ${srfclassname('${uiLogic.getCodeName()}')}UILogic from './${srffilepath2(uiLogic.getCodeName())}-ui-logic';
</#if>
</#list>
</#if>
<#if item.getPSAppWF()?? && item.getPSAppWF().getPSWorkflow()??> <#if item.getPSAppWF()?? && item.getPSAppWF().getPSWorkflow()??>
<#assign workflow = item.getPSAppWF().getPSWorkflow()/> <#assign workflow = item.getPSAppWF().getPSWorkflow()/>
<#if workflow.getPSWFDEs()??> <#if workflow.getPSWFDEs()??>
...@@ -381,27 +388,50 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten ...@@ -381,27 +388,50 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
} }
/** /**
* 获取数据对象当前操作标识 * 获取数据对象当前操作标识
* *
* @param data 当前数据 * @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/ */
public getDEMainStateOPPrivs(data:any){ public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){ if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string)); return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{ }else{
return null; return null;
} }
} }
/** /**
* 获取数据对象所有的操作标识 * 获取数据对象所有的操作标识
* *
* @param data 当前数据 * @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/ */
public getAllOPPrivs(data:any){ public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data)); return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
} }
/**
* 执行界面逻辑
*
* @param {string} name
* @param {any[]} args
* @param {*} [context={}]
* @param {*} [params={}]
* @param {*} [$event]
* @param {*} [xData]
* @param {*} [actionContext]
* @param {string} [srfParentDeName]
* @memberof UIService
*/
public executeUILogic(name: string, args: any[], context?: any, params?: any, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string | undefined): void {
<#if de.getAllPSAppDEUILogics?? && de.getAllPSAppDEUILogics()??>
<#list de.getAllPSAppDEUILogics() as uiLogic>
if (name === '${uiLogic.codeName}') {
${srfclassname('${uiLogic.getCodeName()}')}UILogic.getInstance().execute(args, context, params, $event, xData, actionContext, srfParentDeName);
}
</#list>
</#if>
}
} }
\ No newline at end of file
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<#if logicNode.getDstPSAppDataEntity?? && logicNode.getDstPSAppDataEntity()?? && logicNode.getDstPSAppDEAction?? && logicNode.getDstPSAppDEAction()??> <#if logicNode.getDstPSAppDataEntity?? && logicNode.getDstPSAppDataEntity()?? && logicNode.getDstPSAppDEAction?? && logicNode.getDstPSAppDEAction()??>
if (dstParam) { if (dstParam) {
try { try {
const service: any = new ${srfclassname('${logicNode.getDstPSAppDataEntity().getCodeName()}')}Service(); const service: any = window.entityServiceRegister.getService('${logicNode.getDstPSAppDataEntity().getCodeName()?lower_case}');
const getTempContext = (data: any) => { const getTempContext = (data: any) => {
const tempContext = Util.deepCopy(actionContext.context); const tempContext = Util.deepCopy(actionContext.context);
if (data) { if (data) {
...@@ -287,8 +287,9 @@ ...@@ -287,8 +287,9 @@
const retParam = actionContext.getParam('<#if logicNode.getDstPSDEUILogicParam?? && logicNode.getDstPSDEUILogicParam()??>${logicNode.getDstPSDEUILogicParam().codeName}</#if>'); const retParam = actionContext.getParam('<#if logicNode.getDstPSDEUILogicParam?? && logicNode.getDstPSDEUILogicParam()??>${logicNode.getDstPSDEUILogicParam().codeName}</#if>');
if (dstParam) { if (dstParam) {
try { try {
const service: any = new ${srfclassname('${logicNode.getDstPSAppDataEntity().getCodeName()}')}Service(); const service: any = window.entityServiceRegister.getService('${logicNode.getDstPSAppDataEntity().getCodeName()?lower_case}');
const result = await service['executeAppDELogic']('${logicNode.getDstPSAppDELogic().codeName}', actionContext.context, dstParam.getReal() ? dstParam.getReal() : {}); const deLogic: ${srfclassname('${logicNode.getDstPSAppDELogic().getCodeName()}')}Logic = new ${srfclassname('${logicNode.getDstPSAppDELogic().getCodeName()}')}Logic({ context: actionContext.context, data: dstParam.getReal() ? dstParam.getReal() : {} });
const result = await deLogic.onExecute(actionContext.context, dstParam.getReal() ? dstParam.getReal() : {}, false);
if (result) { if (result) {
if(retParam){ if(retParam){
retParam.bind(result); retParam.bind(result);
......
...@@ -42,11 +42,11 @@ export class UIServiceRegister { ...@@ -42,11 +42,11 @@ export class UIServiceRegister {
* @memberof UIServiceRegister * @memberof UIServiceRegister
*/ */
protected init(): void { protected init(): void {
<#if app.getAllPSAppDataEntities()??> <#if app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as curAppEntity> <#list app.getAllPSAppDataEntities() as curAppEntity>
this.allUIService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service')); this.allUIService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/uiservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-ui-service'));
</#list> </#list>
</#if> </#if>
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册