feat(演示): 持久化 Mock 数据并打通文档库发起签署闭环
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { MOCK_STORAGE_KEYS, readMockState, writeMockState } from '@/utils/mock-storage'
|
||||
import type { SigningDocumentData } from '@/utils/signing-document'
|
||||
|
||||
import type { DocumentDepartment, DocumentStatus } from './types'
|
||||
@@ -19,6 +20,16 @@ export { documentStatusLabels }
|
||||
// Word 自维护方案:文书库初始为空,所有文书由科室通过 Word 编辑器(粘贴 / 导入 .docx)创建维护。
|
||||
export const documentLibrary: DocumentDepartment[] = []
|
||||
|
||||
/** 读取演示文书库:优先用本地保存的数据,没有则用初始空库(调用方负责再克隆一份使用) */
|
||||
export function loadDocumentLibrary(): DocumentDepartment[] {
|
||||
return readMockState<DocumentDepartment[]>(MOCK_STORAGE_KEYS.documentLibrary) ?? documentLibrary
|
||||
}
|
||||
|
||||
/** 保存演示文书库,刷新后仍可继续编辑、预览与发起签署 */
|
||||
export function saveDocumentLibrary(library: DocumentDepartment[]): void {
|
||||
writeMockState(MOCK_STORAGE_KEYS.documentLibrary, library)
|
||||
}
|
||||
|
||||
/**
|
||||
* 签署预览使用的示例患者快照(脱敏演示数据)。
|
||||
* 创建文书时还没有真实签署任务,用固定示例值让科室看到占位符被填充后的版式;
|
||||
|
||||
Reference in New Issue
Block a user