mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-28 19:14:13 +08:00
feat: Optimize file selection UI (#8027)
This commit is contained in:
parent
7b1980f7b7
commit
3de37a7cba
@ -1,9 +1,9 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 4776196 */
|
font-family: "iconfont"; /* Project id 4776196 */
|
||||||
src: url('iconfont.woff2?t=1740474796282') format('woff2'),
|
src: url('iconfont.woff2?t=1740641533654') format('woff2'),
|
||||||
url('iconfont.woff?t=1740474796282') format('woff'),
|
url('iconfont.woff?t=1740641533654') format('woff'),
|
||||||
url('iconfont.ttf?t=1740474796282') format('truetype'),
|
url('iconfont.ttf?t=1740641533654') format('truetype'),
|
||||||
url('iconfont.svg?t=1740474796282#iconfont') format('svg');
|
url('iconfont.svg?t=1740641533654#iconfont') format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,48 +8,34 @@
|
|||||||
popper-class="file-list"
|
popper-class="file-list"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="Folder" :disabled="disabled" @click="openPage()"></el-button>
|
<el-button icon="Folder" :disabled="disabled" @click="openPage()"></el-button>
|
||||||
</template>
|
</template>
|
||||||
<div>
|
<div>
|
||||||
<el-button class="close" link @click="closePage">
|
<el-button class="close" link @click="closePage" icon="Close"></el-button>
|
||||||
<el-icon><Close /></el-icon>
|
<div>
|
||||||
</el-button>
|
<el-button type="text" icon="HomeFilled" @click="jump(-1)"></el-button>
|
||||||
<BreadCrumbs>
|
<el-button v-if="paths.length > 0" type="text">
|
||||||
<BreadCrumbItem @click="jump(-1)" :right="paths.length == 0">
|
{{ paths[0] }}
|
||||||
<el-icon><HomeFilled /></el-icon>
|
</el-button>
|
||||||
</BreadCrumbItem>
|
<el-popover v-if="paths.length > 2" placement="bottom" trigger="hover">
|
||||||
<template v-if="paths.length > 2">
|
<template #reference>
|
||||||
<BreadCrumbItem>
|
<el-button type="text">...</el-button>
|
||||||
<el-dropdown ref="dropdown1" trigger="click" @command="jump($event)">
|
</template>
|
||||||
<span class="el-dropdown-link">...</span>
|
<div class="hidden-paths">
|
||||||
<template #dropdown>
|
<el-button
|
||||||
<el-dropdown-menu>
|
v-for="(path, index) in paths.slice(1, -1)"
|
||||||
<el-dropdown-item
|
:key="index"
|
||||||
v-for="(item, key) in paths.slice(0, -1)"
|
type="text"
|
||||||
:key="key"
|
@click="jump(index)"
|
||||||
:command="key"
|
>
|
||||||
>
|
{{ path }}
|
||||||
{{ item }}
|
</el-button>
|
||||||
</el-dropdown-item>
|
</div>
|
||||||
</el-dropdown-menu>
|
</el-popover>
|
||||||
</template>
|
<el-button v-if="paths.length > 1" type="text" @click="jump(paths.length - 1)">
|
||||||
</el-dropdown>
|
{{ paths[paths.length - 1] }}
|
||||||
</BreadCrumbItem>
|
</el-button>
|
||||||
<BreadCrumbItem @click="jump(paths.length - 1)" :right="true">
|
</div>
|
||||||
<span class="sle" style="max-width: 200px">{{ paths[paths.length - 1] }}</span>
|
|
||||||
</BreadCrumbItem>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<BreadCrumbItem
|
|
||||||
v-for="(item, key) in paths"
|
|
||||||
:key="key"
|
|
||||||
@click="jump(key)"
|
|
||||||
:right="key == paths.length - 1"
|
|
||||||
>
|
|
||||||
<span class="sle" style="max-width: 200px">{{ item }}</span>
|
|
||||||
</BreadCrumbItem>
|
|
||||||
</template>
|
|
||||||
</BreadCrumbs>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<el-button link @click="onAddItem(true)" type="primary" size="small">
|
<el-button link @click="onAddItem(true)" type="primary" size="small">
|
||||||
@ -129,9 +115,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { File } from '@/api/interface/file';
|
import { File } from '@/api/interface/file';
|
||||||
import { createFile, getFilesList } from '@/api/modules/files';
|
import { createFile, getFilesList } from '@/api/modules/files';
|
||||||
import { Folder, HomeFilled, Close } from '@element-plus/icons-vue';
|
|
||||||
import BreadCrumbs from '@/components/bread-crumbs/index.vue';
|
|
||||||
import BreadCrumbItem from '@/components/bread-crumbs/bread-crumbs-item.vue';
|
|
||||||
import { onMounted, onUpdated, reactive, ref, nextTick } from 'vue';
|
import { onMounted, onUpdated, reactive, ref, nextTick } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess, MsgWarning } from '@/utils/message';
|
import { MsgSuccess, MsgWarning } from '@/utils/message';
|
||||||
@ -362,4 +345,9 @@ onUpdated(() => {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden-paths {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user