From 82d89972179620b3784a66fc641a1228ba1dfaaf Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:59:43 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=BA=94=E7=94=A8=E5=95=86=E5=BA=97?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=20(#5993)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/interface/app.ts | 2 + frontend/src/views/app-store/apps/index.vue | 234 ++++++++++-------- frontend/src/views/app-store/detail/index.vue | 191 -------------- 3 files changed, 127 insertions(+), 300 deletions(-) delete mode 100644 frontend/src/views/app-store/detail/index.vue diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts index cf27cb27f..3ca18c2b9 100644 --- a/frontend/src/api/interface/app.ts +++ b/frontend/src/api/interface/app.ts @@ -13,6 +13,8 @@ export namespace App { type: string; status: string; limit: number; + website: string; + github: string; } export interface AppDTO extends App { diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue index 9af9ba202..455788e39 100644 --- a/frontend/src/views/app-store/apps/index.vue +++ b/frontend/src/views/app-store/apps/index.vue @@ -60,14 +60,6 @@ - @@ -183,7 +187,6 @@ import { App } from '@/api/interface/app'; import { onMounted, reactive, ref, computed } from 'vue'; import { GetAppTags, SearchApp, SyncApp } from '@/api/modules/app'; import i18n from '@/lang'; -import Detail from '../detail/index.vue'; import Install from '../detail/install/index.vue'; import router from '@/routers'; import { MsgSuccess } from '@/utils/message'; @@ -220,7 +223,6 @@ const activeTag = ref('all'); const showDetail = ref(false); const canUpdate = ref(false); const syncing = ref(false); -const detailRef = ref(); const installRef = ref(); const installKey = ref(''); const moreTag = ref(''); @@ -266,10 +268,6 @@ const openInstall = (app: App.App) => { } }; -const openDetail = (key: string) => { - detailRef.value.acceptParams(key, 'install'); -}; - const sync = () => { syncing.value = true; SyncApp() @@ -313,6 +311,10 @@ const searchByName = () => { search(req); }; +const toLink = (link: string) => { + window.open(link, '_blank'); +}; + onMounted(() => { if (router.currentRoute.value.query.install) { installKey.value = String(router.currentRoute.value.query.install); @@ -338,69 +340,83 @@ onMounted(() => { padding-bottom: 10px; } -.app-card { - margin-top: 10px; - cursor: pointer; - padding: 5px; - - .app-icon-container { - margin-top: 10px; - margin-left: 15px; +.app { + margin: 10px; + .el-card { + padding: 0 !important; + border: var(--panel-border) !important; + &:hover { + border: 1px solid var(--el-color-primary) !important; + } + } + .el-card__body { + padding: 8px 8px 2px 8px !important; + } + .app-wrapper { + display: flex; + height: 100%; + } + .app-image { + cursor: pointer; + flex: 0 0 100px; + display: flex; + justify-content: center; + margin-top: 14px; + transition: transform 0.1s; } - &:hover .app-icon { + &:hover .app-image { transform: scale(1.2); } - .app-icon { - transition: transform 0.1s; - transform-origin: center center; + .el-avatar { + width: 65px !important; + height: 65px !important; + max-width: 65px; + max-height: 65px; + object-fit: cover; } - .app-content { - margin-top: 10px; - height: 100%; - width: 100%; - - .app-header { - height: 20%; - .app-title { - line-height: 1.5; - font-weight: 500; - font-size: 16px; - color: var(--el-text-color-regular); - } - .app-button { - float: right; - margin-right: 20px; - } - } - - .app-desc { - margin-top: 8px; - height: 43px; - .desc { - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - text-overflow: ellipsis; - font-size: 14px; - color: var(--el-text-color-regular); - } - } - - .app-tag { - margin-top: 5px; - } + flex: 1; + display: flex; + flex-direction: column; + padding: 10px; } + .content-top, + .content-bottom { + display: flex; + justify-content: space-between; + align-items: center; + } + .content-middle { + flex: 1; + margin: 10px 0; + overflow: hidden; /* 防止内容溢出 */ + } + .app-name { + margin: 0; + line-height: 1.5; + font-weight: 500; + font-size: 16px; + color: var(--el-text-color-regular); + } + .app-description { + margin: 0; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + font-size: 14px; + color: var(--el-text-color-regular); - .e-card { - border: var(--panel-border) !important; - &:hover { - cursor: pointer; - border: 1px solid var(--el-color-primary) !important; - } + line-height: 1.2; + height: calc(1.2em * 2); + min-height: calc(1.2em * 2); + } + .app-tags { + display: flex; + gap: 5px; } } diff --git a/frontend/src/views/app-store/detail/index.vue b/frontend/src/views/app-store/detail/index.vue deleted file mode 100644 index 5bc8dae34..000000000 --- a/frontend/src/views/app-store/detail/index.vue +++ /dev/null @@ -1,191 +0,0 @@ - - - - -