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

树视图逻辑调整

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