提交 7a607197 编写于 作者: JunZai's avatar JunZai

树导航数据变化刷新树

上级 651d73cc
......@@ -363,6 +363,9 @@ import UIService from '@/uiservice/ui-service';
if (Object.is('refresh_parent', action)) {
this.refresh_parent();
}
if (Object.is('refresh_current', action)) {
this.refresh_current();
}
});
}
if(AppCenterService && AppCenterService.getMessageCenter()){
......@@ -425,6 +428,33 @@ import UIService from '@/uiservice/ui-service';
});
}
/**
* 刷新当前节点
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public refresh_current(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.${ctrl.name};
const node: any = tree.getNode(this.currentselectedNode.id);
if (!node || !node.parent) {
return;
}
let curNode:any = {};
curNode = Util.deepObjectMerge(curNode,node);
let tempContext:any = {};
if(curNode.data && curNode.data.srfappctx){
Object.assign(tempContext,curNode.data.srfappctx);
}else{
Object.assign(tempContext,this.context);
}
const id: string = node.key ? node.key : '#';
const param: any = { srfnodeid: id };
this.refresh_node(tempContext,param, false);
}
/**
* 刷新父节点
*
......@@ -577,6 +607,7 @@ import UIService from '@/uiservice/ui-service';
if (parentnode) {
this.currentselectedNode = {};
}
this.$forceUpdate();
this.setDefaultSelection(_items);
}).catch((response: any) => {
if (response && response.status === 401) {
......
......@@ -43,6 +43,7 @@
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)"
@viewdataschange="onViewDatasChange"
@drdatasaved="onViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</component>
......@@ -377,6 +378,10 @@
*/
public onViewDatasChange($event: any): void {
this.$emit('selectionchange', $event);
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.viewState.next({ tag: '${tree.name}', action: 'refresh_current', data: data });
</#if>
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册