P-82 Макет тестов

This commit is contained in:
Denzel committed 2025-01-27 08:29:35 +03:00
1 parent 9673fdacfa
commit 98e800519a
1 file changed
+122 -15
+122 -15
View File
@@ -1,23 +1,130 @@
<template>
<v-row>
<v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
Тестирование
</v-col>
</v-row>
<v-container>
<v-tabs v-model="activeTab" class="mb-4 text-teal-darken-4">
<v-tab>Назначенные ({{tests.length}})</v-tab>
<v-tab>Завершенные</v-tab>
<v-tab>Каталог</v-tab>
</v-tabs>
<v-tabs-window v-model="activeTab">
<v-tabs-window-item>
<v-card class="mb-6" outlined>
<v-card-title>
Назначенные
</v-card-title>
<v-text-field
v-model="search"
label="Найти тестирование по названию"
variant="outlined"
clearable
class="mb-4"
></v-text-field>
<v-data-table
:items="filteredTests"
item-value="id"
class="elevation-1"
:headers="headers"
hide-default-footer
>
<template #item.image="{ item }">
<v-avatar size="48">
<img :src="item.image" alt="Test Image" />
</v-avatar>
</template>
<template #item.actions="{ item }">
<v-btn v-if="item.type === 'test'" color="teal-darken-4" variant="tonal" class="mr-4">Тренироваться</v-btn>
<v-btn color="teal-darken-4">Пройти</v-btn>
</template>
</v-data-table>
</v-card>
</v-tabs-window-item>
<v-tabs-window-item>
<v-card class="mb-6" outlined>
<v-card-title>
Завершенные
</v-card-title>
<p>Список завершенных тестов будет здесь.</p>
</v-card>
</v-tabs-window-item>
<v-tabs-window-item>
<v-card class="mb-6" outlined>
<v-card-title>
Каталог
</v-card-title>
<p>Список доступных тестов будет здесь.</p>
</v-card>
</v-tabs-window-item>
</v-tabs-window>
</v-container>
</template>
<script>
import {pagecounter} from '@/utils/universal_functions'
import { ref, computed } from 'vue';
export default {
setup(){
pagecounter()
}
}
setup() {
const activeTab = ref(0);
const search = ref('');
const headers = [
{ text: 'Картинка', value: 'image', sortable: false },
{ text: 'Название', value: 'title', align: 'start' },
{ text: 'Тип', value: 'type' },
{ text: 'Описание', value: 'description' },
{ text: 'Дата', value: 'date' },
{ text: 'Действия', value: 'actions', sortable: false },
];
const tests = ref([
{
id: 1,
title: 'Комплекс тестовых вопросов на знание в области информационно-коммуникационных технологий',
type: 'test',
description: 'Краткое описание тестирования',
date: '22.06.2024',
questions: 20,
time: '15 минут',
attempts: 1,
image: 'https://via.placeholder.com/48',
},
{
id: 2,
title: 'Удобство раздела тестирования',
type: 'survey',
description: 'Опрос среди сотрудников ЦОД МФ',
date: '22.06.2024',
questions: 28,
time: null,
attempts: null,
image: 'https://via.placeholder.com/48',
},
]);
const filteredTests = computed(() => {
if (!search.value) return tests.value;
return tests.value.filter((test) =>
test.title.toLowerCase().includes(search.value.toLowerCase())
);
});
return {
activeTab,
search,
headers,
tests,
filteredTests,
};
},
};
</script>
<style>
</style>
.v-data-table__wrapper {
overflow-x: auto;
}
</style>