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

新增长按事件

上级 8e06ccb0
......@@ -18,6 +18,7 @@
<#-- END:输出项布局面板 -->
<#else>
<ion-item>
<ion-checkbox v-show="showcheack" @click.stop="checkboxSelect(item)"></ion-checkbox>
<#--实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
......@@ -46,6 +47,7 @@
<#-- END:输出项布局面板 -->
<#else>
<ion-item>
<ion-checkbox v-show="showcheack" @click.stop="checkboxSelect(item)"></ion-checkbox>
<#--实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
......
......@@ -674,6 +674,57 @@
this.goPage(item);
}
/**
* 是否展示多选
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public showcheack = false;
/**
* 选中或取消事件
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public checkboxSelect(item:any){
let count = this.selectedArray.findIndex((i) => {
return i.mobile_entity1id == item.mobile_entity1id;
});
if(count == -1){
this.selectedArray.push(item);
}else{
this.selectedArray.splice(count,1);
}
}
/**
* 长按定时器
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public loop :any;
/**
* 开始长按
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public start () {
      clearTimeout(this.loop); //再次清空定时器,防止重复注册定时器
      this.loop = setTimeout(() => {
this.showcheack = ! this.showcheack;
      }, 1000);
    }
/**
* 结束长按
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public end () {
clearTimeout(this.loop); //清空定时器,防止重复注册定时器
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册