Explorar el Código

qhse资料库左侧菜单

yanghao hace 6 días
padre
commit
ddbe1755bd
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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 {