Commit 10604261 authored by zhangdishen's avatar zhangdishen

Merge branch 'mhy' into 'master'

优化导出excel的返回信息

See merge request !87
parents 6f57362b 98ad3721
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button <el-button
style="margin-top: 10px" style="margin-top: 10px"
...@@ -103,11 +103,11 @@ ...@@ -103,11 +103,11 @@
this.loading = false; this.loading = false;
return false; return false;
} }
// if (uploadedList.includes(file.name)) { if (file.size > 50 * 1024 * 1024) {
// this.$message.warning(file.name + "已被选中过,请勿重复选择"); this.$message.warning(file.name + "文件大于50MB,无法上传");
// return false; this.loading = false;
// } return false;
// uploadedList.push(file.name); }
}, },
async uploadSuccess(response) { async uploadSuccess(response) {
this.fileList = []; this.fileList = [];
...@@ -123,21 +123,17 @@ ...@@ -123,21 +123,17 @@
duration: 0 duration: 0
}); });
}, },
async uploadError(response) { async uploadError(error, file, fileList) {
this.fileList = []; this.fileList = [];
this.dialogTitle = "导入结果"; this.dialogTitle = "导入结果";
this.dialogContent = "导入失败"; this.dialogContent = "导入失败";
// this.dialogVisible = true; // this.dialogVisible = true;
this.loading = false; this.loading = false;
// console.log(response); this.$message({
this.$alert(response.data, '导入结果', { type: "error",
confirmButtonText: '确定', message: "系统错误",
callback: action => { showClose: true,
// this.$message({ duration: 3000
// type: 'info',
// message: `action: ${ action }`
// });
}
}); });
}, },
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload1">数据导入</el-button> <el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload1">数据导入</el-button>
</el-tab-pane> </el-tab-pane>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload2">数据导入</el-button> <el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload2">数据导入</el-button>
</el-tab-pane> </el-tab-pane>
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload3">数据导入</el-button> <el-button style="margin-top: 10px" size="small" type="success" @click="submitUpload3">数据导入</el-button>
</el-tab-pane> </el-tab-pane>
...@@ -229,11 +229,11 @@ ...@@ -229,11 +229,11 @@
this.loading = false; this.loading = false;
return false; return false;
} }
// if (uploadedList.includes(file.name)) { if (file.size > 50 * 1024 * 1024) {
// this.$message.warning(file.name + "已被选中过,请勿重复选择"); this.$message.warning(file.name + "文件大于50MB,无法上传");
// return false; this.loading = false;
// } return false;
// uploadedList.push(file.name); }
}, },
async uploadSuccess(response) { async uploadSuccess(response) {
this.fileList = []; this.fileList = [];
...@@ -255,16 +255,22 @@ ...@@ -255,16 +255,22 @@
this.dialogContent = "导入失败"; this.dialogContent = "导入失败";
// this.dialogVisible = true; // this.dialogVisible = true;
this.loading = false; this.loading = false;
console.log(response); this.$message({
this.$alert(response.data, '导入结果', { type: "error",
confirmButtonText: '确定', message: "系统错误",
callback: action => { showClose: true,
// this.$message({ duration: 3000
// type: 'info',
// message: `action: ${ action }`
// });
}
}); });
// console.log(response);
// this.$alert(response.data, '导入结果', {
// confirmButtonText: '确定',
// callback: action => {
// // this.$message({
// // type: 'info',
// // message: `action: ${ action }`
// // });
// }
// });
}, },
} }
} }
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button <el-button
style="margin-top: 10px" style="margin-top: 10px"
...@@ -187,11 +187,11 @@ ...@@ -187,11 +187,11 @@
this.loading = false; this.loading = false;
return false; return false;
} }
// if (uploadedList.includes(file.name)) { if (file.size > 50 * 1024 * 1024) {
// this.$message.warning(file.name + "已被选中过,请勿重复选择"); this.$message.warning(file.name + "文件大于50MB,无法上传");
// return false; this.loading = false;
// } return false;
// uploadedList.push(file.name); }
}, },
async uploadSuccess(response) { async uploadSuccess(response) {
this.fileList = []; this.fileList = [];
...@@ -213,16 +213,22 @@ ...@@ -213,16 +213,22 @@
this.dialogContent = "导入失败"; this.dialogContent = "导入失败";
// this.dialogVisible = true; // this.dialogVisible = true;
this.loading = false; this.loading = false;
// console.log(response); this.$message({
this.$alert(response.data, '导入结果', { type: "error",
confirmButtonText: '确定', message: "系统错误",
callback: action => { showClose: true,
// this.$message({ duration: 3000
// type: 'info',
// message: `action: ${ action }`
// });
}
}); });
// console.log(response);
// this.$alert(response.data, '导入结果', {
// confirmButtonText: '确定',
// callback: action => {
// // this.$message({
// // type: 'info',
// // message: `action: ${ action }`
// // });
// }
// });
}, },
} }
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button <el-button
style="margin-top: 10px" style="margin-top: 10px"
...@@ -105,11 +105,11 @@ ...@@ -105,11 +105,11 @@
this.loading = false; this.loading = false;
return false; return false;
} }
// if (uploadedList.includes(file.name)) { if (file.size > 50 * 1024 * 1024) {
// this.$message.warning(file.name + "已被选中过,请勿重复选择"); this.$message.warning(file.name + "文件大于50MB,无法上传");
// return false; this.loading = false;
// } return false;
// uploadedList.push(file.name); }
}, },
async uploadSuccess(response) { async uploadSuccess(response) {
this.fileList = []; this.fileList = [];
...@@ -131,16 +131,22 @@ ...@@ -131,16 +131,22 @@
this.dialogContent = "导入失败"; this.dialogContent = "导入失败";
// this.dialogVisible = true; // this.dialogVisible = true;
this.loading = false; this.loading = false;
// console.log(response); this.$message({
this.$alert(response.data, '导入结果', { type: "error",
confirmButtonText: '确定', message: "系统错误",
callback: action => { showClose: true,
// this.$message({ duration: 3000
// type: 'info',
// message: `action: ${ action }`
// });
}
}); });
// console.log(response);
// this.$alert(response.data, '导入结果', {
// confirmButtonText: '确定',
// callback: action => {
// // this.$message({
// // type: 'info',
// // message: `action: ${ action }`
// // });
// }
// });
}, },
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
:auto-upload="false"> :auto-upload="false">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件</div> <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,一次最多只能上传1个文件,且不能超过10MB</div>
</el-upload> </el-upload>
<el-button <el-button
style="margin-top: 10px" style="margin-top: 10px"
...@@ -99,11 +99,11 @@ ...@@ -99,11 +99,11 @@
this.loading = false; this.loading = false;
return false; return false;
} }
// if (uploadedList.includes(file.name)) { if (file.size > 50 * 1024 * 1024) {
// this.$message.warning(file.name + "已被选中过,请勿重复选择"); this.$message.warning(file.name + "文件大于50MB,无法上传");
// return false; this.loading = false;
// } return false;
// uploadedList.push(file.name); }
}, },
async uploadSuccess(response) { async uploadSuccess(response) {
this.fileList = []; this.fileList = [];
...@@ -125,16 +125,22 @@ ...@@ -125,16 +125,22 @@
this.dialogContent = "导入失败"; this.dialogContent = "导入失败";
// this.dialogVisible = true; // this.dialogVisible = true;
this.loading = false; this.loading = false;
// console.log(response); this.$message({
this.$alert(response.data, '导入结果', { type: "error",
confirmButtonText: '确定', message: "系统错误",
callback: action => { showClose: true,
// this.$message({ duration: 3000
// type: 'info',
// message: `action: ${ action }`
// });
}
}); });
// console.log(response);
// this.$alert(response.data, '导入结果', {
// confirmButtonText: '确定',
// callback: action => {
// // this.$message({
// // type: 'info',
// // message: `action: ${ action }`
// // });
// }
// });
}, },
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment