添加标签

This commit is contained in:
xixi 2024-07-31 18:41:25 +08:00
parent 547c63f2bb
commit 08fd4dcb80
6 changed files with 174 additions and 79 deletions

View File

@ -15,7 +15,7 @@ import {
import { Button, Dropdown, Tag, Modal, Carousel } from 'antd'; import { Button, Dropdown, Tag, Modal, Carousel } from 'antd';
import { GenerateStatus, ProjChargeType } from "../../interfaces/proj/IProj.ts"; import { GenerateStatus, ProjChargeType } from "../../interfaces/proj/IProj.ts";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { Axios, put, downloadUrl } from "../../util/AjaxUtils.ts"; import { Axios, post, downloadUrl, get } from "../../util/AjaxUtils.ts";
import { useContext, useEffect, useState } from "react"; import { useContext, useEffect, useState } from "react";
import { IndexListContext } from "../../context/IndexListContext.ts"; import { IndexListContext } from "../../context/IndexListContext.ts";
import useMessage from "antd/es/message/useMessage"; import useMessage from "antd/es/message/useMessage";
@ -32,6 +32,53 @@ import SoftwareManagementShow from '../../route/proj/edit/ProjConfigModListShow.
import DisplayOrder from '../../route/proj/edit/ProjConfigMenuList.tsx' import DisplayOrder from '../../route/proj/edit/ProjConfigMenuList.tsx'
import DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx' import DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx'
export default function CardProj(props: any) { export default function CardProj(props: any) {
// 选项数组
const [tagArray, setTagArray] = useState([])
// 获取标签
const getTag = () => {
get({
messageApi,
url: `/api/proj/tag/list-tag`,
onBefore() {
},
onSuccess(data: any) {
// console.log('标签信息', data);
const newarrty: any = (data.data).map((item: any) => ({
value: item.key,
label: item.value
}));
// console.log('标签信息', newarrty);
setTagArray(newarrty)
},
onFinally() {
}
})
}
// 更新标签状态
const upTag = (dataId:string,projId:string) => {
post<any>({
messageApi,
url: `/api/proj/tag/save-or-delete`,
body: {
dataId,
projId
},
onBefore() {
},
onSuccess() {
// console.log(data);
// props.upData
},
onFinally() {
}
})
}
// 第四步 登陆页面设置 // 第四步 登陆页面设置
const [loginPageOpne, setLoginPageOpne] = useState(false) const [loginPageOpne, setLoginPageOpne] = useState(false)
const [loginPageShowOpne, setLoginPageShowOpne] = useState(false) const [loginPageShowOpne, setLoginPageShowOpne] = useState(false)
@ -117,7 +164,7 @@ export default function CardProj(props: any) {
// console.log('额外收费视频',videoDemoValue); // console.log('额外收费视频',videoDemoValue);
// console.log('额外收费加急',URGENTvalue); // console.log('额外收费加急',URGENTvalue);
// console.log('基础服务费',basicsValue); // console.log('基础服务费',basicsValue);
getTag()
}, []) }, [])
return ( return (
@ -138,16 +185,30 @@ export default function CardProj(props: any) {
<div className='cp-time'> <div className='cp-time'>
{data.gmtCreate} {data.gmtCreate}
</div> </div>
{tagArray.map((item:any) => {
return (
<div className='proj-progress' key={item.value} style={{
background:(data.tagDataIds).includes(item.value)?'#ff7b00':'',
color:(data.tagDataIds).includes(item.value)?'#ffffff':'#5a5a5a',
border:(data.tagDataIds).includes(item.value)?'none':' 1px solid #5a5a5a',
}}
onClick={()=>{
upTag(item.value,data.projId)
props.updata()
}}
>
{item.label}
</div>
)
})}
</div> </div>
<div style={{ display: payCharge == '全托管' ? 'block' : 'none' }}>
<div className='proj-progress'>
{data.progress == 'DONE' ? '已下证' : data.progress == 'SUBMIT_FOR_REVIEW' ? '已提交版权中心' : data.progress == 'PRODUCTION' ? '正在制作中' : '等待制作中'}
</div>
</div>
{/* <div style={{ display: payCharge !== '' ? 'block' : 'none' }}> {/* <div style={{ display: payCharge !== '' ? 'block' : 'none' }}>
<div className='proj-progress' style={{display:data.progress?'block':'none'}}> <div className='proj-progress' style={{display:data.progress?'block':'none'}}>

View File

@ -88,20 +88,22 @@
color: #888888; color: #888888;
} }
.proj-progress{ .proj-progress{
height: 20px;
height: 29px; /* background: #ff7b00; */
background: #ff7b00;
/* background: #01a13f; */ /* background: #01a13f; */
border-radius: 5px; border-radius: 5px;
/* font-family: Microsoft YaHei UI; */ /* font-family: Microsoft YaHei UI; */
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 12px;
color: #ffffff; /* color: #5a5a5a; */
/* border: 1px solid #ff7b00; */
text-align: center; text-align: center;
line-height: 29px; line-height: 20px;
padding-left: 9px; padding-left: 9px;
padding-right: 9px; padding-right: 9px;
margin-left: 19px; margin-left: 10px;
cursor: pointer;
margin-top: 4px;
} }
.cpt-right { .cpt-right {
font-size: 14px; font-size: 14px;

View File

@ -32,7 +32,7 @@ export default function ListProj() {
const name = state ? state.name : '' const name = state ? state.name : ''
const chargeAdditionals = state? state.chargeAdditionals:'' const chargeAdditionals = state? state.chargeAdditionals:''
const progress = state? state.progress:'' const tagDataId = state? state.tagDataId:''
const authorId = state? state.authorId:'' const authorId = state? state.authorId:''
// console.log(keywords); // console.log(keywords);
// const images = [syminga,symingb,symingc,symingd] // const images = [syminga,symingb,symingc,symingd]
@ -63,7 +63,7 @@ export default function ListProj() {
keywords: keywords, keywords: keywords,
charge: name, charge: name,
chargeAdditionals:chargeAdditionals, chargeAdditionals:chargeAdditionals,
progress:progress, tagDataId:tagDataId,
authorId:authorId, authorId:authorId,
projCategoryId: indexListContext.category, projCategoryId: indexListContext.category,
status: indexListContext.status ? indexListContext.status : getMenuActive() status: indexListContext.status ? indexListContext.status : getMenuActive()
@ -73,7 +73,7 @@ export default function ListProj() {
setIsLoading(true); setIsLoading(true);
}, },
onSuccess({ data }) { onSuccess({ data }) {
// console.log('数据',data); console.log('数据',data);
setPage(data.page); setPage(data.page);
setTotal(data.total); setTotal(data.total);
@ -93,31 +93,34 @@ export default function ListProj() {
} }
// 更新数据 // 更新数据
// const upreqData = (currentPage: number) => { const upreqData = () => {
// get<IListPage<IProj>>({ get<IListPage<IProj>>({
// messageApi: messageApi, messageApi: messageApi,
// url: '/api/proj/listpage/self', url: '/api/proj/listpage/self',
// config: { config: {
// params: { params: {
// page: currentPage, page: page,
// rows: 10, rows: 10,
// keywords: keywords, keywords: keywords,
// charge: name, charge: name,
// projCategoryId: indexListContext.category, chargeAdditionals:chargeAdditionals,
// status: indexListContext.status ? indexListContext.status : getMenuActive() tagDataId:tagDataId,
// } authorId:authorId,
// }, projCategoryId: indexListContext.category,
// onBefore() { status: indexListContext.status ? indexListContext.status : getMenuActive()
// setIsLoading(true); }
// }, },
// onSuccess({ data }) { onBefore() {
// setProjs(data.rows); setIsLoading(true);
// }, },
// onFinally() { onSuccess({ data }) {
// setIsLoading(false); setProjs(data.rows);
// } },
// }) onFinally() {
// } setIsLoading(false);
}
})
}
const renderList = () => { const renderList = () => {
@ -140,8 +143,7 @@ export default function ListProj() {
return ( return (
<div className='projListBox' key={new Date().getTime() + ':' + item.projId}> <div className='projListBox' key={new Date().getTime() + ':' + item.projId}>
<CardProj item={item} <CardProj item={item}
// upreqData={() => { upreqData(page) }} updata = {upreqData}
// getreqData={reqDataNoScoll}
/> />
</div> </div>
) )
@ -160,13 +162,13 @@ export default function ListProj() {
// renderCategory(); // renderCategory();
// } // }
// //
// if(!keywords && !name && !chargeAdditionals && !progress && !authorId){ // if(!keywords && !name && !chargeAdditionals && !tagDataId && !authorId){
// reqData(1) // reqData(1)
// } // }
setTimeout(() => { setTimeout(() => {
setShowPage(true) setShowPage(true)
}, 0); }, 0);
}, [indexListContext.status, keywords, name,chargeAdditionals,progress,authorId]) }, [indexListContext.status, keywords, name,chargeAdditionals,tagDataId,authorId])
useEffect(() => { useEffect(() => {
reqData(page); reqData(page);

View File

@ -36,7 +36,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) {
keyword: props.keywords, keyword: props.keywords,
name: props.type, name: props.type,
chargeAdditionals: props.chargeAdditionals, chargeAdditionals: props.chargeAdditionals,
progress: props.progress, tagDataId: props.tagDataId,
authorId: props.authorId authorId: props.authorId
} }
}) })

View File

@ -22,6 +22,6 @@ export interface IMenuWithTopButton {
keywords?:string; keywords?:string;
type?:string ; type?:string ;
chargeAdditionals?:string; chargeAdditionals?:string;
progress?:string; tagDataId?:string;
authorId?:string; authorId?:string;
} }

View File

@ -32,14 +32,40 @@ import { get } from '../../util/AjaxUtils.ts'
import gpsImg from '../../static/right/gps.png' import gpsImg from '../../static/right/gps.png'
import backImg from '../../static/right/back.png' import backImg from '../../static/right/back.png'
// import { Link } from "react-router-dom"; // import { Link } from "react-router-dom";
import { Input, import {
Input,
// Breadcrumb, // Breadcrumb,
message } from 'antd'; message
} from 'antd';
const { Search } = Input; const { Search } = Input;
export default function Index() { export default function Index() {
// 选项数组
const [tagArray, setTagArray] = useState([])
// 获取标签
const getTag = () => {
get({
messageApi,
url: `/api/proj/tag/list-tag`,
onBefore() {
},
onSuccess(data: any) {
// console.log('标签信息', data);
const newarrty: any = (data.data).map((item: any) => ({
value: item.key,
label: item.value
}));
setTagArray(newarrty)
},
onFinally() {
}
})
}
const dispath = useDispatch() const dispath = useDispatch()
//redux的belongArray //redux的belongArray
const redxuState: any = useSelector(state => state) const redxuState: any = useSelector(state => state)
@ -96,7 +122,7 @@ export default function Index() {
const [keywords, setKeywords] = useState(''); const [keywords, setKeywords] = useState('');
const [type, setType] = useState<string | null>(null) const [type, setType] = useState<string | null>(null)
const [chargeAdditionals, setchargeAdditionals] = useState<string | null>(null) const [chargeAdditionals, setchargeAdditionals] = useState<string | null>(null)
const [progress, setprogress] = useState<string | null>(null) const [tagDataId, settagDataId] = useState<string | null>(null)
const [authorId, setauthorId] = useState('') const [authorId, setauthorId] = useState('')
// const indexListContext = useContext(IndexListContext); // const indexListContext = useContext(IndexListContext);
// 所属者信息 // 所属者信息
@ -127,7 +153,7 @@ export default function Index() {
setKeywords('') setKeywords('')
setType(null) setType(null)
setchargeAdditionals(null) setchargeAdditionals(null)
setprogress(null) settagDataId(null)
} }
const nav = useNavigate(); const nav = useNavigate();
@ -421,18 +447,19 @@ export default function Index() {
} }
getProjOwnerList() getProjOwnerList()
getTag()
}, []); }, []);
useEffect(() => { useEffect(() => {
// console.log('监听', '类型:', type, '关键字:', keywords, '额外付费:', chargeAdditionals,'进度:',progress); // console.log('监听', '类型:', type, '关键字:', keywords, '额外付费:', chargeAdditionals,'进度:',tagDataId);
// console.log(Boolean(keywords)); // console.log(Boolean(keywords));
// if (location.pathname.includes('/home')) { // if (location.pathname.includes('/home')) {
if (!keywords && !type && !chargeAdditionals && !progress) { if (!keywords && !type && !chargeAdditionals && !tagDataId) {
setKeywords('') setKeywords('')
setType(null) setType(null)
setchargeAdditionals(null) setchargeAdditionals(null)
setprogress(null) settagDataId(null)
} }
if (location.pathname.includes('/home')) { if (location.pathname.includes('/home')) {
nav('/home', { nav('/home', {
@ -440,14 +467,14 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })
} }
// } // }
}, [type, chargeAdditionals, keywords, progress, authorId]); }, [type, chargeAdditionals, keywords, tagDataId, authorId]);
const handleSearch = (value: string) => { const handleSearch = (value: string) => {
// console.log(value); // console.log(value);
@ -457,7 +484,7 @@ export default function Index() {
keyword: value, keyword: value,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
@ -473,7 +500,7 @@ export default function Index() {
keyword: '', keyword: '',
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })
@ -500,7 +527,7 @@ export default function Index() {
keywords={keywords} keywords={keywords}
type={type ? type : ""} type={type ? type : ""}
chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""} chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""}
progress={progress ? progress : ""} tagDataId={tagDataId ? tagDataId : ""}
authorId={authorId ? authorId : ""} authorId={authorId ? authorId : ""}
/> />
<div className='belongPeopleMenu'> <div className='belongPeopleMenu'>
@ -520,7 +547,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: '' authorId: ''
} }
}) })
@ -531,7 +558,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: item.projOwnerId authorId: item.projOwnerId
} }
}) })
@ -646,7 +673,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
name: value, name: value,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })
@ -676,7 +703,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: value, chargeAdditionals: value,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })
@ -692,11 +719,11 @@ export default function Index() {
placeholder={'选择拓展收费'} placeholder={'选择拓展收费'}
/> />
<Select <Select
value={progress} value={tagDataId}
style={{ height: '31px', width: '183px', marginLeft: 20, display: showSearchBox ? 'block' : 'none' }} style={{ height: '31px', width: '183px', marginLeft: 20, display: showSearchBox ? 'block' : 'none' }}
onChange={(value: string) => { onChange={(value: string) => {
// console.log(`selected ${value}`); // console.log(`selected ${value}`);
setprogress(value) settagDataId(value)
// alert(`selected ${value}`) // alert(`selected ${value}`)
// lyp // lyp
@ -705,19 +732,22 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: value, tagDataId: value,
authorId: authorId authorId: authorId
} }
}) })
}} }}
options={[ options={
{ value: 'PRODUCTION', label: '正在制作中' }, // [
{ value: 'SUBMIT_FOR_REVIEW', label: '已提交版权中心' }, // { value: 'PRODUCTION', label: '正在制作中' },
{ value: 'DONE', label: '已下证' }, // { value: 'SUBMIT_FOR_REVIEW', label: '已提交版权中心' },
]} // { value: 'DONE', label: '已下证' },
// ]
tagArray
}
placeholder={'选择全托管制作进度'} placeholder={'选择标签'}
/> />
@ -758,7 +788,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })
@ -782,7 +812,7 @@ export default function Index() {
keyword: keywords, keyword: keywords,
name: type, name: type,
chargeAdditionals: chargeAdditionals, chargeAdditionals: chargeAdditionals,
progress: progress, tagDataId: tagDataId,
authorId: authorId authorId: authorId
} }
}) })