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

日历部件——日程长按事件

上级 f8fafb47
......@@ -91,11 +91,14 @@
<van-steps active-icon="passed" inactive-icon="passed" direction="vertical">
<van-step v-for="(i,index) in evendata[activeItem]" :key="index">
<p>{{i.time}}</p>
<div v-for="item in i.evens" :key="item.id" class="even-box">
<#-- BENGIN: 事件内容项 -->
<#ibizinclude>./EVENTS_CONTENT.vue.ftl</#ibizinclude>
<#-- END: 事件内容项 -->
<ion-icon @click="remove([item])" class="event-delete" name="close-outline"></ion-icon>
<div class="touch" v-for="item in i.evens" :key="item.id+'1'" @touchstart="evenStart" @touchend="evenEnd">
<ion-checkbox v-if="showcheack" class="touch-checkbox" @click.stop="checkboxSelect(item)"></ion-checkbox>
<div :key="item.id" class="even-box">
<#-- BENGIN: 事件内容项 -->
<#ibizinclude>./EVENTS_CONTENT.vue.ftl</#ibizinclude>
<#-- END: 事件内容项 -->
<ion-icon @click="remove([item])" class="event-delete" name="close-outline"></ion-icon>
</div>
</div>
</van-step>
</van-steps>
......
......@@ -658,6 +658,66 @@ import moment from 'moment';
this.formatData(new Date(year + '/' + month + '/' + (week*7 - weekline + 1)));
}
}
/**
* 选中数组
*
* @param {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public selectedArray:Array<any> = [];
/**
* 是否展示多选
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public showcheack = false;
/**
* 选中或取消事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
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.codeName}')}
*/
public loop :any;
/**
* 开始长按
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public touchStart () {
      clearTimeout(this.loop); //再次清空定时器,防止重复注册定时器
      this.loop = setTimeout(() => {
this.showcheack = ! this.showcheack;
      }, 1000);
    }
/**
* 结束长按
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public touchEnd () {
clearTimeout(this.loop); //清空定时器,防止重复注册定时器
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -139,4 +139,12 @@
.van-step__icon--active, .van-step__title--active {
color: #969799;
}
.touch{
display:flex ;
align-items: center;
.touch-checkbox{
min-width: 25px;
margin-right: 10px;
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册