feat(signing): 将签署占位符改为原子节点并支持多选选项组

This commit is contained in:
yelan
2026-09-24 12:13:24 +08:00
parent ec24e85829
commit 9a6ac93e21
13 changed files with 2141 additions and 121 deletions
@@ -3,6 +3,7 @@ import { computed, onMounted, ref, watch } from 'vue'
import type { SigningAnswers, SigningTaskRecord } from '@/api/workbench/types'
import {
applyAnswerToFieldHost,
applySignatureToRoot,
buildSigningDocumentHtml,
describeFieldProgress,
@@ -143,24 +144,9 @@ function applyStoredValues() {
return
}
if (typeof value === 'boolean') {
const checkbox = host.querySelector<HTMLInputElement>('input[type="checkbox"]')
if (checkbox) {
checkbox.checked = value
}
return
}
const input = host.querySelector<HTMLInputElement>(
'input:not([type="radio"]):not([type="checkbox"])',
)
if (input) {
input.value = value
}
host.querySelectorAll<HTMLInputElement>('input[type="radio"]').forEach((radio) => {
radio.checked = radio.value === value
})
// 读写的判据都在 signing-document 里(readAnswersFromRoot 的镜像),
// 这里不自己写 data-sign-* 选择器,否则多选组这类"同 DOM 不同语义"的控件会两处漂移
applyAnswerToFieldHost(host, value)
})
}