From e7872067adfd9e0b9c308f89b551f2c16b88bfc7 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 12 Aug 2023 23:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=82=E8=BD=BD=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileTree/index.vue | 5 +++ src/components/ShareDialog/index.vue | 2 +- src/components/ShowFile/ShowFile.vue | 34 ++++++++++++++----- .../SimpleUploader/globalUploader.vue | 9 +++-- src/components/preview/SimTextPreview.vue | 24 +++++++++---- src/views/home/mobile/index.vue | 4 +++ src/views/public/share/shareList.vue | 1 + 7 files changed, 60 insertions(+), 19 deletions(-) diff --git a/src/components/FileTree/index.vue b/src/components/FileTree/index.vue index caea1ca..2dfec22 100644 --- a/src/components/FileTree/index.vue +++ b/src/components/FileTree/index.vue @@ -44,6 +44,10 @@ export default { showFooter: { type: Boolean, default: false + }, + hideMountFile: { + type: Boolean, + default: true } }, data() { @@ -162,6 +166,7 @@ export default { api.queryFileTree({ userId: this.$store.state.user.userId, username: this.$store.state.user.name, + hideMountFile: this.hideMountFile, fileId: fileId }).then(res => { const nextNodes = res.data; diff --git a/src/components/ShareDialog/index.vue b/src/components/ShareDialog/index.vue index 81331c7..d0b966b 100644 --- a/src/components/ShareDialog/index.vue +++ b/src/components/ShareDialog/index.vue @@ -14,7 +14,7 @@ {{ filename }}
-
- +
@@ -204,6 +204,7 @@ lineWrapping: false, moblie: false, panelReadOnly: true, + mountFileId: undefined, options: { fontSize: 14, contextmenu: true, @@ -292,7 +293,7 @@ } this.editableTabs = [] this.checkMobile() - this.checkReadOnly(file.userId) + this.checkReadOnly(file) this.loadEditorSize() this.loading = this.$message({ iconClass: 'el-icon-loading', @@ -472,7 +473,7 @@ }, async requestStream(request, params, index) { try { - const readOnly = this.panelReadOnly + const readOnly = this.options.readOnly this.options.readOnly = true this.abortControllerAbort(index) const queryString = this.buildQueryString(params) @@ -800,14 +801,22 @@ checkMobile() { this.moblie = !this.$pc; }, - checkReadOnly(fileUserId){ - if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){ + checkReadOnly(file){ + if(this.$store.state.user.token && this.$store.state.user.userId === file.userId){ this.options.readOnly = false this.panelReadOnly = false + return + } else { + this.mountFileId = file.id + } + if (file.operationPermissionList && file.operationPermissionList.indexOf('PUT') > -1) { + this.options.readOnly = false + this.panelReadOnly = true + return } if (!this.$pc) { - this.options.readOnly = true - this.panelReadOnly = false + this.options.readOnly = false + this.panelReadOnly = true } if(this.panelReadOnly || this.moblie){ this.$nextTick(()=> { @@ -923,6 +932,7 @@ relativePath: encodeURI(path), userId: this.$store.state.user.userId, username: this.$store.state.user.name, + mountFileId: this.mountFileId, contentText: value }).then(() => { this.updating = false diff --git a/src/views/home/mobile/index.vue b/src/views/home/mobile/index.vue index 93a84d8..4272589 100644 --- a/src/views/home/mobile/index.vue +++ b/src/views/home/mobile/index.vue @@ -588,6 +588,7 @@ export default { api.rename({ newFileName: encodeURI(newFileName), username: this.$store.state.user.name, + folder: this.$route.query.folder, id: row.id }).then(() => { this.renameLoading = false @@ -1205,6 +1206,7 @@ export default { // 打开文件选择框 Bus.$emit('openUploader', { // 传入的参数 + folder: this.$route.query.folder, currentDirectory: encodeURI(this.path), username: this.$store.state.user.name, userId: this.$store.state.user.userId @@ -1215,6 +1217,7 @@ export default { // 打开文件夹选择框 Bus.$emit('uploadFolder', { // 传入的参数 + folder: this.$route.query.folder, currentDirectory: encodeURI(this.path), username: this.$store.state.user.name, userId: this.$store.state.user.userId @@ -1228,6 +1231,7 @@ export default { api.uploadFolder({ isFolder: true, filename: encodeURI(this.newFolderName), + folder: this.$route.query.folder, currentDirectory: encodeURI(this.path), username: this.$store.state.user.name, userId: this.$store.state.user.userId diff --git a/src/views/public/share/shareList.vue b/src/views/public/share/shareList.vue index 470eb5f..231be5b 100644 --- a/src/views/public/share/shareList.vue +++ b/src/views/public/share/shareList.vue @@ -989,6 +989,7 @@ export default { fileId: this.selectTreeNode.id }).then(() => { this.$message.success("挂载成功") + this.mountToVisible = false }) }, fileTreeAndNewFolder() {