From acdd310656c12fe119cdf43f8ae09eec1f5f6075 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 28 Nov 2025 13:09:10 +0800 Subject: [PATCH] =?UTF-8?q?word=20=E6=96=87=E6=A1=A3=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=AF=E9=80=89=E4=B8=AD=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/DocumentSearchWord.vue | 95 +++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/views/common/DocumentSearchWord.vue b/src/views/common/DocumentSearchWord.vue index c1f44e3..230ddb3 100644 --- a/src/views/common/DocumentSearchWord.vue +++ b/src/views/common/DocumentSearchWord.vue @@ -928,6 +928,12 @@ export default { color: #303133; line-height: 1.8; font-size: 15px; + // 启用文本选择和复制 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + cursor: text; } .floating-search { @@ -1140,6 +1146,11 @@ export default { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; will-change: scroll-position; + // 启用文本选择 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; // 自定义滚动条 &::-webkit-scrollbar { @@ -1170,6 +1181,20 @@ export default { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); padding: 60px 80px; min-height: calc(100vh - 200px); + // 启用文本选择和复制 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + // 优化选中文本的样式 + ::selection { + background: rgba(64, 158, 255, 0.2); + color: #303133; + } + ::-moz-selection { + background: rgba(64, 158, 255, 0.2); + color: #303133; + } @media (max-width: 1200px) { padding: 50px 60px; @@ -1190,10 +1215,20 @@ export default { box-shadow: none; overflow: visible; border: none; + // 启用文本选择 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; } ::v-deep .docx-viewer-wrapper { background: transparent; + // 启用文本选择 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; } ::v-deep .docx-viewer-wrapper>section.docx-viewer { @@ -1201,33 +1236,64 @@ export default { box-shadow: none; margin-bottom: 0 !important; padding: 0; + // 启用文本选择 + user-select: text; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; } ::v-deep .docx-viewer { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #303133; line-height: 1.8; + // 启用文本选择和复制 + user-select: text !important; + -webkit-user-select: text !important; + -moz-user-select: text !important; + -ms-user-select: text !important; + // 优化选中文本的样式 + ::selection { + background: rgba(64, 158, 255, 0.25) !important; + color: #303133 !important; + } + ::-moz-selection { + background: rgba(64, 158, 255, 0.25) !important; + color: #303133 !important; + } + + // 确保所有子元素都可以选择文本 + * { + user-select: text !important; + -webkit-user-select: text !important; + -moz-user-select: text !important; + -ms-user-select: text !important; + } p { margin: 0.8em 0; word-wrap: break-word; word-break: break-word; + cursor: text; } h1, h2, h3, h4, h5, h6 { margin: 1.2em 0 0.8em 0; font-weight: 600; line-height: 1.4; + cursor: text; } table { border-collapse: collapse; width: 100%; margin: 1em 0; + cursor: text; td, th { padding: 8px 12px; border: 1px solid #e4e7ed; + cursor: text; } th { @@ -1239,10 +1305,12 @@ export default { ul, ol { margin: 0.8em 0; padding-left: 2em; + cursor: text; } li { margin: 0.4em 0; + cursor: text; } img { @@ -1250,6 +1318,21 @@ export default { height: auto; display: block; margin: 1em auto; + user-select: none; + -webkit-user-select: none; + cursor: default; + } + + // 确保链接可以选择文本 + a { + cursor: pointer; + user-select: text !important; + } + + // 确保代码块可以选择文本 + code, pre { + user-select: text !important; + cursor: text; } } @@ -1308,6 +1391,12 @@ export default { padding: 2px 4px; border-radius: 3px; transition: all 0.2s ease; + // 确保高亮标记内的文本可以选择 + user-select: text !important; + -webkit-user-select: text !important; + -moz-user-select: text !important; + -ms-user-select: text !important; + cursor: text; } ::v-deep .search-highlight.is-active, @@ -1319,5 +1408,11 @@ export default { padding: 2px 4px; font-weight: 500; transition: all 0.2s ease; + // 确保激活的高亮标记内的文本可以选择 + user-select: text !important; + -webkit-user-select: text !important; + -moz-user-select: text !important; + -ms-user-select: text !important; + cursor: text; } \ No newline at end of file