feat(signing): 将签署占位符改为原子节点并支持多选选项组
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user