From 572031b7cd4d275177ca6908a8deb47bf6e4ab05 Mon Sep 17 00:00:00 2001 From: yanyan Date: Tue, 22 Jul 2025 17:16:53 +0800 Subject: [PATCH] pdf --- src/views/common/pdfPreview.vue | 350 +++++++++++++++++++++++++------- 1 file changed, 276 insertions(+), 74 deletions(-) diff --git a/src/views/common/pdfPreview.vue b/src/views/common/pdfPreview.vue index 4852f04..8ea5506 100644 --- a/src/views/common/pdfPreview.vue +++ b/src/views/common/pdfPreview.vue @@ -1,99 +1,301 @@ - - + &:hover { + background-color: #f0f0f0; + } + } + + .pdf-actions { + display: flex; + gap: 10px; + } + + .page-navigation { + display: flex; + align-items: center; + .page-controls { + display: flex; + align-items: center; + padding: 2px 8px; + .page-input { + width: 50px; + margin: 0 5px; + + :deep(.el-input__inner) { + text-align: center; + padding: 0 5px; + } + } + } + + .total-pages { + margin-left: 5px; + color: #606266; + } + } + } + + .pdf-content { + flex: 1; + overflow: auto; + + /* 自定义滚动条样式 */ + &::-webkit-scrollbar { + width: 6px; + height: 6px; + } + + &::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0.05); + border-radius: 3px; + } + + &::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.15); + border-radius: 3px; + transition: background 0.2s; + + &:hover { + background: rgba(0, 0, 0, 0.25); + } + } + + .pdf-loading, + .pdf-error { + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + + .pdf-display-area { + .pdf-item { + margin: 16px 0px; + } + } + } + + .page-tool { + position: absolute; + bottom: 35px; + padding-left: 15px; + padding-right: 15px; + display: flex; + align-items: center; + background: rgb(66, 66, 66); + color: white; + border-radius: 19px; + z-index: 100; + cursor: pointer; + margin-left: 50%; + transform: translateX(-50%); + } + .page-tool-item { + padding: 8px 15px; + padding-left: 10px; + cursor: pointer; + } + +} +