|
|
@@ -1,9 +1,7 @@
|
|
|
<template>
|
|
|
<div style="padding-right: 5px">
|
|
|
<el-row style="padding: 5px">
|
|
|
- <el-dropdown style="padding-right: 5px">
|
|
|
- <el-button size="small" type="primary" icon="el-icon-upload" round @click="onClickUpload">上传</el-button>
|
|
|
- </el-dropdown>
|
|
|
+ <el-button size="small" type="primary" icon="el-icon-upload" round @click="onClickUpload">上传</el-button>
|
|
|
<el-button size="small" type="primary" icon="el-icon-folder-add" round @click="onCreateFolder">新建文件夹</el-button>
|
|
|
<el-input
|
|
|
v-model="inputData"
|
|
|
@@ -26,15 +24,6 @@
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</el-breadcrumb-item>
|
|
|
- <!--<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹2</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹3</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹4</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹5</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹6</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹7</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹8</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹9</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹10</el-breadcrumb-item>-->
|
|
|
</el-breadcrumb>
|
|
|
<el-divider />
|
|
|
<el-table
|
|
|
@@ -75,7 +64,7 @@
|
|
|
/>
|
|
|
</el-table>
|
|
|
<div style="margin-top: 20px">
|
|
|
- <el-button v-if="selectedTable.length !== 0" @click="addToAlbum">添加到相册</el-button>
|
|
|
+ <el-button v-if="selectedTable.length !== 0" @click="addToAlbum">添加 {{ selectedTable.length }} 到相册</el-button>
|
|
|
</div>
|
|
|
<el-pagination
|
|
|
background
|
|
|
@@ -198,6 +187,34 @@
|
|
|
</uploader>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="showAddToAlbumUploadDialog"
|
|
|
+ width="50%"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="albumKeyValues"
|
|
|
+ :show-header="true"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="value"
|
|
|
+ label="相册 ID"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="label"
|
|
|
+ label="相册名"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ @click="onAddToAlbum(scope.row)"
|
|
|
+ >选择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -222,14 +239,9 @@ export default {
|
|
|
fileDetail: null,
|
|
|
fileType: 0,
|
|
|
videoProp: null,
|
|
|
- pathList: [
|
|
|
- { path: '/disk', name: '全部文件' },
|
|
|
- { path: '/disk?path=/1', name: '1' },
|
|
|
- { path: '/disk?path=/1/2', name: '2' },
|
|
|
- { path: '/disk?path=/1/2/3', name: '3' }
|
|
|
- ],
|
|
|
+ pathList: [],
|
|
|
queryForm: {
|
|
|
- pn: this.currentPage,
|
|
|
+ pn: 1,
|
|
|
path: '/',
|
|
|
fileType: null
|
|
|
},
|
|
|
@@ -265,7 +277,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
const path = this.$route.query.path
|
|
|
- if (path === undefined) {
|
|
|
+ if (path !== undefined) {
|
|
|
this.queryForm.path = path
|
|
|
}
|
|
|
document.title = '所有文件'
|
|
|
@@ -392,12 +404,21 @@ export default {
|
|
|
this.fileType = row.fileType
|
|
|
if (this.fileType === 1000) {
|
|
|
const filename = row.filename
|
|
|
- const nextPath = this.pathList[this.pathList.length - 1].path + '/' + filename
|
|
|
- console.log(nextPath)
|
|
|
- this.currentPage = 1
|
|
|
- this.queryForm.pn = this.currentPage
|
|
|
- this.queryForm.path = '/pv'
|
|
|
- this.getData()
|
|
|
+ const url = this.pathList[this.pathList.length - 1].path
|
|
|
+ const arr = url.split('?')
|
|
|
+ let path = ''
|
|
|
+ if (arr.length === 1) {
|
|
|
+ path = '/' + filename
|
|
|
+ } else {
|
|
|
+ path = arr[1].split('=')[1] + '/' + filename
|
|
|
+ }
|
|
|
+ this.$router.push({
|
|
|
+ path: '/disk',
|
|
|
+ query: {
|
|
|
+ path: path
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$router.go(0)
|
|
|
} else {
|
|
|
getFileDetail(row.fileId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
@@ -437,11 +458,11 @@ export default {
|
|
|
|
|
|
this.dataList = pageList.list
|
|
|
this.totalSize = pageList.totalSize
|
|
|
- if (this.pathList.length === 0) {
|
|
|
+ if (namePathList.length === 0) {
|
|
|
this.pathList.push({ path: '/disk', name: '全部文件' })
|
|
|
} else {
|
|
|
for (const namePath of namePathList) {
|
|
|
- this.pathList.push({ path: '/disk?path=' + namePath.path, name: namePath.name })
|
|
|
+ this.pathList.push({ path: '/disk?path=' + namePath.path, name: namePath.filename })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -456,13 +477,24 @@ export default {
|
|
|
getAlbumKeyValues().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
this.albumKeyValues = resp.data
|
|
|
+ this.showAddToAlbumUploadDialog = true
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- console.log(this.selectedTable)
|
|
|
+ },
|
|
|
+ onAddToAlbum(row) {
|
|
|
+ const albumId = row.value
|
|
|
+ const fileIds = []
|
|
|
+ for (const item of this.selectedTable) {
|
|
|
+ fileIds.push(item.fileId)
|
|
|
+ }
|
|
|
const jsonData = {}
|
|
|
+ jsonData.albumId = albumId
|
|
|
+ jsonData.fileIds = fileIds
|
|
|
addToAlbum(jsonData).then(resp => {
|
|
|
this.$message.info(resp.msg)
|
|
|
+ }).finally(() => {
|
|
|
+ this.showAddToAlbumUploadDialog = false
|
|
|
+ this.selectedTable = []
|
|
|
})
|
|
|
},
|
|
|
onSearchFile() {
|