提醒标签显示隐藏

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 { Button, Tag, Modal, Carousel } from 'antd';
import { GenerateStatus } from "../../interfaces/proj/IProj.ts"; import { GenerateStatus } from "../../interfaces/proj/IProj.ts";
import { useNavigate } from "react-router-dom"; 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 { useEffect, useState } from "react";
import useMessage from "antd/es/message/useMessage"; import useMessage from "antd/es/message/useMessage";
import setImg from '../../static/right/set.png' 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>({ post<any>({
messageApi, messageApi,
url: `/api/proj/remind/task/save`, url: `/api/proj/remind/task/save`,
@ -155,7 +155,7 @@ export default function CardProj(props: any) {
}, },
onSuccess() { onSuccess() {
setRemindIdArray((prevArray: any) => [...prevArray, projRemindId]); setRemindIdArray((prevArray: any) => [...prevArray, projRemindId]);
}, },
onFinally() { 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)); // setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
del<any>({ 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}`, url: `/api/proj/remind/task/delete/proj-id/${projId}/proj-remind-id/${projRemindId}`,
onSuccess() { onSuccess() {
setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId)); setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
} }
}) })
} }
@ -612,11 +612,12 @@ export default function CardProj(props: any) {
</div> </div>
</div> </div>
</div> </div>
<div className='promptTags'> <div style={{
<div style={{ marginTop: 2 }}> display: props.remindTagArray.length > 0 ? 'unset' : 'none',
}}>
</div> <div className='promptTags' >
{/* {props.tagArray.map((item: any) => {
{/* {props.tagArray.map((item: any) => {
return ( return (
<div className='proj-progress' key={item.value} style={{ <div className='proj-progress' key={item.value} style={{
@ -635,28 +636,32 @@ export default function CardProj(props: any) {
) )
})} */} })} */}
{props.remindTagArray.map((item: any) => { {props.remindTagArray.map((item: any) => {
return ( 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)
}
}} }}
> onClick={() => {
<ClockCircleOutlined style={{marginRight:3}} /> {item.label} if (RemindIdArray.includes(item.value)) {
</div> deleteRemind(item.value, data.projId)
} else {
saveRemind(item.value, data.projId)
}
) }}
})} >
<ClockCircleOutlined style={{ marginRight: 3 }} /> {item.label}
</div>
)
})}
</div>
</div> </div>
{/* <div className="card-proj-title"> {/* <div className="card-proj-title">

View File

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