diff --git a/public/index.html b/public/index.html index ff74a59..31c606b 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,7 @@ - 嘉洛马 — 文件后台管理系统 + 嘉洛马 - 文件管理后台 diff --git a/public/jialuoma2.ico b/public/jialuoma2.ico deleted file mode 100644 index f989c62..0000000 Binary files a/public/jialuoma2.ico and /dev/null differ diff --git a/src/api/user.js b/src/api/user.js index 797ffb9..7b24a27 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -12,7 +12,9 @@ export function captcha(datas) { // 请求出错处理 export function requesterr(thiss, err) { + console.log(err); + console.log(err.toJSON()); if (err.response) { thiss.$message({ showClose: true, message: err.response.data.err, type: 'error' }); } else if (err.request) { diff --git a/src/common/img/jialuoma2.png b/src/common/img/jialuoma2.png deleted file mode 100644 index dc14df9..0000000 Binary files a/src/common/img/jialuoma2.png and /dev/null differ diff --git a/src/layout/index.vue b/src/layout/index.vue index 5f72749..aa7bca9 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -4,7 +4,7 @@ 图片 - 文件后台管理系统 + 嘉洛马 - 文件管理后台
@@ -32,7 +33,8 @@ - 图片 + + @@ -126,6 +128,8 @@ data() { // 当前目录子目录数据 dirdata: [], + loadingText: '文件夹获取中...', //加载提示语 + subloading: false, //切换目录loading mkdirloadings: false, //创建目录loading // 创建目录弹出框数据 @@ -165,11 +169,13 @@ methods: { getFileData() { let thiss = this; + this.dirdata = [] + this.loadingText = '获取文件夹中...' this.subloading = true; mirlist().then(response => { let datamain = response.data; //console.log(maindata); - this.dirdata = [] + if (datamain.code == 1) { let maindata = datamain.data.menus; //console.log(maindata.directories.length); @@ -183,7 +189,10 @@ methods: { // this.movefileform.from = maindata.realpath; // 移动目录 //console.log(this.movefileform.from); } - this.subloading = false; + this.$nextTick(function () { + //console.log(this.$el.textContent) // => '已更新' + this.subloading = false; + }) }).catch(error => { requesterr(this, error); this.subloading = false; @@ -221,6 +230,7 @@ methods: { return; } //console.log(this.dirform); + this.loadingText = '创建文件夹中...' this.mkdirloadings = true; mkdir(this.dirform).then(response => { let datamain = response.data; @@ -249,6 +259,7 @@ methods: { // 删除目录 rmdirm() { let thiss = this; + this.loadingText = '删除文件夹中...' this.subloading = true; //console.log(this.rmdirform); rmdirs(this.rmdirform).then(response => { @@ -263,7 +274,7 @@ methods: { } else { thiss.$message({showClose: true,message: datamain.err,type: 'error'}); } - this.subloading = false; + //this.subloading = false; //this.dirbox = false; }).catch(error => { requesterr(this, error); @@ -278,12 +289,13 @@ methods: { return; } let thiss = this; + this.loadingText = '移动文件夹中...' this.subloading = true; //console.log(this.rmfileform); movefiledir(this.movefileform).then(response => { let datamain = response.data; if (datamain.code == 1) { - console.log(66666); + //console.log(66666); EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 this.getFileData(); thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); @@ -292,7 +304,7 @@ methods: { thiss.$message({showClose: true,message: datamain.err,type: 'error'}); } - this.subloading = false; + //this.subloading = false; this.movebox = false; }).catch(error => { @@ -312,7 +324,9 @@ methods: { this.renamefileform.to += this.filesuffix; } let thiss = this; - this.subloading = true; + this.loadingText = '文件夹重命名中...' + this.mkdirloadings = true; + //this.subloading = true; //console.log(this.rmfileform); renamefile(this.renamefileform).then(response => { let datamain = response.data; @@ -326,7 +340,7 @@ methods: { thiss.$message({showClose: true,message: datamain.err,type: 'error'}); } - this.subloading = false; + //this.subloading = false; this.renamebox = false; }).catch(error => { @@ -346,10 +360,23 @@ methods: { objmark = getbutton.getAttribute('mark'); + // 点击删除目录 // 点击删除目录 if (objmark == 'dirdelete') { this.rmdirform.dir = getbutton.getAttribute('filenames'); - this.rmdirm(); + this.$confirm('此操作将删除该文件夹, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.rmdirm(); + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); + return; } diff --git a/src/views/subfile/index.vue b/src/views/subfile/index.vue index 390f827..db56f5a 100644 --- a/src/views/subfile/index.vue +++ b/src/views/subfile/index.vue @@ -12,13 +12,14 @@ 上传 + 刷新
- 图片 + +
@@ -67,7 +69,7 @@ @@ -198,7 +200,7 @@
开始上传
-
目前只能上传{{supportedFileTypes}}文件,且不超过{{maxUploadFileSize/1024/1024}}MB
+
目前只能上传{{supportedFileTypes}}文件,且单个文件不超过{{maxUploadFileSize/1024/1024}}MB
图片 @@ -244,7 +246,8 @@ export default { data() { return { // 环境变量 - imgurl:process.env.VUE_APP_IMG_URL, + //imgurl:process.env.VUE_APP_IMG_URL, + imgurl:'https://demo.jialuoma.com', loadingText: '文件获取中...', @@ -456,7 +459,8 @@ export default { let Progress = progressEvent => { //progressEvent.loaded:已上传文件大小 //progressEvent.total:被上传文件的总大小 - let num = progressEvent.loaded / progressEvent.total * 100 | 0; //百分比 + //let num = progressEvent.loaded / progressEvent.total * 100 | 0; //百分比 + let num = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2)) //console.log(num); files.onProgress({percent: num}) //进度条 } @@ -466,20 +470,23 @@ export default { let datamain = response.data; if (datamain.code == 1) { //console.log(datamain); - this.$message({showClose: true,message: datamain.msg, type:'success'}); + //this.$message({showClose: true,message: datamain.msg, type:'success'}); files.onSuccess(); //上传成功(打钩的小图标) this.uploadCount++; //如果全部上传完成则刷新数据 - //console.log(this.uploadCount); + console.log(this.uploadCount); if (this.uploadCount == this.uploadFilelist.length) { this.uploadDrawer = false; this.uploadFilelist = []; this.uploadCount = 0; this.getFileData(); + this.loadingText = '新增上传文件中...' + + this.uploadLoad = false; } } - this.uploadLoad = false; + }).catch(error => { requesterr(this, error); this.uploadLoad = false; @@ -502,14 +509,17 @@ export default { can.id = menusindex.split('?id=')[1] } let thiss = this; - this.subloading = true; + + this.dirdata = [] + this.tableData = [] + this.loadingText = '获取文件中...' + this.subloading = true mirlist(can).then(response => { let datamain = response.data; let maindata = datamain.data.dirTree; if (datamain.code == 1) { //console.log(maindata.directories.length); - this.dirdata = [] - this.tableData = [] + if (maindata.directories) { this.dirdata = this.forObjectData(maindata.directories); } @@ -602,6 +612,7 @@ export default { rmdirm() { let thiss = this; this.subloading = true; + this.loadingText = '删除文件夹中...' //console.log(this.rmdirform); rmdirs(this.rmdirform).then(response => { let datamain = response.data; @@ -609,7 +620,6 @@ export default { if (datamain.code == 1) { EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 - this.loadingText = '删除文件夹中...' this.getFileData(); thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); //this.subloading = false; @@ -627,13 +637,13 @@ export default { // 删除文件 rmfile() { let thiss = this; + this.loadingText = '文件删除中...' this.subloading = true; //console.log(this.rmfileform); deletefile(this.rmfileform).then(response => { let datamain = response.data; if (datamain.code == 1) { - this.loadingText = '文件删除中...' this.getFileData(); thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); //this.subloading = false; @@ -641,7 +651,7 @@ export default { thiss.$message({showClose: true,message: datamain.err,type: 'error'}); } - this.subloading = false; + //this.subloading = false; //this.dirbox = false; }).catch(error => { @@ -691,13 +701,13 @@ export default { return; } let thiss = this; + this.loadingText = '文件移动中...' this.subloading = true; //console.log(this.rmfileform); movefiledir(this.movefileform).then(response => { let datamain = response.data; if (datamain.code == 1) { EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 - this.loadingText = '文件移动中...' this.getFileData(); thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); //this.subloading = false;