添加提醒标签

This commit is contained in:
xixi 2024-11-04 11:55:51 +08:00
parent e086624dfa
commit a3aaef6485
5 changed files with 224 additions and 31 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 } 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'
@ -67,8 +67,9 @@ export default function CardProj(props: any) {
// data.generate.generateStatus == GenerateStatus.SUCCESS ?'查看':'编辑' // data.generate.generateStatus == GenerateStatus.SUCCESS ?'查看':'编辑'
const [tagIdArray, setTagIdArray] = useState(data.tagDataIds) const [tagIdArray, setTagIdArray] = useState(data.tagDataIds)
// 动态显示标签状态 const [RemindIdArray, setRemindIdArray] = useState(data.projRemindIds)
// const [tagStatus, setTagStatus] = useState('')
const downAll = (projId: string, name: string) => { const downAll = (projId: string, name: string) => {
setHasDown(true) setHasDown(true)
@ -83,7 +84,7 @@ export default function CardProj(props: any) {
setDownModal(true); // 打开下载模态框 setDownModal(true); // 打开下载模态框
setHasDown(true); // 设置正在下载状态 setHasDown(true); // 设置正在下载状态
}, },
onSuccess(data:any) { onSuccess(data: any) {
// 处理下载成功的逻辑 // 处理下载成功的逻辑
const blob = new Blob([data.data]); // 创建 Blob 对象 const blob = new Blob([data.data]); // 创建 Blob 对象
const url = window.URL.createObjectURL(blob); // 创建下载链接 const url = window.URL.createObjectURL(blob); // 创建下载链接
@ -141,6 +142,40 @@ export default function CardProj(props: any) {
} }
}) })
} }
// 保存提示标签
const saveRemind= (projRemindId: string, projId: string) => {
post<any>({
messageApi,
url: `/api/proj/remind/task/save`,
body: {
projRemindId,
projId
},
onBefore() {
},
onSuccess() {
setRemindIdArray((prevArray: any) => [...prevArray, projRemindId]);
},
onFinally() {
}
})
}
// 删除提示标签
const deleteRemind= (projRemindId: string, projId: string) => {
// setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
del<any>({
messageApi,
url: `/api/proj/remind/task/delete/proj-id/${projId}/proj-remind-id/${projRemindId}`,
onSuccess() {
setRemindIdArray((prevArray: any[]) => prevArray.filter(id => id !== projRemindId));
}
})
}
// 更改data加入数组 // 更改data加入数组
// const upData = (tagId:string) => { // const upData = (tagId:string) => {
// if(tagStatus=='SAVE'){ // if(tagStatus=='SAVE'){
@ -299,6 +334,7 @@ export default function CardProj(props: any) {
<div className='cp-time'> <div className='cp-time'>
{data.gmtCreate} {data.gmtCreate}
</div> </div>
{/* 标签 */}
{props.tagArray.map((item: any) => { {props.tagArray.map((item: any) => {
return ( return (
@ -576,7 +612,52 @@ export default function CardProj(props: any) {
</div> </div>
</div> </div>
</div> </div>
<div className='promptTags'>
<div style={{ marginTop: 2 }}>
</div>
{/* {props.tagArray.map((item: any) => {
return (
<div className='proj-progress' key={item.value} style={{
background: tagIdArray.includes(item.value) ? '#ff7b00' : '',
color: tagIdArray.includes(item.value) ? '#ffffff' : '#5a5a5a',
border: tagIdArray.includes(item.value) ? ' 1px solid #ff7b00' : ' 1px solid #5a5a5a',
}}
onClick={() => {
upTag(item.value, data.projId)
}}
>
{item.label}
</div>
)
})} */}
{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',
}}
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 className="card-proj-title"> {/* <div className="card-proj-title">
<div className='titleLift'> <div className='titleLift'>

View File

@ -19,7 +19,7 @@
border-radius: 6px; border-radius: 6px;
background-color: var(--color-light); background-color: var(--color-light);
/* padding: 5px 15px; */ /* padding: 5px 15px; */
height: 230px; height: 270px;
/* width: calc(100vw - 330px); */ /* width: calc(100vw - 330px); */
/* margin-bottom: 20px; */ /* margin-bottom: 20px; */
border-radius: 13px; border-radius: 13px;
@ -37,7 +37,13 @@
padding-left: 21px; padding-left: 21px;
padding-right: 29px; padding-right: 29px;
} }
.promptTags{
padding-left: 21px;
display: flex;
/* background-color: red; */
align-items: center;
/* justify-content: center; */
}
.cpt-left { .cpt-left {
display: flex; display: flex;
/* align-items: center; */ /* align-items: center; */
@ -570,7 +576,7 @@
border-radius: 6px; border-radius: 6px;
background-color: var(--color-light); background-color: var(--color-light);
/* padding: 5px 15px; */ /* padding: 5px 15px; */
min-height: 260px; min-height: 280px;
/* width: calc(100vw - 330px); */ /* width: calc(100vw - 330px); */
/* margin-bottom: 20px; */ /* margin-bottom: 20px; */
border-radius: 13px; border-radius: 13px;
@ -588,7 +594,13 @@
padding-left: 21px; padding-left: 21px;
padding-right: 29px; padding-right: 29px;
} }
.promptTags{
padding-left: 21px;
display: flex;
/* background-color: red; */
align-items: center;
/* justify-content: center; */
}
.cpt-left { .cpt-left {
display: flex; display: flex;
/* align-items: center; */ /* align-items: center; */
@ -666,8 +678,11 @@
font-size: 12px; font-size: 12px;
/* color: #5a5a5a; */ /* color: #5a5a5a; */
/* border: 1px solid #ff7b00; */ /* border: 1px solid #ff7b00; */
text-align: center; /* text-align: center;
line-height: 20px; line-height: 20px; */
display: flex;
align-items: center;
justify-content: center;
padding-left: 9px; padding-left: 9px;
padding-right: 9px; padding-right: 9px;
margin-left: 10px; margin-left: 10px;

View File

@ -33,6 +33,8 @@ export default function ListProj() {
const chargeAdditionals = state ? state.chargeAdditionals : '' const chargeAdditionals = state ? state.chargeAdditionals : ''
const tagDataId = state ? state.tagDataId : '' const tagDataId = state ? state.tagDataId : ''
const projRemindId = state? state.projRemindId : ''
const authorId = state ? state.authorId : '' const authorId = state ? state.authorId : ''
const payStatus = state ? state.payStatus : '' const payStatus = state ? state.payStatus : ''
// console.log(keywords); // console.log(keywords);
@ -67,6 +69,7 @@ export default function ListProj() {
chargeType: type, chargeType: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
projRemindId: projRemindId,
authorId: authorId, authorId: authorId,
payStatus: payStatus, payStatus: payStatus,
projCategoryId: indexListContext.category, projCategoryId: indexListContext.category,
@ -77,7 +80,7 @@ export default function ListProj() {
setIsLoading(true); setIsLoading(true);
}, },
onSuccess({ data }) { onSuccess({ data }) {
// console.log('数据', data); // console.log('数据', data.rows);
// console.log('得到数据'); // console.log('得到数据');
setPage(data.page); setPage(data.page);
@ -122,11 +125,37 @@ export default function ListProj() {
} }
}) })
} }
// 提示标签数组
const [remindTagArray, setRemindTagArray] = useState([])
// 获取提示标签
const getremindTag = () => {
get({
messageApi,
url: `/api/proj/remind/list`,
onBefore() {
},
onSuccess(data: any) {
// console.log('标签信息', data.data);
const newarrty: any = (data.data).map((item: any) => ({
value: item.projRemindId,
label: item.title
}));
// // console.log('标签信息', newarrty);
setRemindTagArray(newarrty)
},
onFinally() {
}
})
}
useEffect(() => { useEffect(() => {
getTag() getTag()
// console.log('这啥啊',indexListContext.categoryChangeCount); // console.log('这啥啊',indexListContext.categoryChangeCount);
// console.log('这啥啊2',indexListContext.category) // console.log('这啥啊2',indexListContext.category)
getremindTag()
}, []) }, [])
// 更新数据 // 更新数据
@ -182,6 +211,7 @@ export default function ListProj() {
<CardProj item={item} <CardProj item={item}
// updata={upreqData} // updata={upreqData}
tagArray={tagArray} tagArray={tagArray}
remindTagArray={remindTagArray}
/> />
</div> </div>
) )
@ -211,7 +241,7 @@ export default function ListProj() {
}, 0); }, 0);
// console.log('传递',state); // console.log('传递',state);
}, [indexListContext.status, keywords, type, chargeAdditionals, tagDataId, authorId, payStatus]) }, [indexListContext.status, keywords, type, chargeAdditionals, tagDataId, projRemindId,authorId, payStatus])
useEffect(() => { useEffect(() => {
// reqData(page); //注释掉了 不知道者干嘛的 写上之后刷新要两次才不掉状态 // reqData(page); //注释掉了 不知道者干嘛的 写上之后刷新要两次才不掉状态

View File

@ -53,6 +53,8 @@ export default function Index() {
// const [clickBelongpeople, setClickBelongpeople] = useState(true) // const [clickBelongpeople, setClickBelongpeople] = useState(true)
// 选项数组 // 选项数组
const [tagArray, setTagArray] = useState([]) const [tagArray, setTagArray] = useState([])
// 获取标签 // 获取标签
const getTag = () => { const getTag = () => {
get({ get({
@ -75,6 +77,32 @@ export default function Index() {
} }
}) })
} }
// 提示数组
const [remindTagArray, setRemindTagArray] = useState([])
// 获取提示
const getremindTag = () => {
get({
messageApi,
url: `/api/proj/remind/list`,
onBefore() {
},
onSuccess(data: any) {
// console.log('标签信息', data.data);
const newarrty: any = (data.data).map((item: any) => ({
value: item.projRemindId,
label: item.title
}));
// // console.log('标签信息', newarrty);
setRemindTagArray(newarrty)
},
onFinally() {
}
})
}
const dispath = useDispatch() const dispath = useDispatch()
//redux的belongArray //redux的belongArray
const redxuState: any = useSelector(state => state) const redxuState: any = useSelector(state => state)
@ -141,6 +169,8 @@ export default function Index() {
const [tagDataId, settagDataId] = useState<string | null>(null) const [tagDataId, settagDataId] = useState<string | null>(null)
const [payStatus, setpayStatus] = useState<string | null>(null) const [payStatus, setpayStatus] = useState<string | null>(null)
const [authorId, setauthorId] = useState('') const [authorId, setauthorId] = useState('')
const [projRemindId,setprojRemindId] = useState<string | null>(null)
//退款状态 //退款状态
const [applyStatus, setapplyStatus] = useState<string | null>(null) const [applyStatus, setapplyStatus] = useState<string | null>(null)
// 退款关键字 // 退款关键字
@ -189,6 +219,7 @@ export default function Index() {
setchargeAdditionals(null) setchargeAdditionals(null)
settagDataId(null) settagDataId(null)
setpayStatus(null) setpayStatus(null)
setprojRemindId(null)
} }
// 退款页初搜索条件始化 // 退款页初搜索条件始化
const refunInit = () => { const refunInit = () => {
@ -772,6 +803,7 @@ export default function Index() {
} }
getProjOwnerList() getProjOwnerList()
getTag() getTag()
getremindTag()
}, []); }, []);
useEffect(() => { useEffect(() => {
if (location.pathname.includes('/home')) { if (location.pathname.includes('/home')) {
@ -782,8 +814,8 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
} }
@ -808,7 +840,7 @@ export default function Index() {
}) })
} }
}, [type, chargeAdditionals, keywords, tagDataId, payStatus, authorId, refunKeywords, applyStatus, correctionKeywords, correctionNumType, correctionType, correctionApplyStatus]); }, [type, chargeAdditionals, keywords, tagDataId,projRemindId, payStatus, authorId, refunKeywords, applyStatus, correctionKeywords, correctionNumType, correctionType, correctionApplyStatus]);
// const [menuName,setMenuName] = useState<string | null>('') // const [menuName,setMenuName] = useState<string | null>('')
// useEffect(()=>{ // useEffect(()=>{
@ -824,7 +856,9 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
} }
@ -840,7 +874,8 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
@ -1171,7 +1206,8 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
@ -1203,7 +1239,8 @@ export default function Index() {
chargeAdditionals: value, chargeAdditionals: value,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
@ -1234,23 +1271,52 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: value, tagDataId: value,
authorId: authorId, authorId: authorId,
payStatus: payStatus payStatus: payStatus,
projRemindId: projRemindId
} }
}) })
}} }}
options={ options={
// [
// { value: 'PRODUCTION', label: '正在制作中' },
// { value: 'SUBMIT_FOR_REVIEW', label: '已提交版权中心' },
// { value: 'DONE', label: '已下证' },
// ]
tagArray tagArray
} }
placeholder={'选择标签'} placeholder={'选择标签'}
/>
<Select
allowClear
value={projRemindId}
style={{ height: '31px', width: '130px', marginLeft: 20, display: showSearchBox ? 'block' : 'none' }}
onChange={(value: string) => {
// console.log(`selected ${value}`);
setprojRemindId(value)
// alert(`selected ${value}`)
// lyp
nav('/home', {
state: {
keyword: keywords,
type: type,
chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId,
authorId: authorId,
payStatus: payStatus,
projRemindId:value
}
})
}}
options={
remindTagArray
}
placeholder={'选择提醒'}
/> />
<Select <Select
allowClear allowClear
@ -1266,7 +1332,8 @@ export default function Index() {
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
tagDataId: tagDataId, tagDataId: tagDataId,
authorId: authorId, authorId: authorId,
payStatus: value payStatus: value,
projRemindId: projRemindId
} }
}) })

View File

@ -516,7 +516,7 @@
} }
} }
@media (max-width: 1400px) { @media (max-width: 1550px) {
.index { .index {
height: 100vh; height: 100vh;
display: flex; display: flex;