去除log

This commit is contained in:
lyp 2025-01-03 17:00:42 +08:00
parent 38f4e1a406
commit b909b41187

View File

@ -47,6 +47,9 @@ import red from '../../static/projBox/red.png'
import blue from '../../static/projBox/blue.png'
import black from '../../static/projBox/black.png'
export default function Correction() {
// 标签变量
// const [tagDataIds, setTagDataIds] = useState<any[]>([])
const height = window.innerHeight - 180;
const [messageApi, contextHolder] = message.useMessage();
// const nav = useNavigate();
@ -921,6 +924,7 @@ export default function Correction() {
: <>
{correctionArray.map((item: any, index: any) => {
// setBack(item.tagDataIds.includes(part1)?true:false)
const downCode = [
{
key: 'downword',
@ -1017,26 +1021,14 @@ export default function Correction() {
{item.correctionType == 'CODE' ? '代码' : item.correctionType == 'MANUAL' ? '操作手册' : item.correctionType == 'ALL' ? '全部补正' : ''}
</div>
</div>
{
// tagCorArray.map((item: any) => (
// const [part1, part2] = item.value.split(':');
// if(part2 == 'TAG_NOT'){
// return(
// <div></div>
// )
// }
// // <div key={item.value} className='corrTypeC'>
// // </div>
// ))
}
<div style={{
display: 'flex',
}}>
{
tagCorArray.map((tagitem: any) => {
const [part1, part2] = tagitem.value.split(':');
// setTagDataIds(tagitem.tagDataIds)
if (part2 !== 'TAG_NOT') {
return (
<div key={tagitem.value} className='corrTypeC'
@ -1044,9 +1036,14 @@ export default function Correction() {
background: item.tagDataIds.includes(part1) ? '#ff7b00' : '',
color: item.tagDataIds.includes(part1) ? '#ffffff' : '#5a5a5a',
border: item.tagDataIds.includes(part1) ? ' 1px solid #ff7b00' : ' 1px solid #5a5a5a',
// background: back?'#ff7b00':'',
}}
onClick={
() => {
(e:any) => {
// 获取点击的这个盒子的背景色
post<any>({
messageApi,
url: `/api/proj/correction/apply/tag/save-or-delete`,
@ -1059,38 +1056,21 @@ export default function Correction() {
},
onSuccess(data) {
if (data.data.data === 'SAVE') {
const updatedArray = correctionArray.map((Aitem:any) => {
if (Aitem.projCorrectionApplyId === item.projCorrectionApplyId) {
return {
...Aitem,
tagDataIds: [...Aitem.tagDataIds, part1]
};
}
return Aitem;
});
dispath({
type: 'upCorrectionArray',
val: updatedArray
});
e.target.style.background = '#ff7b00';
e.target.style.color = '#ffffff';
e.target.style.border = '1px solid #ff7b00';
} else if (data.data.data === 'DELETE') {
const updatedArray = correctionArray.map((Aitem:any) => {
if (Aitem.projCorrectionApplyId === item.projCorrectionApplyId) {
return {
...Aitem,
tagDataIds: Aitem.tagDataIds.filter((id:any) => id !== part1)
};
}
return Aitem;
});
dispath({
type: 'upCorrectionArray',
val: updatedArray
});
e.target.style.background = '';
e.target.style.color = '#5a5a5a';
e.target.style.border = '1px solid #5a5a5a';
}
},