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
f643ca1626
commit
afbe9b59ad
Binary file not shown.
@ -88,6 +88,11 @@
|
|||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-checkbox-group-item {
|
||||||
|
font-family: "Noto Sans SC", serif;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
.ant-tree-checkbox-inner,
|
.ant-tree-checkbox-inner,
|
||||||
.ant-checkbox-inner {
|
.ant-checkbox-inner {
|
||||||
border: 1px solid rgba(45, 119, 243, 0.3) !important;
|
border: 1px solid rgba(45, 119, 243, 0.3) !important;
|
||||||
|
@ -230,7 +230,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
|
|||||||
// authentication schemes,e.g: Bearer
|
// authentication schemes,e.g: Bearer
|
||||||
// authenticationScheme: 'Bearer',
|
// authenticationScheme: 'Bearer',
|
||||||
authenticationScheme: '',
|
authenticationScheme: '',
|
||||||
timeout: 10 * 1000,
|
timeout: 60 * 1000,
|
||||||
// 基础接口地址
|
// 基础接口地址
|
||||||
// baseURL: globSetting.apiUrl,
|
// baseURL: globSetting.apiUrl,
|
||||||
|
|
||||||
|
@ -4,18 +4,26 @@
|
|||||||
<BasicTable @register="registerTable">
|
<BasicTable @register="registerTable">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<div style="margin-right: 20px; color: #ffffff; font-size: 14px;">共 {{ paramData.length }} 件</div>
|
<div style="margin-right: 20px; color: #ffffff; font-size: 14px;">共 {{ paramData.length }} 件</div>
|
||||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handleCreate">新 增</a-button>
|
<div>
|
||||||
<a-button type="primary" :icon="h(EyeOutlined)" :disabled="importDisabled" @click="handleOpenFileDialog">OCR识别</a-button>
|
<div style="margin-bottom: 10px">
|
||||||
<a-button type="primary" :icon="h(FileSyncOutlined)" style="font-size: 10px;" :disabled="importDisabled" @click="handleParamData">根据墙体类型和方向整理OCR识别的数据</a-button>
|
<a-button type="primary" style="margin-left: 10px" :icon="h(PlusOutlined)" @click="handleCreate">新 增</a-button>
|
||||||
<a-button type="primary" :icon="h(FileExcelOutlined)" :disabled="importDisabled" @click="handleImport">导入Excel</a-button>
|
<a-button type="primary" style="margin-left: 10px" :icon="h(EyeOutlined)" :disabled="importDisabled" @click="handleOpenFileDialog">OCR识别</a-button>
|
||||||
<Popconfirm
|
<a-button type="primary" style="margin-left: 10px" :icon="h(FileExcelOutlined)" :disabled="importDisabled" @click="handleImport">导入Excel</a-button>
|
||||||
title="确定要清空预埋件列表吗?"
|
<Popconfirm
|
||||||
ok-text="确定"
|
title="确定要清空预埋件列表吗?"
|
||||||
cancel-text="取消"
|
ok-text="确定"
|
||||||
@confirm="handleDeleteAll"
|
cancel-text="取消"
|
||||||
>
|
@confirm="handleDeleteAll"
|
||||||
<a-button type="primary" :icon="h(MinusOutlined)">清空列表</a-button>
|
>
|
||||||
</Popconfirm>
|
<a-button type="primary" style="margin-left: 10px" :icon="h(MinusOutlined)">清空列表</a-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span v-if="numberList.length !== 0" style="font-family: 'Noto Sans SC', serif; font-size: 14px; color: #ffffff; padding-right: 10px">{{ valueLabel }}</span>
|
||||||
|
<CheckboxGroup v-if="numberList.length !== 0" v-model:value="numberCheckedList" :options="numberList" />
|
||||||
|
<a-button type="primary" style="margin-left: 10px" :icon="h(FileSyncOutlined)" :disabled="importDisabled" @click="handleParamData">整理OCR数据</a-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'x'">
|
<template v-if="column.dataIndex === 'x'">
|
||||||
@ -70,7 +78,7 @@ import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
|||||||
import * as TaskApi from '@/api/data/taskApi';
|
import * as TaskApi from '@/api/data/taskApi';
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||||
import { EyeOutlined, PlusOutlined, MinusOutlined, FileSyncOutlined, FileExcelOutlined } from "@ant-design/icons-vue";
|
import { EyeOutlined, PlusOutlined, MinusOutlined, FileSyncOutlined, FileExcelOutlined } from "@ant-design/icons-vue";
|
||||||
import { Popconfirm } from 'ant-design-vue';
|
import { Popconfirm, CheckboxGroup } from 'ant-design-vue';
|
||||||
import Modal from "@/views/data/task/modal.vue";
|
import Modal from "@/views/data/task/modal.vue";
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
const [register, { openModal }] = useModal();
|
const [register, { openModal }] = useModal();
|
||||||
@ -123,6 +131,10 @@ const columns = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const valueLabel = ref<string>("");
|
||||||
|
const numberList = ref<any>([]);
|
||||||
|
const numberCheckedList = ref<any>([]);
|
||||||
|
const paramRawData = ref<any>([]);
|
||||||
const paramData = ref<any>([]);
|
const paramData = ref<any>([]);
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register', 'ocrClick']);
|
const emit = defineEmits(['success', 'register', 'ocrClick']);
|
||||||
@ -141,6 +153,10 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (
|
|||||||
setDrawerProps({confirmLoading: false});
|
setDrawerProps({confirmLoading: false});
|
||||||
isUpdate.value = !!data?.isUpdate;
|
isUpdate.value = !!data?.isUpdate;
|
||||||
entity.value = data?.record;
|
entity.value = data?.record;
|
||||||
|
valueLabel.value = "";
|
||||||
|
numberList.value = [];
|
||||||
|
numberCheckedList.value = [];
|
||||||
|
paramRawData.value = [];
|
||||||
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, index: number) => {
|
||||||
@ -227,7 +243,7 @@ const handleCreate = () => {
|
|||||||
openModal(true, { isUpdate: false });
|
openModal(true, { isUpdate: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEdit = (record: Recordable, index: number) => {
|
const handleEdit = (record: Recordable) => {
|
||||||
openModal(true, { record, isUpdate: true });
|
openModal(true, { record, isUpdate: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -315,8 +331,6 @@ const handleValuesChanged = () => {
|
|||||||
|
|
||||||
// OCR识别
|
// OCR识别
|
||||||
const setParamData = (data: any) => {
|
const setParamData = (data: any) => {
|
||||||
if (!paramData.value)
|
|
||||||
paramData.value = [];
|
|
||||||
data.forEach((d: any) => {
|
data.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) {
|
||||||
@ -326,63 +340,94 @@ const setParamData = (data: any) => {
|
|||||||
items[0] = {...d};
|
items[0] = {...d};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
WebViewService.setMessage('数据导入成功!', "success").then(() => {});
|
numberList.value = [];
|
||||||
};
|
numberCheckedList.value = [];
|
||||||
|
const wallType = getFieldsValue().wallType;
|
||||||
// OCR识别数据整理
|
|
||||||
const handleParamData = () => {
|
|
||||||
const data = getFieldsValue();
|
|
||||||
const wallType = data.wallType;
|
|
||||||
const direction = data.direction;
|
|
||||||
// x去重
|
// x去重
|
||||||
const uniqueListX = Array.from(new Map(paramData.value.map((item: any) => [item.x, item])).values());
|
const uniqueListX = Array.from(new Map(paramData.value.map((item: any) => [item.x, item])).values());
|
||||||
// y去重
|
// y去重
|
||||||
const uniqueListY = Array.from(new Map(paramData.value.map((item: any) => [item.y, item])).values());
|
const uniqueListY = Array.from(new Map(paramData.value.map((item: any) => [item.y, item])).values());
|
||||||
// 墙体类型为 B
|
if (wallType === "B类" && uniqueListX.length <= 3 && uniqueListY.length > 3) {
|
||||||
paramData.value.forEach((d: any) => {
|
valueLabel.value = "选择X值:";
|
||||||
if (wallType === "B类" && uniqueListX.length <= 3 && uniqueListY.length > 3) {
|
uniqueListX.forEach((item: any) => { numberList.value.push(item.x); });
|
||||||
const nX: any = d["y"];
|
}
|
||||||
const nY: any = d["x"];
|
if (wallType === "A类" && uniqueListY.length <= 3 && uniqueListX.length > 3) {
|
||||||
d.nX = nX;
|
valueLabel.value = "选择Y值:";
|
||||||
d.nY = nY;
|
uniqueListY.forEach((item: any) => { numberList.value.push(item.y); });
|
||||||
} else {
|
}
|
||||||
const nX: any = d["x"];
|
};
|
||||||
const nY: any = d["y"];
|
|
||||||
d.nX = nX;
|
// OCR识别数据整理
|
||||||
d.nY = nY;
|
const handleParamData = () => {
|
||||||
}
|
if (valueLabel.value === "") return;
|
||||||
});
|
|
||||||
// 判断正面、背面
|
if (numberCheckedList.value.length === 0) {
|
||||||
const uniqueY = Array.from(new Map(paramData.value.map((item: any) => [item.nY, item])).values());
|
WebViewService.setMessage('没有' + valueLabel.value, 'information').then(() => {});
|
||||||
const maxY = Math.max(...uniqueY.map((item: any) => Math.abs(Number(item.nY))));
|
return;
|
||||||
const minY = Math.min(...uniqueY.map((item: any) => Math.abs(Number(item.nY))));
|
}
|
||||||
paramData.value.forEach((d: any) => {
|
|
||||||
if (Math.abs(Number(d.nY)) === minY) {
|
if (paramRawData.value.length === 0) {
|
||||||
d.zm = 1;
|
paramData.value.forEach((d: any) => {
|
||||||
} else if (Math.abs(Number(d.nY)) === maxY) {
|
paramRawData.value.push({ ...d });
|
||||||
d.zm = 0;
|
})
|
||||||
} else if (maxY - Math.abs(Number(d.nY)) < Math.abs(Number(d.nY)) - minY) {
|
}
|
||||||
d.zm = 0;
|
|
||||||
} else {
|
paramData.value = paramRawData.value.filter((d: any) => {
|
||||||
d.zm = 1;
|
return (valueLabel.value.includes("X") && numberCheckedList.value.join(",").includes(d.x)) ||
|
||||||
}
|
(valueLabel.value.includes("Y") && numberCheckedList.value.join(",").includes(d.y))
|
||||||
});
|
|
||||||
paramData.value = direction === "正面" ? paramData.value.filter((d: any) => {
|
|
||||||
return d.zm === 1
|
|
||||||
}).map((d: any) => ({...d})) : paramData.value.filter((d: any) => {
|
|
||||||
return d.zm === 0
|
|
||||||
}).map((d: any) => ({...d}));
|
|
||||||
paramData.value.forEach((d: any) => {
|
|
||||||
if (d.hasOwnProperty("zm")) {
|
|
||||||
delete d.zm;
|
|
||||||
}
|
|
||||||
if (d.hasOwnProperty("nX")) {
|
|
||||||
delete d.nX;
|
|
||||||
}
|
|
||||||
if (d.hasOwnProperty("nY")) {
|
|
||||||
delete d.nY;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
// const data = getFieldsValue();
|
||||||
|
// const wallType = data.wallType;
|
||||||
|
// const direction = data.direction;
|
||||||
|
// x去重
|
||||||
|
// const uniqueListX = Array.from(new Map(paramData.value.map((item: any) => [item.x, item])).values());
|
||||||
|
// // y去重
|
||||||
|
// const uniqueListY = Array.from(new Map(paramData.value.map((item: any) => [item.y, item])).values());
|
||||||
|
// // 墙体类型为 B
|
||||||
|
// paramData.value.forEach((d: any) => {
|
||||||
|
// if (wallType === "B类" && uniqueListX.length <= 4 && uniqueListY.length > 3) {
|
||||||
|
// const nX: any = d["y"];
|
||||||
|
// const nY: any = d["x"];
|
||||||
|
// d.nX = nX;
|
||||||
|
// d.nY = nY;
|
||||||
|
// } else {
|
||||||
|
// const nX: any = d["x"];
|
||||||
|
// const nY: any = d["y"];
|
||||||
|
// d.nX = nX;
|
||||||
|
// d.nY = nY;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// // 判断正面、背面
|
||||||
|
// const uniqueY = Array.from(new Map(paramData.value.map((item: any) => [item.nY, item])).values());
|
||||||
|
// const maxY = Math.max(...uniqueY.map((item: any) => Math.abs(Number(item.nY))));
|
||||||
|
// const minY = Math.min(...uniqueY.map((item: any) => Math.abs(Number(item.nY))));
|
||||||
|
// paramData.value.forEach((d: any) => {
|
||||||
|
// if (Math.abs(Number(d.nY)) === minY) {
|
||||||
|
// d.zm = 1;
|
||||||
|
// } else if (Math.abs(Number(d.nY)) === maxY) {
|
||||||
|
// d.zm = 0;
|
||||||
|
// } else if (maxY - Math.abs(Number(d.nY)) < Math.abs(Number(d.nY)) - minY) {
|
||||||
|
// d.zm = 0;
|
||||||
|
// } else {
|
||||||
|
// d.zm = 1;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// paramData.value = direction === "正面" ? paramData.value.filter((d: any) => {
|
||||||
|
// return d.zm === 1
|
||||||
|
// }).map((d: any) => ({...d})) : paramData.value.filter((d: any) => {
|
||||||
|
// return d.zm === 0
|
||||||
|
// }).map((d: any) => ({...d}));
|
||||||
|
// paramData.value.forEach((d: any) => {
|
||||||
|
// if (d.hasOwnProperty("zm")) {
|
||||||
|
// delete d.zm;
|
||||||
|
// }
|
||||||
|
// if (d.hasOwnProperty("nX")) {
|
||||||
|
// delete d.nX;
|
||||||
|
// }
|
||||||
|
// if (d.hasOwnProperty("nY")) {
|
||||||
|
// delete d.nY;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
WebViewService.setMessage('数据整理完成!', "success").then(() => {});
|
WebViewService.setMessage('数据整理完成!', "success").then(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ export const schema = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'direction',
|
field: 'direction',
|
||||||
label: '方向',
|
label: '检测方向',
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
form: {
|
form: {
|
||||||
colProps,
|
colProps,
|
||||||
|
Loading…
Reference in New Issue
Block a user