From 03538b11909c2196b82c3f76978251a0ef91f301 Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Tue, 21 May 2024 11:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/card/CardImgSelect.tsx | 5 +- src/components/card/card-img-select.css | 2 + src/components/menu/MenuWithBottomButton.tsx | 31 +- .../menu/menu-with-bottom-button.css | 14 + src/interfaces/menu/IMenuWithTopButton.ts | 1 + src/route/CopyrightGgoods/CopyrightGgoods.tsx | 9 + src/route/Home/Home.tsx | 2 +- src/route/ProductRelease/ProductRelease.tsx | 9 + src/route/TradingGoods/TradingGoods.tsx | 7 + .../TransactionOrder/TransactionOrder.tsx | 7 + src/route/index/Index.tsx | 163 +- src/route/proj/ProjCreate.tsx | 178 +- src/route/proj/ProjEdit.tsx | 157 +- src/route/proj/ProjEditAll.tsx | 70 +- src/route/proj/ProjEditFree.tsx | 142 +- src/route/proj/ProjNew.tsx | 28 +- src/route/proj/edit/ProjConfigLoginpage.tsx | 531 ++++-- .../proj/edit/ProjConfigLoginpageShow.tsx | 542 ++++-- src/route/proj/edit/ProjConfigMenuList.tsx | 16 +- src/route/proj/edit/ProjConfigModEdit.tsx | 12 +- src/route/proj/edit/ProjConfigModList.tsx | 8 +- src/route/proj/edit/ProjConfigModSave.tsx | 12 +- src/route/proj/edit/ProjEditStep1.tsx | 238 +-- src/route/proj/edit/ProjEditStep1Show.tsx | 272 +-- src/route/proj/edit/ProjEditStep2.tsx | 11 +- src/route/proj/edit/ProjEditStep2Show.tsx | 1463 ++++++++++++++++- src/route/proj/edit/ProjEditStep3.tsx | 580 +++---- src/route/proj/edit/ProjEditStep3Show.tsx | 381 ++--- src/route/proj/edit/proj-config-loginpage.css | 98 +- src/route/proj/edit/proj-edit-step.css | 72 +- src/route/proj/proj-create.css | 1 + src/route/router.tsx | 31 +- 32 files changed, 3542 insertions(+), 1551 deletions(-) create mode 100644 src/route/CopyrightGgoods/CopyrightGgoods.tsx create mode 100644 src/route/ProductRelease/ProductRelease.tsx create mode 100644 src/route/TradingGoods/TradingGoods.tsx create mode 100644 src/route/TransactionOrder/TransactionOrder.tsx diff --git a/src/components/card/CardImgSelect.tsx b/src/components/card/CardImgSelect.tsx index 9bd2e6b..9bb2ab5 100644 --- a/src/components/card/CardImgSelect.tsx +++ b/src/components/card/CardImgSelect.tsx @@ -16,10 +16,11 @@ export default function CardImgSelect(props: ImgSelect) { const imgSrc = `${Axios.defaults?.baseURL}/route/file/v2/download/true/${props.imgs}`; console.log(imgSrc) return ( -
- +
diff --git a/src/components/card/card-img-select.css b/src/components/card/card-img-select.css index 6496b94..e9ef590 100644 --- a/src/components/card/card-img-select.css +++ b/src/components/card/card-img-select.css @@ -1,4 +1,5 @@ .card-img-select { + width: 200px; display: inline-block; padding: 10px; border: 1px solid var(--color-border); @@ -7,6 +8,7 @@ cursor: pointer; } + .card-img-select:hover { border-color: var(--color-primary); } diff --git a/src/components/menu/MenuWithBottomButton.tsx b/src/components/menu/MenuWithBottomButton.tsx index a9edf9b..bef9f61 100644 --- a/src/components/menu/MenuWithBottomButton.tsx +++ b/src/components/menu/MenuWithBottomButton.tsx @@ -1,6 +1,6 @@ import './menu-with-bottom-button.css' import { IMenuWithTopButton } from "../../interfaces/menu/IMenuWithTopButton.ts"; -import serveImg from '../../static/left/serves.png' +// import serveImg from '../../static/left/serves.png' import { useNavigate } from 'react-router-dom'; // import newImg from '../../static/left/new.png' @@ -8,13 +8,16 @@ import { useNavigate } from 'react-router-dom'; // RightOutlined1 // } from '@ant-design/icons'; export default function MenuWithTopButton(props: IMenuWithTopButton) { - const navugate = useNavigate() + const navigate = useNavigate() const list = props.list.map((item, index) => ( // 创建项目下三个选项
  • { props.handleListItem(e, index, item); - navugate('/home') + if (item.path) { + navigate(item.path); + } + // navigate('/home'); }}> @@ -29,29 +32,15 @@ export default function MenuWithTopButton(props: IMenuWithTopButton) { {/* button 是三个黄色按钮 */}
    { props.button.handle(e); - }}>
    - + {/* */} +
    +
    {props.button.name}
    - {/*
    { - props.button.handle(e); - - }}> - -
    创建
    -
    */} +
    - {/* */}
      {list}
  • ) diff --git a/src/components/menu/menu-with-bottom-button.css b/src/components/menu/menu-with-bottom-button.css index 2bbb980..fb730ad 100644 --- a/src/components/menu/menu-with-bottom-button.css +++ b/src/components/menu/menu-with-bottom-button.css @@ -29,6 +29,19 @@ margin-right: 9px; } +.bot-lift .sell-buy { + width: 19px; + height: 19px; + border-radius: 50%; + border: 2px solid #FFAF22; + font-size: 12px; + text-align: center; + line-height: 19px; + font-weight: 700; + margin-left: 23px; + margin-right: 6px; +} + .bot-right { display: flex; align-items: center; @@ -66,6 +79,7 @@ text-decoration-line: underline; } + /* .icon{ color: white; margin-left: 101px; diff --git a/src/interfaces/menu/IMenuWithTopButton.ts b/src/interfaces/menu/IMenuWithTopButton.ts index 5f76614..e272db7 100644 --- a/src/interfaces/menu/IMenuWithTopButton.ts +++ b/src/interfaces/menu/IMenuWithTopButton.ts @@ -5,6 +5,7 @@ export interface IMenuListItem { icon?: string; name: string; active?: boolean; + path?:string } export interface IMenuButton { diff --git a/src/route/CopyrightGgoods/CopyrightGgoods.tsx b/src/route/CopyrightGgoods/CopyrightGgoods.tsx new file mode 100644 index 0000000..f049c2d --- /dev/null +++ b/src/route/CopyrightGgoods/CopyrightGgoods.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function CopyrightGgoods() { + return ( +
    + 著作权商品页面 +
    + ) +} diff --git a/src/route/Home/Home.tsx b/src/route/Home/Home.tsx index d1edb43..b0b60c6 100644 --- a/src/route/Home/Home.tsx +++ b/src/route/Home/Home.tsx @@ -19,7 +19,7 @@ export default function Home() { // setListType(state.listType) // } // console.log('传递过来的',listType); - // console.log(indexListContext); + console.log('页面判断',indexListContext.type); return ( diff --git a/src/route/ProductRelease/ProductRelease.tsx b/src/route/ProductRelease/ProductRelease.tsx new file mode 100644 index 0000000..7754443 --- /dev/null +++ b/src/route/ProductRelease/ProductRelease.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function ProductRelease() { + return ( +
    + 商品发布页面 +
    + ) +} diff --git a/src/route/TradingGoods/TradingGoods.tsx b/src/route/TradingGoods/TradingGoods.tsx new file mode 100644 index 0000000..d7e35ce --- /dev/null +++ b/src/route/TradingGoods/TradingGoods.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function TradingGoods() { + return ( +
    交易商品页面
    + ) +} diff --git a/src/route/TransactionOrder/TransactionOrder.tsx b/src/route/TransactionOrder/TransactionOrder.tsx new file mode 100644 index 0000000..3197170 --- /dev/null +++ b/src/route/TransactionOrder/TransactionOrder.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function TransactionOrder() { + return ( +
    交易订单页面
    + ) +} diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index 62b2e2e..d040e76 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -4,7 +4,7 @@ import { MouseEvent, Reducer, useEffect, useReducer, useState } from "react"; import { useNavigate, useSearchParams, Outlet } from "react-router-dom"; import { IMenuListItem, IMenuWithTopButton } from "../../interfaces/menu/IMenuWithTopButton.ts"; import MenuWithTopButton from "../../components/menu/MenuWithTopButton.tsx"; -import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' +// import MenuWithBottomButtom from '../../components/menu/MenuWithBottomButton.tsx' import MenuTreeWithTopButton from "../../components/menu/MenuTreeWithTopButton.tsx"; // import ListProj from "../../components/list/ListProj.tsx"; // import ListProjAgent from "../../components/list/ListProjAgent.tsx"; @@ -80,7 +80,9 @@ export default function Index() { ], handleListItem(_e, _index, item: IMenuListItem) { projMenu.list.forEach(item => item.active = false); - agentMenu.list.forEach(item => item.active = false); + sellMenu.list.forEach(item => item.active = false); + buyMenu.list.forEach(item => item.active = false); + item.active = true; setProjMenu({ ...projMenu @@ -91,50 +93,100 @@ export default function Index() { // keywords: '' }) - // sessionStorage.setItem('listType', String(IndexListDataType.PROJ)); - // sessionStorage.setItem('listType', String(IndexListDataType.AGENT)); - // console.log(IndexListDataType.PROJ); - // console.log(sessionStorage.getItem('listType')); - - - // nav('/home', { - // state: { - // listType: '0', - // } - - // }) }, }); - const [agentMenu, setAgentMenu] = useState({ + // const [agentMenu, setAgentMenu] = useState({ + // button: { + // name: '代理服务', + // handle() { + // dispatch({ + // type: IndexListDataType.PROJ, + // value: 'COMPLETE', + // }) + // } + // }, + // list: [ + // { id: 'ALL', name: '全部项目' }, + // { id: 'PROCESSING', name: '进行中的' }, + // { id: 'COMPLETE', name: '已完成的' }, + // ], + // handleListItem(_e: MouseEvent, _index: number, item: IMenuListItem) { + // projMenu.list.forEach(item => item.active = false); + // agentMenu.list.forEach(item => item.active = false); + // item.active = true; + // setAgentMenu({ + // ...agentMenu + // }) + // dispatch({ + // type: IndexListDataType.AGENT, + // value: item.id, + + // }) + // } + // }) + const [sellMenu, setSellMenu] = useState({ button: { - name: '代理服务', + name: '我要卖', handle() { - dispatch({ - type: IndexListDataType.PROJ, - value: 'COMPLETE', - }) + // dispatch({ + // type: IndexListDataType.PROJ, + // value: 'COMPLETE', + // }) } }, list: [ - { id: 'ALL', name: '全部项目' }, - { id: 'PROCESSING', name: '进行中的' }, - { id: 'COMPLETE', name: '已完成的' }, + { id: '1', name: '商品发布', path: '/product-release' }, + { id: '2', name: '交易订单', path: '/transaction-order' }, + // { id: 'COMPLETE', name: '已完成的' }, ], handleListItem(_e: MouseEvent, _index: number, item: IMenuListItem) { projMenu.list.forEach(item => item.active = false); - agentMenu.list.forEach(item => item.active = false); - item.active = true; - setAgentMenu({ - ...agentMenu - }) - dispatch({ - type: IndexListDataType.AGENT, - value: item.id, + sellMenu.list.forEach(item => item.active = false); + buyMenu.list.forEach(item => item.active = false); + item.active = true; + setSellMenu({ + ...sellMenu }) + // dispatch({ + // type: IndexListDataType.AGENT, + // value: item.id, + + // }) } }) + const [buyMenu, setBuyMenu] = useState({ + button: { + name: '我要买', + handle() { + // dispatch({ + // type: IndexListDataType.PROJ, + // value: 'COMPLETE', + // }) + } + }, + list: [ + { id: '1', name: '著作权商品', path: '/copyright-goods' }, + { id: '2', name: '交易商品', path: '/trading-goods' }, + // { id: 'COMPLETE', name: '已完成的' }, + ], + handleListItem(_e: MouseEvent, _index: number, item: IMenuListItem) { + projMenu.list.forEach(item => item.active = false); + sellMenu.list.forEach(item => item.active = false); + buyMenu.list.forEach(item => item.active = false); + item.active = true; + setBuyMenu({ + ...buyMenu + }) + // dispatch({ + // type: IndexListDataType.AGENT, + // value: item.id, + + // }) + } + }) + const location = useLocation() const [now, setNow] = useState('首页') // 编辑项目路由名 @@ -152,8 +204,8 @@ export default function Index() { } else if (location.pathname.includes('/proj-create')) { setNow('创建项目') setPathArray([{ title: 首页 }, { title: '创建项目' }]) - // - } else if (location.pathname.includes('/proj-edit') && !location.pathname.includes('/step') &&!location.pathname.includes('/config-loginpage') ) { + // /config-mod-list /config-menu-list + } else if (location.pathname.includes('/proj-edit')&& !location.pathname.includes('/config-mod-edit') && !location.pathname.includes('/step') && !location.pathname.includes('/config-loginpage')&& !location.pathname.includes('/config-mod-save')&& !location.pathname.includes('/config-mod-list')&& !location.pathname.includes('/config-menu-list')) { setNow('编辑项目') // setEditname(location.pathname) setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: '编辑项目' }]) @@ -177,17 +229,35 @@ export default function Index() { setNow('标题简介') // setNewname(location.pathname) setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '基本信息' }]) - }else if (location.pathname.includes('/proj-edit/config-loginpage')) { + } else if (location.pathname.includes('/proj-edit/config-loginpage')) { setNow('登录界面设置') // setNewname(location.pathname) setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '登录界面设置' }]) + }else if (location.pathname.includes('/proj-edit/config-mod-list')) { + setNow('系统菜单管理') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '系统菜单管理' }]) + }else if (location.pathname.includes('/proj-edit/config-menu-list')) { + setNow('系统菜单顺序') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '系统菜单顺序' }]) + }else if (location.pathname.includes('/step3')) { + setNow('软件功能特点') + // setNewname(location.pathname) + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '软件功能特点' }]) + }else if (location.pathname.includes('/proj-edit/config-mod-save')) { + setNow('添加菜单') + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-1) }}>编辑项目 }, { title: '添加菜单' }]) + }else if (location.pathname.includes('/proj-edit/config-mod-edit')) { + setNow('编辑菜单') + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-2) }}>编辑项目 },{ title: { nav(-1) }}>系统菜单管理 }, { title: '编辑菜单' }]) + // /config-mod-edit } - }, [location.pathname]) useEffect(() => { - - sessionStorage.setItem('pathArray', JSON.stringify([{ title: 首页 }])); - sessionStorage.setItem('now', '首页'); + // nav('/home') + // sessionStorage.setItem('pathArray', JSON.stringify([{ title: 首页 }])); + // sessionStorage.setItem('now', '首页'); if (searchParams.get('type') == 'agent') { dispatch({ type: IndexListDataType.AGENT, @@ -223,23 +293,28 @@ export default function Index() {
    -
    +
    - {/* */} + {/* + */}
    diff --git a/src/route/proj/ProjCreate.tsx b/src/route/proj/ProjCreate.tsx index 4be2529..eb593c2 100644 --- a/src/route/proj/ProjCreate.tsx +++ b/src/route/proj/ProjCreate.tsx @@ -23,7 +23,7 @@ export default function ProjCreate() { } }); const nav = useNavigate(); - const height = window.innerHeight - 140; + const height = window.innerHeight - 170; useEffect(() => { get({ messageApi: messageApi, @@ -41,150 +41,9 @@ export default function ProjCreate() { return ( < > {contextHolder} - {/* 首页 }, - { title: '创建项目' }, - ]} - /> */} -
    -
    - {/* {*/} - {/* nav(`/proj-new/${ProjChargeType.ALL}`)*/} - {/* }*/} - {/* }*/} - {/* ]}*/} - {/*/>*/} - {/* { - nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`) - } - }, - { - id: ProjChargeType.MATERIAL_AGENT_URGENT, - label: '加急:', - price: charge.proj.materialAgentUrgent, - handleClick: (_title, additional) => { - nav(`/proj-new/${ProjChargeType.MATERIAL_AGENT_URGENT}?pkg=${additional.pkg}&videoDemo=${additional.videoDemo}`) - } - } - ]} */} - {/*/>*/} - +
    +
    {/* { - nav(`/proj-new/${ProjChargeType.MATERIAL}?${additional.pkg ? 'pkg=true' : 'pkg='}&${additional.videoDemo ? 'videoDemo=true' : 'videoDemo='}`); - } - } - ]} - /> */} - - - */} + {/* + /> */} - + /> */}
    diff --git a/src/route/proj/ProjEdit.tsx b/src/route/proj/ProjEdit.tsx index 15a7b4a..46bd8bf 100644 --- a/src/route/proj/ProjEdit.tsx +++ b/src/route/proj/ProjEdit.tsx @@ -52,11 +52,14 @@ export default function ProjEdit() { projDesc: '', projMods: [], }); - + // 判断状态 + // const height = window.innerHeight - 240; - const renderEditStep = (editSteps: any[], isEdited: boolean, isGenerateSuccess: boolean) => { + const renderEditStep = (data:any, isEdited: boolean, isGenerateSuccess: boolean) => { + console.log('嘻嘻',data); + // projIntroduction const editStepArray: IProjEdit[] = []; editStepArray.push( { @@ -64,7 +67,7 @@ export default function ProjEdit() { desc: '完善代码、样式类型和详细介绍等内容', step: 1, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[0].editStatus, + status: data.projIntroduction?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/step1/${pathParams.projId}`) @@ -78,7 +81,7 @@ export default function ProjEdit() { desc: '完善项目简介、编程语言、版本、公司等内容', step: 2, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[1].editStatus, + status: data.apply.projDevCompleteDate?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { // if (generateStatus != GenerateStatus.SUCCESS) { if (!isGenerateSuccess) { @@ -93,7 +96,7 @@ export default function ProjEdit() { desc: '请完善软件功能特点', step: 3, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[2].editStatus, + status: data.apply.envHardDev?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/step3/${pathParams.projId}`) @@ -102,62 +105,13 @@ export default function ProjEdit() { } } }, - { - title: '著作人信息', - desc: '请完善著作人相关信息', - step: 4, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[3].editStatus, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step4/${pathParams.projId}`) - } else { - nav(`/proj-edit/step4-show/${pathParams.projId}`) - } - } - }, - { - title: '申请人信息', - desc: '请完善申请人信息', - step: 5, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[4].editStatus, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step5/${pathParams.projId}`) - } else { - nav(`/proj-edit/step5-show/${pathParams.projId}`) - } - } - }, - { - title: '选择登录页面', - desc: '选择软件的登录页面模板', - step: 6, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[5].editStatus, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step6/${pathParams.projId}`) - } else { - nav(`/proj-edit/step6-show/${pathParams.projId}`) - } - } - } - ) - setEditStepArray(editStepArray); - setIsEditStepEdited(isEdited); - } - - const renderSetting = (data: any, isConfig: boolean, isGenerateSuccess: boolean) => { - const configArray: IProjEdit[] = []; - configArray.push( { title: '登录界面设置', desc: '请对登录界面完成个性化设置', step: 1, btnName: !isGenerateSuccess ? '设置' : '查看', - status: data.loginpage.loginpageId ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT, + // 状态判断lyp + status: data.loginpage.loginpageId?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/config-loginpage/${pathParams.projId}`) @@ -166,7 +120,71 @@ export default function ProjEdit() { } } }, - { + // { + // title: '著作人信息', + // desc: '请完善著作人相关信息', + // step: 4, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[3].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step4/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step4-show/${pathParams.projId}`) + // } + // } + // }, + // { + // title: '申请人信息', + // desc: '请完善申请人信息', + // step: 5, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[4].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step5/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step5-show/${pathParams.projId}`) + // } + // } + // }, + // { + // title: '选择登录页面', + // desc: '选择软件的登录页面模板', + // step: 6, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[5].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step6/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step6-show/${pathParams.projId}`) + // } + // } + // } + ) + setEditStepArray(editStepArray); + setIsEditStepEdited(isEdited); + } + + const renderSetting = (data: any, isConfig: boolean, isGenerateSuccess: boolean) => { + const configArray: IProjEdit[] = []; + configArray.push( + // { + // title: '登录界面设置', + // desc: '请对登录界面完成个性化设置', + // step: 1, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: data.loginpage.loginpageId ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/config-loginpage/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/config-loginpage-show/${pathParams.projId}`) + // } + // } + // }, + { title: '系统菜单管理', desc: '请对系统菜单进行设置', step: 2, @@ -179,6 +197,7 @@ export default function ProjEdit() { nav(`/proj-edit/config-mod-list-show/${pathParams.projId}`) } } + }, { title: '菜单顺序', @@ -204,16 +223,20 @@ export default function ProjEdit() { messageApi: messageApi, url: `/api/proj/get/${pathParams.projId}`, onSuccess({ data }) { - const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED - && data.editSteps[1].editStatus == EditStepEnum.EDITED - && data.editSteps[2].editStatus == EditStepEnum.EDITED - && data.editSteps[3].editStatus == EditStepEnum.EDITED - && data.editSteps[4].editStatus == EditStepEnum.EDITED - && data.editSteps[5].editStatus == EditStepEnum.EDITED; + console.log('状态判断',data); + // const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED + // && data.editSteps[1].editStatus == EditStepEnum.EDITED + // && data.editSteps[2].editStatus == EditStepEnum.EDITED + // && data.editSteps[3].editStatus == EditStepEnum.EDITED + // && data.editSteps[4].editStatus == EditStepEnum.EDITED + // && data.editSteps[5].editStatus == EditStepEnum.EDITED; + const isEdited = Boolean(data.projIntroduction) == true && Boolean(data.apply.projDevCompleteDate) == true && Boolean(data.apply.envHardDev) == true && Boolean(data.loginpage.loginpageId) == true + // console.log('isEdited',isEdited); + const isConfig = data.loginpage.loginpageId && data.projModCount > MIN_MOD_SIZE; const isGenerate = isEdited && isConfig; const isGenerateSuccess: boolean = data.generate.generateStatus == GenerateStatus.SUCCESS; - renderEditStep(data.editSteps, isEdited, isGenerateSuccess); + renderEditStep(data, isEdited, isGenerateSuccess); renderSetting(data, isConfig, isGenerateSuccess); setCanGenerate(isGenerate); setGenerateStatus(data.generate.generateStatus); @@ -278,7 +301,7 @@ export default function ProjEdit() { title={item.title} desc={item.desc} btnName={item.btnName} - canBtnClick={item.status == EditStepEnum.EDITED} + canBtnClick={isEditStepEdited} status={item.status} handleEdit={item.handleEdit} background={item.status == EditStepEnum.EDITED ? '#F5FEFA' : '#f3f3f3'} @@ -472,7 +495,9 @@ export default function ProjEdit() { destroyOnClose onCancel={() => { setAiHelperModalOpen(false); - renderData() + // console.log(123); + + // renderData() }} > { + const renderEditStep = (data: any, isEdited: boolean, isGenerateSuccess: boolean) => { const editStepArray: IProjEdit[] = []; editStepArray.push( { @@ -33,7 +33,7 @@ export default function ProjEditAll() { desc: '完善代码、样式类型和详细介绍等内容', step: 1, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[0].editStatus, + status: data.projIntroduction?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/step1/${pathParams.projId}`) @@ -43,33 +43,48 @@ export default function ProjEditAll() { } }, { - title: '著作人信息', - desc: '请完善著作人相关信息', - step: 4, + title: '基本信息', + desc: '完善项目简介、编程语言、版本、公司等内容', + step: 2, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[3].editStatus, + status: data.apply.projDevCompleteDate?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, + canBtnClick: false, handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step4/${pathParams.projId}`) + if (generateStatus != GenerateStatus.SUCCESS) { + nav(`/proj-edit/step2/${pathParams.projId}`) } else { - nav(`/proj-edit/step4-show/${pathParams.projId}`) - } - } - }, - { - title: '申请人信息', - desc: '请完善申请人信息', - step: 5, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[4].editStatus, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step5/${pathParams.projId}`) - } else { - nav(`/proj-edit/step5-show/${pathParams.projId}`) + nav(`/proj-edit/step2-show/${pathParams.projId}`) } } }, + // { + // title: '著作人信息', + // desc: '请完善著作人相关信息', + // step: 4, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[3].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step4/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step4-show/${pathParams.projId}`) + // } + // } + // }, + // { + // title: '申请人信息', + // desc: '请完善申请人信息', + // step: 5, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[4].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step5/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step5-show/${pathParams.projId}`) + // } + // } + // }, ) setEditStepArray(editStepArray); setIsEditStepEdited(isEdited); @@ -80,15 +95,10 @@ export default function ProjEditAll() { messageApi: messageApi, url: `/api/proj/get/${pathParams.projId}`, onSuccess({data}) { - const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED - && data.editSteps[1].editStatus == EditStepEnum.EDITED - && data.editSteps[2].editStatus == EditStepEnum.EDITED - && data.editSteps[3].editStatus == EditStepEnum.EDITED - && data.editSteps[4].editStatus == EditStepEnum.EDITED - && data.editSteps[5].editStatus == EditStepEnum.EDITED; + const isEdited = Boolean(data.projIntroduction) == true && Boolean(data.apply.projDevCompleteDate) == true && Boolean(data.apply.envHardDev) == true && Boolean(data.loginpage.loginpageId) == true const isConfig = data.loginpage.loginpageId && MAX_MOD_SIZE > 0; const isGenerateSuccess: boolean = data.generate.generateStatus == GenerateStatus.SUCCESS; - renderEditStep(data.editSteps, isEdited, isGenerateSuccess); + renderEditStep(data, isEdited, isGenerateSuccess); setIsConfigEdited(isConfig); setGenerateStatus(data.generate.generateStatus); setPreviewUrl(data.previewUrl); diff --git a/src/route/proj/ProjEditFree.tsx b/src/route/proj/ProjEditFree.tsx index 7ef42b0..031ed2f 100644 --- a/src/route/proj/ProjEditFree.tsx +++ b/src/route/proj/ProjEditFree.tsx @@ -27,7 +27,7 @@ export default function ProjEdit() { // const height = window.innerHeight - 240; - const renderEditStep = (editSteps: any[], isEdited: boolean, isGenerateSuccess: boolean) => { + const renderEditStep = (data: any, isEdited: boolean, isGenerateSuccess: boolean) => { const editStepArray: IProjEdit[] = []; editStepArray.push( { @@ -35,7 +35,7 @@ export default function ProjEdit() { desc: '完善代码、样式类型和详细介绍等内容', step: 1, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[0].editStatus, + status: data.projIntroduction?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/step1/${pathParams.projId}`) @@ -49,7 +49,7 @@ export default function ProjEdit() { desc: '完善项目简介、编程语言、版本、公司等内容', step: 2, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[1].editStatus, + status: data.apply.projDevCompleteDate?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, canBtnClick: false, handleEdit() { if (generateStatus != GenerateStatus.SUCCESS) { @@ -64,7 +64,7 @@ export default function ProjEdit() { desc: '请完善软件功能特点', step: 3, btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[2].editStatus, + status: data.apply.envHardDev?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, canBtnClick: false, handleEdit() { if (!isGenerateSuccess) { @@ -74,64 +74,15 @@ export default function ProjEdit() { } } }, - { - title: '著作人信息', - desc: '请完善著作人相关信息', - step: 4, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[3].editStatus, - canBtnClick: false, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step4/${pathParams.projId}`) - } else { - nav(`/proj-edit/step4-show/${pathParams.projId}`) - } - } - }, - { - title: '申请人信息', - desc: '请完善申请人信息', - step: 5, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[4].editStatus, - canBtnClick: false, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step5/${pathParams.projId}`) - } else { - nav(`/proj-edit/step5-show/${pathParams.projId}`) - } - } - }, - { - title: '选择登录页面', - desc: '选择软件的登录页面模板', - step: 6, - btnName: !isGenerateSuccess ? '设置' : '查看', - status: editSteps[5].editStatus, - handleEdit() { - if (!isGenerateSuccess) { - nav(`/proj-edit/step6/${pathParams.projId}`) - } else { - nav(`/proj-edit/step6-show/${pathParams.projId}`) - } - } - } - ) - setEditStepArray(editStepArray); - setIsEditStepEdited(isEdited); - } - - const renderSetting = (data: any, isConfig: boolean, isGenerateSuccess: boolean) => { - const configArray: IProjEdit[] = []; - configArray.push( { title: '登录界面设置', desc: '请对登录界面完成个性化设置', step: 1, btnName: !isGenerateSuccess ? '设置' : '查看', - status: data.loginpage.loginpageId ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT, + canBtnClick: false, + + // 状态判断lyp + status:data.loginpage.loginpageId?EditStepEnum.EDITED:EditStepEnum.UN_EDIT, handleEdit() { if (!isGenerateSuccess) { nav(`/proj-edit/config-loginpage/${pathParams.projId}`) @@ -140,6 +91,72 @@ export default function ProjEdit() { } } }, + // { + // title: '著作人信息', + // desc: '请完善著作人相关信息', + // step: 4, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[3].editStatus, + // canBtnClick: false, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step4/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step4-show/${pathParams.projId}`) + // } + // } + // }, + // { + // title: '申请人信息', + // desc: '请完善申请人信息', + // step: 5, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[4].editStatus, + // canBtnClick: false, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step5/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step5-show/${pathParams.projId}`) + // } + // } + // }, + // { + // title: '选择登录页面', + // desc: '选择软件的登录页面模板', + // step: 6, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: editSteps[5].editStatus, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/step6/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/step6-show/${pathParams.projId}`) + // } + // } + // } + ) + setEditStepArray(editStepArray); + setIsEditStepEdited(isEdited); + } + + const renderSetting = (data: any, isConfig: boolean, isGenerateSuccess: boolean) => { + const configArray: IProjEdit[] = []; + configArray.push( + // { + // title: '登录界面设置', + // desc: '请对登录界面完成个性化设置', + // step: 1, + // btnName: !isGenerateSuccess ? '设置' : '查看', + // status: data.loginpage.loginpageId ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT, + // handleEdit() { + // if (!isGenerateSuccess) { + // nav(`/proj-edit/config-loginpage/${pathParams.projId}`) + // } else { + // nav(`/proj-edit/config-loginpage-show/${pathParams.projId}`) + // } + // } + // }, { title: '系统菜单管理', desc: '请对系统菜单进行设置', @@ -178,12 +195,16 @@ export default function ProjEdit() { messageApi: messageApi, url: `/api/proj/get/${pathParams.projId}`, onSuccess({ data }) { - const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED - && data.editSteps[5].editStatus == EditStepEnum.EDITED; + // const isEdited = data.editSteps[0].editStatus == EditStepEnum.EDITED + // && data.editSteps[5].editStatus == EditStepEnum.EDITED; + // console.log(data); + + const isEdited = Boolean(data.projIntroduction) && Boolean(data.loginpage.loginpageId) == true + // console.log('isEdited',isEdited); const isConfig = data.loginpage.loginpageId && data.projModCount > MAX_MOD_SIZE_FREE; const isGenerate = isEdited && isConfig; const isGenerateSuccess: boolean = data.generate.generateStatus == GenerateStatus.SUCCESS; - renderEditStep(data.editSteps, isEdited, isGenerateSuccess); + renderEditStep(data, isEdited, isGenerateSuccess); renderSetting(data, isConfig, isGenerateSuccess); setCanGenerate(isGenerate); setGenerateStatus(data.generate.generateStatus); @@ -244,7 +265,6 @@ export default function ProjEdit() { background={item.status == EditStepEnum.EDITED ? '#F5FEFA' : '#f3f3f3'} shadow={item.status == EditStepEnum.EDITED ? ' 0px 3px 0px 0px rgba(55,215,138,0.18)' : ''} - /> }) } diff --git a/src/route/proj/ProjNew.tsx b/src/route/proj/ProjNew.tsx index 88b5e71..3157a4f 100644 --- a/src/route/proj/ProjNew.tsx +++ b/src/route/proj/ProjNew.tsx @@ -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 - 180; const [isCreateModalOpen, setIsCreateModalOpen] = useState(false); const [isEditModalOpen, setIsEditModalOpen] = useState(false); const [chargePrice, setChargePrice] = useState(0); @@ -91,7 +91,7 @@ export default function ProjNew() { {title: '新建项目'}, ]} /> */} -
    +
    {/*
    请完善项目的基本信息
    */}
    @@ -132,19 +132,25 @@ export default function ProjNew() {
    - diff --git a/src/route/proj/edit/ProjConfigLoginpage.tsx b/src/route/proj/edit/ProjConfigLoginpage.tsx index 827edd9..5676ec7 100644 --- a/src/route/proj/edit/ProjConfigLoginpage.tsx +++ b/src/route/proj/edit/ProjConfigLoginpage.tsx @@ -2,13 +2,13 @@ import './proj-config-loginpage.css'; import { Col, - Flex, + // Flex, GetProp, Input, message, Modal, Row, - Space, + // Space, Spin, Upload, UploadFile, @@ -18,6 +18,7 @@ import { useNavigate, useParams } from "react-router-dom"; import { useEffect, useState } from "react"; import { DevUserId, get, downloadUrl, put, uploadImageUrl, post } from "../../../util/AjaxUtils.ts"; import { Button, Form } from 'antd'; +import CardImgSelect, { } from "../../../components/card/CardImgSelect.tsx"; type FormFieldType = { loginpageId: string; @@ -43,7 +44,10 @@ export default function ProjConfigLoginpage() { const [bgImgArray, setBgImgArray] = useState([]); const [iframeSrcDoc, setIframeSrcDoc] = useState(); const height = window.innerHeight - 180; - + const [loginpageArray, setloginpageArray] = useState([]) + const [selectedLoginpageId, setSelectedLoginpageId] = useState(''); + // 若无选择的背景 默认的第一个图片的背景 + // const [defaultId, setDefaultId] = useState('') const beforeUpload = (file: FileType) => { const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; if (!isJpgOrPng) { @@ -55,10 +59,42 @@ export default function ProjConfigLoginpage() { const preview = () => { post({ messageApi, - url: '/api/proj/preview', + url: `/api/proj/preview/${pathParams.projId}`, body: { - projId: pathParams.projId, - loginpageId: form.getFieldValue('loginpageId'), + // projId: pathParams.projId, + loginpageId: selectedLoginpageId, + logo: logoImgArray.length > 0 ? logoImgArray[0].uid : '', + bgImgs: bgImgArray.length > 0 ? bgImgArray[0].uid : '', + subTitle: form.getFieldValue('subTitle'), + copyrightOwner: form.getFieldValue('copyrightOwner'), + copyrightDate: form.getFieldValue('copyrightDate'), + }, + onSuccess({ data }) { + setIframeSrcDoc(data.data); + console.log(data); + + } + }) + } + const getlistLoginpage = () => { + get({ + messageApi, + url: '/api/loginpage/list', + onSuccess({ data }) { + console.log('登录页图片列表', data); + setloginpageArray(data) + // setDefaultId(data[0].loginpageId) + upLoginPage(data[0].loginpageId) + } + }) + } + const upLoginPage = (id: string) => { + post({ + messageApi, + url: `/api/proj/preview/${pathParams.projId}`, + body: { + // projId: pathParams.projId, + loginpageId: id, logo: logoImgArray.length > 0 ? logoImgArray[0].uid : '', bgImgs: bgImgArray.length > 0 ? bgImgArray[0].uid : '', subTitle: form.getFieldValue('subTitle'), @@ -70,12 +106,14 @@ export default function ProjConfigLoginpage() { } }) } - useEffect(() => { + getlistLoginpage() get({ messageApi, url: `/api/proj/get/config-loginpage/${pathParams.projId}`, onSuccess({ data }) { + console.log('寻找被选中id', data); + setSelectedLoginpageId(data.loginpageId); form.setFieldValue('loginpageId', data.loginpageId); form.setFieldValue('subTitle', data.subTitle); form.setFieldValue('copyrightOwner', data.copyrightOwner); @@ -108,7 +146,13 @@ export default function ProjConfigLoginpage() { ...bgImgArray ]) } - preview(); + // preview() + if (data.loginpageId) { + upLoginPage(data.loginpageId) + + } else { + getlistLoginpage(); + } } }) @@ -125,22 +169,32 @@ export default function ProjConfigLoginpage() { {title: '登录界面设置'}, ]} /> */} -
    -
    +
    +
    -
    +