提交 d61cdfc4 编写于 作者: tony001's avatar tony001

调整权限服务和ui服务的依赖关系

上级 257b89f3
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
TARGET=PSAPPDATAENTITY TARGET=PSAPPDATAENTITY
</#ibiztemplate> </#ibiztemplate>
import AuthService from '../auth-service'; import AuthService from '../auth-service';
import ${srfclassname('${item.getCodeName()}')}UIService from '@/uiservice/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-ui-service';
/** /**
* ${de.getLogicName()}权限服务对象基类 * ${de.getLogicName()}权限服务对象基类
...@@ -13,13 +12,6 @@ import ${srfclassname('${item.getCodeName()}')}UIService from '@/uiservice/${srf ...@@ -13,13 +12,6 @@ import ${srfclassname('${item.getCodeName()}')}UIService from '@/uiservice/${srf
*/ */
export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase extends AuthService { export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase extends AuthService {
/**
* 所依赖UI服务
*
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/
public ${item.getCodeName()?lower_case}UIService:any;
/** /**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}AuthServiceBase. * Creates an instance of ${srfclassname('${item.getCodeName()}')}AuthServiceBase.
* *
...@@ -28,18 +20,16 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext ...@@ -28,18 +20,16 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
super(opts); super(opts);
this.${item.getCodeName()?lower_case}UIService = new ${srfclassname('${item.getCodeName()}')}UIService(opts);
} }
/** /**
* 根据当前数据获取实体操作标识 * 根据当前数据获取实体操作标识
* *
* @param {*} data 传入数据 * @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any} * @returns {any}
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/ */
public getOPPrivs(data:any):any{ public getOPPrivs(mainSateOPPrivs:any):any{
let mainSateOPPrivs:any = this.${item.getCodeName()?lower_case}UIService.getDEMainStateOPPrivs(data);
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs)); let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){ if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs); Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
......
...@@ -15,6 +15,7 @@ import { UIActionTool,Util } from '@/utils'; ...@@ -15,6 +15,7 @@ import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service'; import UIService from '../ui-service';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import ${srfclassname('${item.getCodeName()}')}Service from '@/service/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-service'; import ${srfclassname('${item.getCodeName()}')}Service from '@/service/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-service';
import ${srfclassname('${item.getCodeName()}')}AuthService from '@/authservice/${srffilepath2(item.getCodeName())}/${srffilepath2(item.getCodeName())}-auth-service';
<#if item.getAllPSAppDEUIActions()??> <#if item.getAllPSAppDEUIActions()??>
<#list item.getAllPSAppDEUIActions() as appdeUIAction> <#list item.getAllPSAppDEUIActions() as appdeUIAction>
<#if appdeUIAction.getPSAppDataEntity()??> <#if appdeUIAction.getPSAppDataEntity()??>
...@@ -109,6 +110,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten ...@@ -109,6 +110,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UIServiceBase exten
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
super(opts); super(opts);
this.authService = new ${srfclassname('${item.getCodeName()}')}AuthService(opts);
this.initViewMap(); this.initViewMap();
this.initDeMainStateMap(); this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap(); this.initDeMainStateOPPrivsMap();
...@@ -362,17 +364,27 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code} ...@@ -362,17 +364,27 @@ ${P.getLogicCode(appdeUIAction, "LOGIC.vue").code}
} }
/** /**
* 获取数据对象操作标识 * 获取数据对象当前操作标识
* *
* @param curData 当前数据 * @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/ */
public getDEMainStateOPPrivs(curData:any){ public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(curData)){ if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(curData) as string)); return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{ }else{
return null; return null;
} }
} }
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof ${srfclassname('${item.getCodeName()}')}UIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getDEMainStateOPPrivs(this.getDEMainStateOPPrivs(data));
}
} }
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册