|
|
@ -2,13 +2,9 @@ |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import { UITypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { UITypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { type Row, computed, ref } from '#imports' |
|
|
|
import { type Row, computed, ref } from '#imports' |
|
|
|
import { isRowEmpty } from '~/utils' |
|
|
|
import { generateRandomNumber, isRowEmpty } from '~/utils' |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['expandRecord', 'new-record']) |
|
|
|
const emit = defineEmits(['expandRecord', 'new-record']) |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
|
|
|
|
const container = ref() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
|
selectedDate, |
|
|
|
selectedDate, |
|
|
@ -22,6 +18,11 @@ const { |
|
|
|
showSideMenu, |
|
|
|
showSideMenu, |
|
|
|
} = useCalendarViewStoreOrThrow() |
|
|
|
} = useCalendarViewStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const container = ref<null | HTMLElement>(null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const hours = computed(() => { |
|
|
|
const hours = computed(() => { |
|
|
|
const hours: Array<dayjs.Dayjs> = [] |
|
|
|
const hours: Array<dayjs.Dayjs> = [] |
|
|
|
const _selectedDate = dayjs(selectedDate.value) |
|
|
|
const _selectedDate = dayjs(selectedDate.value) |
|
|
@ -32,12 +33,6 @@ const hours = computed(() => { |
|
|
|
return hours |
|
|
|
return hours |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
function getRandomNumbers() { |
|
|
|
|
|
|
|
const typedArray = new Uint8Array(10) |
|
|
|
|
|
|
|
const randomValues = window.crypto.getRandomValues(typedArray) |
|
|
|
|
|
|
|
return randomValues.join('') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const recordsAcrossAllRange = computed<{ |
|
|
|
const recordsAcrossAllRange = computed<{ |
|
|
|
record: Row[] |
|
|
|
record: Row[] |
|
|
|
count: { |
|
|
|
count: { |
|
|
@ -85,7 +80,7 @@ const recordsAcrossAllRange = computed<{ |
|
|
|
|
|
|
|
|
|
|
|
if (fromCol && endCol) { |
|
|
|
if (fromCol && endCol) { |
|
|
|
for (const record of sortedFormattedData) { |
|
|
|
for (const record of sortedFormattedData) { |
|
|
|
const id = getRandomNumbers() |
|
|
|
const id = generateRandomNumber() |
|
|
|
let startDate = dayjs(record.row[fromCol.title!]) |
|
|
|
let startDate = dayjs(record.row[fromCol.title!]) |
|
|
|
let endDate = dayjs(record.row[endCol.title!]) |
|
|
|
let endDate = dayjs(record.row[endCol.title!]) |
|
|
|
|
|
|
|
|
|
|
@ -164,7 +159,7 @@ const recordsAcrossAllRange = computed<{ |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (fromCol) { |
|
|
|
} else if (fromCol) { |
|
|
|
for (const record of sortedFormattedData) { |
|
|
|
for (const record of sortedFormattedData) { |
|
|
|
const id = getRandomNumbers() |
|
|
|
const id = generateRandomNumber() |
|
|
|
|
|
|
|
|
|
|
|
const startDate = dayjs(record.row[fromCol.title!]) |
|
|
|
const startDate = dayjs(record.row[fromCol.title!]) |
|
|
|
const endDate = dayjs(record.row[fromCol.title!]).add(15, 'minutes') |
|
|
|
const endDate = dayjs(record.row[fromCol.title!]).add(15, 'minutes') |
|
|
@ -728,9 +723,7 @@ const viewMore = (hour: dayjs.Dayjs) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-else ref="container" class="w-full h-full flex text-md font-bold text-gray-500 items-center justify-center"> |
|
|
|
<div v-else class="w-full h-full flex text-md font-bold text-gray-500 items-center justify-center">No records in this day</div> |
|
|
|
No records in this day |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|