소스 검색

qhse资料库左侧菜单

yanghao 6 일 전
부모
커밋
ddbe1755bd
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/views/pms/qhse/data/PmsTree.vue

+ 5 - 0
src/views/pms/qhse/data/PmsTree.vue

@@ -114,6 +114,7 @@ const submitForm = async () => {
   // 表单验证逻辑
 
   try {
+    const targetParentId = formType.value === 'create' ? parentId.value : formData.value.parentId
     formData.value.type = 'file'
     if (formType.value === 'create') {
       formData.value.parentId = parentId.value
@@ -125,6 +126,10 @@ const submitForm = async () => {
     dialogVisible.value = false
     menuVisible.value = false
     await getTreeInfo()
+    if (targetParentId) {
+      expandedKeys.value = [...new Set([...expandedKeys.value, targetParentId])]
+      locateNode(targetParentId)
+    }
   } catch (error) {
     console.error(error)
   } finally {