77 :data =" folderList"
88 :currentNodeKey =" currentFolder?.id"
99 @handleNodeClick =" folderClickHandel"
10+ @refreshTree =" refreshFolder"
1011 class =" p-8"
1112 />
1213 </template >
129130 </el-dropdown >
130131 </div >
131132 </template >
132- <div v-loading.fullscreen.lock =" paginationConfig.current_page === 1 && loading" >
133+ <div
134+ v-loading.fullscreen.lock =" paginationConfig.current_page === 1 && loading"
135+ style =" max-height : calc (100vh - 140px )"
136+ >
133137 <InfiniteScroll
134138 :size =" applicationList.length"
135139 :total =" paginationConfig.total"
@@ -367,21 +371,6 @@ function getList() {
367371 })
368372}
369373
370- function getFolder() {
371- const params = {}
372- folder .asyncGetFolder (FolderSource .APPLICATION , params , loading ).then ((res : any ) => {
373- folderList .value = res .data
374- currentFolder .value = res .data ?.[0 ] || {}
375- getList ()
376- })
377- }
378-
379- function folderClickHandel(row : any ) {
380- currentFolder .value = row
381- applicationList .value = []
382- getList ()
383- }
384-
385374function clickFolder(item : any ) {
386375 currentFolder .value .id = item .id
387376 applicationList .value = []
@@ -482,15 +471,6 @@ const exportApplication = (application: any) => {
482471 })
483472}
484473
485- const CreateFolderDialogRef = ref ()
486- function openCreateFolder() {
487- CreateFolderDialogRef .value .open (FolderSource .APPLICATION , currentFolder .value .parent_id )
488- }
489- function refreshFolder() {
490- applicationList .value = []
491- getFolder ()
492- getList ()
493- }
494474const elUploadRef = ref ()
495475const importApplication = (file : any ) => {
496476 const formData = new FormData ()
@@ -515,8 +495,34 @@ const importApplication = (file: any) => {
515495 })
516496}
517497
518- onMounted (() => {
498+ // 文件夹相关
499+ const CreateFolderDialogRef = ref ()
500+ function openCreateFolder() {
501+ CreateFolderDialogRef .value .open (FolderSource .APPLICATION , currentFolder .value .id )
502+ }
503+
504+ function getFolder(bool ? : boolean ) {
505+ const params = {}
506+ folder .asyncGetFolder (FolderSource .APPLICATION , params , loading ).then ((res : any ) => {
507+ folderList .value = res .data
508+ if (bool ) {
509+ // 初始化刷新
510+ currentFolder .value = res .data ?.[0 ] || {}
511+ }
512+ getList ()
513+ })
514+ }
515+ function folderClickHandel(row : any ) {
516+ currentFolder .value = row
517+ applicationList .value = []
518+ getList ()
519+ }
520+ function refreshFolder() {
521+ applicationList .value = []
519522 getFolder ()
523+ }
524+ onMounted (() => {
525+ getFolder (true )
520526})
521527 </script >
522528
0 commit comments