|
@@ -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) {
|
|
//msSaveOrOpenBlob方法返回bool值
|
|
//msSaveOrOpenBlob方法返回bool值
|
|
@@ -591,18 +603,17 @@ 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"
|
|
});
|
|
});
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
this.$message({
|
|
this.$message({
|
|
message: response.message,
|
|
message: response.message,
|
|
type: "error"
|
|
type: "error"
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
},
|
|
},
|
|
handleError(err) {
|
|
handleError(err) {
|
|
this.$message({
|
|
this.$message({
|