From 62ddd703f16ae7ac6ed713a3119fb28fd6682758 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 10 Apr 2024 16:45:17 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=94=AF=E6=8C=81=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=8F=92=E4=BB=B6=E6=9B=B4=E6=96=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types.ts | 3 +++ src/components/cards/PluginAppCard.vue | 35 +++++++++++++++++++++++++- src/components/misc/VersionHistory.vue | 22 ++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/components/misc/VersionHistory.vue diff --git a/src/api/types.ts b/src/api/types.ts index 2125c4df..32ab43f6 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -612,6 +612,9 @@ export interface Plugin { // 插件仓库地址 repo_url?: string + + // 变更历史 + history?: { [key: string]: string } } // 种子信息 diff --git a/src/components/cards/PluginAppCard.vue b/src/components/cards/PluginAppCard.vue index b7e528a4..69e688ae 100644 --- a/src/components/cards/PluginAppCard.vue +++ b/src/components/cards/PluginAppCard.vue @@ -4,6 +4,8 @@ import api from '@/api' import type { Plugin } from '@/api/types' import noImage from '@images/logos/plugin.png' import { getDominantColor } from '@/@core/utils/image' +import VersionHistory from '../misc/VersionHistory.vue' +import { isNullOrEmptyObject } from '@/@core/utils' // 输入参数 const props = defineProps({ @@ -37,6 +39,9 @@ const isImageLoaded = ref(false) // 图片是否加载失败 const imageLoadError = ref(false) +// 更新日志弹窗 +const releaseDialog = ref(false) + // 图片加载完成 async function imageLoaded() { isImageLoaded.value = true @@ -118,15 +123,29 @@ function visitPluginPage() { window.open(repoUrl, '_blank') } +// 显示更新日志 +function showUpdateHistory() { + releaseDialog.value = true +} + // 弹出菜单 const dropdownItems = ref([ { - title: '查看详情', + title: '项目主页', value: 1, + show: true, props: { prependIcon: 'mdi-information-outline', click: visitPluginPage, }, + },{ + title: '更新说明', + value: 2, + show: !isNullOrEmptyObject(props.plugin?.history || {}), + props: { + prependIcon: 'mdi-update', + click: showUpdateHistory, + }, }, ]) @@ -151,6 +170,7 @@ const dropdownItems = ref([ + + + + + {{ props.plugin?.plugin_name }} 变更说明 + + +