|
@@ -22,8 +22,7 @@
|
|
|
</div>
|
|
|
<div class="timer">
|
|
|
<div class="imgWrap"
|
|
|
- v-drag
|
|
|
- draggable="true">
|
|
|
+ v-drag>
|
|
|
<img :src="timerImg">
|
|
|
<div v-for="(item,index) in newList"
|
|
|
:key="index+'new'">
|
|
@@ -104,7 +103,6 @@ export default {
|
|
|
this.startTime = getNowDateAndMonday(setDate(date))
|
|
|
this.tableTime = this.startTime;
|
|
|
this.active = 0;
|
|
|
- console.log(this.active)
|
|
|
this.endTime = getNowDateAndSunday(setDate(date))
|
|
|
},
|
|
|
getCalendatList () {
|
|
@@ -165,8 +163,6 @@ export default {
|
|
|
},
|
|
|
setWeekDotList (item, index) {
|
|
|
this.active = index;
|
|
|
- console.log(item)
|
|
|
- console.log(item.date)
|
|
|
this.tableTime = item.date
|
|
|
},
|
|
|
changeWeek (val) {
|
|
@@ -174,30 +170,26 @@ export default {
|
|
|
this.getCalendatList()
|
|
|
this.setWeekList()
|
|
|
},
|
|
|
- scrollImg (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
directives: {
|
|
|
drag (el) {
|
|
|
let oDiv = el; //当前元素
|
|
|
let self = this; //上下文
|
|
|
//禁止选择网页上的文字
|
|
|
- document.onselectstart = function () {
|
|
|
- return false;
|
|
|
- };
|
|
|
+ // document.onselectstart = function () {
|
|
|
+ // return false;
|
|
|
+ // };
|
|
|
oDiv.onmousedown = function (e) {
|
|
|
//鼠标按下,计算当前元素距离可视区的距离
|
|
|
let disX = e.clientX - oDiv.offsetLeft;
|
|
|
let disY = e.clientY - oDiv.offsetTop;
|
|
|
let wrapW = document.querySelector('.timer').offsetWidth
|
|
|
let imgW = document.querySelector('.imgWrap').offsetWidth
|
|
|
- console.log(imgW - wrapW)
|
|
|
document.onmousemove = function (e) {
|
|
|
//通过事件委托,计算移动的距离
|
|
|
let l = e.clientX - disX;
|
|
|
let t = e.clientY - disY;
|
|
|
- // console.log(oDiv.offsetWidth, l, oDiv.offsetLeft)
|
|
|
//移动当前元素
|
|
|
|
|
|
if (l > 0) {
|