Browse Source

fix(nc-gui): included record to card for debugging

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
5562d6171f
  1. 3
      packages/nc-gui/components/smartsheet/calendar/DayView.vue
  2. 1
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  3. 1
      packages/nc-gui/components/smartsheet/calendar/RecordCard.vue
  4. 7
      packages/nc-gui/components/smartsheet/calendar/WeekView.vue

3
packages/nc-gui/components/smartsheet/calendar/DayView.vue

@ -157,10 +157,10 @@ const dropEvent = (event: DragEvent) => {
> >
<LazySmartsheetRow v-for="(record, rowIndex) in recordsAcrossAllRange" :key="rowIndex" :row="record"> <LazySmartsheetRow v-for="(record, rowIndex) in recordsAcrossAllRange" :key="rowIndex" :row="record">
<LazySmartsheetCalendarRecordCard <LazySmartsheetCalendarRecordCard
:key="rowIndex"
:date="record.row[record.rowMeta.range.fk_from_col.title]" :date="record.row[record.rowMeta.range.fk_from_col.title]"
:name="record.row[displayField.title]" :name="record.row[displayField.title]"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record"
color="blue" color="blue"
size="small" size="small"
@click="emit('expand-record', record)" @click="emit('expand-record', record)"
@ -218,6 +218,7 @@ const dropEvent = (event: DragEvent) => {
:date="dayjs(record.row[record.rowMeta.range.fk_from_col.title]).format('H:mm')" :date="dayjs(record.row[record.rowMeta.range.fk_from_col.title]).format('H:mm')"
:name="record.row[displayField.title]" :name="record.row[displayField.title]"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record"
class="!h-full" class="!h-full"
color="blue" color="blue"
size="small" size="small"

1
packages/nc-gui/components/smartsheet/calendar/MonthView.vue

@ -367,6 +367,7 @@ const isDateSelected = (date: Date) => {
" "
:name="record.row[displayField.title]" :name="record.row[displayField.title]"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record"
@click="emit('expand-record', record)" @click="emit('expand-record', record)"
/> />
</LazySmartsheetRow> </LazySmartsheetRow>

1
packages/nc-gui/components/smartsheet/calendar/RecordCard.vue

@ -1,5 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
interface Props { interface Props {
record: Record<string, string>
name: string name: string
date?: string date?: string
color?: string color?: string

7
packages/nc-gui/components/smartsheet/calendar/WeekView.vue

@ -67,7 +67,11 @@ const calendarData = computed(() => {
const fromCol = range.fk_from_col const fromCol = range.fk_from_col
const toCol = range.fk_to_col const toCol = range.fk_to_col
if (fromCol && toCol) { if (fromCol && toCol) {
for (const record of formattedData.value) { for (const record of [...formattedData.value].filter((r) => {
const startDate = dayjs(r.row[fromCol.title])
const endDate = dayjs(r.row[toCol.title])
return !endDate.isBefore(startDate)
})) {
let startDate = dayjs(record.row[fromCol.title]) let startDate = dayjs(record.row[fromCol.title])
const ogStartDate = startDate.clone() const ogStartDate = startDate.clone()
const endDate = dayjs(record.row[toCol.title]) const endDate = dayjs(record.row[toCol.title])
@ -213,6 +217,7 @@ const calendarData = computed(() => {
" "
:name="record.row[displayField.title]" :name="record.row[displayField.title]"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record"
color="blue" color="blue"
@click="emits('expand-record', record)" @click="emits('expand-record', record)"
/> />

Loading…
Cancel
Save