Compare commits

..

3 Commits

Author SHA1 Message Date
njdaoyehu
213b0b8a9e fixed 2025-04-23 17:28:55 +08:00
njdaoyehu
ae3d126ef1 fixed 2025-04-23 17:00:27 +08:00
njdaoyehu
3e3b405ae0 fixed 2025-04-23 15:24:05 +08:00
3 changed files with 78 additions and 13 deletions

View File

@ -400,16 +400,16 @@
background-color: rgba(146,214,237,0.3) !important;
}
:deep(.ant-popover-inner) {
border: 1px solid #183171 !important;
background-color: #13265a !important;
}
:deep(.ant-popconfirm-message-title) {
font-family: "Noto Sans SC", serif;
font-size: 14px;
color: white;
}
//:deep(.ant-popover-inner) {
// border: 1px solid #183171 !important;
// background-color: #13265a !important;
//}
//
//:deep(.ant-popconfirm-message-title) {
// font-family: "Noto Sans SC", serif;
// font-size: 14px;
// color: white;
//}
:deep(.ant-picker),
:deep(.ant-picker-range) {

View File

@ -21,6 +21,10 @@
border: none;
}
.ant-btn-sm {
height: 24px !important;
}
.ant-btn-primary:hover {
font-family: "Noto Sans SC", serif;
font-size: 14px;
@ -190,3 +194,14 @@
color: #ffffff;
border-bottom: 1px solid rgba(45,119,243,0.3) !important;
}
.ant-popover-inner {
border: 1px solid #183171 !important;
background-color: #13265a !important;
}
.ant-popconfirm-message-title {
font-family: "Noto Sans SC", serif;
font-size: 14px;
color: white;
}

View File

@ -7,8 +7,33 @@
<div style="width: 5px" />
<a-button type="primary" :icon="h(EyeOutlined)" @click="handleOpenFileDialog">OCR识别</a-button>
<div style="width: 5px" />
<Popconfirm
title="确定要清空预埋件列表吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDeleteAll"
>
<a-button type="primary" :icon="h(MinusOutlined)">清空列表</a-button>
</Popconfirm>
<div style="width: 5px" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'x'">
<span v-if="markField('x', record)" style="color: red">{{ record.x }}</span>
<span v-else style="color: white">{{ record.x }}</span>
</template>
<template v-if="column.dataIndex === 'center'">
<span v-if="markField('center', record)" style="color: red">{{ record.center }}</span>
<span v-else style="color: white">{{ record.center }}</span>
</template>
<template v-if="column.dataIndex === 'w'">
<span v-if="record.w !== record.h" style="color: red">{{ record.w }}</span>
<span v-else style="color: white">{{ record.w }}</span>
</template>
<template v-if="column.dataIndex === 'h'">
<span v-if="record.w !== record.h" style="color: red">{{ record.h }}</span>
<span v-else style="color: white">{{ record.h }}</span>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="[
@ -44,7 +69,8 @@ import { formSchema } from './schema';
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
import * as TaskApi from '@/api/data/taskApi';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { EyeOutlined, PlusOutlined } from "@ant-design/icons-vue";
import { EyeOutlined, PlusOutlined, MinusOutlined } from "@ant-design/icons-vue";
import { Popconfirm } from 'ant-design-vue';
import Modal from "@/views/data/task/modal.vue";
import { useModal } from '/@/components/Modal';
const [register, { openModal }] = useModal();
@ -118,8 +144,12 @@ 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) => {
items.forEach((d: any, index: number) => {
if (Object.keys(d).includes('sn')) {
paramData.value.push({...d});
} else {
paramData.value.push({ sn: (index + 1) + '', ...d});
}
});
await setFieldsValue({
...data.record,
@ -217,6 +247,10 @@ const handleOpenFileDialog = () => {
emit("ocrClick", data);
};
const handleDeleteAll = (e: MouseEvent) => {
paramData.value = [];
};
const updateParamData = async (data: any) => {
paramData.value.forEach((d: any, index: number) => {
if (d["code"] === data["code"]) {
@ -225,6 +259,22 @@ const updateParamData = async (data: any) => {
});
}
const markField = computed(() => {
return (field: any, record: any) => {
let c = 0
paramData.value.forEach((d: any) => {
if (Number(d[field]) < 0) {
c += 1;
}
});
if (paramData.value.length - c < c) {
return Number(record[field]) > 0
} else {
return Number(record[field]) < 0
}
};
});
defineExpose({
setParamData
});