feat: 新增挂载文件夹功能

This commit is contained in:
jmal 2023-08-10 19:05:47 +08:00
parent 515f8d2a27
commit 5323d91abd
3 changed files with 23 additions and 3 deletions

View File

@ -191,6 +191,14 @@ export default {
params
})
},
// 挂载文件夹
mountFolder: function(data) {
return request({
url: '/share/mount-folder',
method: 'put',
data: data
})
},
// 验证提取码
validShareCode: function(data) {
return request({

View File

@ -2675,7 +2675,7 @@ export default {
.searchFileAndOpenDir({
userId: this.$store.state.user.userId,
username: this.$store.getters.name,
id: row.id,
id: row.mountFileId || row.id,
currentDirectory: encodeURI(this.$route.query.path),
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize

View File

@ -9,7 +9,7 @@
<Logo v-model="netdiskLogo" width="35"></Logo>
<span>{{ netdiskName }}</span>
</div>
<div class="share-header-content sharer" v-if="sharer">
<div class="share-header-content sharer" v-if="sharer && !showShareCode">
<el-button v-if="loginTitle.length > 0" type="primary" size="small" @click="loginOrMount"> {{ loginTitle }} </el-button>
<span class="user">{{ sharer.showName }}的分享</span>
<el-avatar :src="sharerAvatarUrl"></el-avatar>
@ -41,7 +41,7 @@
<file-tree v-if="mountToVisible" :localFileMode="false" ref="fileTreeMount" @treeNodeClick="onTreeNodeClick"></file-tree>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="fileTreeAndNewFolder" :disabled="fileTreeAndNewFolderDisabled"><i class="el-icon-folder-add"></i>&nbsp;&nbsp;新建文件夹</el-button>
<el-button size="small" type="primary">挂载</el-button>
<el-button size="small" type="primary" @click="mountFolder">挂载</el-button>
</div>
</el-dialog>
@ -979,6 +979,18 @@ export default {
this.$router.push({path: '/login', query: {redirect: this.$route.fullPath}})
}
},
/**
* 挂载操作
*/
mountFolder() {
api.mountFolder({
userId: this.$store.getters.userId,
shareId: this.shareId,
fileId: this.selectTreeNode.id
}).then(() => {
this.$message.success("挂载成功")
})
},
fileTreeAndNewFolder() {
this.$refs.fileTreeMount.fileTreeAndNewFolder(this.selectTreeNode)
},