fix: 修改页面布局

This commit is contained in:
sunhe 2025-05-08 20:15:53 +08:00
parent c8f251a4a2
commit cac4384184
5 changed files with 38 additions and 6 deletions

View File

@ -8,10 +8,10 @@ export default [
{ path: '/home', name :"首页", icon: "PieChartOutlined", component: './HomePage' },
{ path: '/add_chart', name :"智能分析", icon: "barChart", component: './AddChart' },
{ path: '/add_async', name: "异步分析", icon: "DotChartOutlined", component: './AddChartAsync' },
{ path: '/report', name: "报告中心", icon: "commentOutlined", component: './Report' },
{ path: '/code', name: "代码分析", icon: "GithubOutlined", component: './Code' },
{ path: '/Forecast', name :"分析中心", icon: "ApiOutlined", component: './Forecast' },
{ path: '/my_chart', name: "我的图表", icon: "PictureOutlined", component: './MyChart' },
{ path: '/code', name: "代码分析", icon: "GithubOutlined", component: './Code' },
{ path: '/report', name: "数据报告", icon: "commentOutlined", component: './Report' },
{ path: '/Forecast', name :"数据分析", icon: "ApiOutlined", component: './Forecast' },
{ path: '/open_platform', name :"开放中心", icon: "ApiOutlined", component: './OpenPlatform' },
{ path: '/forum', name: "交流论坛", icon: "CrownOutlined", component: './Forum' },
{ path: '/user/center', name: "个人中心", icon: "UserOutlined", component: './User/Info' },

View File

@ -103,6 +103,8 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
};
};
/**
* @name request
* axios ahooks useRequest

View File

@ -76,6 +76,7 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre
[setInitialState],
);
const loading = (
<span className={styles.action}>
<Spin

View File

@ -69,6 +69,36 @@ const CodeAnalysisPage: React.FC = () => {
message.warning('请输入或上传代码');
return;
}
setLoading(true);
try {
const response = await fetch('http://8.218.106.190:3000/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk-mw9ekhJlSj3GeGiw0hLRSHlwdkDFst8q6oBfQrW0L15QilbY'
},
body: JSON.stringify({
model: 'gpt-4o-mini',
messages: [
{
role: 'user',
content: [
{
type: 'text',
text: analysisType === 'er'
? '请分析这段代码并生成对应的ER图使用mermaid语法,用于计算机科学与技术毕业论文。分析要点1. 实体关系 2. 属性定义 3. 关系类型'
: '请分析这段代码并生成数据流图使用mermaid语法,用于计算机科学与技术毕业论文。。分析要点1. 模块划分 2. 依赖关系 3. 调用流程'
},
{
type: 'text',
text: codeContent
}
]
}
],
max_tokens: 2000
})
});
try {
const content = await sendRequest([
@ -128,7 +158,7 @@ const CodeAnalysisPage: React.FC = () => {
}}
>
<Radio.Button value="er">ER图生成</Radio.Button>
<Radio.Button value="module"></Radio.Button>
<Radio.Button value="module"></Radio.Button>
</Radio.Group>
<Tabs activeKey={activeTab} onChange={setActiveTab}>

View File

@ -49,7 +49,6 @@ const AnalysisCenter: React.FC = () => {
const messagesEndRef = useRef<null | HTMLDivElement>(null);
const analysisOptions = [
{ value: 'predictive', label: '预测性分析', icon: <LineChartOutlined />, color: '#1890ff' },
{ value: 'descriptive', label: '描述性统计', icon: <BarChartOutlined />, color: '#52c41a' },
{ value: 'anomaly', label: '异常检测', icon: <PieChartOutlined />, color: '#faad14' },
{ value: 'quality', label: '数据质量分析', icon: <AreaChartOutlined />, color: '#722ed1' },