import { useState, useEffect } from "react"; import './home.css' import videoRef from "./img/bj1.mp4" import headImg from "./img/head.png" import { Carousel, message } from 'antd'; import moment from 'moment'; import icon1 from "./img/1.png" import icon2 from "./img/2.png" import icon3 from "./img/3.png" import icon4 from "./img/4.png" import icon5 from "./img/5.png" import icon6 from "./img/6.png" import icon7 from "./img/7.png" import icon8 from "./img/8.png" export default function Home() { const [data, setData] = useState(false); const weeks = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; const [renderKey, setRenderKey] = useState(1); // 链接类型:1-路由 2-链接 3-建设中 4-点击事件 const list = [ { type: 1, url: '/Main', name: 'AI问政', icon: icon3, }, { type: 1, url: '/home/DataAnalysis', name: '数据分析', icon: icon1, }, { type: 1, url: '/home/Tendency', name: '趋势洞察', icon: icon4, }, { type: 1, url: '/home/ReportGeneration', name: '报告生成', icon: icon2, }, { type: 2, url: '', name: '文件上传', icon: icon6, }, { type: 1, url: '/home/PolicyLibrary', name: '政策库', icon: icon5, }, { type: 2, url: '', name: '应用管理', icon: icon7, }, { type: 1, url: '/settings/appearance', name: '系统管理', icon: icon8, }, ] // 点击事件 const bindUrl = (e) => { console.log(1234, e); if (e.type == 1) { window.location = e.url } else { message.info({ content: e.name + '开发中...' }) } } //方法 useEffect(() => { const timer = setInterval(() => { setRenderKey(Math.random()); }, 1000); // 组件卸载清除定时器 return () => clearInterval(timer); }, []); return (
{/* 背景视频 */}
阿拉善盟AI行政数据分析与决策参考系统
{moment().format('HH:mm:ss')}
{moment().format('YYYY年MM月DD日')}
{weeks[moment().day()]}
{list.map((item, index) => (
bindUrl(item)}>
{item.name}
))}
) }