Skip to content

Commit 1bedbcf

Browse files
committed
fix:同时间段任务过多显示异常
1 parent 7284629 commit 1bedbcf

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

packages/theme-saas/src/calendar-view/index.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
@apply w-12;
450450

451451
ul>li{
452-
@apply h-5;
452+
@apply h-6;
453453
@apply text-center;
454454
@apply border-b;
455455
@apply border-b-color-bg-1;
@@ -494,6 +494,12 @@
494494
&.is-even-num{
495495
@apply border-dashed;
496496
}
497+
498+
&.is-scroll-list{
499+
@apply overflow-y-auto;
500+
@apply overflow-x-hidden;
501+
@apply scrollbar-size-0;
502+
}
497503
}
498504

499505
.events-item{
@@ -502,12 +508,12 @@
502508
@apply flex;
503509
@apply items-center;
504510
@apply ~'px-1.5';
505-
@apply absolute;
506511
@apply top-0;
507512
@apply left-0;
508513
@apply z-10;
509514
@apply leading-normal;
510515
@apply rounded-sm;
516+
@apply ~'mb-0.5';
511517

512518
&.theme-blue {
513519
@apply text-color-brand;

packages/theme/src/calendar-view/index.less

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@
446446
margin-left: 21px;
447447

448448
ul > li {
449-
height: 20px;
449+
height: var(--tv-CalendarView-events-list-height);
450+
padding: var(--tv-CalendarView-events-list-padding);
450451
text-align: left;
451452
border-bottom-width: var(--tv-CalendarView-timeline-li-border-width);
452453
border-bottom-style: solid;
@@ -493,6 +494,16 @@
493494
&.is-even-num {
494495
border-bottom-style: dashed;
495496
}
497+
498+
&.is-scroll-list{
499+
overflow-y: auto;
500+
overflow-x: hidden;
501+
502+
&.is-scroll-list::-webkit-scrollbar {
503+
width: 0;
504+
height: 0;
505+
}
506+
}
496507
}
497508

498509
.events-item {
@@ -502,13 +513,13 @@
502513
display: flex;
503514
align-items: center;
504515
padding: 0 6px;
505-
position: absolute;
506516
top: 0;
507517
left: 0;
508518
z-index: 10;
509519
line-height: 1.5;
510520
border-radius: 2px;
511521
color: var(--tv-CalendarView-events-item-text-color);
522+
margin-bottom: 1px;
512523

513524
&.theme-blue {
514525
border-left: 2px solid #1890ff;

packages/vue/src/calendar-view/src/mobile-first.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,13 @@
243243
v-for="(item, i) in state.dayTimes"
244244
:key="date.value + item.time"
245245
class="relative h-5 p-0.5 list-none border-b border-color-bg-2"
246-
:class="[i % 2 === 0 ? 'border-dashed' : 'border-solid']"
246+
:class="{
247+
'border-dashed': i % 2 === 0,
248+
'border-solid': i % 2 !== 0,
249+
'overflow-hidden overflow-y-auto scrollbar-size-0':
250+
getEventByTime(date.value, item.time, state.dayTimes[i + 1] && state.dayTimes[i + 1].time)
251+
.length > 1
252+
}"
247253
>
248254
<div
249255
v-for="(event, idx) of getEventByTime(
@@ -252,12 +258,12 @@
252258
state.dayTimes[i + 1] && state.dayTimes[i + 1].time
253259
)"
254260
:key="idx"
255-
class="w-11/12 flex items-center px-1.5 absolute top-0 left-0 z-10 leading-normal rounded-sm"
261+
class="w-11/12 flex mb-0.5 items-center px-1.5 top-0 left-0 z-10 leading-normal rounded-sm"
256262
:class="[gcls(`theme-${event.theme || blue}`)]"
257263
:style="{
258264
'height': event.height + 'px',
259-
'left': event.left + 'px',
260-
'width': `calc(92% - ${event.left}px)`
265+
266+
'width': `92%`
261267
}"
262268
>
263269
<span>{{ event.title }}</span>

packages/vue/src/calendar-view/src/pc.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="tiny-calendar-view" :style="{ 'height': height ? `${parseInt(height)}px` : 'auto'}">
2+
<div class="tiny-calendar-view" :style="{ 'height': height ? `${parseInt(height)}px` : 'auto' }">
33
<div class="tiny-calendar-view__header">
44
<div>
55
<tiny-button v-if="showBackToday" @click="toToday">{{ t('ui.calendarView.backToday') }}</tiny-button>
@@ -162,7 +162,12 @@
162162
<li
163163
v-for="(item, i) in state.dayTimes"
164164
:key="date.value + item.time"
165-
:class="i % 2 === 0 && 'is-even-num'"
165+
:class="{
166+
'is-even-num': i % 2 === 0,
167+
'is-scroll-list':
168+
getEventByTime(date.value, item.time, state.dayTimes[i + 1] && state.dayTimes[i + 1].time)
169+
.length > 1
170+
}"
166171
>
167172
<div
168173
v-for="(event, idx) of getEventByTime(
@@ -175,8 +180,7 @@
175180
:class="[`theme-${event.theme || 'blue'}`]"
176181
:style="{
177182
'height': event.height + 'px',
178-
'left': event.left + 'px',
179-
'width': `calc(92% - ${event.left}px)`
183+
'width': `92%`
180184
}"
181185
>
182186
<span>{{ event.title }}</span>

0 commit comments

Comments
 (0)