Commit 8b3773b5 authored by liuzhaoh's avatar liuzhaoh

导入功能修改

parent de930a40
...@@ -318,8 +318,10 @@ const onExportFile = () => { ...@@ -318,8 +318,10 @@ const onExportFile = () => {
}; };
// 模板下载 // 模板下载
const onDownloadTemplate = () => { const onDownloadTemplate = () => {
window.open('https://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx') window.open(
return "https://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx"
);
return;
axios axios
.get("https://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx", { .get("https://visimg.bmetech.com/stone/img/1748314002767/设备数据.xlsx", {
responseType: "blob", responseType: "blob",
...@@ -367,17 +369,27 @@ const handleError = () => { ...@@ -367,17 +369,27 @@ const handleError = () => {
duration: 5 * 1000, duration: 5 * 1000,
}); });
}; };
const handleSuccess = () => { const handleSuccess = (res) => {
ElMessage({ if (res.code == 1) {
message: "文件上传成功", if (res.data && res.data.length > 0) {
type: "success", ElMessage({
duration: 5 * 1000, message: res.msg,
}); type: "error",
duration: 5 * 1000,
});
} else {
this.checkTableData = [];
ElMessage({
message: res.msg,
type: "success",
duration: 5 * 1000,
});
}
}
getDeviceContent(); getDeviceContent();
}; };
const handleProgress = (evt, uploadFile) => {}; const handleProgress = (evt, uploadFile) => {};
const beforeUpload = (file) => { const beforeUpload = (file) => {
console.log(file);
if ( if (
file.type !== "application/vnd.ms-excel" && file.type !== "application/vnd.ms-excel" &&
file.type !== file.type !==
......
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