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

zk——应用级数据状态同步(日历部件)

上级 f5af9d96
...@@ -626,6 +626,15 @@ FullCalendar, ...@@ -626,6 +626,15 @@ FullCalendar,
*/ */
public selections: any[] = []; public selections: any[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -674,6 +683,16 @@ FullCalendar, ...@@ -674,6 +683,16 @@ FullCalendar,
} }
}); });
} }
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();
}
})
}
} }
...@@ -717,6 +736,9 @@ FullCalendar, ...@@ -717,6 +736,9 @@ FullCalendar,
if (this.viewStateEvent) { if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe(); this.viewStateEvent.unsubscribe();
} }
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
<#if destroyed_block??> <#if destroyed_block??>
${destroyed_block} ${destroyed_block}
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册