sadais-piui 1.2.7-beta161 → 1.2.7-beta163
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.
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
class="date-item"
|
|
16
16
|
style="cursor: pointer;"
|
|
17
17
|
:class="[
|
|
18
|
-
{
|
|
18
|
+
{
|
|
19
|
+
'pi-calendar-day-item-disabled':
|
|
20
|
+
day.disabled ||
|
|
21
|
+
day.type === 'disabled-prev' ||
|
|
22
|
+
day.type === 'disabled-next'
|
|
23
|
+
},
|
|
19
24
|
{ range: day.range },
|
|
20
25
|
{ marked: day.marked }
|
|
21
26
|
]"
|
|
@@ -234,7 +239,7 @@ export default {
|
|
|
234
239
|
day = {
|
|
235
240
|
...day,
|
|
236
241
|
...this.$pi.date.parseDate(this.firstDay[i - 1]),
|
|
237
|
-
type: this.weekView ? '' : 'disabled'
|
|
242
|
+
type: this.weekView ? '' : 'disabled-prev'
|
|
238
243
|
}
|
|
239
244
|
} else if (i > monthDays + firstDayCount) {
|
|
240
245
|
// 下月数据
|
|
@@ -243,7 +248,7 @@ export default {
|
|
|
243
248
|
...this.$pi.date.parseDate(
|
|
244
249
|
new Date(nextMonthFirstDay.setDate(i - monthDays - firstDayCount))
|
|
245
250
|
),
|
|
246
|
-
type: this.weekView ? '' : 'disabled'
|
|
251
|
+
type: this.weekView ? '' : 'disabled-next'
|
|
247
252
|
}
|
|
248
253
|
} else {
|
|
249
254
|
// 当月数据
|
|
@@ -360,7 +365,24 @@ export default {
|
|
|
360
365
|
this.$emit('change', value)
|
|
361
366
|
},
|
|
362
367
|
handleSelectDate(date) {
|
|
363
|
-
if (date.disabled)
|
|
368
|
+
if (date.disabled) {
|
|
369
|
+
if (/disabled/.test(date.type)) {
|
|
370
|
+
if (date.type === 'disabled-prev') {
|
|
371
|
+
this.$emit('change-prev-month')
|
|
372
|
+
} else if (date.type === 'disabled-next') {
|
|
373
|
+
this.$emit('change-next-month')
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return
|
|
377
|
+
}
|
|
378
|
+
if (/disabled/.test(date.type)) {
|
|
379
|
+
if (date.type === 'disabled-prev') {
|
|
380
|
+
this.$emit('change-prev-month')
|
|
381
|
+
} else if (date.type === 'disabled-next') {
|
|
382
|
+
this.$emit('change-next-month')
|
|
383
|
+
}
|
|
384
|
+
return
|
|
385
|
+
}
|
|
364
386
|
if (this.type === 'date') {
|
|
365
387
|
// 单选方式
|
|
366
388
|
this.handleChange(date)
|
|
@@ -384,6 +406,9 @@ export default {
|
|
|
384
406
|
</script>
|
|
385
407
|
|
|
386
408
|
<style lang="scss" scoped>
|
|
409
|
+
.pi-calendar-day-item-disabled {
|
|
410
|
+
opacity: $pi-disabled-opacity;
|
|
411
|
+
}
|
|
387
412
|
.date-item {
|
|
388
413
|
position: relative;
|
|
389
414
|
z-index: 2;
|