fix:监听输入变量值,预测节点轨迹。导致节点配置审批人错误问题

This commit is contained in:
smallNorthLee 2025-02-18 22:40:47 +08:00
parent 7467b0b4e0
commit b53bfbd49e

View File

@ -108,6 +108,7 @@ const fApi = ref<ApiAttrs>()
//
const startUserSelectTasks: any = ref([]) //
const startUserSelectAssignees = ref({}) //
const hisStartUserSelectAssignees = ref({}) //
const bpmnXML: any = ref(null) // BPMN
const simpleJson = ref<string | undefined>() // Simple json
@ -154,13 +155,15 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
// Tab
}
}
//
watch(
detailForm.value,
(newValue) => {
if (newValue && Object.keys(newValue.value).length > 0) {
// startUserSelectTasks.value = []
// startUserSelectAssignees.value = []
//
hisStartUserSelectAssignees.value = startUserSelectAssignees.value
startUserSelectAssignees.value = {}
getApprovalDetail({
id: props.selectProcessDefinition.id,
processVariablesStr: newValue.value
@ -186,19 +189,24 @@ const getApprovalDetail = async (row: any) => {
message.error('查询不到审批详情信息!')
return
}
// Timeline
activityNodes.value = data.activityNodes
//
startUserSelectTasks.value = data.activityNodes?.filter(
(node: ApprovalNodeInfo) => CandidateStrategy.START_USER_SELECT === node.candidateStrategy
)
if (startUserSelectTasks.value?.length > 0) {
for (const node of startUserSelectTasks.value) {
if (hisStartUserSelectAssignees.value[node.id] && hisStartUserSelectAssignees.value[node.id].length > 0) {
startUserSelectAssignees.value[node.id] = hisStartUserSelectAssignees.value[node.id]
} else {
startUserSelectAssignees.value[node.id] = []
}
}
}
// Timeline
activityNodes.value = data.activityNodes
//
const formFieldsPermission = data.formFieldsPermission
//
@ -236,7 +244,6 @@ const submitForm = async () => {
}
//
await fApi.value.validate()
// debugger
//
if (startUserSelectTasks.value?.length > 0) {
for (const userTask of startUserSelectTasks.value) {