fix:监听表单字段,调用流程预测节点

This commit is contained in:
lizhixian 2025-02-18 17:15:17 +08:00
parent b03711e0df
commit 7467b0b4e0

View File

@ -154,17 +154,21 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
// Tab // Tab
} }
} }
//
// formVariables
watch( watch(
detailForm.value, detailForm.value,
(newValue, oldValue) => { (newValue) => {
console.log('formVariables 发生了变化') if (newValue && Object.keys(newValue.value).length > 0) {
console.log('新值:', newValue) // startUserSelectTasks.value = []
console.log('旧值:', oldValue) // startUserSelectAssignees.value = []
getApprovalDetail({
id: props.selectProcessDefinition.id,
processVariablesStr: newValue.value
})
}
}, },
{ {
deep: true // immediate: true
} }
) )
@ -232,19 +236,7 @@ const submitForm = async () => {
} }
// //
await fApi.value.validate() await fApi.value.validate()
// // debugger
const savedAssignees = { ...startUserSelectAssignees.value }
//
await getApprovalDetail({
id: props.selectProcessDefinition.id,
processVariablesStr: detailForm.value?.value
})
//
Object.keys(savedAssignees).forEach((id) => {
if (startUserSelectAssignees.value[id]) {
startUserSelectAssignees.value[id] = savedAssignees[id]
}
})
// //
if (startUserSelectTasks.value?.length > 0) { if (startUserSelectTasks.value?.length > 0) {
for (const userTask of startUserSelectTasks.value) { for (const userTask of startUserSelectTasks.value) {