From b6e721826fda1240737879240a3344dcf7341a06 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Sat, 2 Nov 2024 23:16:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF=E5=BA=93?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/print/Print.vue | 83 +++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/src/components/print/Print.vue b/src/components/print/Print.vue index b8dc195..ee4545a 100644 --- a/src/components/print/Print.vue +++ b/src/components/print/Print.vue @@ -181,8 +181,23 @@ - - +
+
+
+ + + +

{{ item.name }}

+ 使用模板 +
+
+
+ @@ -320,7 +335,7 @@ }, searchTemplate: { current: 1, - size: 10, + size: 8, type: 1 }, templateTotal: 0, @@ -331,7 +346,8 @@ { prop: 'name', label: '模板名称', align: 'left' }, { slot: 'img'} ], - templateLoading: false + templateLoading: false, + hasMore: true } }, @@ -431,12 +447,23 @@ }, getTemplateList() { + if (!this.hasMore) return + if (this.templateLoading) return + this.templateLoading = true this.$http.post(`/api/templateRecommend/getRecommendPage`, null, { params: this.searchTemplate }).then(res => { if (res.code === 0) { - this.templateList = res.data.records + this.templateList = [...this.templateList, ...res.data.records] this.templateTotal = res.data.total + + if (res.data.records.length < this.searchTemplate.size) { + this.hasMore = false + } else { + this.searchTemplate.current = this.searchTemplate.current + 1 + } + + this.templateLoading = false } }) }, @@ -861,5 +888,49 @@ .print-viewer { color: #000; } + + .templateList-wrapper { + padding-right: 10px; + + .templateList { + display: flex; + flex-wrap: wrap; + + .templateList-item { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + width: 24%; + margin-bottom: 20px; + margin-right: 1.333%; + padding: 10px; + border-radius: 3px; + overflow: hidden; + background-color: #f4f4f4; + + .el-button { + position: absolute; + top: 0; + right: 0; + z-index: 1; + } + + h2 { + margin-top: 12px; + font-size: 14px; + font-weight: 600; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + &:nth-of-type(4n) { + margin-right: 0; + } + } + } + } }