This commit is contained in:
zlwu committed 2026-08-01 17:29:37 +08:00
1 parent 06956b742b
commit e59b2aa6cb
104 files changed
+653227 -7621

No files matched your search

@@ -102,13 +102,19 @@
const submitting = ref(false)
const form = reactive({
approved: true,
commentText: ''
commentText: '审批通过'
})
const DEFAULT_OPINIONS = ['审批通过', '审批驳回'] as const
const bizLoading = ref(false)
const formFields = ref<Array<{ label: string; value: string }>>([])
const instanceData = ref<Record<string, any> | null>(null)
function defaultOpinion(approved: boolean) {
return approved ? '审批通过' : '审批驳回'
}
async function loadFormData() {
if (!props.instanceId) return
bizLoading.value = true
@@ -130,12 +136,21 @@
(val) => {
if (val) {
form.approved = true
form.commentText = ''
form.commentText = defaultOpinion(true)
loadFormData()
}
}
)
watch(
() => form.approved,
(approved) => {
if (!form.commentText.trim() || DEFAULT_OPINIONS.includes(form.commentText as (typeof DEFAULT_OPINIONS)[number])) {
form.commentText = defaultOpinion(approved)
}
}
)
async function handleSubmit() {
submitting.value = true
try {