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

选择树视图--fix3

上级 52b3f3e8
......@@ -27,16 +27,16 @@
</ion-item>
</template>
</ion-list>
<!-- 树选 -->
<!-- 树选 -->
<ion-list v-else-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect">
<template v-for="item in valueNodes">
<ion-item v-if="!item.isNode" :key="item.id">
<ion-checkbox color="secondary" v-if="viewType == 'DEMOBPICKUPTREEVIEW' && !isSingleSelect" :checked="item.checked" :value="item.srfkey" @ionChange="checkboxChange" slot="end"></ion-checkbox>
<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>
</template>
</ion-list>
<!-- 树选 -->
<!-- 树选 -->
<ion-radio-group v-else-if="viewType == 'DEMOBPICKUPTREEVIEW' && isSingleSelect" :value="selectedValue" >
<template v-for="item in valueNodes">
<ion-item :key="item.id" @click="onSimpleSelChange(item)">
......
......@@ -748,16 +748,6 @@ ${P.getCtrlCode(childCtrl, 'CONTROL.html').code}
this.$emit('nodedblclick', this.selectedNodes);
}
/**
* 节点点击行为
*
* @param {*} node
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public node_click(){
console.log(1);
}
/**
* 单选选择值
*
......@@ -769,13 +759,37 @@ ${P.getCtrlCode(childCtrl, 'CONTROL.html').code}
/**
* 单选点击行为
*
* @param {*} node
* @param {*} item
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSimpleSelChange(item:any){
this.$emit('selectchange', [item]);
this.selectedValue = item.srfkey;
}
/**
* 多选点击行为
*
* @param {*} data
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onChecked(data:any){
let { detail } = data;
if (!detail) {
return;
}
let { value } = detail;
this.valueNodes.forEach((item: any, index: number) => {
if (Object.is(item.id, value)) {
if (detail.checked) {
this.selectedNodes.push(this.valueNodes[index]);
} else {
this.selectedNodes.splice(this.selectedNodes.findIndex((i: any) => i.value === item.value), 1)
}
}
});
this.$emit('selectchange', this.selectedNodes);
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册