update 订单,设备的获取方式

This commit is contained in:
lb
2023-04-17 17:01:40 +08:00
parent 37371fc023
commit 891a75556b
6 changed files with 165 additions and 62 deletions

View File

@@ -14,7 +14,8 @@
:headers="uploadHeaders"
:show-file-list="false"
:on-error="handleError"
:on-success="handleSuccess">
:on-success="handleSuccess"
:before-upload="handleBeforeUploadCheck">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
@@ -109,6 +110,23 @@ export default {
// 上传前检查文件大小: Boolean
},
handleBeforeUploadCheck(file) {
if (typeof file !== "object") return false;
if (!("name" in file) || !("type" in file)) return false;
const isXlsx =
file.name.split(".").pop() === "xlsx" &&
file.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
const isXls = file.name.split(".").pop() === "xls" && file.type === "application/vnd.ms-excel";
if (isXls || isXlsx) return true;
// false
this.$message({
message: "仅支持上传 Excel(.xls, .xlsx) 文件",
type: "error",
duration: 1500,
});
return false;
},
handleSuccess(response, file, fileList) {
// console.log("success response", response);