diff --git a/src/components/card/CardProjJump.tsx b/src/components/card/CardProjJump.tsx index 207e35e..bf6c91b 100644 --- a/src/components/card/CardProjJump.tsx +++ b/src/components/card/CardProjJump.tsx @@ -4,7 +4,9 @@ import {IProjJump} from "../../interfaces/card/ICardProj.ts"; export default function CardProjJump(props: IProjJump) { return ( -
{ +
{ if(!props.canBtnClick) { return; } diff --git a/src/components/card/card-proj-jump.css b/src/components/card/card-proj-jump.css index 8972d09..25e3699 100644 --- a/src/components/card/card-proj-jump.css +++ b/src/components/card/card-proj-jump.css @@ -4,7 +4,7 @@ box-sizing: border-box; cursor: pointer; background-color: #F5FEFA; - box-shadow:0px 3px 0px 0px rgba(55,215,138,0.18) ; + /* box-shadow:0px 3px 0px 0px rgba(55,215,138,0.18) ; */ position: relative; } diff --git a/src/components/card/card-proj.css b/src/components/card/card-proj.css index d3d8673..77931ba 100644 --- a/src/components/card/card-proj.css +++ b/src/components/card/card-proj.css @@ -3,9 +3,11 @@ background-color: var(--color-light); /* padding: 5px 15px; */ height: 230px; - width: calc(100vw - 330px); + /* width: calc(100vw - 330px); */ /* margin-bottom: 20px; */ border-radius: 13px; + + } .card-proj .cp-top { diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 3aa7943..d2b4ee9 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -1,7 +1,7 @@ import './list-proj.css' import CardProj from "../card/CardProj.tsx"; import { useRef, MutableRefObject, useState, useEffect, useContext } from "react"; -import { Pagination, message, Spin, Image } from 'antd'; +import { Pagination, message, Spin, Image } from 'antd'; import { get } from "../../util/AjaxUtils.ts"; import { IndexListContext } from "../../context/IndexListContext.ts"; import { IListPage } from "../../interfaces/listpage/IListPage.ts"; @@ -17,15 +17,15 @@ import { useLocation } from 'react-router-dom'; export default function ListProj() { const indexListContext = useContext(IndexListContext); - const {state} = useLocation() + const { state } = useLocation() // console.log('传递过来的参数',state.keyword); // if(state){ // console.log('传递过来的参数',state.keyword); // // setKeywords(state.keyword) // } - const keywords = state?state.keyword:'' + const keywords = state ? state.keyword : '' // console.log(keywords); - + const listProjRef: MutableRefObject = useRef(null); const listRef: MutableRefObject = useRef(null); @@ -36,7 +36,7 @@ export default function ListProj() { const [isLoading, setIsLoading] = useState(false); // const [keywords, setKeywords] = useState(''); const domHeight = window.innerHeight - 280; - + // const navigate = useNavigate() const reqData = (currentPage: number) => { get>({ messageApi: messageApi, @@ -45,7 +45,7 @@ export default function ListProj() { params: { page: currentPage, rows: 20, - keywords: keywords, + keywords: keywords, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : '' } @@ -54,6 +54,8 @@ export default function ListProj() { setIsLoading(true); }, onSuccess({ data }) { + console.log('看看结果', data); + setPage(data.page); setTotal(data.total); setProjs(data.rows); @@ -82,20 +84,28 @@ export default function ListProj() { ) } return projs.map((item) => { - return ; + return ( +
+ +
+ ) }); } const renderCategory = () => { } - useEffect(() => { if (indexListContext.categorys) { + reqData(page); renderCategory(); } }, [indexListContext.status, indexListContext.categoryChangeCount, indexListContext.category, keywords, page]) - + + useEffect(() => { + + + }, [indexListContext.status]) // const renderStatus = () => { // if (indexListContext.status == 'ALL') { // return 项目:全部项目 @@ -114,12 +124,13 @@ export default function ListProj() {
-
+
{renderList()}
- { - setPage(page); + { + reqData(page); + // setPage(page); }} />
diff --git a/src/components/list/list-proj.css b/src/components/list/list-proj.css index 99358e6..404ea08 100644 --- a/src/components/list/list-proj.css +++ b/src/components/list/list-proj.css @@ -4,7 +4,9 @@ /* padding-right: 33px; */ margin-top: 10px; } - +.projListBox{ + margin-bottom: 25px; +} .list-proj .top { /* padding: 10px 15px; */ box-sizing: border-box; diff --git a/src/route/Home/Home.tsx b/src/route/Home/Home.tsx index 2511cb3..d1edb43 100644 --- a/src/route/Home/Home.tsx +++ b/src/route/Home/Home.tsx @@ -19,12 +19,12 @@ export default function Home() { // setListType(state.listType) // } // console.log('传递过来的',listType); - console.log(indexListContext); + // console.log(indexListContext); return ( -
+
{ String(indexListContext.type) == '0' ? : ( String(indexListContext.type) == '1' ? : <> diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index f0146a1..984be0c 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -32,7 +32,7 @@ export default function Index() { // const [keywords, setKeywords] = useState(''); // const indexListContext = useContext(IndexListContext); - + const nav = useNavigate(); @@ -131,32 +131,59 @@ export default function Index() { dispatch({ type: IndexListDataType.AGENT, value: item.id, - + }) } }) const location = useLocation() - const [now,setNow] = useState('首页') - const [pathArray,setPathArray] = useState([ { title: 首页 }]) - useEffect(()=>{ - // const nowname = sessionStorage.getItem('now') - console.log( '路由名字', location.pathname); - if(location.pathname.includes('/home') ){ - setNow('首页') - setPathArray([ { title: 首页 }]) - }else if(location.pathname.includes('/proj-create') ){ - setNow('创建项目') - setPathArray([ { title: 首页 },{title: 创建项目}]) - // - }else if(location.pathname.includes('/proj-edit')){ - setNow('编辑项目') - setPathArray([ { title: 首页 },{title: 创建项目},{title: 编辑项目}]) - } - - },[location.pathname]) + const [now, setNow] = useState('首页') + // 编辑项目路由名 + // const [editname,setEditname] = useState('') + // 新建项目路由名字 + // const [newname,setNewname] = useState('') + + const [pathArray, setPathArray] = useState([]) useEffect(() => { - - sessionStorage.setItem('pathArray', JSON.stringify([ { title: 首页 }])); + // const nowname = sessionStorage.getItem('now') + console.log('路由名字', location.pathname); + if (location.pathname.includes('/home')) { + setNow('首页') + setPathArray([{ title: '首页' }]) + } else if (location.pathname.includes('/proj-create')) { + setNow('创建项目') + setPathArray([{ title: 首页 }, { title: '创建项目' }]) + // + } else if (location.pathname.includes('/proj-edit')&&!location.pathname.includes('/step')) { + setNow('编辑项目') + // setEditname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title:'编辑项目'}]) + } else if (location.pathname.includes('/proj-new')) { + setNow('新建项目') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: '新建项目' }]) + }else if (location.pathname.includes('/proj-efree')) { + setNow('编辑项目') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: '编辑项目' }]) + }else if (location.pathname.includes('/proj-eall')) { + setNow('编辑项目') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: '编辑项目' }]) + }else if (location.pathname.includes('/proj-edit/step1')) { + setNow('标题简介') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, {title: {nav(-1)}}>编辑项目},{title: '标题简介'}]) + }else if (location.pathname.includes('/proj-edit/step2')) { + setNow('标题简介') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, {title: {nav(-1)}}>编辑项目},{title: '基本信息'}]) + } + + // /proj-edit/step1 + }, [location.pathname]) + useEffect(() => { + + sessionStorage.setItem('pathArray', JSON.stringify([{ title: 首页 }])); sessionStorage.setItem('now', '首页'); if (searchParams.get('type') == 'agent') { dispatch({ @@ -176,9 +203,11 @@ export default function Index() { const handleSearch = (value: string) => { console.log(value); - nav('/home',{state:{ - keyword:value - }}) + nav('/home', { + state: { + keyword: value + } + }) } return ( <> @@ -210,7 +239,7 @@ export default function Index() { {/* {renderStatus()} */}
-
当前位置:{ now}
+
当前位置:{now}
: <> ) } */} - +
+ +
diff --git a/src/route/proj/ProjEdit.tsx b/src/route/proj/ProjEdit.tsx index 5014c73..52cf2ac 100644 --- a/src/route/proj/ProjEdit.tsx +++ b/src/route/proj/ProjEdit.tsx @@ -79,7 +79,8 @@ export default function ProjEdit() { btnName: !isGenerateSuccess ? '设置' : '查看', status: editSteps[1].editStatus, handleEdit() { - if (generateStatus != GenerateStatus.SUCCESS) { + // if (generateStatus != GenerateStatus.SUCCESS) { + if (!isGenerateSuccess) { nav(`/proj-edit/step2/${pathParams.projId}`) } else { nav(`/proj-edit/step2-show/${pathParams.projId}`) diff --git a/src/route/proj/ProjEditAll.tsx b/src/route/proj/ProjEditAll.tsx index a973ec6..87f5db6 100644 --- a/src/route/proj/ProjEditAll.tsx +++ b/src/route/proj/ProjEditAll.tsx @@ -1,6 +1,6 @@ import './proj-edit.css'; -import {Link, useNavigate, useParams} from "react-router-dom"; -import {Breadcrumb, Button, message} from "antd"; +import { useNavigate, useParams} from "react-router-dom"; +import { Button, message} from "antd"; import StepProjEdit from "../../components/step/StepProjEdit.tsx"; import CardProjEdit from "../../components/card/CardProjEdit.tsx"; import {Process} from "../../interfaces/step/IStepProj.ts"; @@ -23,7 +23,7 @@ export default function ProjEditAll() { const [generateStatus, setGenerateStatus] = useState(GenerateStatus.NONE); const [previewUrl, setPreviewUrl] = useState(''); - const height = window.innerHeight - 240; + // const height = window.innerHeight - 240; const renderEditStep = (editSteps: any[], isEdited: boolean, isGenerateSuccess: boolean) => { const editStepArray: IProjEdit[] = []; @@ -103,14 +103,14 @@ export default function ProjEditAll() { return ( <> {contextHolder} - 首页}, {title: 创建项目}, {title: '编辑项目'}, ]} - /> -
+ /> */} +
}) } @@ -178,9 +181,11 @@ export default function ProjEditAll() {
diff --git a/src/route/proj/ProjEditFree.tsx b/src/route/proj/ProjEditFree.tsx index 089bd45..7ef42b0 100644 --- a/src/route/proj/ProjEditFree.tsx +++ b/src/route/proj/ProjEditFree.tsx @@ -1,16 +1,16 @@ import './proj-edit.css'; -import {Link, useNavigate, useParams} from "react-router-dom"; -import {Breadcrumb, Button, message} from "antd"; +import { useNavigate, useParams } from "react-router-dom"; +import { Button, message } from "antd"; import StepProjEdit from "../../components/step/StepProjEdit.tsx"; import CardProjEdit from "../../components/card/CardProjEdit.tsx"; -import {Process} from "../../interfaces/step/IStepProj.ts"; +import { Process } from "../../interfaces/step/IStepProj.ts"; import CardProjDownload from "../../components/card/CardProjDownload.tsx"; import CardProjJump from "../../components/card/CardProjJump.tsx"; -import {useEffect, useState} from "react"; -import {Axios, get} from "../../util/AjaxUtils.ts"; -import {EditStepEnum, IProjEdit} from "../../interfaces/card/ICardProj.ts"; -import {MAX_MOD_SIZE_FREE} from "./edit/ProjConfigModList.tsx"; -import {GenerateStatus} from "../../interfaces/proj/IProj.ts"; +import { useEffect, useState } from "react"; +import { Axios, get } from "../../util/AjaxUtils.ts"; +import { EditStepEnum, IProjEdit } from "../../interfaces/card/ICardProj.ts"; +import { MAX_MOD_SIZE_FREE } from "./edit/ProjConfigModList.tsx"; +import { GenerateStatus } from "../../interfaces/proj/IProj.ts"; export default function ProjEdit() { const nav = useNavigate(); @@ -25,7 +25,7 @@ export default function ProjEdit() { const [generateStatus, setGenerateStatus] = useState(GenerateStatus.NONE); const [previewUrl, setPreviewUrl] = useState(''); - const height = window.innerHeight - 240; + // const height = window.innerHeight - 240; const renderEditStep = (editSteps: any[], isEdited: boolean, isGenerateSuccess: boolean) => { const editStepArray: IProjEdit[] = []; @@ -177,7 +177,7 @@ export default function ProjEdit() { get({ messageApi: messageApi, url: `/api/proj/get/${pathParams.projId}`, - onSuccess({data}) { + onSuccess({ data }) { const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED && data.editSteps[5].editStatus == EditStepEnum.EDITED; const isConfig = data.loginpage.loginpageId && data.projModCount > MAX_MOD_SIZE_FREE; @@ -197,73 +197,82 @@ export default function ProjEdit() { }, []) return ( - <> + <> {contextHolder} - 首页}, - {title: 创建项目}, - {title: '编辑项目'}, + { title: 首页 }, + { title: 创建项目 }, + { title: '编辑项目' }, ]} - /> -
+ /> */} +
+ descTitle="完善信息" + descDetail="完善项目的基本信息" + hasNext={true}> { editStepArray.map((item, index) => { return }) } + process={!isEditStepEdited ? Process.PENDING : (isConfigEdited ? Process.COMPLETE : Process.PROCESSING)} + descTitle="功能设置" + descDetail="设置系统的菜单功能" hasNext={true}> { configArray.map((item, index) => { return }) } { isEditStepEdited && isConfigEdited ? ( { - window.open(`${Axios.defaults?.baseURL}/${previewUrl}`, '_blank') - }} + desc="点击查看预览系统" + handleJump={() => { + window.open(`${Axios.defaults?.baseURL}/${previewUrl}`, '_blank') + }} /> ) : <> } + process={generateStatus == GenerateStatus.SUCCESS ? Process.COMPLETE : (canGenerate ? Process.PROCESSING : Process.PENDING)} + descTitle="资料生成" + hasNext={true}> { generateStatus == GenerateStatus.NONE || generateStatus == GenerateStatus.FAILED ? ( {}} + desc="生成软著所需要的资料,此操作后项目无法再次编辑" + btnName="生成" + status={EditStepEnum.UN_EDIT} + canBtnClick={false} + handleEdit={() => { }} + background='#f3f3f3' + /> ) : <> } @@ -271,41 +280,43 @@ export default function ProjEdit() { + process={generateStatus == GenerateStatus.SUCCESS ? Process.PROCESSING : Process.PENDING} + descTitle="资料下载"> {}} + desc="点击下载申请表" + canBtnClick={false} + handleDownload={() => { }} /> {}} + desc="点击下载操作手册" + canBtnClick={false} + handleDownload={() => { }} /> {}} + desc="点击下载代码压缩包" + canBtnClick={false} + handleDownload={() => { }} /> {}} + desc="点击下载代码文档" + canBtnClick={false} + handleDownload={() => { }} /> {}} + desc="到软著代理完成软著申请" + canBtnClick={false} + handleJump={() => { }} />
diff --git a/src/route/proj/ProjNew.tsx b/src/route/proj/ProjNew.tsx index e84530f..88b5e71 100644 --- a/src/route/proj/ProjNew.tsx +++ b/src/route/proj/ProjNew.tsx @@ -1,11 +1,11 @@ import './proj-new.css'; -import {Link, useNavigate, useParams, useSearchParams} from "react-router-dom"; -import {Breadcrumb, Button, Flex, Form, Input, message, Modal, Spin} from "antd"; -import {useContext, useEffect, useState} from "react"; -import {get, post} from "../../util/AjaxUtils.ts"; -import {IProjCharge, ProjAdditionalType, ProjChargeType} from "../../interfaces/proj/IProj.ts"; -import {GlobalDispatchContext, reloadUser} from "../../context/GlobalContext.ts"; - +import { useNavigate, useParams, useSearchParams } from "react-router-dom"; +import { Button, Flex, Form, Input, message, Modal, Spin } from "antd"; +import { useContext, useEffect, useState } from "react"; +import { get, post } from "../../util/AjaxUtils.ts"; +import { IProjCharge, ProjAdditionalType, ProjChargeType } from "../../interfaces/proj/IProj.ts"; +import { GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts"; +const { TextArea } = Input; type ProjInfo = { projName: string; projIntroduction: string; @@ -19,7 +19,7 @@ export default function ProjNew() { const [messageApi, contextHolder] = message.useMessage(); const [loading, setLoading] = useState(false); - const height = window.innerHeight - 150; + // const height = window.innerHeight - 150; const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); const [isEditModalOpen, setIsEditModalOpen] = useState(false); const [chargePrice, setChargePrice] = useState(0); @@ -34,18 +34,18 @@ export default function ProjNew() { get({ messageApi: messageApi, url: '/api/proj/charge/get', - onSuccess({data}) { - + onSuccess({ data }) { + const charge = data as IProjCharge; // console.log('创建页price',charge.proj.materialAgent); - + let price = 0; switch (pathParams.projChargeType) { case ProjChargeType.ALL: price = charge.proj.all; break; case ProjChargeType.MATERIAL_AGENT: - price = charge.proj.materialAgent; + price = charge.proj.materialAgent; break; case ProjChargeType.MATERIAL_AGENT_URGENT: price = charge.proj.materialAgentUrgent; @@ -62,8 +62,8 @@ export default function ProjNew() { content: '价格类型错误', }) } - const pkg = queryParams.get('pkg') == 'true'?true:false - const videoDemo = queryParams.get('videoDemo') == 'true'?true:false + const pkg = queryParams.get('pkg') == 'true' ? true : false + const videoDemo = queryParams.get('videoDemo') == 'true' ? true : false if (pkg) { price += charge.additional.pkg; listProjChargeAdditional.push(ProjAdditionalType.PKG); @@ -73,10 +73,10 @@ export default function ProjNew() { listProjChargeAdditional.push(ProjAdditionalType.VIDEO_DEMO); } setChargePrice(price); - console.log('传递信息pkg:',pkg,'videoDemo:',videoDemo); - - console.log('显示价格',price); - + // console.log('传递信息pkg:',pkg,'videoDemo:',videoDemo); + + // console.log('显示价格',price); + } }) }, []); @@ -84,23 +84,23 @@ export default function ProjNew() { return ( <> {contextHolder} - 首页}, {title: 创建项目}, {title: '新建项目'}, ]} - /> -
+ /> */} +
-
请完善项目的基本信息
+ {/*
请完善项目的基本信息
*/}
{ setIsCreateModalOpen(true); setProjInfo({ @@ -110,83 +110,104 @@ export default function ProjNew() { }} autoComplete="off" > - - name="projName" - rules={[{required: true, message: '请输入系统标题'}]} - > - - +
+
系统标题*
+ + name="projName" + rules={[{ required: true, message: '请输入系统标题' }]} + > + + +
+
+
简单描述
+ + name="projIntroduction" + // rules={[{required: true, message: '请输入系统标题'}]} + > +