отладил добавление кнопок
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:
@@ -31,6 +31,10 @@
|
|||||||
<option value="Япония">Япония</option>
|
<option value="Япония">Япония</option>
|
||||||
<option value="viewed">Просмотренные</option>
|
<option value="viewed">Просмотренные</option>
|
||||||
<option value="status">Избранные</option>
|
<option value="status">Избранные</option>
|
||||||
|
<option value="tematik">Тематическая</option>
|
||||||
|
<option value="svodka">Сводка</option>
|
||||||
|
<option value="donesenie">Донесение</option>
|
||||||
|
<option value="bilutene">Билутень</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<Time />
|
<Time />
|
||||||
@@ -48,11 +52,19 @@
|
|||||||
:parsed_at="item.parsed_at"
|
:parsed_at="item.parsed_at"
|
||||||
:status="item.status"
|
:status="item.status"
|
||||||
:viewed="item.viewed"
|
:viewed="item.viewed"
|
||||||
|
:tematik="item.tematik"
|
||||||
|
:svodka="item.svodka"
|
||||||
|
:donesenie="item.donesenie"
|
||||||
|
:bilutene="item.bilutene"
|
||||||
:original_text="item.original_text"
|
:original_text="item.original_text"
|
||||||
:translation_text="item.translation_text"
|
:translation_text="item.translation_text"
|
||||||
:other="item.other"
|
:other="item.other"
|
||||||
@update:viewed="handleViewedChange"
|
@update:viewed="handleViewedChange"
|
||||||
@update:status="handleStatusChange"
|
@update:status="handleStatusChange"
|
||||||
|
@update:tematik="handleTematikChange"
|
||||||
|
@update:svodka="handleSvodkaChange"
|
||||||
|
@update:donesenie="handleDonesenieChange"
|
||||||
|
@update:bilutene="handleBiluteneChange"
|
||||||
/>
|
/>
|
||||||
<!-- Sentinel для бесконечного скролла -->
|
<!-- Sentinel для бесконечного скролла -->
|
||||||
<div ref="sentinel" class="h-4"></div>
|
<div ref="sentinel" class="h-4"></div>
|
||||||
@@ -93,7 +105,6 @@ let currentOffset = 0;
|
|||||||
let pollTimer = null;
|
let pollTimer = null;
|
||||||
let lastScrollTop = 0; // Сохраняем позицию скролла
|
let lastScrollTop = 0; // Сохраняем позицию скролла
|
||||||
|
|
||||||
|
|
||||||
const fetchData = async (url) => {
|
const fetchData = async (url) => {
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get(url);
|
const { data } = await axios.get(url);
|
||||||
@@ -198,7 +209,11 @@ const checkForUpdates = async () => {
|
|||||||
hasNew = true;
|
hasNew = true;
|
||||||
} else if (
|
} else if (
|
||||||
existing.viewed !== item.viewed ||
|
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 - обновляем
|
// Изменились viewed/status - обновляем
|
||||||
const index = items.value.indexOf(existing);
|
const index = items.value.indexOf(existing);
|
||||||
@@ -240,6 +255,26 @@ const handleStatusChange = ({ url, status }) => {
|
|||||||
if (item) item.status = 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 ===
|
// === Watch ===
|
||||||
|
|
||||||
let debounceTimer = null;
|
let debounceTimer = null;
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ onBeforeUnmount(() => {
|
|||||||
<!-- Кнопки Т, С, Д, Б -->
|
<!-- Кнопки Т, С, Д, Б -->
|
||||||
<button
|
<button
|
||||||
@click="tematik_b"
|
@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="
|
:class="
|
||||||
localTematik
|
localTematik
|
||||||
? 'bg-green-500 text-white'
|
? 'bg-green-500 text-white'
|
||||||
@@ -386,7 +386,7 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
@click="svodka_b"
|
@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="
|
:class="
|
||||||
localSvodka
|
localSvodka
|
||||||
? 'bg-blue-500 text-white'
|
? 'bg-blue-500 text-white'
|
||||||
@@ -398,7 +398,7 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
@click="donesenie_b"
|
@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="
|
:class="
|
||||||
localDonesenie
|
localDonesenie
|
||||||
? 'bg-yellow-500 text-white'
|
? 'bg-yellow-500 text-white'
|
||||||
@@ -410,7 +410,7 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
@click="bilutene_b"
|
@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="
|
:class="
|
||||||
localBilutene
|
localBilutene
|
||||||
? 'bg-purple-500 text-white'
|
? 'bg-purple-500 text-white'
|
||||||
|
|||||||
Reference in New Issue
Block a user