diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index 02401fd..29d75d2 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -526,6 +526,7 @@ export default function CardProj(props: any) { destroyOnClose={true} onCancel={() => { + // props.upreqData() setSoftwareManagementOpen(false); // props.getreqData() // window.location.reload(); // 在取消时刷新页面 @@ -554,6 +555,7 @@ export default function CardProj(props: any) { destroyOnClose={true} onCancel={() => { + // props.upreqData() setDisplayOrderOpen(false); }} footer={null} diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index f8a0d3c..d2d5c57 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -29,7 +29,7 @@ export default function ListProj() { // // setKeywords(state.keyword) // } const keywords = state ? state.keyword : '' - const name = state?state.name:'' + const name = state ? state.name : '' // console.log(keywords); // const images = [syminga,symingb,symingc,symingd] const listProjRef: MutableRefObject = useRef(null); @@ -56,7 +56,7 @@ export default function ListProj() { page: currentPage, rows: 10, keywords: keywords, - charge:name, + charge: name, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : getMenuActive() } @@ -75,16 +75,16 @@ export default function ListProj() { // })); // console.log('循环数组',updatedArr); // setProjs(updatedArr); - + }, onFinally() { setIsLoading(false); } }) } - // const reqDataNoScoll = (currentPage: number) => { - // // setProjs([]) + // 更新数据 + // const upreqData = (currentPage: number) => { // get>({ // messageApi: messageApi, // url: '/api/proj/listpage/self', @@ -93,6 +93,7 @@ export default function ListProj() { // page: currentPage, // rows: 10, // keywords: keywords, + // charge: name, // projCategoryId: indexListContext.category, // status: indexListContext.status ? indexListContext.status : getMenuActive() // } @@ -101,23 +102,14 @@ export default function ListProj() { // setIsLoading(true); // }, // onSuccess({ data }) { - // console.log('看看结果', data); - // setPage(data.page); - // setTotal(data.total); - // // setProjs(data.rows); - // const updatedArr = (data.rows).map((item, index) => ({ - // ...item, - // img: images[index % images.length] // 利用取余来循环填充图片 - // })); - // console.log('循环数组',updatedArr); - // setProjs(updatedArr); - + // setProjs(data.rows); // }, // onFinally() { // setIsLoading(false); // } // }) // } + const renderList = () => { if (projs.length == 0) { @@ -131,14 +123,15 @@ export default function ListProj() { justifyContent: 'center', alignItems: 'center' }}> - + ) } return projs.map((item) => { return (
- { upreqData(page) }} // getreqData={reqDataNoScoll} />
@@ -157,15 +150,15 @@ export default function ListProj() { renderCategory(); } console.log(page); - + setTimeout(() => { setShowPage(true) }, 0); - }, [indexListContext.status,keywords,name]) + }, [indexListContext.status, keywords, name]) useEffect(() => { if (indexListContext.categorys) { - + reqData(page); renderCategory(); } @@ -194,9 +187,9 @@ export default function ListProj() {
{/* defaultCurrent: 默认当前页数 total:数据总数 */} - {showPage? { + {showPage ? { reqData(page); - }} /> : null} + }} /> : null}
diff --git a/src/components/scrollAD/ScrollAd.tsx b/src/components/scrollAD/ScrollAd.tsx index dedcf16..71c9037 100644 --- a/src/components/scrollAD/ScrollAd.tsx +++ b/src/components/scrollAD/ScrollAd.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react' import './scrollAd.css' -export default function ScrollAd() { +export default function ScrollAd(props:any) { useEffect(() => { const scrollInterval = setInterval(() => { const adContainer = document.getElementById('scrolling-ad-container'); @@ -18,7 +18,7 @@ export default function ScrollAd() {
- 广告广告广告广告广告广告广告广告广告广告广告广告广告广 + {props.ad}
diff --git a/src/route/proj/ProjCreate.tsx b/src/route/proj/ProjCreate.tsx index 680f2bf..f270a05 100644 --- a/src/route/proj/ProjCreate.tsx +++ b/src/route/proj/ProjCreate.tsx @@ -40,6 +40,21 @@ export default function ProjCreate() { const nav = useNavigate(); const height = window.innerHeight - 170; const [show,setShow] = useState(true) //是否显示广告 + const [ad,setAd] = useState('') + const getAd = () => { + get({ + messageApi: messageApi, + url: '/api/env/custom/get-proj-create-notice', + onSuccess({ data }) { + console.log('广告',data); + setAd(data.data) + setShow(data.data==''?false:true) + } + }) + // sessionStorage.setItem('pathArray', JSON.stringify([ { title: 首页 },{ title: '创建项目' }])); + // sessionStorage.setItem('now', '创建'); + console.log(allInfo); + } useEffect(() => { get({ messageApi: messageApi, @@ -58,7 +73,7 @@ export default function ProjCreate() { // sessionStorage.setItem('pathArray', JSON.stringify([ { title: 首页 },{ title: '创建项目' }])); // sessionStorage.setItem('now', '创建'); console.log(allInfo); - + getAd() }, []) return ( @@ -69,7 +84,7 @@ export default function ProjCreate() {
- +
{ setShow(false)