From 545326bd8112c1b6bb63d9959d44696963d08ed7 Mon Sep 17 00:00:00 2001 From: yelan Date: Mon, 14 Sep 2026 09:13:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(signing):=20=E7=AD=BE=E7=BD=B2=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=9B=BA=E5=8C=96=E6=96=87=E4=B9=A6=20HTML=20?= =?UTF-8?q?=E5=B9=B6=E4=BA=A4=E4=BA=92=E5=8C=96=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clinical-web/package-lock.json | 23 -- clinical-web/package.json | 2 - clinical-web/src/api/workbench/signing.ts | 1 + clinical-web/src/api/workbench/types.ts | 6 + .../src/composables/useSigningTaskForm.ts | 1 + .../documents/components/WordEditorDialog.vue | 9 +- .../components/editors/EditorTinyPane.vue | 82 ----- .../src/views/management/documents/index.vue | 1 + .../components/SigningDocumentInteractive.vue | 310 ++++++++++++++++++ .../signing/components/SigningTaskDetail.vue | 9 +- 10 files changed, 328 insertions(+), 116 deletions(-) delete mode 100644 clinical-web/src/views/management/documents/components/editors/EditorTinyPane.vue create mode 100644 clinical-web/src/views/workbench/signing/components/SigningDocumentInteractive.vue diff --git a/clinical-web/package-lock.json b/clinical-web/package-lock.json index ddd3682..980efa8 100644 --- a/clinical-web/package-lock.json +++ b/clinical-web/package-lock.json @@ -9,7 +9,6 @@ "version": "0.0.0", "dependencies": { "@ckeditor/ckeditor5-vue": "^8.2.0", - "@tinymce/tinymce-vue": "^6.3.0", "@tiptap/extension-color": "^2.27.3", "@tiptap/extension-font-family": "^2.27.3", "@tiptap/extension-table": "^2.27.3", @@ -29,7 +28,6 @@ "element-plus": "^2.14.5", "mammoth": "^1.12.2", "pinia": "^4.0.3", - "tinymce": "^8.9.1", "vue": "^3.5.41", "vue-router": "^5.2.0" }, @@ -1605,21 +1603,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/@tinymce/tinymce-vue": { - "version": "6.3.0", - "resolved": "https://registry.npmmirror.com/@tinymce/tinymce-vue/-/tinymce-vue-6.3.0.tgz", - "integrity": "sha512-DSP8Jhd3XqCCliTnusfbmz3D8GqQ4iRzkc4aadYHDcJPVjkaqopJ61McOdH82CSy599vGLkPjGzqJYWJkRMiUA==", - "license": "MIT", - "peerDependencies": { - "tinymce": "^8.0.0 || ^7.0.0 || ^6.0.0 || ^5.5.1", - "vue": "^3.0.0" - }, - "peerDependenciesMeta": { - "tinymce": { - "optional": true - } - } - }, "node_modules/@tiptap/core": { "version": "2.27.3", "resolved": "https://registry.npmmirror.com/@tiptap/core/-/core-2.27.3.tgz", @@ -7078,12 +7061,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinymce": { - "version": "8.9.1", - "resolved": "https://registry.npmmirror.com/tinymce/-/tinymce-8.9.1.tgz", - "integrity": "sha512-5KrFiuKri2sPQW3ERWodsx3R0RZiw0cJJDr61qaMQiXO1ir3ZYaf6gVVaao+T29spZ9L9waaeE/co8Ov2Rn3vQ==", - "license": "SEE LICENSE IN license.md" - }, "node_modules/tippy.js": { "version": "6.3.7", "resolved": "https://registry.npmmirror.com/tippy.js/-/tippy.js-6.3.7.tgz", diff --git a/clinical-web/package.json b/clinical-web/package.json index 07c8ca9..18e8ccc 100644 --- a/clinical-web/package.json +++ b/clinical-web/package.json @@ -14,7 +14,6 @@ }, "dependencies": { "@ckeditor/ckeditor5-vue": "^8.2.0", - "@tinymce/tinymce-vue": "^6.3.0", "@tiptap/extension-color": "^2.27.3", "@tiptap/extension-font-family": "^2.27.3", "@tiptap/extension-table": "^2.27.3", @@ -34,7 +33,6 @@ "element-plus": "^2.14.5", "mammoth": "^1.12.2", "pinia": "^4.0.3", - "tinymce": "^8.9.1", "vue": "^3.5.41", "vue-router": "^5.2.0" }, diff --git a/clinical-web/src/api/workbench/signing.ts b/clinical-web/src/api/workbench/signing.ts index 63c09b2..dc91318 100644 --- a/clinical-web/src/api/workbench/signing.ts +++ b/clinical-web/src/api/workbench/signing.ts @@ -946,6 +946,7 @@ export async function createSigningTask(input: CreateSigningTaskInput): Promise< updatedAt: formatMockDate(), rowVersion: 1, backendStatus: 'WAITING_SIGN', + documentContentHtml: input.documentContentHtml, } mockRecords.unshift(task) diff --git a/clinical-web/src/api/workbench/types.ts b/clinical-web/src/api/workbench/types.ts index d85f66a..23b0241 100644 --- a/clinical-web/src/api/workbench/types.ts +++ b/clinical-web/src/api/workbench/types.ts @@ -60,6 +60,8 @@ export interface SigningTemplate { category: string description: string supportedMethods: SigningMethod[] + /** 原型:文书定稿 HTML 随模板携带,发起签署时进入任务快照。 */ + contentHtml?: string } export interface WorkbenchSummary { @@ -186,6 +188,8 @@ export interface SigningTaskRecord extends WorkbenchTask { signatureDataUrl?: string signedAt?: string voidReason?: string + /** 原型:任务创建时固化的文书 HTML(对应真实实现的模板版本快照 + contentSha256)。 */ + documentContentHtml?: string } export type SigningTaskListResponse = PageResult @@ -202,6 +206,8 @@ export interface CreateSigningTaskInput { visitType: VisitType visitNo: string department: string + /** 页面快照字段:仅 Mock 模式进入任务记录;真实接口不提交(后端按 templateVersionId 取版本快照)。 */ + documentContentHtml?: string } /** MEDISIGN 创建签署任务请求 DTO。不要向后端提交页面快照字段。 */ diff --git a/clinical-web/src/composables/useSigningTaskForm.ts b/clinical-web/src/composables/useSigningTaskForm.ts index 49cffc9..abd28b0 100644 --- a/clinical-web/src/composables/useSigningTaskForm.ts +++ b/clinical-web/src/composables/useSigningTaskForm.ts @@ -271,6 +271,7 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) { visitType: selectedVisit.value.type, visitNo: selectedVisit.value.visitNo, department: selectedVisit.value.department, + documentContentHtml: selectedTemplate.value.contentHtml, }) if (!isSigningMockEnabled && method.value === 'sms') { diff --git a/clinical-web/src/views/management/documents/components/WordEditorDialog.vue b/clinical-web/src/views/management/documents/components/WordEditorDialog.vue index 9aef0b4..3c6061d 100644 --- a/clinical-web/src/views/management/documents/components/WordEditorDialog.vue +++ b/clinical-web/src/views/management/documents/components/WordEditorDialog.vue @@ -6,7 +6,6 @@ import type { CampusRecord, DepartmentRecord } from '@/api/management/types' import EditorCkPane from './editors/EditorCkPane.vue' import EditorTipTapPane from './editors/EditorTipTapPane.vue' -import EditorTinyPane from './editors/EditorTinyPane.vue' import EditorWangPane from './editors/EditorWangPane.vue' import type { DocumentTemplate, TemplateEditorForm } from '../types' @@ -26,7 +25,7 @@ const emit = defineEmits<{ // Word 自维护方案:科室把文书从 Word/WPS 直接粘贴进来(保留表格与基本格式), // 或上传 .docx 由 mammoth 转换;签署时由交互管线识别"勾选"表并转为签署域。 // 富文本引擎做成可切换的三套(对比 Word 粘贴保真度),存储统一为编辑器产出的 HTML。 -type EditorEngine = 'wangeditor' | 'ckeditor5' | 'tinymce' | 'tiptap' +type EditorEngine = 'wangeditor' | 'ckeditor5' | 'tiptap' interface EditorPaneHandle { getText: () => string @@ -36,7 +35,6 @@ interface EditorPaneHandle { const engineComponents = { wangeditor: EditorWangPane, ckeditor5: EditorCkPane, - tinymce: EditorTinyPane, tiptap: EditorTipTapPane, } @@ -51,11 +49,6 @@ const engineOptions: Array<{ key: EditorEngine; label: string; note: string }> = label: 'CKEditor 5', note: 'PasteFromOffice 插件,Word 粘贴保真最强(GPL2)', }, - { - key: 'tinymce', - label: 'TinyMCE', - note: '均衡之选(MIT)', - }, { key: 'tiptap', label: 'TipTap', diff --git a/clinical-web/src/views/management/documents/components/editors/EditorTinyPane.vue b/clinical-web/src/views/management/documents/components/editors/EditorTinyPane.vue deleted file mode 100644 index 69d3162..0000000 --- a/clinical-web/src/views/management/documents/components/editors/EditorTinyPane.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/clinical-web/src/views/management/documents/index.vue b/clinical-web/src/views/management/documents/index.vue index cee6f5c..810ad1c 100644 --- a/clinical-web/src/views/management/documents/index.vue +++ b/clinical-web/src/views/management/documents/index.vue @@ -247,6 +247,7 @@ function toSigningTemplate(template: DocumentTemplate): SigningTemplate { category: template.category, description: template.description, supportedMethods: ['pad', 'sms'], + contentHtml: template.contentHtml, } } diff --git a/clinical-web/src/views/workbench/signing/components/SigningDocumentInteractive.vue b/clinical-web/src/views/workbench/signing/components/SigningDocumentInteractive.vue new file mode 100644 index 0000000..be05acd --- /dev/null +++ b/clinical-web/src/views/workbench/signing/components/SigningDocumentInteractive.vue @@ -0,0 +1,310 @@ + + + + + diff --git a/clinical-web/src/views/workbench/signing/components/SigningTaskDetail.vue b/clinical-web/src/views/workbench/signing/components/SigningTaskDetail.vue index 76b3884..06c1f28 100644 --- a/clinical-web/src/views/workbench/signing/components/SigningTaskDetail.vue +++ b/clinical-web/src/views/workbench/signing/components/SigningTaskDetail.vue @@ -1,6 +1,7 @@