From 715b9a03abb3b91d1d4bf8c6e7672c5e25772098 Mon Sep 17 00:00:00 2001 From: yelan Date: Wed, 7 Oct 2026 15:02:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(documents):=20=E6=96=B0=E5=A2=9E=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E9=A1=B9=E5=8D=A0=E4=BD=8D=E7=AC=A6=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E6=89=8B=E5=8A=A8=E6=8C=89=E9=92=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../documents/components/WordEditorDialog.vue | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/clinical-web/src/views/management/documents/components/WordEditorDialog.vue b/clinical-web/src/views/management/documents/components/WordEditorDialog.vue index 816a1b4..d7b1875 100644 --- a/clinical-web/src/views/management/documents/components/WordEditorDialog.vue +++ b/clinical-web/src/views/management/documents/components/WordEditorDialog.vue @@ -77,7 +77,34 @@ const message = reactive({ text: '', tone: '' as '' | 'ok' | 'warn' }) * 那种位置必须有占位符,否则签署时不会回填(系统不会另外在文书上插患者信息)。 */ const AUTO_FILL_LABELS = ['患者姓名', '性别', '年龄', '就诊号', '与患者关系', '签署日期'] -const MANUAL_LABELS = ['签名', '勾选项'] + +/** + * 自行填写 / 签名按钮。三项的取值都来自现场采集,没有系统来源,因此都不查目录、 + * 一律走自定义项(custom:…,字段键由 insertField 按正文占用情况当场分配): + * - 签名:插入独立签名位,可重复插入并改名; + * - 勾选项:勾选 / 单选控件,选项在右侧面板里配置; + * - 填写项:自由文本输入框,签署时由患者或家属现场填写。 + * + * kind 必须逐项写死:这三项在目录里都查不到,兜底出来的类型不会自己变成想要的那个 + * (findPreset 只认目录与签名),一律兜成 checkbox 会让填写项插出来是个勾选框。 + */ +const MANUAL_BUTTONS: Array<{ label: string; kind: SigningFieldKind; title: string }> = [ + { + label: '签名', + kind: 'signature', + title: '插入独立签名位置,可改名为患者签名、家属签名或医生签名', + }, + { + label: '勾选项', + kind: 'checkbox', + title: '签署时由患者逐项勾选;点正文里的胶囊可配置多个选项', + }, + { + label: '填写项', + kind: 'text', + title: '签署时由患者或家属现场填写;点正文里的胶囊可改名称与是否必填', + }, +] function findPreset(label: string): SigningFieldDef | null { if (label === '签名') { @@ -100,12 +127,13 @@ const autoFillButtons = computed(() => ) const manualButtons = computed(() => - MANUAL_LABELS.map((label) => ({ + MANUAL_BUTTONS.map(({ label, kind, title }) => ({ label, + title, field: findPreset(label) ?? { id: `custom:${label}`, label, - kind: 'checkbox' as SigningFieldKind, + kind, required: false, options: [], }, @@ -762,16 +790,14 @@ function requestClose() { type="button" class="pb-chip" :class="`is-${button.field.kind}`" - :title=" - button.field.kind === 'signature' - ? '插入独立签名位置,可改名为患者签名、家属签名或医生签名' - : '签署时由患者逐项勾选;点正文里的胶囊可配置多个选项' - " + :title="button.title" @click="insertField(button.field)" > [{{ button.label }}] - 签名可重复插入并自定义名称;勾选项在签署时填写 + + 签名可重复插入并自定义名称;勾选项与填写项在签署时填写 + @@ -1129,8 +1155,9 @@ function requestClose() { color: #9a5f00; } -/* 占位符按钮:颜色与正文里胶囊的配色一一对应(蓝=自动填、橙=签名、绿=勾选), - 点之前就知道会插进一个什么样的胶囊 */ +/* 占位符按钮:颜色与正文里胶囊的配色一一对应(蓝=文本、橙=签名、绿=勾选), + 点之前就知道会插进一个什么样的胶囊。文本蓝同时用于 HIS 自动填充项与「填写项」: + 两者落进正文都是同一个文本胶囊,颜色按控件类型走,不按取值来源分 */ .pb-chip { padding: 3px 7px; font-size: 12px; @@ -1154,6 +1181,10 @@ function requestClose() { border-color: #0f9d6c; } +.pb-chip.is-text { + color: var(--brand); +} + .pb-chip:hover { background: var(--brand-l); }