diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 2853853..69313ea 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -12,7 +12,6 @@ import Login from "@/pages/Login"; import SimpleSSOPassthrough from "@/pages/Login/SSO/simple"; import OnboardingFlow from "@/pages/OnboardingFlow"; import i18n from "./i18n"; - import { PfpProvider } from "./PfpContext"; import { LogoProvider } from "./LogoContext"; import { FullScreenLoader } from "./components/Preloader"; @@ -23,13 +22,8 @@ const Home = lazy(() => import("@/pages/Home")); // 新首页 const PolicyLibrary = lazy(() => import("@/pages/PolicyLibrary")); // 政策库 const DataAnalysis = lazy(() => import("@/pages/DataAnalysis")); // 数据分析 const Tendency = lazy(() => import("@/pages/Tendency")); // 趋势洞察 -const Yuqingfenxi = lazy(() => import("@/pages/Yuqingfenxi")); // 分析详情 -const Economics = lazy(() => import("@/pages/Economics")); // 经济发展 -const Talents = lazy(() => import("@/pages/Talents")); // 人才分析 -const Industry = lazy(() => import("@/pages/Industry")); // 产业分析 -const TrendPrediction = lazy(() => import("@/pages/TrendPrediction")); // 趋势预测 const ReportGeneration = lazy(() => import("@/pages/ReportGeneration")); // 报告生成 -const Report = lazy(() => import("@/pages/Report")); // 报告生成1 +const GeneralView = lazy(() => import("@/pages/GeneralView")); // 数据详情 const InvitePage = lazy(() => import("@/pages/Invite")); const WorkspaceChat = lazy(() => import("@/pages/WorkspaceChat")); @@ -111,38 +105,18 @@ export default function App() { path="/home/Tendency" element={} /> - } - /> - } - /> - } - /> - } - /> - } - /> } + /> + } /> } /> - } - /> } /> {titleCase(user.role)} - {user.createdAt} + {new Date(user.createdAt).toLocaleDateString()} {canModify && ( { if (e.url) { - navigate(e.url) + navigate(e.url,{state:{address:e.address}}) } else { message.info({ content: e.name + '开发中...' diff --git a/frontend/src/pages/Economics/index.jsx b/frontend/src/pages/GeneralView/index.jsx similarity index 62% rename from frontend/src/pages/Economics/index.jsx rename to frontend/src/pages/GeneralView/index.jsx index a55cff3..3484478 100644 --- a/frontend/src/pages/Economics/index.jsx +++ b/frontend/src/pages/GeneralView/index.jsx @@ -1,8 +1,12 @@ import React, { useEffect, useState, useRef } from 'react'; +import { useLocation } from 'react-router-dom'; +import { Spin } from 'antd'; +function GeneralView() { + const location = useLocation(); + const { address } = location.state || {}; + console.log(2222, address); -function Economics() { const iframeRef = useRef(null); - useEffect(() => { if (iframeRef.current) { iframeRef.current.contentWindow.addEventListener('message', (event) => { @@ -21,10 +25,12 @@ function Economics() { return ( - ; + + ; + ) } -export default Economics; +export default GeneralView; diff --git a/frontend/src/pages/Home/home.css b/frontend/src/pages/Home/home.css index e6e9750..35fe803 100644 --- a/frontend/src/pages/Home/home.css +++ b/frontend/src/pages/Home/home.css @@ -27,10 +27,10 @@ position: absolute; left: 0; right: 0; - top: 16px; + top: 9px; margin: auto; font-weight: bold; - font-size: 26px; + font-size: 36px; letter-spacing: 4px; color: transparent; @@ -124,4 +124,4 @@ .lunType2:hover { color: #00f8b0; background-image: url('./img/11.png'); -} \ No newline at end of file +} diff --git a/frontend/src/pages/Home/index.jsx b/frontend/src/pages/Home/index.jsx index 4032e03..b742e55 100644 --- a/frontend/src/pages/Home/index.jsx +++ b/frontend/src/pages/Home/index.jsx @@ -44,7 +44,7 @@ export default function Home() { { type: 1, url: '/home/DataAnalysis', - name: '数据分析', + name: '智析中心', icon: icon1, }, { @@ -56,19 +56,19 @@ export default function Home() { { type: 1, url: '/home/ReportGeneration', - name: '报告生成', + name: '智汇报告', icon: icon2, }, { type: 2, url: '', - name: '文件上传', + name: '智策融汇', icon: icon6, }, { type: 1, url: '/home/PolicyLibrary', - name: '政策库', + name: '政策智库', icon: icon5, }, { @@ -121,7 +121,7 @@ export default function Home() { - 阿拉善盟AI行政数据分析与决策参考系统 + 阿拉善盟AI智策中枢 {time} diff --git a/frontend/src/pages/Industry/index.jsx b/frontend/src/pages/Industry/index.jsx deleted file mode 100644 index b72e973..0000000 --- a/frontend/src/pages/Industry/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; - -function Industry() { - const iframeRef = useRef(null); - - useEffect(() => { - if (iframeRef.current) { - iframeRef.current.contentWindow.addEventListener('message', (event) => { - console.log(11111, event.data); - }); - } - - return () => { - if (iframeRef.current) { - iframeRef.current.contentWindow.removeEventListener('message', (event) => { - console.log('Received message:', event.data); - }); - } - }; - }, []); // 空依赖数组确保只运行一次清理操作 - - return ( - - ; - - ) - -} - -export default Industry; diff --git a/frontend/src/pages/Report/index.jsx b/frontend/src/pages/Report/index.jsx deleted file mode 100644 index ec6d213..0000000 --- a/frontend/src/pages/Report/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; - -function Report() { - const iframeRef = useRef(null); - - useEffect(() => { - if (iframeRef.current) { - iframeRef.current.contentWindow.addEventListener('message', (event) => { - console.log(11111, event.data); - }); - } - - return () => { - if (iframeRef.current) { - iframeRef.current.contentWindow.removeEventListener('message', (event) => { - console.log('Received message:', event.data); - }); - } - }; - }, []); // 空依赖数组确保只运行一次清理操作 - - return ( - - ; - - ) - -} - -export default Report; diff --git a/frontend/src/pages/ReportGeneration/index.jsx b/frontend/src/pages/ReportGeneration/index.jsx index 9b9c6c5..0c25e7b 100644 --- a/frontend/src/pages/ReportGeneration/index.jsx +++ b/frontend/src/pages/ReportGeneration/index.jsx @@ -19,7 +19,8 @@ function IframeComponent() { name: '报告生成', text: '根据分析结果和用户需求,自动生成各类报告,并支持多种输出格式。', img: tu17, - url: '/home/Report' + url: '/home/GeneralView', + address: 'http://ds1.chenhaitech.com/chat/9miqAsKQCQjCOATH' }, { name: '报告模板', @@ -45,15 +46,15 @@ function IframeComponent() { const bindUrl = (e) => { if (e.url) { - navigate(e.url) + navigate(e.url,{state:{address:e.address}}) } else { - message.info({ - content: e.name + '开发中...' - }) + message.info({ + content: e.name + '开发中...' + }) } -} + } - const bindUrl1 = () =>{ + const bindUrl1 = () => { window.location = '/' } diff --git a/frontend/src/pages/Talents/index.jsx b/frontend/src/pages/Talents/index.jsx deleted file mode 100644 index 41c6ada..0000000 --- a/frontend/src/pages/Talents/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; - -function Talents() { - const iframeRef = useRef(null); - - useEffect(() => { - if (iframeRef.current) { - iframeRef.current.contentWindow.addEventListener('message', (event) => { - console.log(11111, event.data); - }); - } - - return () => { - if (iframeRef.current) { - iframeRef.current.contentWindow.removeEventListener('message', (event) => { - console.log('Received message:', event.data); - }); - } - }; - }, []); // 空依赖数组确保只运行一次清理操作 - - return ( - - ; - - ) - -} - -export default Talents; diff --git a/frontend/src/pages/Tendency/index.jsx b/frontend/src/pages/Tendency/index.jsx index 18b7193..e436101 100644 --- a/frontend/src/pages/Tendency/index.jsx +++ b/frontend/src/pages/Tendency/index.jsx @@ -9,14 +9,14 @@ import tu14 from '../DataAnalysis/img/14.png' import tu15 from '../DataAnalysis/img/15.png' function Tendency() { - const [renderKey, setRenderKey] = useState(); const navigate = useNavigate(); const list = [ { name: '趋势预测', text: '利用机器学习算法对历史数据进行分析,预测未来一段时间内的数据变化趋势,如经济发展、人口流动、环境状况等。', img: tu13, - url: '/home/TrendPrediction' + url: '/home/GeneralView', + address: 'http://ds1.chenhaitech.com/chat/TBbQM3inivFUO1yT' }, { name: '异常监测', @@ -36,13 +36,13 @@ function Tendency() { const bindUrl = (e) => { if (e.url) { - navigate(e.url) + navigate(e.url, { state: { address: e.address } }) } else { - message.info({ - content: e.name + '开发中...' - }) + message.info({ + content: e.name + '开发中...' + }) } -} + } const bindUrl1 = () => { window.location = '/' diff --git a/frontend/src/pages/TrendPrediction/index.jsx b/frontend/src/pages/TrendPrediction/index.jsx deleted file mode 100644 index ed29627..0000000 --- a/frontend/src/pages/TrendPrediction/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; - -function TrendPrediction() { - const iframeRef = useRef(null); - - useEffect(() => { - if (iframeRef.current) { - iframeRef.current.contentWindow.addEventListener('message', (event) => { - console.log(11111, event.data); - }); - } - - return () => { - if (iframeRef.current) { - iframeRef.current.contentWindow.removeEventListener('message', (event) => { - console.log('Received message:', event.data); - }); - } - }; - }, []); // 空依赖数组确保只运行一次清理操作 - - return ( - - ; - - ) - -} - -export default TrendPrediction; diff --git a/frontend/src/pages/Yuqingfenxi/index.jsx b/frontend/src/pages/Yuqingfenxi/index.jsx deleted file mode 100644 index 96c7155..0000000 --- a/frontend/src/pages/Yuqingfenxi/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; - -function Yuqingfenxi() { - const iframeRef = useRef(null); - - useEffect(() => { - if (iframeRef.current) { - iframeRef.current.contentWindow.addEventListener('message', (event) => { - console.log(11111, event.data); - }); - } - - return () => { - if (iframeRef.current) { - iframeRef.current.contentWindow.removeEventListener('message', (event) => { - console.log('Received message:', event.data); - }); - } - }; - }, []); // 空依赖数组确保只运行一次清理操作 - - return ( - - ; - - ) - -} - -export default Yuqingfenxi; diff --git a/frontend/src/utils/paths.js b/frontend/src/utils/paths.js index 8f3bed8..d37179b 100644 --- a/frontend/src/utils/paths.js +++ b/frontend/src/utils/paths.js @@ -17,30 +17,15 @@ export default { Tendency: () => { return "/home/Tendency"; }, - Yuqingfenxi: () => { - return "/home/Yuqingfenxi"; - }, - Economics: () => { - return "/home/Economics"; - }, - TrendPrediction: () => { - return "/home/TrendPrediction"; - }, - Industry: () => { - return "/home/Industry"; - }, - Talents: () => { - return "/home/Talents"; - }, DataAnalysis: () => { return "/home/DataAnalysis"; }, ReportGeneration:() =>{ return "/home/ReportGeneration"; }, - Report:() =>{ - return "/home/Report"; - } + GeneralView:() =>{ + return "/home/GeneralView"; + }, }, onboarding: { home: () => {