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

树部件导航数据处理 ---fix2

上级 b0c8cc00
......@@ -303,10 +303,10 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if>
<#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, {navigateContext: '<@getNavigateContext node />' });
Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: '<@getNavigateParams node />' });
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if>
<#-- 补充nodeid和nodeid2 -->
Object.assign(treeNode, { nodeid: treeNode.srfkey });
......@@ -372,10 +372,10 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
Object.assign(item, { navfilter: "${node.getNavFilter()}" });
</#if>
<#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, {navigateContext: '<@getNavigateContext node />' });
Object.assign(item, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: '<@getNavigateParams node />' });
Object.assign(item, {navigateParams: <@getNavigateParams node /> });
</#if>
<#-- 补充nodeid和nodeid2 -->
Object.assign(item, { nodeid: item.srfkey });
......@@ -441,10 +441,10 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if>
<#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, {navigateContext: '<@getNavigateContext node />' });
Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: '<@getNavigateParams node />' });
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if>
if(item.children && item.children.length >0){
Object.assign(treeNode, { children: item.children });
......@@ -572,10 +572,10 @@ ${navParam.getKey()}:<#if navParam.isRawValue()?? && navParam.isRawValue() == tr
Object.assign(treeNode, { navfilter: "${node.getNavFilter()}" });
</#if>
<#if node.getPSNavigateContexts?? && node.getPSNavigateContexts()??>
Object.assign(treeNode, {navigateContext: '<@getNavigateContext node />' });
Object.assign(treeNode, {navigateContext: <@getNavigateContext node /> });
</#if>
<#if node.getPSNavigateParams?? && node.getPSNavigateParams()??>
Object.assign(treeNode, {navigateParams: '<@getNavigateParams node />' });
Object.assign(treeNode, {navigateParams: <@getNavigateParams node /> });
</#if>
<#-- 补充nodeid和nodeid2 -->
Object.assign(treeNode, { nodeid: treeNode.srfkey });
......
......@@ -198,38 +198,28 @@
})
Object.assign(tempContext,{srfcounter:this.counter});
}
if(arg && arg.navparams){
let curNavParams:any = JSON.parse(arg.navparams);
if(Object.keys(curNavParams).length >0){
Object.keys(curNavParams).forEach((name:any) =>{
if (!name) {
return;
}
let value: string | null = curNavParams[name];
if (value && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else {
value = null;
}
}
Object.assign(tempViewparam, { [name]: value });
})
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
}
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let _context = this.$util.computedNavData(arg,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
}
if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
}
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let _params = this.$util.computedNavData(arg,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册