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