1
1
<template >
2
- <el-popover placement =" right" :width =" 400" trigger =" click" :title =" $t('file.list')" >
2
+ <el-popover placement =" right" :width =" 400" trigger =" click" :title =" $t('file.list')" :visible = " popoverVisible " >
3
3
<template #reference >
4
- <el-button :icon =" Folder" ></el-button >
4
+ <el-button :icon =" Folder" @click = " popoverVisible = true " ></el-button >
5
5
</template >
6
6
<div >
7
7
<BreadCrumbs >
8
- <BreadCrumbItem @click =" jump(-1)" :right =" paths.length == 0" >/</BreadCrumbItem >
9
- <BreadCrumbItem
10
- v-for =" (item, key) in paths"
11
- :key =" key"
12
- @click =" jump(key)"
13
- :right =" key == paths.length - 1"
14
- >
15
- <!-- <span class="sle">{{ item }}</span> -->
16
- {{ item }}
8
+ <BreadCrumbItem @click =" jump(-1)" :right =" paths.length == 0" >
9
+ <el-icon ><HomeFilled /></el-icon >
17
10
</BreadCrumbItem >
11
+ <template v-if =" paths .length > 2 " >
12
+ <BreadCrumbItem >
13
+ <el-dropdown ref =" dropdown1" trigger =" click" @command =" jump($event)" >
14
+ <span class =" el-dropdown-link" >...</span >
15
+ <template #dropdown >
16
+ <el-dropdown-menu >
17
+ <el-dropdown-item
18
+ v-for =" (item, key) in paths.slice(0, -1)"
19
+ :key =" key"
20
+ :command =" key"
21
+ >
22
+ {{ item }}
23
+ </el-dropdown-item >
24
+ </el-dropdown-menu >
25
+ </template >
26
+ </el-dropdown >
27
+ </BreadCrumbItem >
28
+ <BreadCrumbItem @click =" jump(paths.length - 1)" :right =" true" >
29
+ <span class =" sle" style =" max-width : 200px " >{{ paths[paths.length - 1] }}</span >
30
+ </BreadCrumbItem >
31
+ </template >
32
+ <template v-else >
33
+ <BreadCrumbItem
34
+ v-for =" (item, key) in paths"
35
+ :key =" key"
36
+ @click =" jump(key)"
37
+ :right =" key == paths.length - 1"
38
+ >
39
+ <span class =" sle" style =" max-width : 200px " >{{ item }}</span >
40
+ </BreadCrumbItem >
41
+ </template >
18
42
</BreadCrumbs >
19
43
</div >
20
44
<div >
@@ -50,6 +74,8 @@ let loading = ref(false);
50
74
let paths = ref <string []>([]);
51
75
let req = reactive ({ path: ' /' , expand: true , page: 1 , pageSize: 300 });
52
76
77
+ const popoverVisible = ref (false );
78
+
53
79
const props = defineProps ({
54
80
path: {
55
81
type: String ,
@@ -66,6 +92,7 @@ const em = defineEmits(['choose']);
66
92
const checkFile = (row : any ) => {
67
93
rowName .value = row .name ;
68
94
em (' choose' , row .path );
95
+ popoverVisible .value = false ;
69
96
};
70
97
71
98
const open = async (row : File .File ) => {
@@ -91,6 +118,7 @@ const jump = async (index: number) => {
91
118
}
92
119
req .path = path ;
93
120
search (req );
121
+ popoverVisible .value = true ;
94
122
};
95
123
96
124
const search = async (req : File .ReqFile ) => {
0 commit comments