From b4268c996107d19341e4732de6b6609379f51150 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Tue, 9 Aug 2022 16:27:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E5=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capacitySquare/components/algorithm.vue | 29 +++++++++++++++---- .../views/capacitySquare/components/layer.vue | 29 +++++++++++++++---- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/front/src/views/capacitySquare/components/algorithm.vue b/front/src/views/capacitySquare/components/algorithm.vue index 35b6e2d0..3ad40105 100644 --- a/front/src/views/capacitySquare/components/algorithm.vue +++ b/front/src/views/capacitySquare/components/algorithm.vue @@ -12,11 +12,15 @@ :width="525" :height="275" :fallback="imgSrc" + :preview="false" > -
{{ item.name }}
+
+ {{ item.name }} + {{ item.deptName }} +
@@ -58,9 +62,14 @@ }) return url.value } + //跳转详情页 + const detailFunction = (id) => { + window.open(window.SITE_CONFIG.previewUrl + `#/details?id=${id}`) + } onMounted(() => { const algorithmclass = document.querySelector('.algorithm-class') if (dataLength.value) { + //监听滚动事件 algorithmclass.addEventListener('scroll', (e) => { var scrollTop = e.currentTarget.scrollTop var windowHeight = e.currentTarget.clientHeight @@ -118,7 +127,6 @@ position: absolute; height: 0.6rem; width: 100%; - line-height: 0.6rem; color: #ffffff; font-size: 0.22rem; font-family: alibaba; @@ -127,10 +135,19 @@ background: url('~@/assets/capacitySquare/algorithm-title-bg.png') no-repeat; background-size: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: pointer; + display: flex; + flex-direction: column; + justify-content: center; + span { + line-height: 0.24rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + } + span:last-child { + font-size: 0.14rem; + } } } } diff --git a/front/src/views/capacitySquare/components/layer.vue b/front/src/views/capacitySquare/components/layer.vue index 67d4d626..a84c2878 100644 --- a/front/src/views/capacitySquare/components/layer.vue +++ b/front/src/views/capacitySquare/components/layer.vue @@ -12,11 +12,15 @@ :width="525" :height="275" :fallback="imgSrc" + :preview="false" > -
{{ item.name }}
+
+ {{ item.name }} + {{ item.deptName }} +
@@ -58,9 +62,14 @@ }) return url.value } + //跳转详情页 + const detailFunction = (id) => { + window.open(window.SITE_CONFIG.previewUrl + `#/details?id=${id}`) + } onMounted(() => { const algorithmclass = document.querySelector('.algorithm-class') if (dataLength.value) { + //监听滚动事件 algorithmclass.addEventListener('scroll', (e) => { var scrollTop = e.currentTarget.scrollTop var windowHeight = e.currentTarget.clientHeight @@ -118,7 +127,6 @@ position: absolute; height: 0.6rem; width: 100%; - line-height: 0.6rem; color: #ffffff; font-size: 0.22rem; font-family: alibaba; @@ -127,10 +135,19 @@ background: url('~@/assets/capacitySquare/algorithm-title-bg.png') no-repeat; background-size: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: pointer; + display: flex; + flex-direction: column; + justify-content: center; + span { + line-height: 0.24rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: pointer; + } + span:last-child { + font-size: 0.14rem; + } } } }