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

树视图逻辑调整

上级 d1413a41
......@@ -12,7 +12,7 @@
<div class="tree-partition" v-if="valueNodes.length > 0" ></div>
<ion-list>
<template v-for="item in rootNodes">
<ion-item v-if="item.isNode" :key="item.id" @click="click_node(item)">
<ion-item :key="item.id" @click="click_node(item)">
<ion-label>{{item.text}}</ion-label>
<ion-icon class="tree-icon" slot="end" name="chevron-forward-outline"></ion-icon>
</ion-item>
......@@ -22,7 +22,7 @@
<!-- 树视图 -->
<ion-list v-if="viewType == 'DEMOBTREEVIEW'">
<template v-for="item in valueNodes">
<ion-item v-if="!item.isNode" :key="item.id">
<ion-item :key="item.id">
<ion-label>{{item.text}}</ion-label>
</ion-item>
</template>
......@@ -30,7 +30,7 @@
<!-- 树多选 -->
<ion-list v-else-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect">
<template v-for="item in valueNodes">
<ion-item v-if="!item.isNode" :key="item.id">
<ion-item :key="item.id">
<ion-checkbox color="secondary" v-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect" :checked="item.checked" :value="item.id" slot="end" @ionChange="onChecked"></ion-checkbox>
<ion-label>{{item.text}}</ion-label>
</ion-item>
......
......@@ -177,11 +177,11 @@ import { Util } from '@ibiz-core/utils'
* @param {*} nodes
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public parsNodes(nodes:any) {
public parseNodes(nodes:any) {
let rootNodes :any= [];
let valueNodes :any= [];
nodes.forEach((item:any) => {
if(item.isNode){
if(!item.leaf){
rootNodes.push(item);
}else{
valueNodes.push(item);
......@@ -489,7 +489,7 @@ import { Util } from '@ibiz-core/utils'
}
this.nodes = response.data; -->
this.nodes = [..._items];
this.parsNodes(this.nodes);
this.parseNodes(this.nodes);
let isRoot = Object.is(node.level,0);
let isSelectedAll = node.checked;
this.setDefaultSelection(_items, isRoot, isSelectedAll);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册