提交 5a26947b 编写于 作者: KK's avatar KK

表单应用通知中心

上级 1a646114
...@@ -134,6 +134,16 @@ import { Util } from '@/ibiz-core/utils'; ...@@ -134,6 +134,16 @@ import { Util } from '@/ibiz-core/utils';
*/ */
protected formState: Subject<any> = new Subject(); protected formState: Subject<any> = new Subject();
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 忽略表单项值变化 * 忽略表单项值变化
* *
...@@ -893,6 +903,16 @@ import { Util } from '@/ibiz-core/utils'; ...@@ -893,6 +903,16 @@ import { Util } from '@/ibiz-core/utils';
this.$emit('load', this.data); this.$emit('load', this.data);
</#if> </#if>
}); });
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"${ctrl.getPSAppDataEntity().getCodeName()}")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
} }
/** /**
...@@ -916,6 +936,9 @@ import { Util } from '@/ibiz-core/utils'; ...@@ -916,6 +936,9 @@ import { Util } from '@/ibiz-core/utils';
if (this.dataChangEvent) { if (this.dataChangEvent) {
this.dataChangEvent.unsubscribe(); this.dataChangEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册