отладил добавление кнопок
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -27,10 +27,14 @@
|
||||
<option value="all">Все</option>
|
||||
<option value="time">По времени</option>
|
||||
<option value="Китай">Китай</option>
|
||||
<option value="Корея">Корея</option>
|
||||
<option value="Корея">Корея</option>
|
||||
<option value="Япония">Япония</option>
|
||||
<option value="viewed">Просмотренные</option>
|
||||
<option value="status">Избранные</option>
|
||||
<option value="tematik">Тематическая</option>
|
||||
<option value="svodka">Сводка</option>
|
||||
<option value="donesenie">Донесение</option>
|
||||
<option value="bilutene">Билутень</option>
|
||||
</select>
|
||||
</div>
|
||||
<Time />
|
||||
@@ -48,11 +52,19 @@
|
||||
:parsed_at="item.parsed_at"
|
||||
:status="item.status"
|
||||
:viewed="item.viewed"
|
||||
:tematik="item.tematik"
|
||||
:svodka="item.svodka"
|
||||
:donesenie="item.donesenie"
|
||||
:bilutene="item.bilutene"
|
||||
:original_text="item.original_text"
|
||||
:translation_text="item.translation_text"
|
||||
:other="item.other"
|
||||
@update:viewed="handleViewedChange"
|
||||
@update:status="handleStatusChange"
|
||||
@update:tematik="handleTematikChange"
|
||||
@update:svodka="handleSvodkaChange"
|
||||
@update:donesenie="handleDonesenieChange"
|
||||
@update:bilutene="handleBiluteneChange"
|
||||
/>
|
||||
<!-- Sentinel для бесконечного скролла -->
|
||||
<div ref="sentinel" class="h-4"></div>
|
||||
@@ -93,7 +105,6 @@ let currentOffset = 0;
|
||||
let pollTimer = null;
|
||||
let lastScrollTop = 0; // Сохраняем позицию скролла
|
||||
|
||||
|
||||
const fetchData = async (url) => {
|
||||
try {
|
||||
const { data } = await axios.get(url);
|
||||
@@ -198,7 +209,11 @@ const checkForUpdates = async () => {
|
||||
hasNew = true;
|
||||
} else if (
|
||||
existing.viewed !== item.viewed ||
|
||||
existing.status !== item.status
|
||||
existing.status !== item.status ||
|
||||
existing.tematik !== item.tematik ||
|
||||
existing.svodka !== item.svodka ||
|
||||
existing.donesenie !== item.donesenie ||
|
||||
existing.bilutene !== item.bilutene
|
||||
) {
|
||||
// Изменились viewed/status - обновляем
|
||||
const index = items.value.indexOf(existing);
|
||||
@@ -240,6 +255,26 @@ const handleStatusChange = ({ url, status }) => {
|
||||
if (item) item.status = status;
|
||||
};
|
||||
|
||||
const handleTematikChange = ({ url, tematik }) => {
|
||||
const item = items.value.find((i) => i.url === url);
|
||||
if (item) item.tematik = tematik;
|
||||
};
|
||||
|
||||
const handleSvodkaChange = ({ url, svodka }) => {
|
||||
const item = items.value.find((i) => i.url === url);
|
||||
if (item) item.svodka = svodka;
|
||||
};
|
||||
|
||||
const handleDonesenieChange = ({ url, donesenie }) => {
|
||||
const item = items.value.find((i) => i.url === url);
|
||||
if (item) item.donesenie = donesenie;
|
||||
};
|
||||
|
||||
const handleBiluteneChange = ({ url, bilutene }) => {
|
||||
const item = items.value.find((i) => i.url === url);
|
||||
if (item) item.bilutene = bilutene;
|
||||
};
|
||||
|
||||
// === Watch ===
|
||||
|
||||
let debounceTimer = null;
|
||||
|
||||
@@ -374,7 +374,7 @@ onBeforeUnmount(() => {
|
||||
<!-- Кнопки Т, С, Д, Б -->
|
||||
<button
|
||||
@click="tematik_b"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors cursor-pointer"
|
||||
:class="
|
||||
localTematik
|
||||
? 'bg-green-500 text-white'
|
||||
@@ -386,7 +386,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<button
|
||||
@click="svodka_b"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors cursor-pointer"
|
||||
:class="
|
||||
localSvodka
|
||||
? 'bg-blue-500 text-white'
|
||||
@@ -398,7 +398,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<button
|
||||
@click="donesenie_b"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors cursor-pointer"
|
||||
:class="
|
||||
localDonesenie
|
||||
? 'bg-yellow-500 text-white'
|
||||
@@ -410,7 +410,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<button
|
||||
@click="bilutene_b"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors"
|
||||
class="w-10 h-10 rounded-lg font-bold text-sm hover:opacity-75 active:opacity-75 transition-colors cursor-pointer"
|
||||
:class="
|
||||
localBilutene
|
||||
? 'bg-purple-500 text-white'
|
||||
|
||||
Reference in New Issue
Block a user