From 8a9c5c7fbafa9bb2a25fac2b634f9a282c08b8ab Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Wed, 22 May 2024 16:18:38 +0800 Subject: [PATCH] lyp --- src/components/list/ListProj.tsx | 4 +- src/route/index/Index.tsx | 10 +- src/route/proj/edit/ProjConfigModList.tsx | 97 +++++++------ src/route/proj/edit/ProjConfigModShow.tsx | 159 +++++++++++----------- 4 files changed, 144 insertions(+), 126 deletions(-) diff --git a/src/components/list/ListProj.tsx b/src/components/list/ListProj.tsx index 01d5747..c008137 100644 --- a/src/components/list/ListProj.tsx +++ b/src/components/list/ListProj.tsx @@ -44,7 +44,7 @@ export default function ListProj() { config: { params: { page: currentPage, - rows: 20, + rows: 10, keywords: keywords, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : '' @@ -128,7 +128,7 @@ export default function ListProj() { {renderList()}
- { + { reqData(page); // setPage(page); }} /> diff --git a/src/route/index/Index.tsx b/src/route/index/Index.tsx index d040e76..57212e8 100644 --- a/src/route/index/Index.tsx +++ b/src/route/index/Index.tsx @@ -204,8 +204,8 @@ export default function Index() { } else if (location.pathname.includes('/proj-create')) { setNow('创建项目') setPathArray([{ title: 首页 }, { title: '创建项目' }]) - // /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')) { + // /config-mod-list /config-menu-list /config-mod-show + } else if (location.pathname.includes('/proj-edit')&& !location.pathname.includes('/config-mod-show')&& !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: '编辑项目' }]) @@ -251,7 +251,11 @@ export default function Index() { }else if (location.pathname.includes('/proj-edit/config-mod-edit')) { setNow('编辑菜单') setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-2) }}>编辑项目 },{ title: { nav(-1) }}>系统菜单管理 }, { title: '编辑菜单' }]) - // /config-mod-edit + // /config-mod-edit /config-mod-show + }else if (location.pathname.includes('/proj-edit/config-mod-show')) { + setNow('查看菜单') + setPathArray([{ title: 首页 }, { title: 创建项目 }, { title: { nav(-2) }}>编辑项目 },{ title: { nav(-1) }}>系统菜单管理 }, { title: '查看菜单' }]) + // /config-mod-edit } }, [location.pathname]) useEffect(() => { diff --git a/src/route/proj/edit/ProjConfigModList.tsx b/src/route/proj/edit/ProjConfigModList.tsx index 10d6246..894c9bd 100644 --- a/src/route/proj/edit/ProjConfigModList.tsx +++ b/src/route/proj/edit/ProjConfigModList.tsx @@ -1,14 +1,14 @@ import './proj-config-list-mod.css'; import { Alert, - Breadcrumb, Button, + Button, message, Table, TableProps, } from "antd"; -import {Link, useNavigate, useParams} from "react-router-dom"; -import {useEffect, useState} from "react"; -import {EditOutlined, PlusOutlined, DeleteOutlined, SearchOutlined} from "@ant-design/icons"; -import {del, get} from "../../../util/AjaxUtils.ts"; +import { useNavigate, useParams } from "react-router-dom"; +import { useEffect, useState } from "react"; +import { EditOutlined, PlusOutlined, DeleteOutlined } from "@ant-design/icons"; +import { del, get } from "../../../util/AjaxUtils.ts"; export const MAX_MOD_SIZE = 15; export const MIN_MOD_SIZE = 10 @@ -49,7 +49,7 @@ export default function ProjConfigModList(props: PropType) { projId: pathParams.projId } }, - onSuccess({data}) { + onSuccess({ data }) { setDataArray([...data]); setModSize(data.length); } @@ -96,46 +96,57 @@ export default function ProjConfigModList(props: PropType) { render: (_text, record) => { return ( <> - { + + {/* { modSize < maxSize ? ( ) : ( ) - } + } */} + onClick={() => { + del({ + messageApi, + url: `/api/proj-mod/remove/proj-id/${pathParams.projId}/${record.projModId}`, + onSuccess() { + messageApi.success('删除成功'); + renderData(); + } + }) + }} + > ) } @@ -161,25 +172,25 @@ export default function ProjConfigModList(props: PropType) { {title: '系统菜单管理'}, ]} /> */} -
- +
+
{ modSize < maxSize ? ( + }}> 新增 ) : <> }
- +
diff --git a/src/route/proj/edit/ProjConfigModShow.tsx b/src/route/proj/edit/ProjConfigModShow.tsx index ae7171b..b52319e 100644 --- a/src/route/proj/edit/ProjConfigModShow.tsx +++ b/src/route/proj/edit/ProjConfigModShow.tsx @@ -1,14 +1,14 @@ import './proj-config-list-mod.css'; import { Alert, - Breadcrumb, Button, Col, Flex, Form, Input, + Button, Col, Flex, Form, Input, message, Row, } from "antd"; -import {Link, useNavigate, useParams} from "react-router-dom"; -import {useEffect, useState} from "react"; -import ModField, {IModField} from "../../../components/modfield/ModField.tsx"; -import {get} from "../../../util/AjaxUtils.ts"; -import {MAX_MOD_SIZE, MAX_MOD_SIZE_FREE, MIN_MOD_SIZE, MIN_MOD_SIZE_FREE} from "./ProjConfigModList.tsx"; +import { useNavigate, useParams } from "react-router-dom"; +import { useEffect, useState } from "react"; +import ModField, { IModField } from "../../../components/modfield/ModField.tsx"; +import { get } from "../../../util/AjaxUtils.ts"; +import { MAX_MOD_SIZE, MAX_MOD_SIZE_FREE, MIN_MOD_SIZE, MIN_MOD_SIZE_FREE } from "./ProjConfigModList.tsx"; type FormFieldType = { projId: string; @@ -32,13 +32,13 @@ export default function ProjConfigModShow(props: PropsType) { const minSize = props.isFree ? MIN_MOD_SIZE_FREE : MIN_MOD_SIZE; const maxSize = props.isFree ? MAX_MOD_SIZE_FREE : MAX_MOD_SIZE; - const height = window.innerHeight - 180; + const height = window.innerHeight - 210; useEffect(() => { get({ messageApi, url: `api/proj-mod/get/${pathParams.projModId}`, - onSuccess({data}) { + onSuccess({ data }) { form.setFieldsValue({ projId: data.projId, modName: data.modName, @@ -55,7 +55,7 @@ export default function ProjConfigModShow(props: PropsType) { return ( <> {contextHolder} - 首页}, {title: 创建项目}, @@ -75,77 +75,80 @@ export default function ProjConfigModShow(props: PropsType) { }, {title: '查看菜单'}, ]} - /> -
- -
-
- -
- - label="菜单名称" - name="modName" - extra="此内容会作为菜单名生成菜单,最多8个字" - rules={[{required: true, message: '请输入菜单名称'}]} - > - - - - label="菜单说明" - name="modDesc" - extra="此内容会作为功能描述生成到操作手册中,请详细描述,最多600字" - rules={[{required: true, message: '请输入菜单说明'}]} - > - - - - label="菜单图标" - name="modIcon" - extra="菜单图标会显示在菜单栏中" - rules={[{required: true, message: '请输入菜单图标'}]} - > - - - - - - name="fields" - rules={[{required: true, message: '请添加菜单属性'}]} - > - { - if (!dataArray) { - return; - } - form.setFieldValue('fields', dataArray); - }}/> - - - + /> */} +
+
+ +
+ + +
+ + label="菜单名称" + name="modName" + extra="此内容会作为菜单名生成菜单,最多8个字" + rules={[{ required: true, message: '请输入菜单名称' }]} + > + + + + label="菜单说明" + name="modDesc" + extra="此内容会作为功能描述生成到操作手册中,请详细描述,最多600字" + rules={[{ required: true, message: '请输入菜单说明' }]} + > + + + + label="菜单图标" + name="modIcon" + extra="菜单图标会显示在菜单栏中" + rules={[{ required: true, message: '请输入菜单图标' }]} + > + + + + + + name="fields" + rules={[{ required: true, message: '请添加菜单属性' }]} + > + { + if (!dataArray) { + return; + } + form.setFieldValue('fields', dataArray); + }} /> + + + - -
- - - -
-
- + +
+ + + +
+
+ +