提醒标签显示隐藏

This commit is contained in:
xixi 2024-11-06 10:21:25 +08:00
parent a3aaef6485
commit c42fb830b6
2 changed files with 46 additions and 36 deletions

View File

@ -15,7 +15,7 @@ import {
import { Button, Tag, Modal, Carousel } from 'antd';
import { GenerateStatus } from "../../interfaces/proj/IProj.ts";
import { useNavigate } from "react-router-dom";
import { Axios, post, downloadUrl, get,del } from "../../util/AjaxUtils.ts";
import { Axios, post, downloadUrl, get, del } from "../../util/AjaxUtils.ts";
import { useEffect, useState } from "react";
import useMessage from "antd/es/message/useMessage";
import setImg from '../../static/right/set.png'
@ -143,7 +143,7 @@ export default function CardProj(props: any) {
})
}
// 保存提示标签
const saveRemind= (projRemindId: string, projId: string) => {
const saveRemind = (projRemindId: string, projId: string) => {
post<any>({
messageApi,
url: `/api/proj/remind/task/save`,
@ -155,7 +155,7 @@ export default function CardProj(props: any) {
},
onSuccess() {
setRemindIdArray((prevArray: any) => [...prevArray, projRemindId]);
},
onFinally() {
@ -164,7 +164,7 @@ export default function CardProj(props: any) {
})
}
// 删除提示标签
const deleteRemind= (projRemindId: string, projId: string) => {
const deleteRemind = (projRemindId: string, projId: string) => {
// setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
del<any>({
@ -172,7 +172,7 @@ export default function CardProj(props: any) {
url: `/api/proj/remind/task/delete/proj-id/${projId}/proj-remind-id/${projRemindId}`,
onSuccess() {
setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
}
})
}
@ -612,11 +612,12 @@ export default function CardProj(props: any) {
</div>
</div>
</div>
<div className='promptTags'>
<div style={{ marginTop: 2 }}>
</div>
{/* {props.tagArray.map((item: any) => {
<div style={{
display: props.remindTagArray.length > 0 ? 'unset' : 'none',
}}>
<div className='promptTags' >
{/* {props.tagArray.map((item: any) => {
return (
<div className='proj-progress' key={item.value} style={{
@ -635,28 +636,32 @@ export default function CardProj(props: any) {
)
})} */}
{props.remindTagArray.map((item: any) => {
return (
{props.remindTagArray.map((item: any) => {
return (
<div className='proj-progress' key={item.value} style={{
background: RemindIdArray.includes(item.value) ? '#ff7b00' : '',
color: RemindIdArray.includes(item.value) ? '#ffffff' : '#5a5a5a',
border: RemindIdArray.includes(item.value) ? ' 1px solid #ff7b00' : ' 1px solid #5a5a5a',
// display: props.remindTagArray.length > 0 ? 'unset' : 'none',
<div className='proj-progress' key={item.value} style={{
background: RemindIdArray.includes(item.value) ? '#ff7b00' : '',
color: RemindIdArray.includes(item.value) ? '#ffffff' : '#5a5a5a',
border: RemindIdArray.includes(item.value) ? ' 1px solid #ff7b00' : ' 1px solid #5a5a5a',
}}
onClick={() => {
if(RemindIdArray.includes(item.value)){
deleteRemind(item.value, data.projId)
}else{
saveRemind(item.value, data.projId)
}
}}
>
<ClockCircleOutlined style={{marginRight:3}} /> {item.label}
</div>
onClick={() => {
if (RemindIdArray.includes(item.value)) {
deleteRemind(item.value, data.projId)
} else {
saveRemind(item.value, data.projId)
}
)
})}
}}
>
<ClockCircleOutlined style={{ marginRight: 3 }} /> {item.label}
</div>
)
})}
</div>
</div>
{/* <div className="card-proj-title">

View File

@ -19,11 +19,12 @@
border-radius: 6px;
background-color: var(--color-light);
/* padding: 5px 15px; */
height: 270px;
/* height: 270px; */
/* width: calc(100vw - 330px); */
/* margin-bottom: 20px; */
border-radius: 13px;
padding-bottom: 20px;
box-sizing: border-box;
}
@ -43,6 +44,7 @@
/* background-color: red; */
align-items: center;
/* justify-content: center; */
margin-top: 10px;
}
.cpt-left {
display: flex;
@ -154,8 +156,9 @@
display: flex;
align-items: center;
justify-content: space-between;
height: 175px;
/* height: 175px; */
padding-left: 18px;
margin-top: 20px;
}
.cpb-left {
@ -576,11 +579,12 @@
border-radius: 6px;
background-color: var(--color-light);
/* padding: 5px 15px; */
min-height: 280px;
/* min-height: 280px; */
/* width: calc(100vw - 330px); */
/* margin-bottom: 20px; */
border-radius: 13px;
padding-bottom: 10px;
box-sizing: border-box;
}
@ -687,7 +691,7 @@
padding-right: 9px;
margin-left: 10px;
cursor: pointer;
margin-top: 4px;
/* margin-top: 4px; */
}
.cpt-right {
@ -715,8 +719,9 @@
display: flex;
align-items: center;
justify-content: space-between;
min-height: 175px;
/* min-height: 175px; */
padding-left: 18px;
margin-top: 20px;
}
.cpb-left {