Skip to content

Commit 3de37a7

Browse files
feat: Optimize file selection UI (#8027)
1 parent 7b1980f commit 3de37a7

File tree

5 files changed

+35
-47
lines changed

5 files changed

+35
-47
lines changed

frontend/src/assets/iconfont/iconfont.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@font-face {
22
font-family: "iconfont"; /* Project id 4776196 */
3-
src: url('iconfont.woff2?t=1740474796282') format('woff2'),
4-
url('iconfont.woff?t=1740474796282') format('woff'),
5-
url('iconfont.ttf?t=1740474796282') format('truetype'),
6-
url('iconfont.svg?t=1740474796282#iconfont') format('svg');
3+
src: url('iconfont.woff2?t=1740641533654') format('woff2'),
4+
url('iconfont.woff?t=1740641533654') format('woff'),
5+
url('iconfont.ttf?t=1740641533654') format('truetype'),
6+
url('iconfont.svg?t=1740641533654#iconfont') format('svg');
77
}
88

99
.iconfont {
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.

frontend/src/components/file-list/index.vue

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,34 @@
88
popper-class="file-list"
99
>
1010
<template #reference>
11-
<el-button :icon="Folder" :disabled="disabled" @click="openPage()"></el-button>
11+
<el-button icon="Folder" :disabled="disabled" @click="openPage()"></el-button>
1212
</template>
1313
<div>
14-
<el-button class="close" link @click="closePage">
15-
<el-icon><Close /></el-icon>
16-
</el-button>
17-
<BreadCrumbs>
18-
<BreadCrumbItem @click="jump(-1)" :right="paths.length == 0">
19-
<el-icon><HomeFilled /></el-icon>
20-
</BreadCrumbItem>
21-
<template v-if="paths.length > 2">
22-
<BreadCrumbItem>
23-
<el-dropdown ref="dropdown1" trigger="click" @command="jump($event)">
24-
<span class="el-dropdown-link">...</span>
25-
<template #dropdown>
26-
<el-dropdown-menu>
27-
<el-dropdown-item
28-
v-for="(item, key) in paths.slice(0, -1)"
29-
:key="key"
30-
:command="key"
31-
>
32-
{{ item }}
33-
</el-dropdown-item>
34-
</el-dropdown-menu>
35-
</template>
36-
</el-dropdown>
37-
</BreadCrumbItem>
38-
<BreadCrumbItem @click="jump(paths.length - 1)" :right="true">
39-
<span class="sle" style="max-width: 200px">{{ paths[paths.length - 1] }}</span>
40-
</BreadCrumbItem>
41-
</template>
42-
<template v-else>
43-
<BreadCrumbItem
44-
v-for="(item, key) in paths"
45-
:key="key"
46-
@click="jump(key)"
47-
:right="key == paths.length - 1"
48-
>
49-
<span class="sle" style="max-width: 200px">{{ item }}</span>
50-
</BreadCrumbItem>
51-
</template>
52-
</BreadCrumbs>
14+
<el-button class="close" link @click="closePage" icon="Close"></el-button>
15+
<div>
16+
<el-button type="text" icon="HomeFilled" @click="jump(-1)"></el-button>
17+
<el-button v-if="paths.length > 0" type="text">
18+
{{ paths[0] }}
19+
</el-button>
20+
<el-popover v-if="paths.length > 2" placement="bottom" trigger="hover">
21+
<template #reference>
22+
<el-button type="text">...</el-button>
23+
</template>
24+
<div class="hidden-paths">
25+
<el-button
26+
v-for="(path, index) in paths.slice(1, -1)"
27+
:key="index"
28+
type="text"
29+
@click="jump(index)"
30+
>
31+
{{ path }}
32+
</el-button>
33+
</div>
34+
</el-popover>
35+
<el-button v-if="paths.length > 1" type="text" @click="jump(paths.length - 1)">
36+
{{ paths[paths.length - 1] }}
37+
</el-button>
38+
</div>
5339
</div>
5440
<div class="mt-4">
5541
<el-button link @click="onAddItem(true)" type="primary" size="small">
@@ -129,9 +115,6 @@
129115
<script lang="ts" setup>
130116
import { File } from '@/api/interface/file';
131117
import { createFile, getFilesList } from '@/api/modules/files';
132-
import { Folder, HomeFilled, Close } from '@element-plus/icons-vue';
133-
import BreadCrumbs from '@/components/bread-crumbs/index.vue';
134-
import BreadCrumbItem from '@/components/bread-crumbs/bread-crumbs-item.vue';
135118
import { onMounted, onUpdated, reactive, ref, nextTick } from 'vue';
136119
import i18n from '@/lang';
137120
import { MsgSuccess, MsgWarning } from '@/utils/message';
@@ -362,4 +345,9 @@ onUpdated(() => {
362345
float: right;
363346
}
364347
}
348+
349+
.hidden-paths {
350+
display: flex;
351+
flex-direction: column;
352+
}
365353
</style>

0 commit comments

Comments
 (0)