fix: 修改页面布局
This commit is contained in:
parent
c8f251a4a2
commit
cac4384184
@ -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' },
|
||||
|
@ -103,6 +103,8 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @name request 配置,可以配置错误处理
|
||||
* 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
|
||||
|
@ -76,6 +76,7 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre
|
||||
[setInitialState],
|
||||
);
|
||||
|
||||
|
||||
const loading = (
|
||||
<span className={styles.action}>
|
||||
<Spin
|
||||
|
@ -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}>
|
||||
|
@ -48,8 +48,7 @@ const AnalysisCenter: React.FC = () => {
|
||||
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
||||
const messagesEndRef = useRef<null | HTMLDivElement>(null);
|
||||
|
||||
const analysisOptions = [
|
||||
{ value: 'predictive', label: '预测性分析', icon: <LineChartOutlined />, color: '#1890ff' },
|
||||
const analysisOptions = [
|
||||
{ value: 'descriptive', label: '描述性统计', icon: <BarChartOutlined />, color: '#52c41a' },
|
||||
{ value: 'anomaly', label: '异常检测', icon: <PieChartOutlined />, color: '#faad14' },
|
||||
{ value: 'quality', label: '数据质量分析', icon: <AreaChartOutlined />, color: '#722ed1' },
|
||||
|
Loading…
x
Reference in New Issue
Block a user