Compare commits

...

2 Commits

Author SHA1 Message Date
86b97db885 优化 2025-10-20 15:43:13 +08:00
0545433c64 根据当下需求优化 2025-10-17 19:32:46 +08:00
11 changed files with 74 additions and 29 deletions

View File

@ -1,2 +1,3 @@
window.BACKEND_ADDRESS = "http://localhost:8080";
//window.BACKEND_ADDRESS = "http://43.138.83.20:10001";
window.BACKEND_TIMEOUT = 10000;

View File

@ -10,15 +10,15 @@ const CourseTypeTag = (props) => {
useEffect(() => {
if (courseNature === '01') {
setColor('green');
setText('公共必修');
setText('公共');
}
if (courseNature === '02') {
setColor('blue');
setText('院选修');
setText('专业课');
}
if (courseNature === '03') {
setColor('purple');
setText('专业必修');
setText('校选课');
}
}, [props]);

View File

@ -1,5 +1,6 @@
const baseWebConfig ={
baseUrl: 'http://localhost:8080',
//baseUrl: 'http://43.138.83.20:10001',
timeout: 10000,
}

View File

@ -76,7 +76,7 @@ const ImportDataDrawer = props => {
labelAlign={'left'}
onFinish={onFinish}
>
<Form.Item
{/*<Form.Item
label={'起始年度'}
name={'startYear'}
labelCol={{span: 6}}
@ -100,7 +100,7 @@ const ImportDataDrawer = props => {
<Radio value={1}>第一学期</Radio>
<Radio value={2}>第二学期</Radio>
</Radio.Group>
</Form.Item>
</Form.Item>*/}
<Form.Item
name={'file'}
label={'数据文件'}

View File

@ -16,15 +16,15 @@ const ContentConfig = props => {
let text = '';
if (courseNature === '01') {
color = 'green';
text = '公共必修';
text = '公共';
}
if (courseNature === '02') {
color = 'blue';
text = '院选修';
text = '专业课';
}
if (courseNature === '03') {
color = 'purple';
text = '专业必修';
text = '校选课';
}
return (
<Tag color={color} key={courseNature}>
@ -173,7 +173,7 @@ const ContentConfig = props => {
{contentHolder}
<Flex vertical justify={"start"} align={"start"} gap={"middle"}>
<div>
<Title level={4}>内容配置</Title>
<Title level={4}>内容配置</Title>
<Text level={4}
type={'secondary'}>选择您想体现在证明上的工作量数据无论是课时证明还是任职后工作情况证明都将会通过您的选择进而渲染合适的数据到您需要的报告中</Text>
</div>

View File

@ -54,9 +54,9 @@ const ParameterConfig = props => {
}}
>
<Form.Item
label={"证类型"}
label={"证类型"}
name='recordType'
rules={[{required: true, message: '请选择证类型'}]}
rules={[{required: true, message: '请选择证类型'}]}
>
<Radio.Group
onChange={(event) => {
@ -102,7 +102,7 @@ const ParameterConfig = props => {
]}
/>
</Form.Item>
<Form.Item
{/*<Form.Item
label={"总工作量"}
name='total'
hidden={hideWorkloadParam}
@ -162,7 +162,7 @@ const ParameterConfig = props => {
}
}}
/>
</Form.Item>
</Form.Item>*/}
</Form>
</div>
</Flex>

View File

@ -7,15 +7,15 @@ const generateTag = (courseNature) => {
let text = '';
if (courseNature === '01') {
color = 'green';
text = '公共必修';
text = '公共';
}
if (courseNature === '02') {
color = 'blue';
text = '院选修';
text = '专业课';
}
if (courseNature === '03') {
color = 'purple';
text = '专业必修';
text = '校选课';
}
return (
<Tag color={color} key={courseNature}>

View File

@ -44,12 +44,12 @@ const GenerateCertificate = props => {
description: '选择生成证书的用户',
},
{
title: '证参数配置',
description: '证类型、参数配置',
title: '证参数配置',
description: '证类型、参数配置',
},
{
title: '证内容配置',
description: '选择证的工作量记录',
title: '证内容配置',
description: '选择证的工作量记录',
},
{
title: '数据确认',

View File

@ -95,13 +95,13 @@ const AddUserDrawer = props => {
>
<Input placeholder="请输入学院"/>
</Form.Item>
<Form.Item
{/*<Form.Item
label="专业"
name="department"
rules={[{required: true, message: '请输入专业名称'}]}
>
<Input placeholder="请输入专业"/>
</Form.Item>
</Form.Item>*/}
{/*<Form.Item
label="研究室"
name="researchRoom"

View File

@ -28,13 +28,13 @@ const UserInfoTableColumn = (openUserInfoDetails) => [
responsive: ['lg'],
render: (text) => <span key={text}>{text}</span>
},
{
title: '专业',
dataIndex: 'department',
key: 'department',
responsive: ['lg'],
render: (text) => <span key={text}>{text}</span>
},
//{
// title: '专业',
// dataIndex: 'department',
// key: 'department',
// responsive: ['lg'],
// render: (text) => <span key={text}>{text}</span>
//},
//{
// title: '研究室',
// dataIndex: 'researchRoom',

View File

@ -0,0 +1,43 @@
import { useEffect, useLocation, useNavigate } from 'react-router-dom';
/**
* 自动修正路径中的多余斜杠(如 /path/ → /path//path → /path
* 确保 React Router 能正确匹配路由,避免因斜杠问题导致 404/403
*/
const RouteSlashFix = () => {
// 获取当前路径信息
const location = useLocation();
// 用于导航的方法
const navigate = useNavigate();
useEffect(() => {
const { pathname, search, hash } = location;
let fixedPath = pathname;
// 修正1去除末尾多余的斜杠根路径 / 除外)
if (fixedPath !== '/' && fixedPath.endsWith('/')) {
fixedPath = fixedPath.slice(0, -1); // 例如 /data-check/ → /data-check
}
// 修正2去除路径中间的连续斜杠如 //data-check → /data-check/data//check → /data/check
if (fixedPath.includes('//')) {
fixedPath = fixedPath.replace(/\/+/g, '/'); // 多个斜杠替换为一个
}
// 如果路径有修正,更新路由(不改变用户看到的 URL 显示)
if (fixedPath !== pathname) {
navigate(
{ pathname: fixedPath, search, hash }, // 修正后的路径
{
replace: true, // 替换历史记录,避免回退时重复跳转
state: location.state // 保留原路由状态(如传递的参数)
}
);
}
}, [location, navigate]); // 仅当路径变化时执行
// 该组件不渲染任何内容,仅处理路径修正逻辑
return null;
};
export default RouteSlashFix;