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

zk——应用级数据状态同步(树视图部件)

上级 b1969e51
...@@ -240,6 +240,15 @@ ...@@ -240,6 +240,15 @@
@Provide() @Provide()
public expandedKeys: string[] = []; public expandedKeys: string[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public appStateEvent: Subscription | undefined;
/** /**
* 选中数据变更事件 * 选中数据变更事件
* *
...@@ -319,6 +328,16 @@ ...@@ -319,6 +328,16 @@
} }
}); });
} }
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]);
}
})
}
} }
/** /**
...@@ -349,6 +368,9 @@ ...@@ -349,6 +368,9 @@
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册