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

全选事件

上级 04ff9989
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<ion-list class="items"> <ion-list class="items">
<template v-if="(viewType == 'DEMOBMDVIEW9') && controlStyle != 'SWIPERVIEW' "> <template v-if="(viewType == 'DEMOBMDVIEW9') && controlStyle != 'SWIPERVIEW' ">
<div class="selectall"> <div class="selectall">
<ion-checkbox v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox> <ion-checkbox :checked="selectAllIschecked" v-show="showCheack" @ionChange="checkboxAll"></ion-checkbox>
<ion-label class="selectal-label" v-show="showCheack">全选</ion-label> <ion-label class="selectal-label" v-show="showCheack">全选</ion-label>
</div> </div>
<ion-item-sliding v-for="(item, index) in items" @click="goPage(item)" :key="index" class="app-mob-mdctrl-item" @touchstart="start" @touchend="end"> <ion-item-sliding v-for="(item, index) in items" @click="goPage(item)" :key="index" class="app-mob-mdctrl-item" @touchstart="start" @touchend="end">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<#-- END:输出项布局面板 --> <#-- END:输出项布局面板 -->
<#else> <#else>
<ion-item> <ion-item>
<ion-checkbox v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox> <ion-checkbox checked="item.checked" v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox>
<#--实体列表项集合--> <#--实体列表项集合-->
<#if ctrl.getPSDEListItems()??> <#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 --> <!-- 列表视图样式 -->
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<#--多数据视图||多数据视图(部件视图)--> <#--多数据视图||多数据视图(部件视图)-->
<template v-if="(viewType == 'DEMOBMDVIEW') && controlStyle != 'SWIPERVIEW' "> <template v-if="(viewType == 'DEMOBMDVIEW') && controlStyle != 'SWIPERVIEW' ">
<div class="selectall"> <div class="selectall">
<ion-checkbox v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox> <ion-checkbox :checked="selectAllIschecked" v-show="showCheack" @ionChange="checkboxAll"></ion-checkbox>
<ion-label class="selectal-label" v-show="showCheack">全选</ion-label> <ion-label class="selectal-label" v-show="showCheack">全选</ion-label>
</div> </div>
<ion-item-sliding v-for="(item, index) in items" @click="goPage(item)" :key="index" class="app-mob-mdctrl-item" @touchstart="start" @touchend="end"> <ion-item-sliding v-for="(item, index) in items" @click="goPage(item)" :key="index" class="app-mob-mdctrl-item" @touchstart="start" @touchend="end">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<#-- END:输出项布局面板 --> <#-- END:输出项布局面板 -->
<#else> <#else>
<ion-item> <ion-item>
<ion-checkbox v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox> <ion-checkbox checked="item.checked" v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox>
<#--实体列表项集合--> <#--实体列表项集合-->
<#if ctrl.getPSDEListItems()??> <#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 --> <!-- 列表视图样式 -->
......
...@@ -691,11 +691,18 @@ ...@@ -691,11 +691,18 @@
let count = this.selectedArray.findIndex((i) => { let count = this.selectedArray.findIndex((i) => {
return i.${appde.getKeyPSAppDEField().getCodeName()?lower_case} == item.${appde.getKeyPSAppDEField().getCodeName()?lower_case}; return i.${appde.getKeyPSAppDEField().getCodeName()?lower_case} == item.${appde.getKeyPSAppDEField().getCodeName()?lower_case};
}); });
let re = false;
if(count == -1){ if(count == -1){
re = true;
this.selectedArray.push(item); this.selectedArray.push(item);
}else{ }else{
this.selectedArray.splice(count,1); this.selectedArray.splice(count,1);
} }
this.items.forEach((_item:any,index:number)=>{
if(_item.mobile_entity1id == item.mobile_entity1id){
this.items[index].checked = re;
}
});
} }
/** /**
...@@ -726,6 +733,32 @@ ...@@ -726,6 +733,32 @@
clearTimeout(this.loop); //清空定时器,防止重复注册定时器 clearTimeout(this.loop); //清空定时器,防止重复注册定时器
} }
/**
* 全选事件
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public checkboxAll(item:any) {
this.selectAllIschecked = item.detail.checked;
if(this.selectAllIschecked){
this.selectedArray = JSON.parse(JSON.stringify(this.items));
}else{
this.selectedArray = [];
}
this.items.forEach((item:any,index:number)=>{
this.items[index].checked = this.selectAllIschecked
});
this.$forceUpdate();
}
/**
* 全选按钮选中状态
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public selectAllIschecked = false;
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册