diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index f061a50..331b19e 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -15,7 +15,7 @@ import { import { Button, Dropdown, Tag, Modal, Carousel } from 'antd'; import { GenerateStatus, ProjChargeType } from "../../interfaces/proj/IProj.ts"; 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 { IndexListContext } from "../../context/IndexListContext.ts"; 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 DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx' 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({ + 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 [loginPageShowOpne, setLoginPageShowOpne] = useState(false) @@ -117,7 +164,7 @@ export default function CardProj(props: any) { // console.log('额外收费视频',videoDemoValue); // console.log('额外收费加急',URGENTvalue); // console.log('基础服务费',basicsValue); - + getTag() }, []) return ( @@ -138,16 +185,30 @@ export default function CardProj(props: any) {
{data.gmtCreate}
+ {tagArray.map((item:any) => { + return ( +
{ + upTag(item.value,data.projId) + props.updata() + }} + > + {item.label} +
+ + ) + })} + -
-
- {data.progress == 'DONE' ? '已下证' : data.progress == 'SUBMIT_FOR_REVIEW' ? '已提交版权中心' : data.progress == 'PRODUCTION' ? '正在制作中' : '等待制作中'} -
-
+ {/*
@@ -187,12 +248,12 @@ export default function CardProj(props: any) {
- +
- +
@@ -325,8 +386,8 @@ export default function CardProj(props: any) { ) : <> }
*/} -
- 产权所属者:{data.apply.authorName } +
+ 产权所属者:{data.apply.authorName}
{/*
*/} diff --git a/src/components/card/card-proj.css b/src/components/card/card-proj.css index 382c238..5e21a02 100644 --- a/src/components/card/card-proj.css +++ b/src/components/card/card-proj.css @@ -88,20 +88,22 @@ color: #888888; } .proj-progress{ - - height: 29px; - background: #ff7b00; + height: 20px; + /* background: #ff7b00; */ /* background: #01a13f; */ border-radius: 5px; /* font-family: Microsoft YaHei UI; */ font-weight: 400; - font-size: 14px; - color: #ffffff; + font-size: 12px; + /* color: #5a5a5a; */ + /* border: 1px solid #ff7b00; */ text-align: center; - line-height: 29px; + line-height: 20px; padding-left: 9px; padding-right: 9px; - margin-left: 19px; + margin-left: 10px; + cursor: pointer; + margin-top: 4px; } .cpt-right { font-size: 14px; diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 37c9251..9927313 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -32,7 +32,7 @@ export default function ListProj() { const name = state ? state.name : '' const chargeAdditionals = state? state.chargeAdditionals:'' - const progress = state? state.progress:'' + const tagDataId = state? state.tagDataId:'' const authorId = state? state.authorId:'' // console.log(keywords); // const images = [syminga,symingb,symingc,symingd] @@ -63,7 +63,7 @@ export default function ListProj() { keywords: keywords, charge: name, chargeAdditionals:chargeAdditionals, - progress:progress, + tagDataId:tagDataId, authorId:authorId, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : getMenuActive() @@ -73,7 +73,7 @@ export default function ListProj() { setIsLoading(true); }, onSuccess({ data }) { - // console.log('数据',data); + console.log('数据',data); setPage(data.page); setTotal(data.total); @@ -93,31 +93,34 @@ export default function ListProj() { } // 更新数据 - // const upreqData = (currentPage: number) => { - // get>({ - // messageApi: messageApi, - // url: '/api/proj/listpage/self', - // config: { - // params: { - // page: currentPage, - // rows: 10, - // keywords: keywords, - // charge: name, - // projCategoryId: indexListContext.category, - // status: indexListContext.status ? indexListContext.status : getMenuActive() - // } - // }, - // onBefore() { - // setIsLoading(true); - // }, - // onSuccess({ data }) { - // setProjs(data.rows); - // }, - // onFinally() { - // setIsLoading(false); - // } - // }) - // } + const upreqData = () => { + get>({ + messageApi: messageApi, + url: '/api/proj/listpage/self', + config: { + params: { + page: page, + rows: 10, + keywords: keywords, + charge: name, + chargeAdditionals:chargeAdditionals, + tagDataId:tagDataId, + authorId:authorId, + projCategoryId: indexListContext.category, + status: indexListContext.status ? indexListContext.status : getMenuActive() + } + }, + onBefore() { + setIsLoading(true); + }, + onSuccess({ data }) { + setProjs(data.rows); + }, + onFinally() { + setIsLoading(false); + } + }) + } const renderList = () => { @@ -140,8 +143,7 @@ export default function ListProj() { return (
{ upreqData(page) }} - // getreqData={reqDataNoScoll} + updata = {upreqData} />
) @@ -160,13 +162,13 @@ export default function ListProj() { // renderCategory(); // } // - // if(!keywords && !name && !chargeAdditionals && !progress && !authorId){ + // if(!keywords && !name && !chargeAdditionals && !tagDataId && !authorId){ // reqData(1) // } setTimeout(() => { setShowPage(true) }, 0); - }, [indexListContext.status, keywords, name,chargeAdditionals,progress,authorId]) + }, [indexListContext.status, keywords, name,chargeAdditionals,tagDataId,authorId]) useEffect(() => { reqData(page); diff --git a/src/components/menu/MenuWithTopButton.tsx b/src/components/menu/MenuWithTopButton.tsx index 493a0f1..5372527 100644 --- a/src/components/menu/MenuWithTopButton.tsx +++ b/src/components/menu/MenuWithTopButton.tsx @@ -36,7 +36,7 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) { keyword: props.keywords, name: props.type, chargeAdditionals: props.chargeAdditionals, - progress: props.progress, + tagDataId: props.tagDataId, authorId: props.authorId } }) diff --git a/src/interfaces/menu/IMenuWithTopButton.ts b/src/interfaces/menu/IMenuWithTopButton.ts index 803104f..94ad8fa 100644 --- a/src/interfaces/menu/IMenuWithTopButton.ts +++ b/src/interfaces/menu/IMenuWithTopButton.ts @@ -22,6 +22,6 @@ export interface IMenuWithTopButton { keywords?:string; type?:string ; chargeAdditionals?:string; - progress?:string; + tagDataId?:string; authorId?:string; } \ No newline at end of file diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index eb6feaa..56aefb4 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -32,14 +32,40 @@ import { get } from '../../util/AjaxUtils.ts' import gpsImg from '../../static/right/gps.png' import backImg from '../../static/right/back.png' // import { Link } from "react-router-dom"; -import { Input, +import { + Input, // Breadcrumb, - message } from 'antd'; + message +} from 'antd'; const { Search } = Input; 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() //redux的belongArray const redxuState: any = useSelector(state => state) @@ -96,7 +122,7 @@ export default function Index() { const [keywords, setKeywords] = useState(''); const [type, setType] = useState(null) const [chargeAdditionals, setchargeAdditionals] = useState(null) - const [progress, setprogress] = useState(null) + const [tagDataId, settagDataId] = useState(null) const [authorId, setauthorId] = useState('') // const indexListContext = useContext(IndexListContext); // 所属者信息 @@ -127,7 +153,7 @@ export default function Index() { setKeywords('') setType(null) setchargeAdditionals(null) - setprogress(null) + settagDataId(null) } const nav = useNavigate(); @@ -421,18 +447,19 @@ export default function Index() { } getProjOwnerList() + getTag() }, []); useEffect(() => { - // console.log('监听', '类型:', type, '关键字:', keywords, '额外付费:', chargeAdditionals,'进度:',progress); + // console.log('监听', '类型:', type, '关键字:', keywords, '额外付费:', chargeAdditionals,'进度:',tagDataId); // console.log(Boolean(keywords)); // if (location.pathname.includes('/home')) { - if (!keywords && !type && !chargeAdditionals && !progress) { + if (!keywords && !type && !chargeAdditionals && !tagDataId) { setKeywords('') setType(null) setchargeAdditionals(null) - setprogress(null) + settagDataId(null) } if (location.pathname.includes('/home')) { nav('/home', { @@ -440,14 +467,14 @@ export default function Index() { keyword: keywords, name: type, chargeAdditionals: chargeAdditionals, - progress: progress, + tagDataId: tagDataId, authorId: authorId } }) } // } - }, [type, chargeAdditionals, keywords, progress, authorId]); + }, [type, chargeAdditionals, keywords, tagDataId, authorId]); const handleSearch = (value: string) => { // console.log(value); @@ -457,7 +484,7 @@ export default function Index() { keyword: value, name: type, chargeAdditionals: chargeAdditionals, - progress: progress, + tagDataId: tagDataId, authorId: authorId } @@ -473,7 +500,7 @@ export default function Index() { keyword: '', name: type, chargeAdditionals: chargeAdditionals, - progress: progress, + tagDataId: tagDataId, authorId: authorId } }) @@ -500,7 +527,7 @@ export default function Index() { keywords={keywords} type={type ? type : ""} chargeAdditionals={chargeAdditionals ? chargeAdditionals : ""} - progress={progress ? progress : ""} + tagDataId={tagDataId ? tagDataId : ""} authorId={authorId ? authorId : ""} />
@@ -520,7 +547,7 @@ export default function Index() { keyword: keywords, name: type, chargeAdditionals: chargeAdditionals, - progress: progress, + tagDataId: tagDataId, authorId: '' } }) @@ -531,7 +558,7 @@ export default function Index() { keyword: keywords, name: type, chargeAdditionals: chargeAdditionals, - progress: progress, + tagDataId: tagDataId, authorId: item.projOwnerId } }) @@ -646,7 +673,7 @@ export default function Index() { keyword: keywords, chargeAdditionals: chargeAdditionals, name: value, - progress: progress, + tagDataId: tagDataId, authorId: authorId } }) @@ -676,7 +703,7 @@ export default function Index() { keyword: keywords, name: type, chargeAdditionals: value, - progress: progress, + tagDataId: tagDataId, authorId: authorId } }) @@ -692,11 +719,11 @@ export default function Index() { placeholder={'选择拓展收费'} />