feat: обновил типы в DataTable
Frontend CI / build-and-check (push) Successful in 26s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 13s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 35s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s
Backend CI / build-and-test (pull_request) Successful in 1m6s
Frontend CI / build-and-check (pull_request) Successful in 49s
Frontend Playwright / e2e (pull_request) Successful in 10m53s

This commit is contained in:
2026-05-28 20:00:05 +03:00
parent c93d205e34
commit 7f923cd612
4 changed files with 10 additions and 11 deletions
+5 -6
View File
@@ -1,16 +1,15 @@
<script setup lang="ts"> <script setup lang="ts" generic="TRow extends object">
type Column = { key: string; label: string; align?: 'left' | 'center' | 'right' } type Column = { key: string; label: string; align?: 'left' | 'center' | 'right' }
type DataTableSlotRow = Record<string, any>
defineProps<{ defineProps<{
columns: Column[] columns: Column[]
rows: DataTableSlotRow[] rows: TRow[]
}>() }>()
defineSlots<Record<string, (props: { row: DataTableSlotRow; value: any }) => unknown>>() defineSlots<Record<string, (props: { row: TRow; value: unknown }) => unknown>>()
function getCell(row: DataTableSlotRow, key: string): any { function getCell(row: TRow, key: string): unknown {
return row[key] return (row as Record<string, unknown>)[key]
} }
</script> </script>
@@ -162,7 +162,7 @@ const tabConfig: Record<TabKey, TabConfig> = {
}, },
} }
const current = computed(() => { const current = computed<TabConfig>(() => {
const config = tabConfig[activeTab.value] const config = tabConfig[activeTab.value]
if (activeTab.value === 'lectures') { if (activeTab.value === 'lectures') {
return { return {
@@ -297,8 +297,8 @@ onMounted(() => {
</div> </div>
</div> </div>
<DataTable :columns="columns" :rows="rows"> <DataTable :columns="columns" :rows="rows">
<template #text="{ value }"> <template #text="{ row }">
<span class="review-text" :title="value">{{ value }}</span> <span class="review-text" :title="row.text">{{ row.text }}</span>
</template> </template>
<template #analysis="{ row }"> <template #analysis="{ row }">
<div class="analysis-cell"> <div class="analysis-cell">
@@ -51,8 +51,8 @@ watch(() => auth.user?.id, fetchTeacherLectures)
subtitle="Backend не вернул лекции для текущего преподавателя." subtitle="Backend не вернул лекции для текущего преподавателя."
/> />
<DataTable :columns="columns" :rows="rows"> <DataTable :columns="columns" :rows="rows">
<template #status="{ value }"> <template #status="{ row }">
<StatusBadge :status="value" /> <StatusBadge :status="row.status" />
</template> </template>
<template #actions> <template #actions>
<div class="actions"> <div class="actions">