|
@@ -27,6 +27,7 @@
|
|
|
</el-breadcrumb>
|
|
</el-breadcrumb>
|
|
|
<el-divider />
|
|
<el-divider />
|
|
|
<el-table
|
|
<el-table
|
|
|
|
|
+ ref="multipleTable"
|
|
|
:data="dataList"
|
|
:data="dataList"
|
|
|
:show-header="true"
|
|
:show-header="true"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
@@ -76,6 +77,7 @@
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div style="margin-top: 20px">
|
|
<div style="margin-top: 20px">
|
|
|
<el-button v-if="selectedTable.length !== 0" @click="addToAlbum">添加 {{ selectedTable.length }} 到相册</el-button>
|
|
<el-button v-if="selectedTable.length !== 0" @click="addToAlbum">添加 {{ selectedTable.length }} 到相册</el-button>
|
|
|
|
|
+ <el-button v-if="selectedTable.length !== 0" @click="moveToFolder">移动 {{ selectedTable.length }} 个文件</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
background
|
|
background
|
|
@@ -146,7 +148,7 @@
|
|
|
<el-form ref="createFolderForm" :model="createFolderForm">
|
|
<el-form ref="createFolderForm" :model="createFolderForm">
|
|
|
<el-form-item label="当前文件夹" label-width="120px" prop="title">
|
|
<el-form-item label="当前文件夹" label-width="120px" prop="title">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="createFolderForm.path"
|
|
|
|
|
|
|
+ v-model="createFolderForm.parentPath"
|
|
|
style="margin-left: 5px"
|
|
style="margin-left: 5px"
|
|
|
readonly
|
|
readonly
|
|
|
/>
|
|
/>
|
|
@@ -226,11 +228,40 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :visible.sync="showMoveToFolderDialog"
|
|
|
|
|
+ width="50%"
|
|
|
|
|
+ center
|
|
|
|
|
+ >
|
|
|
|
|
+ <div style="padding: 5px;">
|
|
|
|
|
+ <el-card style="padding: 5px;">
|
|
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
|
|
+ <span>目录树</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="text item">
|
|
|
|
|
+ <el-tree :data="folderTree" :props="defaultProps" @node-click="handleNodeClick"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ style="padding: 5px;"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="onMoveToFolder"
|
|
|
|
|
+ >确定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { addToAlbum, getAlbumKeyValues, getDiskChannelInfo, getDiskFile, getFileDetail } from '@/api/disk'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ addToAlbum,
|
|
|
|
|
+ createFolder,
|
|
|
|
|
+ getAlbumKeyValues,
|
|
|
|
|
+ getDiskChannelInfo,
|
|
|
|
|
+ getDiskFile,
|
|
|
|
|
+ getFileDetail,
|
|
|
|
|
+ getFolderTree, moveFile
|
|
|
|
|
+} from '@/api/disk'
|
|
|
import { hashFile } from '@/utils/functions'
|
|
import { hashFile } from '@/utils/functions'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -259,13 +290,24 @@ export default {
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
showCreateFolderDialog: false,
|
|
showCreateFolderDialog: false,
|
|
|
createFolderForm: {
|
|
createFolderForm: {
|
|
|
- path: '/',
|
|
|
|
|
|
|
+ parentPath: '/',
|
|
|
folderName: null
|
|
folderName: null
|
|
|
},
|
|
},
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
showAddToAlbumUploadDialog: false,
|
|
showAddToAlbumUploadDialog: false,
|
|
|
albumKeyValues: [],
|
|
albumKeyValues: [],
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
|
|
+ folderTree: [],
|
|
|
|
|
+ defaultProps: {
|
|
|
|
|
+ children: 'children',
|
|
|
|
|
+ label: 'label'
|
|
|
|
|
+ },
|
|
|
|
|
+ showMoveToFolderDialog: false,
|
|
|
|
|
+ moveFileForm: {
|
|
|
|
|
+ pid: null,
|
|
|
|
|
+ fileIds: []
|
|
|
|
|
+ },
|
|
|
|
|
+ // ****************************************************************************************************************
|
|
|
showUploadDialog: false,
|
|
showUploadDialog: false,
|
|
|
options: {
|
|
options: {
|
|
|
target: '',
|
|
target: '',
|
|
@@ -449,8 +491,16 @@ export default {
|
|
|
this.showCreateFolderDialog = true
|
|
this.showCreateFolderDialog = true
|
|
|
},
|
|
},
|
|
|
createFolder() {
|
|
createFolder() {
|
|
|
- console.log(this.createFolderForm)
|
|
|
|
|
this.showCreateFolderDialog = false
|
|
this.showCreateFolderDialog = false
|
|
|
|
|
+ createFolder(this.createFolderForm).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.$router.go(0)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(resp.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
handleCurrentChange(pageNumber) {
|
|
handleCurrentChange(pageNumber) {
|
|
@@ -506,11 +556,57 @@ export default {
|
|
|
this.$message.info(resp.msg)
|
|
this.$message.info(resp.msg)
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
this.showAddToAlbumUploadDialog = false
|
|
this.showAddToAlbumUploadDialog = false
|
|
|
- this.selectedTable = []
|
|
|
|
|
|
|
+ this.toggleSelection()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ moveToFolder() {
|
|
|
|
|
+ for (const item of this.selectedTable) {
|
|
|
|
|
+ this.moveFileForm.fileIds.push(item.fileId)
|
|
|
|
|
+ }
|
|
|
|
|
+ getFolderTree().then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.folderTree = resp.data
|
|
|
|
|
+ this.showMoveToFolderDialog = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(resp.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
|
+ this.moveFileForm.pid = data.fileId
|
|
|
|
|
+ const label = data.label
|
|
|
|
|
+ this.$message.info('移动文件到 ' + label + ' 目录')
|
|
|
|
|
+ },
|
|
|
|
|
+ onMoveToFolder() {
|
|
|
|
|
+ moveFile(this.moveFileForm).then(resp => {
|
|
|
|
|
+ this.$message.info(resp.msg)
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.info(error.message)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.showMoveToFolderDialog = false
|
|
|
|
|
+ this.toggleSelection()
|
|
|
|
|
+ },
|
|
|
onSearchFile() {
|
|
onSearchFile() {
|
|
|
this.$message.info('search file')
|
|
this.$message.info('search file')
|
|
|
|
|
+ },
|
|
|
|
|
+ toggleSelection() {
|
|
|
|
|
+ this.toggleSelection0(this.selectedTable)
|
|
|
|
|
+ this.selectedTable = []
|
|
|
|
|
+ },
|
|
|
|
|
+ // 取消选中
|
|
|
|
|
+ toggleSelection0(rows) {
|
|
|
|
|
+ if (rows) {
|
|
|
|
|
+ rows.forEach(row => {
|
|
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(row)
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$refs.multipleTable.clearSelection()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
|
+ this.multipleSelection = val
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|