update 订单,设备的获取方式
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user