This commit is contained in:
Professional 2025-05-26 15:37:26 +07:00
parent c590374245
commit b8369c53c3
3 changed files with 31 additions and 43 deletions

View File

@ -483,6 +483,7 @@ h3 i {
border-radius: 12px; border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08); box-shadow: 0 2px 8px rgba(0,0,0,0.08);
padding: 1.5rem; padding: 1.5rem;
overflow-x: hidden; /* Добавляем скрытие горизонтального переполнения */
} }
.participants-list { .participants-list {
@ -490,6 +491,7 @@ h3 i {
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem; gap: 1.5rem;
max-width: 100%; max-width: 100%;
overflow: hidden; /* Скрываем переполнение */
} }
.participant-card { .participant-card {
@ -501,11 +503,8 @@ h3 i {
border-radius: 10px; border-radius: 10px;
background-color: #f9f9f9; background-color: #f9f9f9;
transition: all 0.2s ease; transition: all 0.2s ease;
} max-width: 100%; /* Ограничиваем ширину */
overflow: hidden; /* Скрываем переполнение */
.participant-card:hover {
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
transform: translateY(-2px);
} }
.participant-photo { .participant-photo {
@ -517,24 +516,11 @@ h3 i {
box-shadow: 0 2px 6px rgba(0,0,0,0.15); box-shadow: 0 2px 6px rgba(0,0,0,0.15);
} }
.participant-photo img {
width: 100%;
height: 100%;
object-fit: cover;
}
.participant-photo.placeholder {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #ff3e68, #ff5252);
color: white;
font-weight: bold;
}
.participant-info { .participant-info {
flex: 1; flex: 1;
min-width: 0; min-width: 0; /* Важно для текста с переполнением */
width: 100%; /* Занимает всё доступное пространство */
overflow: hidden; /* Скрываем переполнение */
} }
.participant-name { .participant-name {
@ -545,7 +531,7 @@ h3 i {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: calc(100% - 20px); /* Оставляем немного места для отступа */ max-width: 100%; /* Изменяем с calc(100% - 20px) на 100% */
} }
.participant-email { .participant-email {
@ -555,6 +541,7 @@ h3 i {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 100%; /* Добавляем максимальную ширину */
} }
.btn { .btn {
@ -568,11 +555,14 @@ h3 i {
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
transition: all 0.2s ease; transition: all 0.2s ease;
max-width: 100%; /* Ограничиваем ширину кнопки */
overflow: hidden; /* Скрываем переполнение */
} }
.user-btn { .user-btn {
background-color: rgba(25, 118, 210, 0.1); background-color: rgba(25, 118, 210, 0.1);
color: #1976d2; color: #1976d2;
width: 100%; /* Кнопка занимает всю доступную ширину */
} }
.user-btn:hover { .user-btn:hover {

View File

@ -7,8 +7,8 @@
type="text" type="text"
v-model="searchUserId" v-model="searchUserId"
placeholder="Поиск диалогов по ID пользователя..." placeholder="Поиск диалогов по ID пользователя..."
@input="debouncedSearch"
/> />
<button @click="loadConversations" class="search-btn">Поиск</button>
</div> </div>
<div v-if="loading" class="loading-indicator"> <div v-if="loading" class="loading-indicator">
@ -144,6 +144,22 @@ export default {
pages: 0 pages: 0
}); });
// Таймер для debounce поиска
let searchTimer = null;
const debouncedSearch = () => {
// Сбрасываем предыдущий таймер
if (searchTimer) {
clearTimeout(searchTimer);
}
// Устанавливаем новый таймер (задержка 500мс)
searchTimer = setTimeout(() => {
currentPage.value = 1; // При новом поиске сбрасываем на первую страницу
loadConversations();
}, 500);
};
const loadConversations = async () => { const loadConversations = async () => {
loading.value = true; loading.value = true;
error.value = null; error.value = null;
@ -231,6 +247,7 @@ export default {
currentPage, currentPage,
pagination, pagination,
loadConversations, loadConversations,
debouncedSearch, // Добавляем новую функцию в return
shortenId, shortenId,
formatDate, formatDate,
truncateText, truncateText,
@ -270,7 +287,6 @@ h2::before {
.search-bar { .search-bar {
display: flex; display: flex;
gap: 0.75rem;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
@ -281,20 +297,6 @@ h2::before {
border-radius: 4px; border-radius: 4px;
} }
.search-btn {
padding: 0 1.5rem;
background-color: #ff3e68;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
}
.search-btn:hover {
background-color: #e9365e;
}
.loading-indicator { .loading-indicator {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -593,11 +595,6 @@ h2::before {
gap: 0.5rem; gap: 0.5rem;
} }
.search-btn {
width: 100%;
padding: 0.75rem;
}
.pagination { .pagination {
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.5rem; gap: 0.5rem;

View File

@ -328,6 +328,7 @@ h2 {
position: relative; position: relative;
padding-left: 0.5rem; padding-left: 0.5rem;
display: inline-block; display: inline-block;
font-size: 1.75rem; /* Добавлено свойство размера шрифта */
} }
h2::before { h2::before {