feat(font): 新增字体设置并统一医护端与患者端文书字体
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { loadDocumentFont } from '../../../packages/document-fonts'
|
||||
import { reactive } from 'vue'
|
||||
|
||||
import {
|
||||
@@ -59,6 +60,8 @@ const initialState: SignFlowState = {
|
||||
age: '',
|
||||
visitNo: 'MZ20260827018',
|
||||
department: '',
|
||||
documentFontFamily: '',
|
||||
documentFontReady: false,
|
||||
documentTitle: '儿科急诊特殊检查知情同意书',
|
||||
templateVersion: 'v1.0.0',
|
||||
documentContentHtml: '',
|
||||
@@ -447,6 +450,12 @@ async function loadSigningContext(): Promise<SigningContextResponse | null> {
|
||||
try {
|
||||
const context = await fetchSigningContext(proof)
|
||||
applyContext(context)
|
||||
signingState.documentFontReady = false
|
||||
signingState.documentFontFamily = await loadDocumentFont(
|
||||
context.document?.font ?? null,
|
||||
import.meta.env.VITE_API_BASE_URL || '/api',
|
||||
)
|
||||
signingState.documentFontReady = true
|
||||
persistSession()
|
||||
return context
|
||||
} catch (error) {
|
||||
@@ -488,6 +497,7 @@ function applyDemoContext() {
|
||||
signingState.fields = [
|
||||
{ id: DEMO_PATIENT_FIELD_ID, label: '患者签名', kind: 'signature', required: true },
|
||||
]
|
||||
signingState.documentFontReady = true
|
||||
signingState.documentLoaded = true
|
||||
signingState.documentError = ''
|
||||
signingState.taskStatus = 'WAITING_SIGN'
|
||||
@@ -583,7 +593,9 @@ export async function submitRealSignature(input: {
|
||||
!signingState.taskId ||
|
||||
!signingState.deliveryId ||
|
||||
!signingState.uploadToken ||
|
||||
!input.consentAccepted
|
||||
!input.consentAccepted ||
|
||||
!signingState.documentLoaded ||
|
||||
!signingState.documentFontReady
|
||||
) {
|
||||
throw new Error('签署凭证或知情确认状态无效,请重新打开签署链接。')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user