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 }}
-
+
diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue
index 94c1809..d61df35 100644
--- a/src/components/ShowFile/ShowFile.vue
+++ b/src/components/ShowFile/ShowFile.vue
@@ -1224,7 +1224,13 @@ export default {
},
created() {},
mounted() {
- Bus.$on("fileSuccess", () => {});
+ Bus.$on("fileSuccess", (filename) => {
+ if (this.$route.query.folder) {
+ this.onCreateFilename = filename
+ this.getFileList()
+ this.clearOnCreateFilename()
+ }
+ });
Bus.$on("loadFileFaild", () => {
this.notPreviewDialogVisible = true;
});
@@ -1457,8 +1463,8 @@ export default {
// 延时清空onCreateFilename
clearOnCreateFilename() {
setTimeout(() => {
- this.onCreateFilename = "";
- }, 3000);
+ this.onCreateFilename = '';
+ }, 2000);
},
load() {
this.getFileList(true);
@@ -2212,6 +2218,7 @@ export default {
// 打开文件选择框
Bus.$emit("openUploader", {
// 传入的参数
+ folder: this.$route.query.folder,
currentDirectory: this.path,
username: this.$store.state.user.name,
userId: this.$store.state.user.userId
@@ -2222,6 +2229,7 @@ export default {
// 打开文件夹选择框
Bus.$emit("uploadFolder", {
// 传入的参数
+ folder: this.$route.query.folder,
currentDirectory: this.path,
username: this.$store.state.user.name,
userId: this.$store.state.user.userId
@@ -2391,6 +2399,7 @@ export default {
isFolder: true,
filename: encodeURI(this.newFolderName),
currentDirectory: encodeURI(this.path),
+ folder: this.$route.query.folder,
username: this.$store.state.user.name,
userId: this.$store.state.user.userId
})
@@ -2458,12 +2467,13 @@ export default {
.addFile({
fileName: encodeURI(newFileName),
isFolder: false,
+ folder: this.$route.query.folder,
username: this.$store.state.user.name,
parentPath: encodeURI(parentPath)
})
.then(res => {
this.createFileLoading = false;
- switch (suffix) {
+ switch (suffix && !this.$route.query.folder) {
case "txt":
// 打开编辑器
this.textPreviewRow = res.data;
@@ -2479,9 +2489,14 @@ export default {
break;
}
const that = this;
+ if (this.$route.query.folder) {
+ this.onCreateFilename = newFileName
+ this.getFileList()
+ this.clearOnCreateFilename()
+ }
setTimeout(function() {
that.newCreateFileDialog = false;
- }, 200);
+ }, 200)
})
.catch(() => {
this.createFileLoading = false;
@@ -3115,6 +3130,7 @@ export default {
.rename({
newFileName: encodeURI(newFileName),
username: this.$store.state.user.name,
+ folder: this.$route.query.folder,
id: row.id
})
.then(res => {
@@ -3123,7 +3139,6 @@ export default {
row.suffix = newFileName.replace(/.+\./, "");
this.fileList[row.index] = row;
this.editingIndex = -1;
- this.$message.success("重命名中...");
})
.then(() => {
this.$refs.fileListTable.clearSelection();
@@ -3591,6 +3606,7 @@ export default {
isFolder: true,
filename: encodeURI(newFolderName),
currentDirectory: encodeURI(path),
+ folder: this.$route.query.folder,
username: this.$store.state.user.name,
userId: this.$store.state.user.userId
})
@@ -3746,8 +3762,10 @@ export default {
fileIds: fileIds
})
.then(() => {
- // 移除列表
- // this.removeSelectItme()
+ // 刷新列表
+ if (this.$route.query.folder) {
+ this.getFileList()
+ }
})
.then(() => {
this.$notify({
diff --git a/src/components/SimpleUploader/globalUploader.vue b/src/components/SimpleUploader/globalUploader.vue
index d2c0f63..b6eb16e 100755
--- a/src/components/SimpleUploader/globalUploader.vue
+++ b/src/components/SimpleUploader/globalUploader.vue
@@ -261,7 +261,8 @@ export default {
this.params = {
currentDirectory: this.$route.query.path || '/',
username: this.$store.state.user.name,
- userId: this.$store.state.user.userId
+ userId: this.$store.state.user.userId,
+ folder: this.$route.query.folder
}
},
onFilesAdded(files) {
@@ -280,6 +281,7 @@ export default {
isFolder: true,
folderPath: encodeURI(folder.parent.path),
filename: encodeURI(folder.name),
+ folder: this.$route.query.folder,
currentDirectory: encodeURI(this.params.currentDirectory),
username: this.params.username,
userId: this.params.userId
@@ -359,6 +361,7 @@ export default {
filename: encodeURI(file.name),
relativePath: encodeURI(file.relativePath),
identifier: file.uniqueIdentifier,
+ folder: this.$route.query.folder,
currentDirectory: encodeURI(this.params.currentDirectory),
username: this.params.username,
userId: this.params.userId,
@@ -367,7 +370,7 @@ export default {
}).then(() => {
// console.log('文件合并成功', res)
// 文件合并成功
- Bus.$emit('fileSuccess')
+ Bus.$emit('fileSuccess', file.name)
this.statusRemove(file.id)
this.statusSet(file.id, 'success')
// file.removeFile(file)
@@ -376,7 +379,7 @@ export default {
})
// 不需要合并
} else {
- Bus.$emit('fileSuccess')
+ Bus.$emit('fileSuccess', file.name)
// 完成后从文件列表移除
// file.removeFile(file)
// console.log('上传成功')
diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue
index 3e66ce8..c3d5700 100644
--- a/src/components/preview/SimTextPreview.vue
+++ b/src/components/preview/SimTextPreview.vue
@@ -103,7 +103,7 @@
@@ -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() {