Browse Source

修改,优化。文件夹图片换成svg,图片上传功能优化,增加上传失败处理。页面UI优化。增加刷新按钮

master
wen 2 years ago
parent
commit
a26102357b
  1. 2
      dist/index.html
  2. BIN
      dist/jialuoma2.ico
  3. 1
      dist/static/css/app.02ed341d.css
  4. 1
      dist/static/css/app.294e9f71.css
  5. 2
      dist/static/css/chunk-5840c19e.3f792b5c.css
  6. 0
      dist/static/css/chunk-e9a7ef4e.29596ba5.css
  7. BIN
      dist/static/img/file.8bc3a8bc.png
  8. 1
      dist/static/js/app.79669312.js
  9. 1
      dist/static/js/app.e3f2c470.js
  10. 1
      dist/static/js/chunk-0ca0b526.903554fe.js
  11. 1
      dist/static/js/chunk-3d88170c.50a3e894.js
  12. 1
      dist/static/js/chunk-5840c19e.f6998984.js
  13. 1
      dist/static/js/chunk-e9a7ef4e.051e2845.js
  14. 7
      src/api/user.js
  15. 2
      src/settings.js
  16. 1
      src/styles/element-ui.scss
  17. 64
      src/views/subfile/index.vue

2
dist/index.html vendored

File diff suppressed because one or more lines are too long

BIN
dist/jialuoma2.ico vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

1
dist/static/css/app.02ed341d.css vendored

File diff suppressed because one or more lines are too long

1
dist/static/css/app.294e9f71.css vendored

File diff suppressed because one or more lines are too long

2
dist/static/css/chunk-0ca0b526.36a6dc56.css → dist/static/css/chunk-5840c19e.3f792b5c.css vendored

@ -1 +1 @@
.subfile_main{padding:26px 5% 47px 5%}.subfile_main .block{margin:0 0 28px 0}.subfile_main .sou_bottom{margin-left:10px}.subfile_main .use_button{margin:15px 0 16px 0}.subfile_main .file_caozuo>button{margin:6px 10px 0 0}.subfile_main .el-table td{padding:9px 0}.subfile_main .folder_bottom a{margin:0 6px}.subfile_main .el-table__body-wrapper img{display:block;max-width:66%;max-height:286px}.subfile_main .el-drawer__body{text-align:center;padding:0 10% 20px 10%}.subfile_main .request_main{text-align:center;margin:12px 0}.subfile_main .addimgtext{line-height:25px;display:inline-block;color:#8c939d;vertical-align:middle}.subfile_main .el-upload--picture-card i{vertical-align:middle}.subfile_main .type_file_click img{width:64px;height:48px}.subfile_main .file_show a,.subfile_main .type_file_click a{display:block} .subfile_main{padding:26px 5% 47px 5%}.subfile_main .block{margin:0 0 28px 0}.subfile_main .sou_bottom{margin-left:10px}.subfile_main .use_button{margin:15px 0 16px 0}.subfile_main .file_caozuo>button{margin:6px 10px 0 0}.subfile_main .el-table td{padding:9px 0}.subfile_main .folder_bottom a{margin:0 6px}.subfile_main .el-table__body-wrapper img{display:block;max-width:68%;max-height:286px}.subfile_main .el-drawer__body{text-align:center;padding:0 10% 20px 10%}.subfile_main .request_main{text-align:center;margin:12px 0}.subfile_main .addimgtext{line-height:25px;display:inline-block;color:#8c939d;vertical-align:middle}.subfile_main .el-upload--picture-card i{vertical-align:middle}.subfile_main .type_file_click img{width:64px;height:48px}.subfile_main .type_file_click a{display:block}.subfile_main .file_show a{display:block;min-height:156px;min-width:140px}@media(max-width:990px){.subfile_main .el-table__body-wrapper img{max-width:100%}}

0
dist/static/css/chunk-3d88170c.29596ba5.css → dist/static/css/chunk-e9a7ef4e.29596ba5.css vendored

BIN
dist/static/img/file.8bc3a8bc.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

1
dist/static/js/app.79669312.js vendored

File diff suppressed because one or more lines are too long

1
dist/static/js/app.e3f2c470.js vendored

File diff suppressed because one or more lines are too long

1
dist/static/js/chunk-0ca0b526.903554fe.js vendored

File diff suppressed because one or more lines are too long

1
dist/static/js/chunk-3d88170c.50a3e894.js vendored

File diff suppressed because one or more lines are too long

1
dist/static/js/chunk-5840c19e.f6998984.js vendored

File diff suppressed because one or more lines are too long

1
dist/static/js/chunk-e9a7ef4e.051e2845.js vendored

File diff suppressed because one or more lines are too long

7
src/api/user.js

@ -12,13 +12,14 @@ export function captcha(datas) {
// 请求出错处理 // 请求出错处理
export function requesterr(thiss, err) { export function requesterr(thiss, err) {
console.log(err); // console.log(err.toJSON());
// console.log(err);
console.log(err.toJSON()); //console.log(err.toJSON());
if (err.response) { if (err.response) {
thiss.$message({ showClose: true, message: err.response.data.err, type: 'error' }); thiss.$message({ showClose: true, message: err.response.data.err, type: 'error' });
} else if (err.request) { } else if (err.request) {
thiss.$message({ showClose: true, message: err.request, type: 'error' }); thiss.$message({ showClose: true, message: err.message, type: 'error' });
} else { } else {
thiss.$message({ showClose: true, message: err.message, type: 'error' }); thiss.$message({ showClose: true, message: err.message, type: 'error' });
} }

2
src/settings.js

@ -1,7 +1,7 @@
module.exports = { module.exports = {
title: '嘉洛马', title: '嘉洛马',
address: 'https://demo.jialuoma.com', address: 'https://demo.jialuoma.cn',
/** /**
* @type {boolean} true | false * @type {boolean} true | false

1
src/styles/element-ui.scss

@ -51,6 +51,7 @@
.el-submenu__title i{color:#FFF;} .el-submenu__title i{color:#FFF;}
.el-message{z-index:6000 !important;} .el-message{z-index:6000 !important;}
.content_main .el-drawer__wrapper{z-index:2200 !important;} .content_main .el-drawer__wrapper{z-index:2200 !important;}
.el-message-box__wrapper{z-index:2300 !important;}
#nprogress .bar{background:#409EFF !important;} #nprogress .bar{background:#409EFF !important;}

64
src/views/subfile/index.vue

@ -69,7 +69,7 @@
<!-- 文件数据列表 --> <!-- 文件数据列表 -->
<el-table <el-table
:show-header="false" :show-header="false"
empty-text="无文件数据" :empty-text="emptyText"
:data="tableData" :data="tableData"
style="width:100%;"> style="width:100%;">
@ -175,7 +175,9 @@
<el-drawer <el-drawer
title="上传图片" title="上传图片"
:visible.sync="uploadDrawer" :visible.sync="uploadDrawer"
ref="drawerref"
:direction="direction" :direction="direction"
:before-close="drawerClose"
size="100%" size="100%"
> >
@ -246,10 +248,11 @@ export default {
data() { data() {
return { return {
// //
//imgurl:process.env.VUE_APP_IMG_URL, imgurl:process.env.VUE_APP_IMG_URL,
imgurl:'https://demo.jialuoma.com', //imgurl:'https://demo.jialuoma.cn',
loadingText: '文件获取中...', loadingText: '文件获取中...',
emptyText: '无文件数据',
//haveRealpath: 0, //haveRealpath: 0,
// //
@ -464,7 +467,7 @@ export default {
//console.log(num); //console.log(num);
files.onProgress({percent: num}) // files.onProgress({percent: num}) //
} }
//files.onError()
//console.log(uploaddata); //console.log(uploaddata);
uploadrequest(uploaddata, Progress).then(response => { uploadrequest(uploaddata, Progress).then(response => {
let datamain = response.data; let datamain = response.data;
@ -472,9 +475,11 @@ export default {
//console.log(datamain); //console.log(datamain);
//this.$message({showClose: true,message: datamain.msg, type:'success'}); //this.$message({showClose: true,message: datamain.msg, type:'success'});
files.onSuccess(); //() files.onSuccess(); //()
this.uploadCount++; // this.uploadCount++; //
console.log(this.uploadCount); console.log(this.uploadCount);
console.log(this.uploadFilelist);
if (this.uploadCount == this.uploadFilelist.length) { if (this.uploadCount == this.uploadFilelist.length) {
this.uploadDrawer = false; this.uploadDrawer = false;
this.uploadFilelist = []; this.uploadFilelist = [];
@ -488,7 +493,12 @@ export default {
} }
}).catch(error => { }).catch(error => {
// this.uploadCount++;
// console.log(this.uploadCount);
// console.log(this.uploadFilelist);
requesterr(this, error); requesterr(this, error);
this.$message({showClose: true,message: error.message+ '/文件('+files.file.name+')上传失败,请重新上传', type:'error'});
files.onError(); //
this.uploadLoad = false; this.uploadLoad = false;
}); });
//console.log(res) //console.log(res)
@ -496,11 +506,34 @@ export default {
}, },
// //
// uploadDrawerClose(done) { drawerClose(done) {
// this.uploadDrawer = false; // this.uploadDrawer = false;
// this.uploadFilelist = []; // this.uploadFilelist = [];
// }, //confirm('退')
console.log(this.uploadCount);
if (this.uploadFilelist.length == 0) {
done();
return;
}
this.$confirm('离开该页面将退出照片上传', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if(this.uploadCount > 0) {
this.getFileData();
this.loadingText = '新增上传文件中...'
}
done();
this.uploadFilelist = [];
}).catch(() => {
});
},
getFileData() { getFileData() {
let can = {}; let can = {};
const menusindex = window.location.href const menusindex = window.location.href
@ -509,12 +542,13 @@ export default {
can.id = menusindex.split('?id=')[1] can.id = menusindex.split('?id=')[1]
} }
let thiss = this; let thiss = this;
this.subloading = true
this.dirdata = []
this.tableData = []
this.loadingText = '获取文件中...' this.loadingText = '获取文件中...'
this.subloading = true this.emptyText = ' ' //
this.dirdata = []
this.tableData = []
mirlist(can).then(response => { mirlist(can).then(response => {
let datamain = response.data; let datamain = response.data;
let maindata = datamain.data.dirTree; let maindata = datamain.data.dirTree;
if (datamain.code == 1) { if (datamain.code == 1) {
@ -528,7 +562,7 @@ export default {
this.tableData = this.forObjectData(maindata.files); this.tableData = this.forObjectData(maindata.files);
} }
this.emptyText = '无文件数据'
//this.haveRealpath = maindata.realpath; //this.haveRealpath = maindata.realpath;
//console.log(this.haveRealpath); //console.log(this.haveRealpath);
this.dirform.parent = maindata.realpath; // this.dirform.parent = maindata.realpath; //
@ -838,7 +872,7 @@ export default {
.type_file_click img{width:64px;height:48px;} .type_file_click img{width:64px;height:48px;}
.type_file_click a{display:block;} .type_file_click a{display:block;}
// .file_show{position:relative;} // .file_show{position:relative;}
.file_show a{display:block;} .file_show a{display:block;min-height:156px;min-width:140px;}
// .link_copy{position:absolute;top:0;right:0;} // .link_copy{position:absolute;top:0;right:0;}
// .el-table .is-center{text-align:left;} // .el-table .is-center{text-align:left;}
} }

Loading…
Cancel
Save