fix(document): 统一编辑器与文书纸的排版和字体口径
This commit is contained in:
@@ -361,11 +361,9 @@ defineExpose({ getDocumentElement })
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.managed-font,
|
||||
.managed-font :deep(*) {
|
||||
font-family: var(--document-font) !important;
|
||||
font-synthesis: none;
|
||||
}
|
||||
/* 文书字体(.managed-font / --document-font)在 utils/document-paper.ts 的
|
||||
DOCUMENT_PAPER_CSS 里 —— 编辑器编辑面也要换上同一份字体,所以它是全局规则,
|
||||
不是这张纸私有的。 */
|
||||
|
||||
/* 基础排版(p / h2 / h3 / table / th / td / img)在 utils/document-paper.ts 的
|
||||
DOCUMENT_PAPER_CSS 里,运行期注入 head —— 那里是唯一一份。
|
||||
|
||||
@@ -58,7 +58,14 @@ const props = withDefaults(
|
||||
* - `stage`:深灰底、居中 A4,用于「在线预览(PDF)」(原型 #mdPdfView)
|
||||
*/
|
||||
stage?: 'plain' | 'stage'
|
||||
/** 弹窗宽度(px) */
|
||||
/**
|
||||
* 弹窗宽度(px)。
|
||||
*
|
||||
* 默认 880 不是随手取的:纸钉在 A4 设计宽 820px(.doc-paper-stage),
|
||||
* 纸舞台左右各留 18px 内边距 → 856px 刚好放下。窄于它虽然靠横向滚动也能看全,
|
||||
* 但一进来就出现横向滚动条会让人以为版式坏了。深灰舞台(stage)的左右内边距是 24px,
|
||||
* 所以那一档要 960(见 SignedDocumentDialog)。
|
||||
*/
|
||||
width?: number
|
||||
/**
|
||||
* 是否叠在另一个弹窗之上(发起签署弹窗里的文档预览)。
|
||||
@@ -84,7 +91,7 @@ const props = withDefaults(
|
||||
note: '',
|
||||
emptyText: '该文书暂无正文内容。',
|
||||
stage: 'plain',
|
||||
width: 720,
|
||||
width: 880,
|
||||
stacked: false,
|
||||
},
|
||||
)
|
||||
@@ -159,7 +166,10 @@ defineExpose({ getDocumentElement })
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="preview-body" :class="{ 'preview-body--stage': stage === 'stage' }">
|
||||
<div
|
||||
class="preview-body doc-paper-stage"
|
||||
:class="{ 'preview-body--stage': stage === 'stage' }"
|
||||
>
|
||||
<p v-if="note && !loading && !error" class="preview-note">{{ note }}</p>
|
||||
<div v-if="loading" class="preview-state">正在加载文书内容…</div>
|
||||
<div v-else-if="error" class="preview-state preview-state--error">{{ error }}</div>
|
||||
@@ -335,7 +345,10 @@ defineExpose({ getDocumentElement })
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* 唯一滚动区:纸在自己的框里滚,头尾常驻 */
|
||||
/* 唯一滚动区:纸在自己的框里滚,头尾常驻。
|
||||
`doc-paper-stage`(见 utils/document-paper.ts)把纸钉在 A4 设计宽 820px:
|
||||
框比纸窄时横向滚动,而不是把纸压窄 —— 版心一变,换行位置就和编辑器/PDF 不同了。
|
||||
`overflow-y: auto` 已隐含 overflow-x 为 auto,横向滚动条按需出现,不必另写。 */
|
||||
.preview-body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user