diff --git a/src/views/data/task/drawer.vue b/src/views/data/task/drawer.vue
index 790a16b..d82f94d 100644
--- a/src/views/data/task/drawer.vue
+++ b/src/views/data/task/drawer.vue
@@ -64,25 +64,25 @@ const columns = [
title: 'X(mm)',
dataIndex: 'x',
key: 'x',
- width: '80px',
+ width: '75px',
},
{
title: 'Y(mm)',
dataIndex: 'y',
key: 'y',
- width: '80px',
+ width: '75px',
},
{
title: 'w(mm)',
dataIndex: 'w',
key: 'w',
- width: '80px',
+ width: '75px',
},
{
title: 'h(mm)',
dataIndex: 'h',
key: 'h',
- width: '80px',
+ width: '75px',
},
{
title: '中心点(m)',
diff --git a/src/views/data/task/index.vue b/src/views/data/task/index.vue
index 703ee18..8a510bc 100644
--- a/src/views/data/task/index.vue
+++ b/src/views/data/task/index.vue
@@ -23,15 +23,13 @@
@click="handleDownload"
:icon="h(DownloadOutlined)"
:disabled="checkedKeys.length === 0"
- >下发数据
+ >下发数据
同步数据
+ >同步数据
@@ -62,6 +60,7 @@
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
divider: true,
+ disabled: record.endTime === undefined || record.endTime === null,
},
{
label: '下发数据',
@@ -220,18 +219,36 @@
const handleView = (record: any) => {
const params = JSON.parse(record.paramJson);
- params.forEach((d) => {
- const r = Math.ceil(Math.random() * 10) - 3;
- d.l1 = r + parseInt(d.w);
- d.l2 = r + parseInt(d.h);
- d.l3 = r + parseInt(d.w);
- d.l4 = r + parseInt(d.h);
- const x = parseInt(d.x) + d.l1 / 2;
- const y = parseInt(d.y) + d.l2 / 2;
- d.c = x + ' , ' + y;
- d.result = r >= -2 && r <= 5 ? 'OK' : 'NG';
+ const result = JSON.parse(record.resultJson);
+ if (record.resultJson === undefined || record.resultJson === null)
+ return;
+ result.forEach((items: any) => {
+ items.forEach((d: any) => {
+ params[d.code - 1].x1 = d.x1;
+ params[d.code - 1].x2 = d.x2;
+ params[d.code - 1].x3 = d.x3;
+ params[d.code - 1].x4 = d.x4;
+ params[d.code - 1].y1 = d.y1;
+ params[d.code - 1].y2 = d.y2;
+ params[d.code - 1].y3 = d.y3;
+ params[d.code - 1].y4 = d.y4;
+ params[d.code - 1].w = d.w;
+ params[d.code - 1].h = d.h;
+ params[d.code - 1].status = d.status;
+ })
});
- record.resultJson = JSON.stringify(params);
+ // params.forEach((d) => {
+ // const r = Math.ceil(Math.random() * 10) - 3;
+ // d.l1 = r + parseInt(d.w);
+ // d.l2 = r + parseInt(d.h);
+ // d.l3 = r + parseInt(d.w);
+ // d.l4 = r + parseInt(d.h);
+ // const x = parseInt(d.x) + d.l1 / 2;
+ // const y = parseInt(d.y) + d.l2 / 2;
+ // d.c = x + ' , ' + y;
+ // d.result = r >= -2 && r <= 5 ? 'OK' : 'NG';
+ // });
+ record.resultJson1 = JSON.stringify(params);
openModal(true, { record });
};
diff --git a/src/views/data/task/result.vue b/src/views/data/task/result.vue
index 8d6582c..7c508c4 100644
--- a/src/views/data/task/result.vue
+++ b/src/views/data/task/result.vue
@@ -3,9 +3,9 @@
-
-
-
+
+
+
@@ -53,40 +53,64 @@ const columns = [
key: 'h',
width: '80px',
},
- {
- title: '边长1(mm)',
- dataIndex: 'l1',
- key: 'l1',
- width: '90px',
- },
- {
- title: '边长2(mm)',
- dataIndex: 'l2',
- key: 'l2',
- width: '90px',
- },
- {
- title: '边长3(mm)',
- dataIndex: 'l3',
- key: 'l3',
- width: '90px',
- },
- {
- title: '边长4(mm)',
- dataIndex: 'l4',
- key: 'l4',
- width: '90px',
- },
{
title: '检测中心(mm)',
dataIndex: 'c',
key: 'c',
width: '110px',
},
+ {
+ title: 'X1',
+ dataIndex: 'x1',
+ key: 'x1',
+ width: '40px',
+ },
+ {
+ title: 'Y1',
+ dataIndex: 'y1',
+ key: 'y1',
+ width: '40px',
+ },
+ {
+ title: 'X2',
+ dataIndex: 'x2',
+ key: 'x2',
+ width: '40px',
+ },
+ {
+ title: 'Y2',
+ dataIndex: 'y2',
+ key: 'y2',
+ width: '40px',
+ },
+ {
+ title: 'X3',
+ dataIndex: 'x3',
+ key: 'x3',
+ width: '40px',
+ },
+ {
+ title: 'Y3',
+ dataIndex: 'y3',
+ key: 'y3',
+ width: '40px',
+ },
+ {
+ title: 'X4',
+ dataIndex: 'x4',
+ key: 'x4',
+ width: '40px',
+ },
+ {
+ title: 'Y4',
+ dataIndex: 'y4',
+ key: 'y4',
+ width: '40px',
+ },
{
title: '结果',
- dataIndex: 'result',
- key: 'result',
+ dataIndex: 'status',
+ key: 'status',
width: '80px',
},
];
@@ -100,7 +124,7 @@ const [register, { closeModal, setModalProps }] = useModalInner(async (data) =>
setModalProps({ confirmLoading: false });
entity.value = data?.record;
paramData.value = [];
- const items = entity.value && entity.value.resultJson ? JSON.parse(entity.value.resultJson) : [];
+ const items = entity.value && entity.value.resultJson ? JSON.parse(entity.value.resultJson1) : [];
items.forEach((d: any, index: number) => {
paramData.value.push({ index, ...d });
});