|
|
@@ -3,35 +3,52 @@ |
|
|
|
<app-header |
|
|
|
theme="basis" |
|
|
|
showBackBtn |
|
|
|
backBtnTitle="返回上一界面" |
|
|
|
title="回收站" |
|
|
|
:backBtnTitle="title" |
|
|
|
showUserCenter |
|
|
|
isInRecycle |
|
|
|
showRecycleBin |
|
|
|
> |
|
|
|
<template #center> |
|
|
|
<div class="main-title">{{showTitle}}</div> |
|
|
|
</template> |
|
|
|
<template #right> |
|
|
|
<search-bar class="proj-search-bar" |
|
|
|
placeholder="请输入要搜索的文件" |
|
|
|
@changeSearchContent="changeSearchContent" |
|
|
|
@hideSearchBar="hideSearchBar" |
|
|
|
@goToSearch="searchForFile" |
|
|
|
@showSearchBar="showSearchBar" |
|
|
|
@maxTextLengthArrived="maxTextLengthArrived"/> |
|
|
|
</template> |
|
|
|
</app-header> |
|
|
|
<div class="clearfile_box"> |
|
|
|
<!-- <div class="clearfile_box"> |
|
|
|
<div class="clearfile_content"> |
|
|
|
清空 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="recycle_content"> |
|
|
|
<recycle-file |
|
|
|
v-for="file in fileList" |
|
|
|
:key="file.id" |
|
|
|
:file="file" |
|
|
|
@recycleFile="isRecycle" |
|
|
|
> |
|
|
|
</recycle-file> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
|
|
|
|
<div class="recycle_content"> |
|
|
|
<transition-group name="file-fade" tag="p"> |
|
|
|
<recycle-file |
|
|
|
v-for="file in fileList" |
|
|
|
:key="file.id" |
|
|
|
:file="file" |
|
|
|
@recycleFile="isRecycle" |
|
|
|
> |
|
|
|
</recycle-file> |
|
|
|
</transition-group> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import AppHeader from '../../../components/app-header/app-header.vue'; |
|
|
|
import recycleFile from './components/recycle-file.vue' |
|
|
|
import {queryFilesFromRecycleBin, removeFromRecycleBin} from './service' |
|
|
|
import recycleFile from './components/recycle-file.vue'; |
|
|
|
import {queryFilesFromRecycleBin, removeFromRecycleBin} from './service'; |
|
|
|
import SearchBar from "@/components/search-bar/search-bar"; |
|
|
|
export default { |
|
|
|
components: { recycleFile, AppHeader }, |
|
|
|
components: { recycleFile, AppHeader, SearchBar }, |
|
|
|
created(){ |
|
|
|
this.getRecycleFiles(); |
|
|
|
}, |
|
|
@@ -41,18 +58,56 @@ export default { |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
fileList:[], |
|
|
|
searchFileList:[], |
|
|
|
title:'返回'+sessionStorage.pageTitle, |
|
|
|
isShowSearchBar: false,//控制搜索框显示隐藏 |
|
|
|
searchContent: '',//搜索的文件名称 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
async getRecycleFiles(){ |
|
|
|
const res = await queryFilesFromRecycleBin(); |
|
|
|
this.fileList = res; |
|
|
|
this.searchFileList = res; |
|
|
|
}, |
|
|
|
isRecycle(flag){ |
|
|
|
if(flag){ |
|
|
|
this.getRecycleFiles(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
changeSearchContent(content) { |
|
|
|
this.searchContent = content; |
|
|
|
this.searchForFile(); |
|
|
|
}, |
|
|
|
hideSearchBar() { |
|
|
|
this.isShowSearchBar = false; |
|
|
|
this.searchContent = ''; |
|
|
|
}, |
|
|
|
showSearchBar() { |
|
|
|
this.isShowSearchBar = true; |
|
|
|
}, |
|
|
|
// 搜索框字数超出35个字 |
|
|
|
maxTextLengthArrived() { |
|
|
|
this.$notify({ |
|
|
|
message: '请输入35个字之内的搜索内容', |
|
|
|
type: ["warning"], |
|
|
|
}) |
|
|
|
}, |
|
|
|
searchForFile() { |
|
|
|
let _fileList = this.searchFileList; |
|
|
|
|
|
|
|
_fileList = _fileList.filter(f =>{ |
|
|
|
const matchArray = f.archName.match(new RegExp(this.searchContent, 'gi')); |
|
|
|
return !!matchArray; |
|
|
|
}); |
|
|
|
this.fileList = _fileList; |
|
|
|
}, |
|
|
|
// 搜索文件时 中间导航栏的标题 |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
showTitle() { |
|
|
|
return this.isShowSearchBar && this.searchContent ? `“${this.searchContent}”搜索结果` : '回收站'; |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -73,5 +128,20 @@ export default { |
|
|
|
margin-bottom: 13px; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.file-fade-enter { |
|
|
|
opacity: 0.1; |
|
|
|
} |
|
|
|
.file-fade-enter-active { |
|
|
|
opacity: 1; |
|
|
|
transition: all 0.3s ease-in; |
|
|
|
} |
|
|
|
|
|
|
|
.file-fade-leave { |
|
|
|
opacity: 1; |
|
|
|
} |
|
|
|
.file-fade-leave-active { |
|
|
|
opacity: 0.1; |
|
|
|
transition: all 0.3s ease-in; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |