diff --git a/src/api/file-api.js b/src/api/file-api.js
index 1126801..bd92775 100644
--- a/src/api/file-api.js
+++ b/src/api/file-api.js
@@ -16,11 +16,11 @@ export default {
})
},
// 检查文件是否存在
- checkExist: function (params) {
+ checkExist: function (data) {
return request({
url: "checkExist",
method: "post",
- params
+ data
})
},
// 上传文件夹
diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue
index d58c6f0..46c20f6 100644
--- a/src/components/ShowFile/ShowFile.vue
+++ b/src/components/ShowFile/ShowFile.vue
@@ -1490,6 +1490,9 @@ export default {
this.path = ''
}
if (fileDoc) {
+ if (this.$store.state.uploaderState) {
+ return
+ }
if (fileDoc.$set) {
let path = fileDoc.$set.path
path = path.replace(/\\/g, '/')
diff --git a/src/components/SimpleUploader/globalUploader.vue b/src/components/SimpleUploader/globalUploader.vue
index e593b75..e59a8be 100755
--- a/src/components/SimpleUploader/globalUploader.vue
+++ b/src/components/SimpleUploader/globalUploader.vue
@@ -17,7 +17,7 @@
>
-
+
上传文件到当前目录下
@@ -190,7 +190,7 @@ export default {
fileListScrollTop: 0,
dragoverLoop: null,
successMsg: null,
- enableDragUplaod: false,// 是否启用拖拽上传
+ enableDragUpload: false,// 是否启用拖拽上传
uploader: null,
}
},
@@ -200,7 +200,7 @@ export default {
watch: {
$route(route) {
// 只有首页才启用拖拽上传
- this.enableDragUplaod = route.path === '/'
+ this.enableDragUpload = route.path === '/'
},
message(msg) {
switch (msg.event) {
@@ -234,12 +234,12 @@ export default {
}
},
mounted() {
- this.enableDragUplaod = this.$route.path === '/'
+ this.enableDragUpload = this.$route.path === '/'
let that = this
let dropbox = document.body
document.body.ondragstart = function (e) {
- if (that.enableDragUplaod) {
+ if (that.enableDragUpload) {
if (e.target.slot === 'jmal') {
that.isDragStart = true
}
@@ -357,6 +357,10 @@ export default {
this.doUploadBefore(files)
}
},
+ displayPanel(display) {
+ this.panelShow = display
+ this.$store.dispatch('updateUploaderState', display)
+ },
doUploadBefore(files) {
this.fileListLength = this.uploader.fileList.length
const filePaths = this.uploader.filePaths
@@ -382,7 +386,7 @@ export default {
}
if (window.pc) {
this.pc = true
- this.panelShow = true
+ this.displayPanel(true)
} else {
this.pc = false
this.shrink()
@@ -490,7 +494,7 @@ export default {
}
if (this.process === -10 || this.process === 100 || this.fileListLength === 0) {
this.uploader.cancel()
- this.panelShow = false
+ this.displayPanel(false)
}
},
onFileError(rootFile, file, response) {
@@ -641,7 +645,7 @@ export default {
close() {
if (this.process === -10 || this.process === 100 || this.fileListLength === 0) {
this.uploader.cancel()
- this.panelShow = false
+ this.displayPanel(false)
} else {
this.$confirm('还有文件正在上传, 确定要关闭吗?', '提示', {
confirmButtonText: '确定',
@@ -649,7 +653,7 @@ export default {
type: 'warning'
}).then(() => {
this.uploader.cancel()
- this.panelShow = false
+ this.displayPanel(false)
})
}
},
diff --git a/src/store/index.js b/src/store/index.js
index 4247cbb..7421af5 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -16,16 +16,23 @@ const store = new Vuex.Store({
getters,
state: {
message: null,
+ uploaderState: null,
},
mutations: {
setMessage(state, message) {
state.message = message;
},
+ setUploaderState(state, uploaderState) {
+ state.uploaderState = uploaderState;
+ },
},
actions: {
updateMessage({ commit }, message) {
commit('setMessage', message);
},
+ updateUploaderState({ commit }, uploaderState) {
+ commit('setUploaderState', uploaderState);
+ },
}
})