This commit is contained in:
xixi 2024-05-22 16:18:38 +08:00
parent d5d4e1bae5
commit 8a9c5c7fba
4 changed files with 144 additions and 126 deletions

View File

@ -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()}
</div>
<div className="page" >
<Pagination defaultCurrent={page} total={total} defaultPageSize={20} onChange={(page) => {
<Pagination defaultCurrent={page} total={total} defaultPageSize={10} onChange={(page) => {
reqData(page);
// setPage(page);
}} />

View File

@ -204,8 +204,8 @@ export default function Index() {
} else if (location.pathname.includes('/proj-create')) {
setNow('创建项目')
setPathArray([{ title: <Link to={'/home'}></Link> }, { 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: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: '编辑项目' }])
@ -251,7 +251,11 @@ export default function Index() {
}else if (location.pathname.includes('/proj-edit/config-mod-edit')) {
setNow('编辑菜单')
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-2) }}></a> },{ title: <a onClick={() => { nav(-1) }}></a> }, { title: '编辑菜单' }])
// /config-mod-edit
// /config-mod-edit /config-mod-show
}else if (location.pathname.includes('/proj-edit/config-mod-show')) {
setNow('查看菜单')
setPathArray([{ title: <Link to={'/home'}></Link> }, { title: <Link to={'/proj-create'}></Link> }, { title: <a onClick={() => { nav(-2) }}></a> },{ title: <a onClick={() => { nav(-1) }}></a> }, { title: '查看菜单' }])
// /config-mod-edit
}
}, [location.pathname])
useEffect(() => {

View File

@ -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 (
<>
{
<Button type="primary" size="small"
style={{ marginRight: '5px' }}
onClick={() => {
if (props.isFree) {
nav(`/proj-edit/config-mod-fedit/${pathParams.projId}/${record.projModId}`)
} else {
nav(`/proj-edit/config-mod-edit/${pathParams.projId}/${record.projModId}`)
}
}}>
<EditOutlined />
</Button>
{/* {
modSize < maxSize ? (
<Button type="primary" size="small"
style={{marginRight: '5px'}}
onClick={() => {
if(props.isFree) {
nav(`/proj-edit/config-mod-fedit/${pathParams.projId}/${record.projModId}`)
} else {
nav(`/proj-edit/config-mod-edit/${pathParams.projId}/${record.projModId}`)
}
}}>
<EditOutlined/>
style={{ marginRight: '5px' }}
onClick={() => {
if (props.isFree) {
nav(`/proj-edit/config-mod-fedit/${pathParams.projId}/${record.projModId}`)
} else {
nav(`/proj-edit/config-mod-edit/${pathParams.projId}/${record.projModId}`)
}
}}>
<EditOutlined />
</Button>
) : (
<Button type="default" size="small"
style={{marginRight: '5px'}}
onClick={() => {
if(props.isFree) {
nav(`/proj-edit/config-mod-fshow/${pathParams.projId}/${record.projModId}`)
} else {
nav(`/proj-edit/config-mod-show/${pathParams.projId}/${record.projModId}`)
}
}}>
<SearchOutlined/>
style={{ marginRight: '5px' }}
onClick={() => {
if (props.isFree) {
nav(`/proj-edit/config-mod-fshow/${pathParams.projId}/${record.projModId}`)
} else {
nav(`/proj-edit/config-mod-show/${pathParams.projId}/${record.projModId}`)
}
}}>
<EditOutlined />
</Button>
)
}
} */}
<Button value="large" type="primary" size="small" danger
onClick={() => {
del({
messageApi,
url: `/api/proj-mod/remove/proj-id/${pathParams.projId}/${record.projModId}`,
onSuccess() {
messageApi.success('删除成功');
renderData();
}
})
}}
><DeleteOutlined/></Button>
onClick={() => {
del({
messageApi,
url: `/api/proj-mod/remove/proj-id/${pathParams.projId}/${record.projModId}`,
onSuccess() {
messageApi.success('删除成功');
renderData();
}
})
}}
><DeleteOutlined /></Button>
</>
)
}
@ -161,25 +172,25 @@ export default function ProjConfigModList(props: PropType) {
{title: '系统菜单管理'},
]}
/> */}
<div className="mod-list-container" style={{height: `${height}px`, marginTop:'17px'}}>
<Alert message={`菜单指的是系统的功能,最少${minSize}个菜单,最多${maxSize}个菜单`} type="info"/>
<div className="mod-list-container" style={{ height: `${height}px`, marginTop: '17px' }}>
<Alert message={`菜单指的是系统的功能,最少${minSize}个菜单,最多${maxSize}个菜单`} type="info" />
<div className="mod-list">
<div className="table-btn-group">
{
modSize < maxSize ? (
<Button value="small" onClick={() => {
if(props.isFree) {
if (props.isFree) {
nav(`/proj-edit/config-mod-fsave/${pathParams.projId}`)
} else {
nav(`/proj-edit/config-mod-save/${pathParams.projId}`)
}
}}><PlusOutlined/> </Button>
}}><PlusOutlined /> </Button>
) : <></>
}
</div>
<Table columns={columns} dataSource={dataArray} pagination={{pageSize: 20}}
scroll={{y: height - 210}} size="middle" bordered key="dataTable" rowKey="projModId"/>
<Table columns={columns} dataSource={dataArray} pagination={{ pageSize: 20 }}
scroll={{ y: height - 210 }} size="middle" bordered key="dataTable" rowKey="projModId" />
</div>
</div>
</>

View File

@ -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<any>({
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}
<Breadcrumb
{/* <Breadcrumb
items={[
{title: <Link to={'/'}></Link>},
{title: <Link to={'/proj-create'}></Link>},
@ -75,77 +75,80 @@ export default function ProjConfigModShow(props: PropsType) {
},
{title: '查看菜单'},
]}
/>
<div className="mod-edit-container" style={{height: `${height}px`}}>
<Alert message={`菜单指的是系统的功能,最少${minSize}个菜单,最多${maxSize}个菜单`} type="info"/>
<div className="mod-content">
<Form
name="basic"
form={form}
layout="vertical"
labelCol={{span: 8}}
wrapperCol={{span: 24}}
style={{width: '100%'}}
autoComplete="off"
>
<Row gutter={15}>
<Col span={10}>
<Form.Item<FormFieldType>
label="菜单名称"
name="modName"
extra="此内容会作为菜单名生成菜单最多8个字"
rules={[{required: true, message: '请输入菜单名称'}]}
>
<Input placeholder="请输入菜单名称" maxLength={8} readOnly/>
</Form.Item>
<Form.Item<FormFieldType>
label="菜单说明"
name="modDesc"
extra="此内容会作为功能描述生成到操作手册中请详细描述最多600字"
rules={[{required: true, message: '请输入菜单说明'}]}
>
<Input.TextArea placeholder="请输入菜单说明" rows={6} maxLength={600} readOnly/>
</Form.Item>
<Form.Item<FormFieldType>
label="菜单图标"
name="modIcon"
extra="菜单图标会显示在菜单栏中"
rules={[{required: true, message: '请输入菜单图标'}]}
>
<Button size="large"><i className={selectedModIcon}></i></Button>
</Form.Item>
</Col>
<Col span={14}>
<Form.Item<FormFieldType>
name="fields"
rules={[{required: true, message: '请添加菜单属性'}]}
>
<ModField modFiledArray={fields}
isEdit={false}
scrollHeight={height - 380}
handleChange={(dataArray) => {
if (!dataArray) {
return;
}
form.setFieldValue('fields', dataArray);
}}/>
</Form.Item>
</Col>
</Row>
/> */}
<div className="mod-edit-container" style={{ height: `${height}px`, marginTop: '17px' }}>
<div style={{ height: `${height}px`, overflow: 'auto' }}>
<Alert message={`菜单指的是系统的功能,最少${minSize}个菜单,最多${maxSize}个菜单`} type="info" />
<div className="mod-content" >
<Form
name="basic"
form={form}
layout="vertical"
labelCol={{ span: 8 }}
wrapperCol={{ span: 24 }}
style={{ width: '100%' }}
autoComplete="off"
>
<Row gutter={15}>
<Col span={10}>
<Form.Item<FormFieldType>
label="菜单名称"
name="modName"
extra="此内容会作为菜单名生成菜单最多8个字"
rules={[{ required: true, message: '请输入菜单名称' }]}
>
<Input placeholder="请输入菜单名称" maxLength={8} readOnly />
</Form.Item>
<Form.Item<FormFieldType>
label="菜单说明"
name="modDesc"
extra="此内容会作为功能描述生成到操作手册中请详细描述最多600字"
rules={[{ required: true, message: '请输入菜单说明' }]}
>
<Input.TextArea placeholder="请输入菜单说明" rows={6} maxLength={600} readOnly />
</Form.Item>
<Form.Item<FormFieldType>
label="菜单图标"
name="modIcon"
extra="菜单图标会显示在菜单栏中"
rules={[{ required: true, message: '请输入菜单图标' }]}
>
<Button size="large"><i className={selectedModIcon}></i></Button>
</Form.Item>
</Col>
<Col span={14}>
<Form.Item<FormFieldType>
name="fields"
rules={[{ required: true, message: '请添加菜单属性' }]}
>
<ModField modFiledArray={fields}
isEdit={false}
scrollHeight={height - 380}
handleChange={(dataArray) => {
if (!dataArray) {
return;
}
form.setFieldValue('fields', dataArray);
}} />
</Form.Item>
</Col>
</Row>
<Form.Item wrapperCol={{span: 24}}>
<div style={{paddingTop: '15px'}}>
<Flex align="center" justify="center" gap="large">
<Button type="default" htmlType="button" onClick={() => {
nav(-1);
}}>
</Button>
</Flex>
</div>
</Form.Item>
</Form>
<Form.Item wrapperCol={{ span: 24 }}>
<div style={{ paddingTop: '15px' }}>
<Flex align="center" justify="center" gap="large">
<Button type="default" size='large' htmlType="button" onClick={() => {
nav(-1);
}}>
</Button>
</Flex>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</>