From b859d00cb9f9e16e13617b0be9e7e7b35e447f0b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 2 Jun 2024 14:58:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=81=9A=E5=90=88=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- src/api/types.ts | 2 + src/components/cards/PluginCard.vue | 10 +- src/layouts/components/SearchBar.vue | 8 +- src/views/plugin/PluginCardListView.vue | 10 ++ src/views/system/SearchBarView.vue | 165 +++++++++++++++++++++++- yarn.lock | 59 +-------- 7 files changed, 193 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index 075f9aac..b5096927 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "express": "^4.18.2", "express-http-proxy": "^2.0.0", "lodash": "^4.17.21", + "mousetrap": "^1.6.5", "nprogress": "^0.2.0", "qrcode.vue": "^3.4.1", "sass": "^1.59.3", @@ -100,4 +101,4 @@ "resolutions": { "postcss": "8" } -} \ No newline at end of file +} diff --git a/src/api/types.ts b/src/api/types.ts index 48f015b3..7b97c0aa 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -445,6 +445,8 @@ export interface Plugin { history?: { [key: string]: string } // 添加时间 add_time?: number + // 页面打开状态 + page_open?: boolean } // 渲染结构 diff --git a/src/components/cards/PluginCard.vue b/src/components/cards/PluginCard.vue index e541ccbe..0fd0b31a 100644 --- a/src/components/cards/PluginCard.vue +++ b/src/components/cards/PluginCard.vue @@ -365,11 +365,19 @@ const dropdownItems = ref([ // 监听插件状态变化 watch( () => props.plugin?.has_update, - (newHasUpdate, oldHasUpdate) => { + (newHasUpdate, _) => { const updateItemIndex = dropdownItems.value.findIndex(item => item.value === 3) if (updateItemIndex !== -1) dropdownItems.value[updateItemIndex].show = newHasUpdate }, ) + +// 监听插件窗口状态变化 +watch( + () => props.plugin?.page_open, + (newOpenState, _) => { + if (newOpenState) openPluginDetail() + }, +)