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

逻辑优化

上级 99d7d451
...@@ -106,7 +106,6 @@ import { Util } from '@ibiz-core/utils' ...@@ -106,7 +106,6 @@ import { Util } from '@ibiz-core/utils'
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public click_node(data:any){ public click_node(data:any){
this.treeNav.push(data);
this.load({data:data}); this.load({data:data});
} }
...@@ -141,6 +140,9 @@ import { Util } from '@ibiz-core/utils' ...@@ -141,6 +140,9 @@ import { Util } from '@ibiz-core/utils'
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public nav_click(item:any) { public nav_click(item:any) {
if(item.id == this.treeNav[this.treeNav.length-1].id){
return
}
const count = this.treeNav.findIndex((i:any) => item.id === i.id) + 1; const count = this.treeNav.findIndex((i:any) => item.id === i.id) + 1;
this.treeNav.splice(count,this.treeNav.length- count); this.treeNav.splice(count,this.treeNav.length- count);
this.load({data:item}); this.load({data:item});
...@@ -468,7 +470,8 @@ import { Util } from '@ibiz-core/utils' ...@@ -468,7 +470,8 @@ import { Util } from '@ibiz-core/utils'
} }
this.nodes = response.data; --> this.nodes = response.data; -->
this.nodes = [..._items]; this.nodes = [..._items];
this.parsNodes(this.nodes) this.parsNodes(this.nodes);
this.treeNav.push(node.data);
let isRoot = Object.is(node.level,0); let isRoot = Object.is(node.level,0);
let isSelectedAll = node.checked; let isSelectedAll = node.checked;
this.setDefaultSelection(_items, isRoot, isSelectedAll); this.setDefaultSelection(_items, isRoot, isSelectedAll);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册