Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ footer {
vertical-align: middle;
}
}
</style>
</style>
133 changes: 133 additions & 0 deletions src/pages/Admin/AdminFeedbackMainPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<script setup lang="ts">
import { ref } from 'vue';
//import { useRouter } from 'vue-router';
import { router } from '@/router';
//const router = useRouter();

// Пример данных для карточек опросов
const surveys = ref([
{
id: 1,
type: 'Ежегодный опрос',
title: 'Оценка удовлетворенности 2024',
description: 'Общий опрос для всех сотрудников компании',
tags: ['front', 'back', 'data'],
deadline: 14,
regularity: 'не повторяется'
},
{
id: 2,
type: 'Экспресс-опрос',
title: 'Оценка тренинга',
description: 'Опрос по итогам прохождения обучения',
tags: ['hr', 'education'],
deadline: 7,
regularity: 'ежеквартально'
}
]);

const goBack = () => {
router.push('/');
};

const createNewPoll = () => {
router.push('/poll/creation');
};
</script>

<template>
<v-container class="pa-6">
<!-- Верхний блок -->
<div class="mb-8">
<!-- Строка с кнопкой назад и заголовком -->
<v-row class="mb-4" align="center" no-gutters>
<v-col cols="auto">
<v-btn icon @click="goBack" class="mr-4">
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
</v-col>
<v-col>
<h1 class="text-h4 font-weight-bold">Назначение опросов</h1>
</v-col>
</v-row>

<!-- Кнопка создания опроса -->
<v-row class="mb-6" no-gutters>
<v-col>
<v-btn color="primary" prepend-icon="mdi-plus" @click="createNewPoll">
Создать опрос
</v-btn>
</v-col>
</v-row>

<!-- Строка с заголовком и кнопками -->
<v-row class="mb-4" align="center" no-gutters>
<v-col>
<h2 class="text-h5">Существующие опросы</h2>
</v-col>
<v-col cols="auto">
<v-btn variant="text" icon class="mr-2">
<v-icon>mdi-cog</v-icon>
</v-btn>
<v-btn variant="text" icon>
<v-icon>mdi-sort</v-icon>
</v-btn>
</v-col>
</v-row>
</div>

<!-- Блок с карточками опросов -->
<v-row>
<v-col cols="12" v-for="survey in surveys" :key="survey.id">
<v-card class="pa-4 position-relative">
<!-- Кнопка редактирования -->
<v-btn icon variant="text" class="position-absolute" style="right: 12px; top: 12px">
<v-icon>mdi-pencil</v-icon>
</v-btn>

<!-- Основное содержимое карточки -->
<div class="mb-4">
<div class="text-subtitle-1 font-weight-bold text-grey-darken-2 mb-2">
{{ survey.type }}
</div>
<div class="text-h6 font-weight-bold mb-2">{{ survey.title }}</div>
<div class="text-body-1 text-grey-darken-1">{{ survey.description }}</div>
</div>

<v-row>
<!-- Левая колонка (70%) -->
<v-col cols="8">
<div class="text-caption font-weight-bold text-grey-darken-1 mb-2">Теги</div>
<v-chip-group>
<v-chip v-for="(tag, index) in survey.tags" :key="index" variant="outlined"
size="small">
{{ tag }}
</v-chip>
</v-chip-group>
</v-col>

<!-- Правая колонка (30%) -->
<v-col cols="4">
<div class="text-caption font-weight-bold text-grey-darken-1">Дэдлайн</div>
<div class="text-body-1 mb-2">{{ survey.deadline }} дней</div>

<div class="text-caption font-weight-bold text-grey-darken-1">Регулярность</div>
<div class="text-body-1">{{ survey.regularity }}</div>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-container>
</template>

<style scoped>
.v-card {
transition: box-shadow 0.3s;
border-radius: 8px;

&:hover {
box-shadow: 0 4px 8px rgba(0 0 0 / 10%);
}
}
</style>
122 changes: 72 additions & 50 deletions src/pages/MainPage.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,78 @@
<script setup lang="ts">
import apiClient from '@/api';
import { useProfileStore } from '@/store';
import { onMounted, ref } from 'vue';

const profileStore = useProfileStore();

const showUserWarn = ref(false);

onMounted(async () => {
// Get username
if (!profileStore.full_name && profileStore.id) {
const { response, data } = await apiClient.GET('/userdata/user/{id}', {
params: { path: { id: profileStore.id } },
});
if (response.status != 200) {
showUserWarn.value = true;
return;
}
if (!data || !data.items) {
showUserWarn.value = true;
return;
}
const nameItem = data.items.find(item => {
return item.category == 'Личная информация' && item.param == 'Полное имя';
});
if (!nameItem) {
showUserWarn.value = true;
return;
}
profileStore.full_name = nameItem?.value ?? null;
}
});
import { ref } from 'vue';
//import { useRouter } from 'vue-router';
//const router = useRouter();
import { router } from '@/router';

interface MenuItem {
title: string;
hasSettings: boolean;
selected: boolean;
}


const location = document.location.origin + '/docs/';
const menuItems = ref<MenuItem[]>([
{ title: 'Обратная связь', hasSettings: true, selected: false },
{ title: 'Встречи 1х1', hasSettings: true, selected: true },
{ title: 'Ревью и оценка', hasSettings: true, selected: true },
{ title: 'Наставничество и адаптация', hasSettings: false, selected: true },
{ title: 'Аналитика', hasSettings: false, selected: true },
{ title: 'Настройки', hasSettings: false, selected: true }
]);

const handleSettingsClick = (index: number) => {
if (index === 0) {
router.push('/admin/main');
}
};
</script>

<template>
<div>
<h1 class="text-h1">
Привет<span v-if="profileStore.full_name">, {{ profileStore.full_name }}</span
>!
</h1>
<p v-if="!profileStore.full_name">
Не удалось получить твое имя из
<a href="https://api.profcomff.com/?urls.primaryName=userdata">Userdata API</a>
=(
</p>
<p>Твой id: {{ profileStore.id }}</p>
<div>
<p>
Документация к этому коду находится по адресу <a href="/docs/">{{ location }}</a>
</p>
</div>
</div>
<v-container class="pa-6">
<!-- Заголовки -->
<v-row class="mb-6" no-gutters>
<v-col>
<h1 class="text-h5 font-weight-bold mb-2">Добро пожаловать!</h1>
<p class="text-subtitle-1 text-grey-darken-1">Выберите раздел:</p>
</v-col>
</v-row>

<!-- Первые три ряда с кнопками -->
<v-row v-for="(item, index) in menuItems.slice(0, 3)" :key="index" class="mb-4 align-center" no-gutters>
<v-col class="pr-2">
<v-btn block height="64" :color="item.selected ? 'grey lighten-1' : 'grey lighten-2'" class="text-none"
@click="item.selected = !item.selected">
{{ item.title }}
</v-btn>
</v-col>

<v-col cols="auto" v-if="item.hasSettings">
<v-btn height="64" width="64" color="grey lighten-2" class="text-none"
@click="handleSettingsClick(index)">
</v-btn>
</v-col>
</v-row>

<!-- Последние три ряда -->
<v-row v-for="(item, index) in menuItems.slice(3)" :key="index + 3" class="mb-4" no-gutters>
<v-col>
<v-btn block height="64" :color="item.selected ? 'grey lighten-1' : 'grey lighten-2'" class="text-none"
@click="item.selected = !item.selected">
{{ item.title }}
</v-btn>
</v-col>
</v-row>
</v-container>
</template>

<style scoped>
@import url('https://fonts.googleapis.com/css2?family=Roboto+Flex&display=swap');

.v-btn {
font-family: 'Roboto Flex', sans-serif;
font-size: 1.1rem;
letter-spacing: normal;
transition: all 0.3s ease;
}
</style>
118 changes: 118 additions & 0 deletions src/pages/PollCreationPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<script setup lang="ts">
//import { useRouter } from 'vue-router';
import { router } from '@/router';
//const router = useRouter();
</script>

<template>
<v-container class="pa-6">
<!-- Шапка -->
<v-row class="mb-4" align="center" no-gutters>
<v-col cols="auto">
<v-btn icon @click="router.push('/admin/main')">
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
</v-col>
<v-col class="pl-4">
<h1 class="text-h4">Создание опроса</h1>
</v-col>
</v-row>

<!-- Группы -->
<v-row class="mb-2" no-gutters>
<v-col>
<h2 class="text-h6">Группы</h2>
<p class="text-caption text-grey">Выбрать группы и пользователей</p>
</v-col>
</v-row>

<!-- Вкладки -->
<v-row class="mb-6" no-gutters>
<v-col>
<v-tabs>
<v-tab value="group">Добавить группу</v-tab>
<v-tab value="user">Добавить человека</v-tab>
</v-tabs>
</v-col>
</v-row>

<!-- Название опроса -->
<v-row class="mb-6" no-gutters>
<v-col>
<h3 class="text-h6 mb-2">Название опроса</h3>
<v-text-field variant="outlined" placeholder="Название опроса" hide-details></v-text-field>
</v-col>
</v-row>

<!-- Описание -->
<v-row class="mb-6" no-gutters>
<v-col>
<h3 class="text-h6 mb-2">Описание</h3>
<p class="text-caption text-grey mb-2">Описание, видимое для других администраторов</p>
<v-text-field variant="outlined" placeholder="Введите описание" rows="2" hide-details></v-text-field>
</v-col>
</v-row>

<!-- Форма -->
<v-row class="mb-6" no-gutters>
<v-col>
<h3 class="text-h6 mb-4">Форма</h3> <!-- Увеличенный отступ снизу -->
<p class="text-caption text-grey mb-2">Ссылка на форму Yandex Forms</p>
<v-text-field variant="outlined" placeholder="Ссылка на форму" hide-details></v-text-field>
</v-col>
</v-row>

<!-- Сообщение -->
<v-row class="mb-6" no-gutters>
<v-col>
<h3 class="text-h6 mb-2">Сообщение</h3>
<p class="text-caption text-grey mb-2">Сообщение, которое пользователи получат в телеграмм боте</p>
<v-text-field variant="outlined" placeholder="Введите сообщение" rows="2" hide-details></v-text-field>
</v-col>
</v-row>

<v-row class="mb-6" no-gutters>
<v-col>
<h3 class="text-h6 mb-4">Дата</h3>
<v-row>
<v-col cols="2">
<p class="text-caption text-grey">Регулярность</p>
<v-btn variant="outlined">
<v-icon left>mdi-calendar</v-icon>
Настроить
</v-btn>
</v-col>

<v-col cols="6">
<p class="text-caption text-grey">Дедлайн: дней</p>
<div class="d-flex align-right">
<v-text-field variant="outlined" class="mr-2" style="max-width: 100px"
hide-details></v-text-field>
</div>
</v-col>
</v-row>
</v-col>
</v-row>

<!-- Кнопка создания -->
<v-row no-gutters>
<v-col>
<v-btn color="primary" block size="large">
Создать
</v-btn>
</v-col>
</v-row>
</v-container>
</template>

<style scoped>
.v-tab {
text-transform: none;
letter-spacing: normal;
}

.v-text-field,
.v-textarea {
font-size: 0.9rem;
}
</style>
Loading
Loading