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

update:更新

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