update 导出

qianlishi 3 years ago
parent 405cbf772a
commit 660e0b3b56

@ -572,6 +572,18 @@ export default {
showDataSet: val showDataSet: val
}; };
exportDashboard(param).then(res => { exportDashboard(param).then(res => {
const that = this;
const type = res.type;
if (type == "application/json") {
var reader = new FileReader();
reader.readAsText(res, "utf-8");
reader.onload = function() {
const data = JSON.parse(reader.result);
that.$message.error(data.message);
};
return;
}
const blob = new Blob([res], { type: "application/octet-stream" }); const blob = new Blob([res], { type: "application/octet-stream" });
if (window.navigator.msSaveOrOpenBlob) { if (window.navigator.msSaveOrOpenBlob) {
//msSaveOrOpenBlobbool //msSaveOrOpenBlobbool
@ -591,7 +603,7 @@ export default {
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
// //
this.initEchartData(); this.initEchartData();
if (response.code == '200') { if (response.code == "200") {
this.$message({ this.$message({
message: "导入成功!", message: "导入成功!",
type: "success" type: "success"
@ -602,7 +614,6 @@ export default {
type: "error" type: "error"
}); });
} }
}, },
handleError(err) { handleError(err) {
this.$message({ this.$message({

Loading…
Cancel
Save