Compare commits

..

No commits in common. "bb15f8ca33ddddc29ec7afe31865db69d77e91a8" and "1c20402de748140d5fb205813a63f7bbc0812fc4" have entirely different histories.

5 changed files with 7 additions and 41 deletions

View File

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

View File

@ -52,10 +52,10 @@ const [register, { openModal }] = useModal();
const columns = [
{
title: '序号',
dataIndex: 'sn',
key: 'sn',
dataIndex: 'index',
key: 'index',
width: '50px',
// customRender: ({ index }) => `${index + 1}`,
customRender: ({ index }) => `${index + 1}`,
},
{
title: '预埋件编号',
@ -129,13 +129,10 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (
const setParamData = (items: any) => {
if (!paramData.value)
paramData.value = [];
items.forEach((d: any) => {
items.forEach((d: any, index: number) => {
const items = paramData.value.filter((p: any) => p.code === d.code);
if (items.length === 0) {
paramData.value.push({...d});
}
else {
items[0] = {...d};
paramData.value.push({index, ...d});
}
});
};
@ -199,7 +196,7 @@ const handleEdit = (record: Recordable, index: number) => {
};
const handleDelete = (record: Recordable) => {
paramData.value = paramData.value.filter((d: any) => d.code !== record.code);
paramData.value = paramData.value.filter(d => d.code !== record.code);
};
const handleOpenFileDialog = () => {
@ -218,11 +215,7 @@ const handleOpenFileDialog = () => {
};
const updateParamData = async (data: any) => {
paramData.value.forEach((d: any, index: number) => {
if (d["code"] === data["code"]) {
paramData.value[index] = { ...data };
}
});
paramData.value[data.index] = { ...data };
}
defineExpose({

View File

@ -292,20 +292,11 @@
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: '',

View File

@ -26,18 +26,6 @@ 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",

View File

@ -30,11 +30,6 @@ import ExcelJS from 'exceljs';
import { saveAs } from 'file-saver';
const columns = [
{
title: '序号',
dataIndex: 'sn',
key: 'sn',
},
{
title: '预埋件编号',
dataIndex: 'code',