Browse Source

fix(nc-gui): review changes

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
becb3806fe
  1. 9
      packages/nc-gui/components/nc/DateWeekSelector.vue
  2. 14
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  3. 4
      packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
  4. 2
      packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vue

9
packages/nc-gui/components/nc/DateWeekSelector.vue

@ -164,11 +164,18 @@ const paginate = (action: 'next' | 'prev') => {
'text-gray-400': !isDateInCurrentMonth(date), 'text-gray-400': !isDateInCurrentMonth(date),
'nc-selected-week-start': isSameDate(date, dayjs(selectedWeek?.start)), 'nc-selected-week-start': isSameDate(date, dayjs(selectedWeek?.start)),
'nc-selected-week-end': isSameDate(date, dayjs(selectedWeek?.end)), 'nc-selected-week-end': isSameDate(date, dayjs(selectedWeek?.end)),
'rounded-md bg-brand-50 text-brand-500': dayjs(date).isSame(dayjs(), 'date'),
}" }"
class="h-9 w-9 px-1 py-2 relative font-medium flex items-center cursor-pointer justify-center" class="h-9 w-9 px-1 py-2 relative font-medium flex items-center cursor-pointer justify-center"
@click="handleSelectDate(date)" @click="handleSelectDate(date)"
> >
<span v-if="isActiveDate(date)" class="absolute z-2 h-1.5 w-1.5 rounded-full bg-brand-500 top-1 right-1"></span> <span
v-if="isActiveDate(date)"
:class="{
'border-2 border-white !h-2 !w-2': dayjs(date).isSame(dayjs(), 'date'),
}"
class="absolute z-2 h-1.5 w-1.5 rounded-full bg-brand-500 top-1 right-1"
></span>
<span class="z-2"> <span class="z-2">
{{ date.get('date') }} {{ date.get('date') }}
</span> </span>

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

@ -784,7 +784,14 @@ onBeforeUnmount(() => {
> >
<component :is="iconMap.plus" class="h-4 w-4" /> <component :is="iconMap.plus" class="h-4 w-4" />
</NcButton> </NcButton>
<span class="px-1 py-2">{{ dayjs(day).format('DD') }}</span> <span
:class="{
'bg-brand-50 text-brand-500': dayjs(day).isSame(dayjs(), 'date'),
}"
class="px-1.5 rounded-lg py-1 my-1"
>
{{ dayjs(day).format('DD') }}
</span>
</div> </div>
<div v-if="!isUIAllowed('dataEdit')" class="p-3">{{ dayjs(day).format('DD') }}</div> <div v-if="!isUIAllowed('dataEdit')" class="p-3">{{ dayjs(day).format('DD') }}</div>
@ -819,11 +826,6 @@ onBeforeUnmount(() => {
> >
<LazySmartsheetRow :row="record"> <LazySmartsheetRow :row="record">
<LazySmartsheetCalendarRecordCard <LazySmartsheetCalendarRecordCard
:date="
calDataType === UITypes.DateTime
? dayjs(record.row[record.rowMeta.range?.fk_from_col.title]).format('YYYY-MM-DD HH:mm')
: dayjs(record.row[record.rowMeta.range?.fk_from_col.title]).format('YYYY-MM-DD')
"
:name="record.row[displayField!.title!]" :name="record.row[displayField!.title!]"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record" :record="record"

4
packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

@ -309,7 +309,7 @@ const sideBarListScrollHandle = useDebounceFn(async (e: Event) => {
record.rowMeta.range?.fk_from_col record.rowMeta.range?.fk_from_col
? calDataType === UITypes.Date ? calDataType === UITypes.Date
? dayjs(record.row[record.rowMeta.range.fk_from_col.title!]).format('DD MMM') ? dayjs(record.row[record.rowMeta.range.fk_from_col.title!]).format('DD MMM')
: dayjs(record.row[record.rowMeta.range.fk_from_col.title!]).format('DD MMM•HH:MM A') : dayjs(record.row[record.rowMeta.range.fk_from_col.title!]).format('DD MMM•HH:mm A')
: null : null
" "
:invalid=" :invalid="
@ -324,7 +324,7 @@ const sideBarListScrollHandle = useDebounceFn(async (e: Event) => {
record.rowMeta.range!.fk_to_col record.rowMeta.range!.fk_to_col
? calDataType === UITypes.Date ? calDataType === UITypes.Date
? dayjs(record.row[record.rowMeta.range!.fk_to_col.title!]).format('DD MMM') ? dayjs(record.row[record.rowMeta.range!.fk_to_col.title!]).format('DD MMM')
: dayjs(record.row[record.rowMeta.range!.fk_to_col.title!]).format('DD MMM•HH:MM A') : dayjs(record.row[record.rowMeta.range!.fk_to_col.title!]).format('DD MMM•HH:mm A')
: null : null
" "
color="blue" color="blue"

2
packages/nc-gui/components/smartsheet/calendar/SideRecordCard.vue

@ -32,7 +32,7 @@ const props = withDefaults(defineProps<Props>(), {
class="block h-10 w-1 rounded" class="block h-10 w-1 rounded"
></span> ></span>
<div class="flex flex-col gap-1 ml-3"> <div class="flex flex-col gap-1 ml-3">
<span class="text-sm font-bold text-gray-700">{{ name }}</span> <span class="text-sm text-gray-800">{{ name }}</span>
<span v-if="showDate" class="text-xs text-gray-500">{{ fromDate }} {{ toDate ? ` - ${toDate}` : '' }}</span> <span v-if="showDate" class="text-xs text-gray-500">{{ fromDate }} {{ toDate ? ` - ${toDate}` : '' }}</span>
</div> </div>
</div> </div>

Loading…
Cancel
Save