|
|
@ -112,7 +112,7 @@ const recordsToDisplay = computed<{ |
|
|
|
const perHeight = gridContainerHeight.value / dates.value.length |
|
|
|
const perHeight = gridContainerHeight.value / dates.value.length |
|
|
|
const perRecordHeight = 40 |
|
|
|
const perRecordHeight = 40 |
|
|
|
|
|
|
|
|
|
|
|
const spaceBetweenRecords = 35 |
|
|
|
const spaceBetweenRecords = 30 |
|
|
|
|
|
|
|
|
|
|
|
// This object is used to keep track of the number of records in a day |
|
|
|
// This object is used to keep track of the number of records in a day |
|
|
|
// The key is the date in the format YYYY-MM-DD |
|
|
|
// The key is the date in the format YYYY-MM-DD |
|
|
@ -528,6 +528,7 @@ const stopDrag = (event: MouseEvent) => { |
|
|
|
dragElement.value = null |
|
|
|
dragElement.value = null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dragRecord.value = undefined |
|
|
|
updateRowProperty(newRow, updateProperty, false) |
|
|
|
updateRowProperty(newRow, updateProperty, false) |
|
|
|
focusedDate.value = null |
|
|
|
focusedDate.value = null |
|
|
|
|
|
|
|
|
|
|
@ -550,12 +551,10 @@ const dragStart = (event: MouseEvent, record: Row) => { |
|
|
|
const allRecords = document.querySelectorAll('.draggable-record') |
|
|
|
const allRecords = document.querySelectorAll('.draggable-record') |
|
|
|
allRecords.forEach((el) => { |
|
|
|
allRecords.forEach((el) => { |
|
|
|
if (!el.getAttribute('data-unique-id').includes(record.rowMeta.id!)) { |
|
|
|
if (!el.getAttribute('data-unique-id').includes(record.rowMeta.id!)) { |
|
|
|
// el.style.visibility = 'hidden' |
|
|
|
|
|
|
|
el.style.opacity = '30%' |
|
|
|
el.style.opacity = '30%' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
dragRecord.value = record |
|
|
|
|
|
|
|
// selectedDate.value = null |
|
|
|
// selectedDate.value = null |
|
|
|
|
|
|
|
|
|
|
|
isDragging.value = true |
|
|
|
isDragging.value = true |
|
|
@ -672,7 +671,7 @@ const isDateSelected = (date: dayjs.Dayjs) => { |
|
|
|
'!block': isDateSelected(day), |
|
|
|
'!block': isDateSelected(day), |
|
|
|
'!hidden': !isDateSelected(day), |
|
|
|
'!hidden': !isDateSelected(day), |
|
|
|
}" |
|
|
|
}" |
|
|
|
class="!group-hover:block" |
|
|
|
class="!group-hover:block rounded" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
type="secondary" |
|
|
|
type="secondary" |
|
|
|
> |
|
|
|
> |
|
|
@ -709,8 +708,8 @@ const isDateSelected = (date: dayjs.Dayjs) => { |
|
|
|
'!block': isDateSelected(day), |
|
|
|
'!block': isDateSelected(day), |
|
|
|
'!hidden': !isDateSelected(day), |
|
|
|
'!hidden': !isDateSelected(day), |
|
|
|
}" |
|
|
|
}" |
|
|
|
class="!group-hover:block" |
|
|
|
class="!group-hover:block !w-6 !h-6 !rounded" |
|
|
|
size="small" |
|
|
|
size="xsmall" |
|
|
|
type="secondary" |
|
|
|
type="secondary" |
|
|
|
@click=" |
|
|
|
@click=" |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -723,13 +722,13 @@ const isDateSelected = (date: dayjs.Dayjs) => { |
|
|
|
} |
|
|
|
} |
|
|
|
" |
|
|
|
" |
|
|
|
> |
|
|
|
> |
|
|
|
<component :is="iconMap.plus" class="h-4 w-4" /> |
|
|
|
<component :is="iconMap.plus" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<span |
|
|
|
<span |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'bg-brand-50 text-brand-500': day.isSame(dayjs(), 'date'), |
|
|
|
'bg-brand-50 text-brand-500': day.isSame(dayjs(), 'date'), |
|
|
|
}" |
|
|
|
}" |
|
|
|
class="px-1.5 rounded-lg py-1 my-1" |
|
|
|
class="px-1.3 py-1 text-xs rounded-lg" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ day.format('DD') }} |
|
|
|
{{ day.format('DD') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -761,10 +760,6 @@ const isDateSelected = (date: dayjs.Dayjs) => { |
|
|
|
:style="{ |
|
|
|
:style="{ |
|
|
|
...record.rowMeta.style, |
|
|
|
...record.rowMeta.style, |
|
|
|
zIndex: record.rowMeta.id === draggingId ? 100 : 0, |
|
|
|
zIndex: record.rowMeta.id === draggingId ? 100 : 0, |
|
|
|
boxShadow: |
|
|
|
|
|
|
|
record.rowMeta.id === draggingId |
|
|
|
|
|
|
|
? '0px 8px 8px -4px rgba(0, 0, 0, 0.04), 0px 20px 24px -4px rgba(0, 0, 0, 0.10)' |
|
|
|
|
|
|
|
: 'none', |
|
|
|
|
|
|
|
}" |
|
|
|
}" |
|
|
|
class="absolute group draggable-record cursor-pointer pointer-events-auto" |
|
|
|
class="absolute group draggable-record cursor-pointer pointer-events-auto" |
|
|
|
@mouseleave="hoverRecord = null" |
|
|
|
@mouseleave="hoverRecord = null" |
|
|
@ -773,17 +768,11 @@ const isDateSelected = (date: dayjs.Dayjs) => { |
|
|
|
> |
|
|
|
> |
|
|
|
<LazySmartsheetRow :row="record"> |
|
|
|
<LazySmartsheetRow :row="record"> |
|
|
|
<LazySmartsheetCalendarRecordCard |
|
|
|
<LazySmartsheetCalendarRecordCard |
|
|
|
:hover="hoverRecord === record.rowMeta.id" |
|
|
|
:hover="hoverRecord === record.rowMeta.id || record.rowMeta.id === draggingId" |
|
|
|
:position="record.rowMeta.position" |
|
|
|
:position="record.rowMeta.position" |
|
|
|
:record="record" |
|
|
|
:record="record" |
|
|
|
:resize="!!record.rowMeta.range?.fk_to_col && isUIAllowed('dataEdit')" |
|
|
|
:resize="!!record.rowMeta.range?.fk_to_col && isUIAllowed('dataEdit')" |
|
|
|
:selected=" |
|
|
|
:selected="dragRecord?.rowMeta?.id === record.rowMeta.id || resizeRecord?.rowMeta?.id === record.rowMeta.id" |
|
|
|
dragRecord |
|
|
|
|
|
|
|
? dragRecord.rowMeta.id === record.rowMeta.id |
|
|
|
|
|
|
|
: resizeRecord |
|
|
|
|
|
|
|
? resizeRecord.rowMeta.id === record.rowMeta.id |
|
|
|
|
|
|
|
: false |
|
|
|
|
|
|
|
" |
|
|
|
|
|
|
|
@resize-start="onResizeStart" |
|
|
|
@resize-start="onResizeStart" |
|
|
|
@dblclick.stop="emit('expandRecord', record)" |
|
|
|
@dblclick.stop="emit('expandRecord', record)" |
|
|
|
> |
|
|
|
> |
|
|
|