feat(management): 接入文档用户权限与报表

This commit is contained in:
yelan
2026-09-01 10:13:11 +08:00
parent beeb98d18f
commit e467f03f23
12 changed files with 2361 additions and 41 deletions
@@ -7,6 +7,8 @@ import type { DocumentTemplate } from '../types'
const props = defineProps<{
visible: boolean
template: DocumentTemplate | null
loading: boolean
error: boolean
}>()
const emit = defineEmits<{
@@ -49,7 +51,18 @@ const statusLabel = computed(() => {
</header>
<div class="dialog-body">
<article class="preview-paper">
<div v-if="loading" class="preview-state">正在加载模板内容…</div>
<div v-else-if="error" class="preview-state preview-state--error">
模板内容加载失败,请关闭后重试。
</div>
<iframe
v-else-if="template.contentHtml"
class="preview-frame"
:srcdoc="template.contentHtml"
sandbox=""
title="文档模板内容预览"
/>
<article v-else class="preview-paper">
<h3>{{ template.name }}</h3>
<p class="paper-number">模板编号:{{ template.code }} · 版本 {{ template.version }}</p>
<p>
@@ -84,9 +97,21 @@ const statusLabel = computed(() => {
</div>
<footer class="dialog-footer">
<p>占位符由系统在签署时自动填充,当前仅用于原型演示。</p>
<p>
{{
template.contentHtml
? '模板内容来自服务端,预览区域已限制脚本执行。'
: '占位符由系统在签署时自动填充,当前仅用于原型演示。'
}}
</p>
<button type="button" class="footer-button secondary" @click="emit('close')">关闭</button>
<button type="button" class="footer-button primary" @click="emit('use', template)">
<button
type="button"
class="footer-button primary"
:disabled="template.status !== 'enabled'"
:title="template.status === 'enabled' ? '用此模板发起签署' : '仅已启用模板可发起签署'"
@click="emit('use', template)"
>
用此模板发起签署
</button>
</footer>
@@ -194,6 +219,26 @@ const statusLabel = computed(() => {
overflow-y: auto;
}
.preview-state {
display: grid;
min-height: 420px;
color: var(--mut);
font-size: 13px;
place-items: center;
}
.preview-state--error {
color: var(--err);
}
.preview-frame {
display: block;
width: 100%;
min-height: 560px;
background: #fff;
border: 1px solid #eef4f6;
}
.preview-paper {
min-height: 420px;
padding: 26px 34px;
@@ -299,6 +344,14 @@ const statusLabel = computed(() => {
filter: brightness(0.96);
}
.footer-button:disabled {
color: #aebbc0;
background: #f1f5f6;
border-color: #dce5e8;
cursor: not-allowed;
filter: none;
}
@media (max-width: 680px) {
.preview-paper {
padding: 22px 18px;