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

update:更新UI服务

上级 3523d739
import { IParam } from "@core";
/** /**
* 界面服务基类 * 界面服务基类
* *
...@@ -5,30 +7,24 @@ ...@@ -5,30 +7,24 @@
* @class UIServiceBase * @class UIServiceBase
*/ */
export class UIServiceBase { export class UIServiceBase {
/** /**
* 执行界面行为统一入口 * 应用上下文
* *
* @param {string} uIActionTag 界面行为tag * @protected
* @param {any[]} args 当前数据 * @type {IParam}
* @param {any} context 行为附加上下文 * @memberof UIServiceBase
* @param {*} [params] 附加参数 */
* @param {*} [$event] 事件源 protected context: IParam;
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文 /**
* @param {*} [srfParentDeName] 父实体名称 * Creates an instance of UIServiceBase.
* *
* @param {*} [opts={}]
* @memberof UIServiceBase * @memberof UIServiceBase
*/ */
protected async excuteAction( constructor(context: IParam = {}) {
uIActionTag: string, this.context = context;
args: any[],
context: any = {},
params: any = {},
$event?: any,
xData?: any,
actionContext?: any,
srfParentDeName?: string,
) {
// TODO 执行UI服务
} }
} }
import { AppUIAction, IUIAction, UIServiceBase } from '@core'; import { IParam, UIServiceBase } from '@core';
/** /**
* {{appEntity.logicName}}UI服务对象基类 * {{appEntity.logicName}}UI服务对象基类
......
...@@ -8,12 +8,30 @@ import { {{pascalCase appEntity.codeName}}UIServiceBase } from './{{spinalCase a ...@@ -8,12 +8,30 @@ import { {{pascalCase appEntity.codeName}}UIServiceBase } from './{{spinalCase a
* @extends {{pascalCase appEntity.codeName}}UIServiceBase * @extends {{pascalCase appEntity.codeName}}UIServiceBase
*/ */
export class {{pascalCase appEntity.codeName}}UIService extends {{pascalCase appEntity.codeName}}UIServiceBase { export class {{pascalCase appEntity.codeName}}UIService extends {{pascalCase appEntity.codeName}}UIServiceBase {
/**
* 基础UI服务实例
*
* @private
* @type { {{pascalCase appEntity.codeName}}UIService }
* @memberof {{pascalCase appEntity.codeName}}UIService
*/
private static basicUIServiceInstance: {{pascalCase appEntity.codeName}}UIService;
/**
* UI服务存储Map对象
*
* @private
* @type {Map<string, any>}
* @memberof {{pascalCase appEntity.codeName}}UIService
*/
private static UIServiceMap: Map<string, any> = new Map();
/** /**
* Creates an instance of {{pascalCase appEntity.codeName}}UIService. * Creates an instance of {{pascalCase appEntity.codeName}}UIService.
* @memberof {{pascalCase appEntity.codeName}}UIService * @memberof {{pascalCase appEntity.codeName}}UIService
*/ */
constructor(opts?: any) { constructor(opts?: any) {
{{!-- const { context: context, tag: cacheKey } = opts; --}}
super(opts); super(opts);
} }
...@@ -26,7 +44,17 @@ export class {{pascalCase appEntity.codeName}}UIService extends {{pascalCase app ...@@ -26,7 +44,17 @@ export class {{pascalCase appEntity.codeName}}UIService extends {{pascalCase app
* @memberof {{pascalCase appEntity.codeName}}UIService * @memberof {{pascalCase appEntity.codeName}}UIService
*/ */
static getInstance(context?: any): {{pascalCase appEntity.codeName}}UIService { static getInstance(context?: any): {{pascalCase appEntity.codeName}}UIService {
return new {{pascalCase appEntity.codeName}}UIService({ context: context }); if (!this.basicUIServiceInstance) {
this.basicUIServiceInstance = new {{pascalCase appEntity.codeName}}UIService(context);
}
if (!context || !context.srfdynainstid) {
return this.basicUIServiceInstance;
} else {
if (!{{pascalCase appEntity.codeName}}UIService.UIServiceMap.get(context.srfdynainstid)) {
{{pascalCase appEntity.codeName}}UIService.UIServiceMap.set(context.srfdynainstid, new {{pascalCase appEntity.codeName}}UIService(context));
}
return {{pascalCase appEntity.codeName}}UIService.UIServiceMap.get(context.srfdynainstid);
}
} }
} }
export default {{pascalCase appEntity.codeName}}UIService; export default {{pascalCase appEntity.codeName}}UIService;
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册