iZaiZaiA há 2 anos atrás
pai
commit
404e8dfb84

+ 2 - 2
src/views/other/components/WbsTree.vue

@@ -128,8 +128,8 @@ const ElTreeClick = async (data,node) => {
 
 //处理自动展开的节点KEY
 const getNodeExpandKeys = async (node, newKeys) => {
-    const parent = getArrValue(node?.parent)
-    const { primaryKeyId } = getObjValue(node?.data)
+    const parent = node?.parent ?? []
+    const primaryKeyId = node?.data?.primaryKeyId ?? ''
     if (primaryKeyId) {
         newKeys.push(primaryKeyId)
         await getNodeExpandKeys(parent, newKeys)

+ 3 - 2
src/views/other/first-item.vue

@@ -67,7 +67,7 @@ watch(() => [
 })
 
 //自动展开缓存
-const TreeAutoExpandKeys = ref(getStoreData('wbsTreeExpandKeys') || [])
+const TreeAutoExpandKeys = ref(getStoreData('firstItemTreeKeys') || [])
 
 //类型tab数据和相关处理
 const tabTypeKey = ref(typeName)
@@ -93,7 +93,8 @@ const nodeWbsElTreeClick = ({data, keys}) => {
         //formValue.value.wbsId = data['primaryKeyId']
         //缓存自动展开
         TreeAutoExpandKeys.value = keys
-        setStoreData('TreeExpandKeys', keys)
+        console.log(keys)
+        setStoreData('firstItemTreeKeys', keys)
     } else {
         //wbsId.value = ''
         treeItem.value = {}