zydx-plus 1.35.588 → 1.35.590
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<teleport to="body">
|
|
3
|
-
<div class="cale" :style="{top: y + 'px', left: x + 'px'}">
|
|
3
|
+
<div ref="caleRef" v-if="isOpen" class="cale" :style="{top: y + 'px', left: x + 'px'}">
|
|
4
4
|
<div class="cale-cont">
|
|
5
5
|
<div class='calendar-Time-header under_line'>
|
|
6
6
|
<span class='calendar-lastY' @click="subYear">《</span>
|
|
@@ -206,17 +206,14 @@ export default {
|
|
|
206
206
|
domeElement: {
|
|
207
207
|
type: Object,
|
|
208
208
|
default: null
|
|
209
|
+
},
|
|
210
|
+
open: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: false
|
|
209
213
|
}
|
|
210
214
|
},
|
|
211
215
|
created() {
|
|
212
216
|
this.render();
|
|
213
|
-
if(this.domeElement) {
|
|
214
|
-
let el = this.domeElement.$el
|
|
215
|
-
if(!el) el = this.domeElement
|
|
216
|
-
const dome = el.getBoundingClientRect()
|
|
217
|
-
this.x = dome.left
|
|
218
|
-
this.y = dome.top + dome.height
|
|
219
|
-
}
|
|
220
217
|
},
|
|
221
218
|
data() {
|
|
222
219
|
return {
|
|
@@ -242,12 +239,32 @@ export default {
|
|
|
242
239
|
minute: '00', // 选择的分钟
|
|
243
240
|
dayChange: undefined, // 选择的日期
|
|
244
241
|
x: 22,
|
|
245
|
-
y: 0
|
|
242
|
+
y: 0,
|
|
243
|
+
isOpen: false
|
|
246
244
|
};
|
|
247
245
|
},
|
|
248
246
|
methods: {
|
|
247
|
+
init() {
|
|
248
|
+
this.$nextTick(() => {
|
|
249
|
+
if(this.domeElement) {
|
|
250
|
+
let el = this.domeElement.$el
|
|
251
|
+
if(!el) el = this.domeElement
|
|
252
|
+
const height = document.documentElement.clientHeight || document.body.clientHeight;
|
|
253
|
+
const dome = el.getBoundingClientRect()
|
|
254
|
+
const hei = this.$refs.caleRef.getBoundingClientRect()
|
|
255
|
+
this.x = dome.left
|
|
256
|
+
if((dome.top + hei.height - height) > 0) {
|
|
257
|
+
this.y = dome.top - hei.height
|
|
258
|
+
}else {
|
|
259
|
+
this.y = dome.top + dome.height
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
})
|
|
263
|
+
},
|
|
249
264
|
cancel() {
|
|
265
|
+
this.isOpen = false
|
|
250
266
|
this.$emit('cancel')
|
|
267
|
+
this.$emit('update:open', this.isOpen)
|
|
251
268
|
},
|
|
252
269
|
confirm() {
|
|
253
270
|
let date = {start: this.dayChange}
|
|
@@ -661,20 +678,35 @@ export default {
|
|
|
661
678
|
|
|
662
679
|
if (type == 1) { //上限值
|
|
663
680
|
let _dateEnd = that.toDateByStr1(that.dateEnd);
|
|
664
|
-
|
|
665
|
-
return true;
|
|
666
|
-
} else
|
|
667
|
-
return false;
|
|
681
|
+
return firstD <= _dateEnd && _dateEnd <= lastD;
|
|
668
682
|
} else { //下限值
|
|
669
683
|
let _dateStart = that.toDateByStr1(that.dateStart);
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
684
|
+
return firstD <= _dateStart && _dateStart <= lastD;
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
handler() {
|
|
688
|
+
if (this.isOpen) {
|
|
689
|
+
setTimeout(() => {
|
|
690
|
+
this.isOpen = false
|
|
691
|
+
this.$emit('update:open', this.isOpen)
|
|
692
|
+
}, 100)
|
|
674
693
|
}
|
|
675
694
|
},
|
|
676
695
|
},
|
|
677
696
|
watch: {
|
|
697
|
+
open: {
|
|
698
|
+
handler: function (v) {
|
|
699
|
+
this.isOpen = v
|
|
700
|
+
if(v) {
|
|
701
|
+
this.init()
|
|
702
|
+
window.addEventListener('scroll', this.handler)
|
|
703
|
+
}else {
|
|
704
|
+
window.removeEventListener('scroll', this.handler)
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
immediate: true,
|
|
708
|
+
deep: true
|
|
709
|
+
},
|
|
678
710
|
currentTime: function (val, oldVal) { //时间改变
|
|
679
711
|
let dateNew = this.toDateByStr1(val);
|
|
680
712
|
if (dateNew.getFullYear() === this.year && (dateNew.getMonth() + 1) === this.month) {
|
|
@@ -237,6 +237,7 @@ export default {
|
|
|
237
237
|
this.reducePop()
|
|
238
238
|
this.state = false
|
|
239
239
|
this.$emit('enlarge', this.state)
|
|
240
|
+
this.draggableState.draggable({enabled: true})
|
|
240
241
|
}
|
|
241
242
|
},
|
|
242
243
|
// 全屏
|
|
@@ -427,7 +428,7 @@ export default {
|
|
|
427
428
|
left: this.x,
|
|
428
429
|
top: this.y
|
|
429
430
|
})
|
|
430
|
-
},
|
|
431
|
+
},200)
|
|
431
432
|
}
|
|
432
433
|
this.$emit('enlarge', this.state)
|
|
433
434
|
},
|
|
@@ -244,6 +244,7 @@ export default {
|
|
|
244
244
|
this.reducePop()
|
|
245
245
|
this.state = false
|
|
246
246
|
this.$emit('enlarge', this.state)
|
|
247
|
+
this.draggableState.draggable({enabled: true})
|
|
247
248
|
}
|
|
248
249
|
},
|
|
249
250
|
// 全屏
|
|
@@ -299,13 +300,13 @@ export default {
|
|
|
299
300
|
}
|
|
300
301
|
})
|
|
301
302
|
sessionStorage.setItem('pop', JSON.stringify(pop))
|
|
303
|
+
|
|
302
304
|
},
|
|
303
305
|
disconnect() {
|
|
304
306
|
this.$emit('dragStatus')
|
|
305
307
|
},
|
|
306
308
|
init() {
|
|
307
309
|
let that = this
|
|
308
|
-
console.log(window.devicePixelRatio)
|
|
309
310
|
if(this.fixedStart) {
|
|
310
311
|
if(!this.isInitShowBottomRight) {
|
|
311
312
|
const wid = document.getElementById('app').offsetWidth
|
|
@@ -437,7 +438,7 @@ export default {
|
|
|
437
438
|
left: this.x,
|
|
438
439
|
top: this.y
|
|
439
440
|
})
|
|
440
|
-
},
|
|
441
|
+
},200)
|
|
441
442
|
}
|
|
442
443
|
this.$emit('enlarge', this.state)
|
|
443
444
|
},
|
|
@@ -592,7 +593,6 @@ export default {
|
|
|
592
593
|
opacity: 1;
|
|
593
594
|
}
|
|
594
595
|
}
|
|
595
|
-
|
|
596
596
|
.drag-pop {
|
|
597
597
|
position: fixed;
|
|
598
598
|
/* top: 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<teleport to="body">
|
|
3
|
-
<div class="year" :style="{top: y + 'px', left: x + 'px'}">
|
|
3
|
+
<div ref="yearRef" v-if="isOpen" class="year" :style="{top: y + 'px', left: x + 'px'}">
|
|
4
4
|
<div class="year-cont">
|
|
5
5
|
<div class='calendar-Time-header under_line'>
|
|
6
6
|
<span class='calendar-lastMonth' @click="last">{{ lastText }}</span>
|
|
@@ -43,6 +43,10 @@ export default {
|
|
|
43
43
|
domeElement: {
|
|
44
44
|
type: Object,
|
|
45
45
|
default: null
|
|
46
|
+
},
|
|
47
|
+
open: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
data() {
|
|
@@ -53,20 +57,55 @@ export default {
|
|
|
53
57
|
max: 0,
|
|
54
58
|
timeObj: 0,
|
|
55
59
|
x: 0,
|
|
56
|
-
y: 0
|
|
60
|
+
y: 0,
|
|
61
|
+
isOpen: false
|
|
57
62
|
}
|
|
58
63
|
},
|
|
59
64
|
created() {
|
|
60
65
|
this.render();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
},
|
|
67
|
+
watch: {
|
|
68
|
+
open: {
|
|
69
|
+
handler: function (v) {
|
|
70
|
+
this.isOpen = v
|
|
71
|
+
if(v) {
|
|
72
|
+
this.init()
|
|
73
|
+
window.addEventListener('scroll', this.handler)
|
|
74
|
+
}else {
|
|
75
|
+
window.removeEventListener('scroll', this.handler)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
immediate: true,
|
|
79
|
+
deep: true
|
|
67
80
|
}
|
|
68
81
|
},
|
|
69
82
|
methods: {
|
|
83
|
+
init() {
|
|
84
|
+
this.$nextTick(() => {
|
|
85
|
+
if(this.domeElement) {
|
|
86
|
+
let el = this.domeElement.$el
|
|
87
|
+
if(!el) el = this.domeElement
|
|
88
|
+
const height = document.documentElement.clientHeight || document.body.clientHeight;
|
|
89
|
+
const dome = el.getBoundingClientRect()
|
|
90
|
+
const hei = this.$refs.yearRef.getBoundingClientRect()
|
|
91
|
+
this.x = dome.left
|
|
92
|
+
if((dome.top + hei.height - height) > 0) {
|
|
93
|
+
this.y = dome.top - hei.height
|
|
94
|
+
}else {
|
|
95
|
+
console.log(dome)
|
|
96
|
+
this.y = dome.top + dome.height
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
handler() {
|
|
102
|
+
if (this.isOpen) {
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
this.isOpen = false
|
|
105
|
+
this.$emit('update:open', this.isOpen)
|
|
106
|
+
}, 100)
|
|
107
|
+
}
|
|
108
|
+
},
|
|
70
109
|
render() {
|
|
71
110
|
this.timeObj = new Date().getFullYear();
|
|
72
111
|
this.min = this.timeObj - 5
|
|
@@ -107,9 +146,7 @@ export default {
|
|
|
107
146
|
|
|
108
147
|
<style scoped>
|
|
109
148
|
.year{
|
|
110
|
-
position:
|
|
111
|
-
top: 22px;
|
|
112
|
-
right: 0;
|
|
149
|
+
position: fixed;
|
|
113
150
|
width: 300px;
|
|
114
151
|
z-index: 100;
|
|
115
152
|
background-color: #fff;
|