mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect-embeded.git
synced 2025-06-24 05:24:12 +08:00
Compare commits
2 Commits
1c20402de7
...
bb15f8ca33
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bb15f8ca33 | ||
![]() |
c64df82202 |
@ -60,6 +60,7 @@ export const schema = {
|
||||
},
|
||||
colProps,
|
||||
component: 'Input',
|
||||
rules: [{ required: true, message: '请输入设备序列号!' }],
|
||||
},
|
||||
table: {
|
||||
},
|
||||
|
@ -52,10 +52,10 @@ const [register, { openModal }] = useModal();
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
dataIndex: 'sn',
|
||||
key: 'sn',
|
||||
width: '50px',
|
||||
customRender: ({ index }) => `${index + 1}`,
|
||||
// customRender: ({ index }) => `${index + 1}`,
|
||||
},
|
||||
{
|
||||
title: '预埋件编号',
|
||||
@ -129,10 +129,13 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (
|
||||
const setParamData = (items: any) => {
|
||||
if (!paramData.value)
|
||||
paramData.value = [];
|
||||
items.forEach((d: any, index: number) => {
|
||||
items.forEach((d: any) => {
|
||||
const items = paramData.value.filter((p: any) => p.code === d.code);
|
||||
if (items.length === 0) {
|
||||
paramData.value.push({index, ...d});
|
||||
paramData.value.push({...d});
|
||||
}
|
||||
else {
|
||||
items[0] = {...d};
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -196,7 +199,7 @@ const handleEdit = (record: Recordable, index: number) => {
|
||||
};
|
||||
|
||||
const handleDelete = (record: Recordable) => {
|
||||
paramData.value = paramData.value.filter(d => d.code !== record.code);
|
||||
paramData.value = paramData.value.filter((d: any) => d.code !== record.code);
|
||||
};
|
||||
|
||||
const handleOpenFileDialog = () => {
|
||||
@ -215,7 +218,11 @@ const handleOpenFileDialog = () => {
|
||||
};
|
||||
|
||||
const updateParamData = async (data: any) => {
|
||||
paramData.value[data.index] = { ...data };
|
||||
paramData.value.forEach((d: any, index: number) => {
|
||||
if (d["code"] === data["code"]) {
|
||||
paramData.value[index] = { ...data };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
@ -292,11 +292,20 @@
|
||||
isLoading.value = true;
|
||||
OCRService.importByOCR(base64ImageString).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: '',
|
||||
|
@ -26,6 +26,18 @@ const [register, { closeModal, setModalProps }] = useModalInner(async (data) =>
|
||||
});
|
||||
|
||||
const paramSchema: FormSchema[] = [
|
||||
{
|
||||
colProps: { span: 24 },
|
||||
field: "sn",
|
||||
label: "序号",
|
||||
componentProps: {
|
||||
allowClear: false,
|
||||
placeholder: '序号',
|
||||
},
|
||||
component: "Input",
|
||||
defaultValue: undefined,
|
||||
rules: [{ required: true, message: '请输入序号!' }],
|
||||
},
|
||||
{
|
||||
colProps: { span: 24 },
|
||||
field: "code",
|
||||
|
@ -30,6 +30,11 @@ import ExcelJS from 'exceljs';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'sn',
|
||||
key: 'sn',
|
||||
},
|
||||
{
|
||||
title: '预埋件编号',
|
||||
dataIndex: 'code',
|
||||
|
Loading…
Reference in New Issue
Block a user