|
@@ -5,7 +5,10 @@
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-select v-model="searchForm.fileType" placeholder="文件类型" @change="search">
|
|
<el-select v-model="searchForm.fileType" placeholder="文件类型" @change="search">
|
|
|
<el-option label="全部" value="0" />
|
|
<el-option label="全部" value="0" />
|
|
|
- <el-option label="图片" value="1" />
|
|
|
|
|
|
|
+ <el-option label="图片" value="1001" />
|
|
|
|
|
+ <el-option label="视频" value="1002" />
|
|
|
|
|
+ <el-option label="音频" value="1003" />
|
|
|
|
|
+ <el-option label="文本" value="1004" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -25,10 +28,9 @@
|
|
|
<el-button size="mini" type="danger" @click="share">分享</el-button>
|
|
<el-button size="mini" type="danger" @click="share">分享</el-button>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
|
|
|
|
- <el-breadcrumb-item :to="{ path: '/1' }">图片</el-breadcrumb-item>
|
|
|
|
|
- <el-breadcrumb-item :to="{ path: '/1/2' }">照片</el-breadcrumb-item>
|
|
|
|
|
- <el-breadcrumb-item v-text="this.$router.currentRoute.name" />
|
|
|
|
|
|
|
+ <el-breadcrumb-item v-for="(item, index) of parentDirs" :key="index">
|
|
|
|
|
+ <a href="javascript:void(0)" style="text-decoration-line: none" @click="goTo(item.path)">{{ item.filename }}</a>
|
|
|
|
|
+ </el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
</el-breadcrumb>
|
|
|
<el-table
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
ref="multipleTable"
|
|
@@ -201,12 +203,30 @@ export default {
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
searchForm: {
|
|
searchForm: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
|
|
+ path: '/',
|
|
|
fileType: '0',
|
|
fileType: '0',
|
|
|
filename: null
|
|
filename: null
|
|
|
},
|
|
},
|
|
|
currentDir: '/',
|
|
currentDir: '/',
|
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
|
- parentDirs: ['图片', '照片', '2023'],
|
|
|
|
|
|
|
+ parentDirs: [
|
|
|
|
|
+ {
|
|
|
|
|
+ filename: '/',
|
|
|
|
|
+ path: '/'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ filename: '图片',
|
|
|
|
|
+ path: '/图片'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ filename: '照片',
|
|
|
|
|
+ path: '/图片/照片'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ filename: '2023',
|
|
|
|
|
+ path: '/图片/照片/2023'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
createFolderDialog: false,
|
|
createFolderDialog: false,
|
|
|
createFolderForm: {
|
|
createFolderForm: {
|
|
|
parent: null,
|
|
parent: null,
|
|
@@ -217,23 +237,30 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ const path = this.$route.query.path
|
|
|
|
|
+ if (path !== undefined && path !== null) {
|
|
|
|
|
+ this.searchForm.path = path
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
document.title = '文件列表'
|
|
document.title = '文件列表'
|
|
|
- this.getData()
|
|
|
|
|
|
|
+ this.getData(this.searchForm)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
handleCurrentChange(pageNumber) {
|
|
handleCurrentChange(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
this.currentPage = pageNumber
|
|
|
this.searchForm.page = this.currentPage
|
|
this.searchForm.page = this.currentPage
|
|
|
- this.getData()
|
|
|
|
|
|
|
+ this.getData(this.searchForm)
|
|
|
// 回到顶部
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
scrollTo(0, 0)
|
|
|
},
|
|
},
|
|
|
- getData() {
|
|
|
|
|
|
|
+ getData(searchForm) {
|
|
|
this.dataList = []
|
|
this.dataList = []
|
|
|
- getFileList(this.searchForm).then(resp => {
|
|
|
|
|
|
|
+ getFileList(searchForm).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
- this.dataList = resp.data.list
|
|
|
|
|
- this.totalSize = resp.data.totalSize
|
|
|
|
|
|
|
+ this.dataList = resp.data.fileList.list
|
|
|
|
|
+ this.totalSize = resp.data.fileList.totalSize
|
|
|
|
|
+
|
|
|
|
|
+ this.parentDirs = resp.data.pathList
|
|
|
} else {
|
|
} else {
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -334,17 +361,28 @@ export default {
|
|
|
const fileType = item.fileType
|
|
const fileType = item.fileType
|
|
|
if (fileType === 1000) {
|
|
if (fileType === 1000) {
|
|
|
const filename = item.filename
|
|
const filename = item.filename
|
|
|
- console.log(filename)
|
|
|
|
|
|
|
+ const namePath = this.parentDirs[this.parentDirs.length - 1]
|
|
|
|
|
+ let currentPath
|
|
|
|
|
+ if (namePath.filename === '/') {
|
|
|
|
|
+ currentPath = namePath.path + filename
|
|
|
|
|
+ } else {
|
|
|
|
|
+ currentPath = namePath.path + '/' + filename
|
|
|
|
|
+ }
|
|
|
|
|
+ this.searchForm.path = currentPath
|
|
|
|
|
+ this.getData(this.searchForm)
|
|
|
} else {
|
|
} else {
|
|
|
const fileId = item.fileId
|
|
const fileId = item.fileId
|
|
|
this.previewFile(fileType, fileId)
|
|
this.previewFile(fileType, fileId)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ goTo(path) {
|
|
|
|
|
+ console.log('go to ' + path)
|
|
|
|
|
+ },
|
|
|
previewFile(fileType, fileId) {
|
|
previewFile(fileType, fileId) {
|
|
|
- this.previewFileDialog = true
|
|
|
|
|
getFileUrl(fileType, fileId).then(resp => {
|
|
getFileUrl(fileType, fileId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
this.fileDetail = resp.data
|
|
this.fileDetail = resp.data
|
|
|
|
|
+ this.previewFileDialog = true
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|