bill hai 7 meses
pai
achega
3681cbb47f
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 1 1
      src/store/floder-type.ts
  2. 3 2
      src/store/floder.ts

+ 1 - 1
src/store/floder-type.ts

@@ -25,7 +25,7 @@ const gemerateRoot = (parentId: number | null = null) => {
   const items: FloderRoot[] = [];
   for (let i = 0; i < floderTypes.value.length; i++) {
     const type = floderTypes.value[i];
-    if (type.parentId === parentId) {
+    if (type.parentId === parentId || (type.parentId === undefined && parentId === null)) {
       const item = {
         id: type.filesTypeId,
         title: type.filesTypeName,

+ 3 - 2
src/store/floder.ts

@@ -5,8 +5,9 @@ import type { Floders } from '@/api'
 import type { FloderType } from './floder-type'
 
 export const floders = ref<Floders>([])
-export const getFloderByType = (type: FloderType) => 
-  floders.value.filter(floder => floder.filesTypeId === type.filesTypeId)
+export const getFloderByType = (type: FloderType) =>  {
+  return floders.value.filter(floder => floder.filesTypeId === type.filesTypeId)
+}
 
 
 export const initialFloders = async () => {