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