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