word 文档修改

This commit is contained in:
cwchen 2025-11-11 18:01:47 +08:00
parent ebf890f579
commit f05818d31a
1 changed files with 0 additions and 96 deletions

View File

@ -50,92 +50,6 @@
import * as docxPreview from 'docx-preview/dist/docx-preview.js'
const DOCX_CUSTOM_STYLE_ID = 'docx-preview-custom-style'
const DOCX_CUSTOM_STYLE = `
.docx-wrapper {
margin: 0 auto;
background: linear-gradient(180deg, #fdfdff 0%, #f6f8ff 100%);
border-radius: 16px;
box-shadow: 0 24px 48px rgba(25,64,158,0.16);
overflow: hidden;
border: 1px solid rgba(68,112,255,0.18);
}
.docx-fonts-resolver {
position: absolute;
width: 0;
height: 0;
overflow: hidden;
opacity: 0;
pointer-events: none;
}
.docx-wrapper section {
background: transparent !important;
padding: 48px 56px !important;
line-height: 1.8;
font-size: 14px;
color: #1f2a62;
}
.docx-wrapper table {
width: 100% !important;
border-collapse: separate !important;
border-spacing: 0 !important;
margin: 24px 0 !important;
background: rgba(255,255,255,0.98) !important;
border-radius: 14px;
overflow: hidden;
box-shadow: inset 0 0 0 1px rgba(68,112,255,0.2);
}
.docx-wrapper table thead th {
background: linear-gradient(135deg, rgba(68,112,255,0.45), rgba(68,112,255,0.22)) !important;
color: #f5f7ff !important;
font-weight: 600 !important;
text-transform: uppercase;
letter-spacing: 0.6px;
padding: 14px 18px !important;
border-bottom: 1px solid rgba(36,71,182,0.3) !important;
}
.docx-wrapper table td,
.docx-wrapper table th {
border-left: 1px solid rgba(68,112,255,0.2) !important;
border-right: 1px solid rgba(68,112,255,0.2) !important;
padding: 14px 18px !important;
vertical-align: top !important;
background: transparent !important;
color: #27325d !important;
font-size: 13px !important;
}
.docx-wrapper table tr:nth-child(even) td {
background: rgba(242,245,255,0.9) !important;
}
.docx-wrapper table tr:nth-child(odd) td {
background: rgba(255,255,255,0.98) !important;
}
.docx-wrapper table tr:hover td {
background: rgba(68,112,255,0.16) !important;
color: #1e2a62 !important;
}
.docx-wrapper table td:first-child,
.docx-wrapper table th:first-child {
border-left: none !important;
}
.docx-wrapper table td:last-child,
.docx-wrapper table th:last-child {
border-right: none !important;
}
.docx-wrapper table tr:last-child td {
border-bottom: none !important;
}
.docx-wrapper table caption {
caption-side: top !important;
padding: 12px 0 !important;
font-weight: 600 !important;
color: #3f57c0 !important;
font-size: 15px !important;
}
.docx-wrapper table strong,
.docx-wrapper table b {
color: #2a3aa8 !important;
}
`
const DEFAULT_DOC_URL = 'http://192.168.0.14:9090/smart-bid/technicalSolutionDatabase/2025/11/11/887b35d28b2149b6a7555fb639be9411.docx'
@ -183,15 +97,6 @@ export default {
}
},
ensureDocxStyleInjected() {
if (document.getElementById(DOCX_CUSTOM_STYLE_ID)) return
const styleTag = document.createElement('style')
styleTag.id = DOCX_CUSTOM_STYLE_ID
styleTag.type = 'text/css'
styleTag.appendChild(document.createTextNode(DOCX_CUSTOM_STYLE))
document.head.appendChild(styleTag)
},
async loadDocument() {
if (!this.docUrl) return
this.loading = true
@ -204,7 +109,6 @@ export default {
if (container) {
container.innerHTML = ''
}
this.ensureDocxStyleInjected()
try {
const headers = {}