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 DataTableSlotRow = Record<string, any>
defineProps<{
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 {
return row[key]
function getCell(row: TRow, key: string): unknown {
return (row as Record<string, unknown>)[key]
}
</script>
@@ -162,7 +162,7 @@ const tabConfig: Record<TabKey, TabConfig> = {
},
}
const current = computed(() => {
const current = computed<TabConfig>(() => {
const config = tabConfig[activeTab.value]
if (activeTab.value === 'lectures') {
return {
@@ -297,8 +297,8 @@ onMounted(() => {
</div>
</div>
<DataTable :columns="columns" :rows="rows">
<template #text="{ value }">
<span class="review-text" :title="value">{{ value }}</span>
<template #text="{ row }">
<span class="review-text" :title="row.text">{{ row.text }}</span>
</template>
<template #analysis="{ row }">
<div class="analysis-cell">
@@ -51,8 +51,8 @@ watch(() => auth.user?.id, fetchTeacherLectures)
subtitle="Backend не вернул лекции для текущего преподавателя."
/>
<DataTable :columns="columns" :rows="rows">
<template #status="{ value }">
<StatusBadge :status="value" />
<template #status="{ row }">
<StatusBadge :status="row.status" />
</template>
<template #actions>
<div class="actions">