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

树视图逻辑调整

上级 57d96158
......@@ -196,14 +196,14 @@ import { Util } from '@ibiz-core/utils'
*/
public isOutputIconDefault: boolean = ${ctrl.isOutputIconDefault()?c};
<#-- /**
* 树数据
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Provide()
public nodes: any[] = []; -->
public nodes: any[] = [];
/**
* 数据展开主键
......@@ -292,6 +292,7 @@ import { Util } from '@ibiz-core/utils'
this.$nextTick(() => {
this.inited = true;
});
this.load();
}
if (Object.is('filter', action)) {
this.srfnodefilter = data.srfnodefilter;
......@@ -386,9 +387,8 @@ import { Util } from '@ibiz-core/utils'
* @param {*} node
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public load(node: any = {}, resolve?: any) {
public load(node: any = {}) {
if (node.data && node.data.children) {
resolve(node.data.children);
return;
}
const params: any = {
......@@ -411,7 +411,6 @@ import { Util } from '@ibiz-core/utils'
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
this.$notice.error(response.info);
resolve([]);
return;
}
const _items = response.data;
......@@ -420,13 +419,12 @@ import { Util } from '@ibiz-core/utils'
this.nodes = [..._items];
}
this.nodes = response.data; -->
resolve([..._items]);
this.nodes = [..._items];
let isRoot = Object.is(node.level,0);
let isSelectedAll = node.checked;
this.setDefaultSelection(_items, isRoot, isSelectedAll);
this.$emit("load", _items);
}).catch((response: any) => {
resolve([]);
if (response && response.status === 401) {
return;
}
......
......@@ -16,8 +16,16 @@
height: 8px;
background-color: #ededed;
}
.tree-icon{
color: #ccc;
font-size: 20px;
.tree-icon {
color: #ccc;
font-size: 20px;
}
.tree-partition-bigger {
height: 16px;
}
ion-list {
ion-item:last-child {
--inner-border-width: 0;
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册