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

视图消息服务补充context和viewparam

上级 bee3b2fc
...@@ -201,7 +201,7 @@ export default class ViewMessageService { ...@@ -201,7 +201,7 @@ export default class ViewMessageService {
public async getViewMessageByTag(tag:string,context:any = {},viewparam:any = {}){ public async getViewMessageByTag(tag:string,context:any = {},viewparam:any = {}){
let messageService:any = await this.getService(tag); let messageService:any = await this.getService(tag);
if(messageService.dynamicMode && Object.is(messageService.dynamicMode,"STATIC")){ if(messageService.dynamicMode && Object.is(messageService.dynamicMode,"STATIC")){
return messageService.getStaticViewMessage(); return messageService.getStaticViewMessage(context,viewparam);
}else{ }else{
return messageService.getDynamicViewMessage(tag,messageService,context,viewparam); return messageService.getDynamicViewMessage(tag,messageService,context,viewparam);
} }
...@@ -209,10 +209,15 @@ export default class ViewMessageService { ...@@ -209,10 +209,15 @@ export default class ViewMessageService {
/** /**
* 转化消息模板标题和内容 * 转化消息模板标题和内容
*
* @target {*} target 返回目标数据
* @param {*} context 应用上下文
* @param {*} viewparam 视图参数
* @param {*} item 源数据
* *
* @memberof ViewMessageService * @memberof ViewMessageService
*/ */
public translateMessageTemp(target:any,item?:any){ public translateMessageTemp(target:any,context:any,viewparam:any,item?:any){
} }
...@@ -221,7 +226,7 @@ export default class ViewMessageService { ...@@ -221,7 +226,7 @@ export default class ViewMessageService {
* *
* @memberof ViewMessageService * @memberof ViewMessageService
*/ */
public getStaticViewMessage():Array<ViewMessage>{ public getStaticViewMessage(context:any,viewparam:any):Array<ViewMessage>{
let returnViewMessage:ViewMessage ={ let returnViewMessage:ViewMessage ={
id:this.id, id:this.id,
name:this.name, name:this.name,
...@@ -236,7 +241,7 @@ export default class ViewMessageService { ...@@ -236,7 +241,7 @@ export default class ViewMessageService {
dynamicMode:this.dynamicMode, dynamicMode:this.dynamicMode,
messageType:this.messageType messageType:this.messageType
}; };
this.translateMessageTemp(returnViewMessage); this.translateMessageTemp(returnViewMessage,context,viewparam);
return [returnViewMessage]; return [returnViewMessage];
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册