From ed921f7c661ee3e8ca12073e3700db53ca1df2cc Mon Sep 17 00:00:00 2001
From: kjqwer <2990346238@qq.com>
Date: Mon, 8 Sep 2025 11:47:31 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E7=9C=8Burl=E5=8F=AF=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BF=AB=E6=8D=B7=E9=94=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
backend/README.md | 2 +-
ui/src/components/artwork/ArtworkInfoPanel.vue | 2 +-
ui/src/components/common/WatchlistWidget.vue | 12 ++++++++----
ui/src/services/watchlist.ts | 1 +
ui/src/views/ArtworkView.vue | 2 +-
5 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/backend/README.md b/backend/README.md
index b472ff7..308a13d 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -151,7 +151,7 @@ backend/
- `POST /api/watchlist` - 添加待看项目
- 参数: `url` (必填), `title` (可选,不提供则自动生成)
- `PUT /api/watchlist/:id` - 更新待看项目
- - 参数: `title` (项目标题)
+ - 参数: `title` (项目标题), `url` (项目URL)
- `DELETE /api/watchlist/:id` - 删除待看项目
## 🔧 配置说明
diff --git a/ui/src/components/artwork/ArtworkInfoPanel.vue b/ui/src/components/artwork/ArtworkInfoPanel.vue
index 26c2164..e197c1a 100644
--- a/ui/src/components/artwork/ArtworkInfoPanel.vue
+++ b/ui/src/components/artwork/ArtworkInfoPanel.vue
@@ -49,7 +49,7 @@
-
-
+
取消
- 保存
+ 保存
@@ -232,6 +232,7 @@ const isOpen = ref(false);
const addLoading = ref(false);
const editingItem = ref(null);
const editTitle = ref('');
+const editUrl = ref('');
const showingAddModal = ref(false);
const addTitle = ref('');
const addUrl = ref('');
@@ -400,18 +401,21 @@ const navigateToItem = (item: WatchlistItem) => {
const editItem = (item: WatchlistItem) => {
editingItem.value = item;
editTitle.value = item.title;
+ editUrl.value = item.url;
};
const cancelEdit = () => {
editingItem.value = null;
editTitle.value = '';
+ editUrl.value = '';
};
const saveEdit = async () => {
- if (!editingItem.value || !editTitle.value.trim()) return;
+ if (!editingItem.value || !editTitle.value.trim() || !editUrl.value.trim()) return;
const success = await watchlistStore.updateItem(editingItem.value.id, {
- title: editTitle.value.trim()
+ title: editTitle.value.trim(),
+ url: editUrl.value.trim()
});
if (success) {
diff --git a/ui/src/services/watchlist.ts b/ui/src/services/watchlist.ts
index 9393766..c5ece2f 100644
--- a/ui/src/services/watchlist.ts
+++ b/ui/src/services/watchlist.ts
@@ -19,6 +19,7 @@ export interface AddWatchlistItemParams {
// 更新项目的参数接口
export interface UpdateWatchlistItemParams {
title?: string;
+ url?: string;
}
class WatchlistService {
diff --git a/ui/src/views/ArtworkView.vue b/ui/src/views/ArtworkView.vue
index 70f0209..a20c19a 100644
--- a/ui/src/views/ArtworkView.vue
+++ b/ui/src/views/ArtworkView.vue
@@ -711,7 +711,7 @@ const handleKeydown = (event: KeyboardEvent) => {
} else if (event.key === 'ArrowRight' && canNavigateToNext.value) {
event.preventDefault();
navigateToNext();
- } else if (event.key === 'Escape') {
+ } else if (event.key === 'Escape' || event.key === 'ArrowUp') {
event.preventDefault();
goBackToArtist();
} else if (event.key === 'ArrowDown') {