This commit is contained in:
njdaoyehu 2025-04-23 10:27:38 +08:00
parent 1c20402de7
commit c64df82202
2 changed files with 12 additions and 1 deletions

View File

@ -60,6 +60,7 @@ export const schema = {
},
colProps,
component: 'Input',
rules: [{ required: true, message: '请输入设备序列号!' }],
},
table: {
},

View File

@ -288,15 +288,25 @@
pdfView.value.show();
};
let wallCode = null;
const handleCapture = (base64ImageString: any) => {
isLoading.value = true;
OCRService.importByOCR(base64ImageString).then(
OCRService.importByOCR(base64ImageString, wallCode).then(
(res: any) => {
if (res === "") {
isLoading.value = false;
return;
}
const data = JSON.parse(res);
if (data.length === 0) {
isLoading.value = false;
return;
}
if (data[0].length > 5) {
wallCode = data[0].code.substring(0, data.length - 5);
} else {
wallCode = null;
}
if (ocrData === null) {
const record = {
name: '',