mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect-embeded.git
synced 2025-06-24 13:34:13 +08:00
fixed
This commit is contained in:
parent
8795da1093
commit
1c20402de7
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="920px" @ok="handleSubmit">
|
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="960px" @ok="handleSubmit">
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm" />
|
||||||
<BasicTable @register="registerTable">
|
<BasicTable @register="registerTable">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
@ -50,6 +50,13 @@ import { useModal } from '/@/components/Modal';
|
|||||||
const [register, { openModal }] = useModal();
|
const [register, { openModal }] = useModal();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'index',
|
||||||
|
key: 'index',
|
||||||
|
width: '50px',
|
||||||
|
customRender: ({ index }) => `${index + 1}`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '预埋件编号',
|
title: '预埋件编号',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
@ -64,25 +71,25 @@ const columns = [
|
|||||||
title: 'X(mm)',
|
title: 'X(mm)',
|
||||||
dataIndex: 'x',
|
dataIndex: 'x',
|
||||||
key: 'x',
|
key: 'x',
|
||||||
width: '75px',
|
width: '72px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Y(mm)',
|
title: 'Y(mm)',
|
||||||
dataIndex: 'y',
|
dataIndex: 'y',
|
||||||
key: 'y',
|
key: 'y',
|
||||||
width: '75px',
|
width: '72px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'w(mm)',
|
title: 'w(mm)',
|
||||||
dataIndex: 'w',
|
dataIndex: 'w',
|
||||||
key: 'w',
|
key: 'w',
|
||||||
width: '75px',
|
width: '72px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'h(mm)',
|
title: 'h(mm)',
|
||||||
dataIndex: 'h',
|
dataIndex: 'h',
|
||||||
key: 'h',
|
key: 'h',
|
||||||
width: '75px',
|
width: '72px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '中心点(m)',
|
title: '中心点(m)',
|
||||||
@ -111,8 +118,8 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (
|
|||||||
entity.value = data?.record;
|
entity.value = data?.record;
|
||||||
paramData.value = [];
|
paramData.value = [];
|
||||||
const items = entity.value && entity.value.paramJson ? JSON.parse(entity.value.paramJson) : [];
|
const items = entity.value && entity.value.paramJson ? JSON.parse(entity.value.paramJson) : [];
|
||||||
items.forEach((d: any, index: number) => {
|
items.forEach((d: any) => {
|
||||||
paramData.value.push({ index, ...d });
|
paramData.value.push({ ...d });
|
||||||
});
|
});
|
||||||
await setFieldsValue({
|
await setFieldsValue({
|
||||||
...data.record,
|
...data.record,
|
||||||
@ -120,9 +127,13 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
const setParamData = (items: any) => {
|
const setParamData = (items: any) => {
|
||||||
paramData.value = [];
|
if (!paramData.value)
|
||||||
|
paramData.value = [];
|
||||||
items.forEach((d: any, index: number) => {
|
items.forEach((d: any, index: number) => {
|
||||||
paramData.value.push({index, ...d});
|
const items = paramData.value.filter((p: any) => p.code === d.code);
|
||||||
|
if (items.length === 0) {
|
||||||
|
paramData.value.push({index, ...d});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@
|
|||||||
return undefined;
|
return undefined;
|
||||||
const results = JSON.parse(record.results);
|
const results = JSON.parse(record.results);
|
||||||
params.forEach((param: any) => {
|
params.forEach((param: any) => {
|
||||||
const l = results.filter((d: any) => param["code"] === getCode(param["code"], d["code"]+''));
|
const l = results.filter((d: any) => param["code"] === d["code"] || param["code"] === getCode(param["code"], d["code"]+''));
|
||||||
if (l.length > 0) {
|
if (l.length > 0) {
|
||||||
param["x1"] = l[0]["x1"];
|
param["x1"] = l[0]["x1"];
|
||||||
param["y1"] = l[0]["y1"];
|
param["y1"] = l[0]["y1"];
|
||||||
@ -293,7 +293,10 @@
|
|||||||
OCRService.importByOCR(base64ImageString).then(
|
OCRService.importByOCR(base64ImageString).then(
|
||||||
(res: any) => {
|
(res: any) => {
|
||||||
const data = JSON.parse(res);
|
const data = JSON.parse(res);
|
||||||
if (data.length === 0) return;
|
if (data.length === 0) {
|
||||||
|
isLoading.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ocrData === null) {
|
if (ocrData === null) {
|
||||||
const record = {
|
const record = {
|
||||||
name: '',
|
name: '',
|
||||||
@ -358,10 +361,10 @@
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
timer.value = setInterval(() => {
|
timer.value = setInterval(() => {
|
||||||
DeviceClientService.getDeviceConnected().then(
|
DeviceClientService.getDeviceConnected().then(
|
||||||
(d) => {
|
(d: any) => {
|
||||||
deviceConnectedList.value = d;
|
deviceConnectedList.value = d;
|
||||||
},
|
},
|
||||||
(_) => {
|
(_: any) => {
|
||||||
WebViewService.setMessage('获取设备连接出错', 'error').then(() => {});
|
WebViewService.setMessage('获取设备连接出错', 'error').then(() => {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -98,6 +98,18 @@ const paramSchema: FormSchema[] = [
|
|||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
rules: [{ required: true, message: '请输入H(mm)!' }],
|
rules: [{ required: true, message: '请输入H(mm)!' }],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
colProps: { span: 24 },
|
||||||
|
field: "center",
|
||||||
|
label: "Center(m)",
|
||||||
|
componentProps: {
|
||||||
|
allowClear: false,
|
||||||
|
placeholder: 'Center(m)',
|
||||||
|
},
|
||||||
|
component: "Input",
|
||||||
|
defaultValue: undefined,
|
||||||
|
rules: [{ required: true, message: '请输入Center(m)!' }],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||||
|
Loading…
Reference in New Issue
Block a user