feat: 调整文件列表页面

This commit is contained in:
zhengkunwang223 2023-02-09 15:36:42 +08:00 committed by zhengkunwang223
parent f4305df7dc
commit aa26b13fad
3 changed files with 20 additions and 11 deletions

View File

@ -711,6 +711,7 @@ export default {
type: '类型',
root: '根目录',
list: '文件列表',
sub: '包含子目录',
},
setting: {
all: '全部',

View File

@ -20,9 +20,6 @@
:rules="rules"
v-loading="loading"
>
<el-form-item :label="$t('file.path')" prop="path">
<el-input v-model="getPath" disabled />
</el-form-item>
<el-form-item :label="$t('file.name')" prop="name">
<el-input v-model="addForm.name" />
</el-form-item>

View File

@ -3,12 +3,7 @@
<el-row>
<el-col :span="2">
<div>
<el-button
:icon="Back"
@click="jump(paths[paths.length - 2].url)"
circle
:disabled="paths.length == 0"
/>
<el-button :icon="Back" @click="back" circle :disabled="paths.length == 0" />
<el-button :icon="Refresh" circle @click="search" />
</div>
</el-col>
@ -16,7 +11,9 @@
<div class="path" ref="pathRef">
<span ref="breadCrumbRef">
<span class="root">
<el-link @click="jump('/')">{{ $t('file.root') }}</el-link>
<el-link @click="jump('/')">
<el-icon :size="20"><HomeFilled /></el-icon>
</el-link>
</span>
<span v-for="item in paths" :key="item.url">
<span class="split">></span>
@ -69,7 +66,11 @@
@blur="search()"
:placeholder="$t('file.search')"
>
<template #prepend><el-checkbox v-model="req.containSub">包含子目录</el-checkbox></template>
<template #prepend>
<el-checkbox :disabled="req.path == '/'" v-model="req.containSub">
{{ $t('file.sub') }}
</el-checkbox>
</template>
</el-input>
</div>
</template>
@ -266,6 +267,16 @@ const handlePath = () => {
}
};
const back = () => {
if (paths.value.length > 0) {
let url = '/';
if (paths.value.length >= 2) {
url = paths.value[paths.value.length - 2].url;
}
jump(url);
}
};
const jump = async (url: string) => {
req.path = url;
req.containSub = false;