From a22c432ec12880c128e4a8d286f99a92d1a70241 Mon Sep 17 00:00:00 2001 From: qiukai <1234567@qq.com> Date: Tue, 11 Mar 2025 13:52:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 2 +- .../components/FactoryHead.jsx | 4 +- .../components/Home/centerPanel.jsx | 12 +-- .../components/Home/firstPanel.jsx | 8 +- .../components/Home/forthPanel.jsx | 8 +- .../SoftwareFactory/components/Home/index.jsx | 70 ++++---------- .../components/Home/rightContent.jsx | 96 +++++++++++-------- .../components/Home/secondPanel.jsx | 8 +- .../components/Home/thirdPanel.jsx | 8 +- .../components/ProjectStatus/ProjectCard.jsx | 30 +++--- .../components/ProjectStatus/index.jsx | 69 +++++++++++-- .../components/ProjectStatus/index.scss | 4 + src/forge/SoftwareFactory/index.jsx | 21 +++- 13 files changed, 197 insertions(+), 143 deletions(-) diff --git a/src/App.js b/src/App.js index f9fcc47e9..d27e9fefd 100644 --- a/src/App.js +++ b/src/App.js @@ -418,7 +418,7 @@ class App extends Component { }> { return () diff --git a/src/forge/SoftwareFactory/components/FactoryHead.jsx b/src/forge/SoftwareFactory/components/FactoryHead.jsx index d876ec94f..907bbcbb3 100644 --- a/src/forge/SoftwareFactory/components/FactoryHead.jsx +++ b/src/forge/SoftwareFactory/components/FactoryHead.jsx @@ -8,8 +8,8 @@ function FactoryHead(props) { return (
-
- +
+
可控开源创新中心
Controllable open source innovation center software factory work diff --git a/src/forge/SoftwareFactory/components/Home/centerPanel.jsx b/src/forge/SoftwareFactory/components/Home/centerPanel.jsx index 432f17a9c..09908811a 100644 --- a/src/forge/SoftwareFactory/components/Home/centerPanel.jsx +++ b/src/forge/SoftwareFactory/components/Home/centerPanel.jsx @@ -9,9 +9,9 @@ function CenterPanel(props) { const [weatherObj, setWetherObj] = useState({}); useEffect(() => { const timer = setInterval(() => { - //天气10分钟更新一次 + //天气5分钟更新一次 // getWether(); - }, 600000); + }, 300000); // getWether(); return () => { clearInterval(timer); @@ -53,25 +53,25 @@ function CenterPanel(props) {
- +
{weatherObj.text}
- +
{weatherObj.temp}℃
- +
{weatherObj.windDir}
- +
{weatherObj.humidity}%
diff --git a/src/forge/SoftwareFactory/components/Home/firstPanel.jsx b/src/forge/SoftwareFactory/components/Home/firstPanel.jsx index ccda048d1..ca1919a4c 100644 --- a/src/forge/SoftwareFactory/components/Home/firstPanel.jsx +++ b/src/forge/SoftwareFactory/components/Home/firstPanel.jsx @@ -69,14 +69,14 @@ function FirstPanel(props) {
{firstPanelList.map((item, idx) => { return ( -
+
- +
{item.title}
{item.isNUm ? ( -
+
{cardPage === "2" ? weekMap[item.key] @@ -85,7 +85,7 @@ function FirstPanel(props) { {item.unit}
) : ( -
+
{cardPage === "2" ? weekMap[item.key] : dayMap[item.key]} diff --git a/src/forge/SoftwareFactory/components/Home/forthPanel.jsx b/src/forge/SoftwareFactory/components/Home/forthPanel.jsx index f72939388..08ce8866f 100644 --- a/src/forge/SoftwareFactory/components/Home/forthPanel.jsx +++ b/src/forge/SoftwareFactory/components/Home/forthPanel.jsx @@ -31,14 +31,14 @@ function ForthPanel(props) {
{forthPanelList.map((item, idx) => { return ( -
+
- +
{item.title}
{item.isNUm ? ( -
+
{cardPage === "2" ? monthMap[item.key] @@ -47,7 +47,7 @@ function ForthPanel(props) { {item.unit}
) : ( -
+
{cardPage === "2" ? monthMap[item.key] : dayMap[item.key]} diff --git a/src/forge/SoftwareFactory/components/Home/index.jsx b/src/forge/SoftwareFactory/components/Home/index.jsx index 6a6bab0f7..cb22d3285 100644 --- a/src/forge/SoftwareFactory/components/Home/index.jsx +++ b/src/forge/SoftwareFactory/components/Home/index.jsx @@ -59,9 +59,9 @@ const setting = { slidesToShow: 1, slidesToScroll: 1, pauseOnDotsHover: true, - autoplaySpeed: 5000, + autoplaySpeed: Number(localStorage.getItem('homeLoopSpeed')) || 5000, pauseOnFocus: true, - autoplay: false, + autoplay: true, arrows: true, prevArrow: , nextArrow: , @@ -74,48 +74,20 @@ function Home(props) { const [timeObj, setTimeObj] = useState({}); const [firstNews, setFirstNews] = useState({}); const [focuseWorkList, setFocuseWorkList] = useState([]); + const rightContentDom = React.useRef(null) // const [focuseWorkList, setFocuseWorkList] = useState([]); useEffect(() => { - getDay() - // getDayData() - // getWeekData() - // getMonthData() - const timer = setInterval(() => { - //10分钟更新一次 - getDay(); - // getDayData() - // getWeekData() - // getMonthData() - }, 600000); - return () => { - clearInterval(timer); - }; + getDay() + const timer = setInterval(() => { + //默认10分钟更新一次 + getDay(); + }, Number(localStorage.getItem('apiTime')) || 300000); + return () => { + clearInterval(timer); + }; }, []); - function getDayData() { - //获取今日昨日数据 - todayWorkSituation().then(res=>{ - - }) - - } - - function getWeekData() { - //获取今日昨日数据 - todayWorkSituation().then(res=>{ - - }) - - } - - function getMonthData() { - //获取今日昨日数据 - todayWorkSituation().then(res=>{ - - }) - - } useEffect(() => { if (newsList && newsList.length) { @@ -186,13 +158,13 @@ function Home(props) {
-
要闻概览:
-
Overview of important news
-
{currentMonth}
-
{firstNews.name}
- -
- +
要闻概览:
+
Overview of important news
+
{currentMonth}
+
{firstNews.name}
+ +
+
{firstNews.summary}
@@ -227,8 +199,8 @@ function Home(props) {
-
- +
+
可控开源创新中心
Controllable open source innovation center software factory work @@ -237,7 +209,7 @@ function Home(props) {
软件工厂工作态势
- +
); diff --git a/src/forge/SoftwareFactory/components/Home/rightContent.jsx b/src/forge/SoftwareFactory/components/Home/rightContent.jsx index 9b2978610..2d829d41e 100644 --- a/src/forge/SoftwareFactory/components/Home/rightContent.jsx +++ b/src/forge/SoftwareFactory/components/Home/rightContent.jsx @@ -7,7 +7,7 @@ import SecondPanel from "./secondPanel"; import ThirdPanel from "./thirdPanel"; import ForthPanel from "./forthPanel"; import CenterPanel from "./centerPanel"; -import {todayWorkSituation,weekMonthWorkSituation} from '../../api' +import { todayWorkSituation, weekMonthWorkSituation } from "../../api"; const setting = { dots: false, infinite: true, @@ -15,9 +15,9 @@ const setting = { slidesToShow: 1, slidesToScroll: 1, pauseOnDotsHover: false, - autoplaySpeed: 5000, + autoplaySpeed: Number(localStorage.getItem("pageLoopSpeed")) || 8000, pauseOnFocus: false, - autoplay: false, + autoplay: true, arrows: false, fade: false, pauseOnHover: false, @@ -25,44 +25,58 @@ const setting = { // nextArrow: , // afterChange: (index) => setTag(index), }; - function RightContent(props) { const { timeObj } = props; - const [dayMap,setDayMap] = useState({}) - const [weekMap,setWeekMap] = useState({}) - const [monthMap,setMonthMap] = useState({}) + const [dayMap, setDayMap] = useState({}); + const [weekMap, setWeekMap] = useState({}); + const [monthMap, setMonthMap] = useState({}); + const firstDayDom = React.useRef(null); + const firstweekDom = React.useRef(null); + const secondDayDom = React.useRef(null); + const secondWeekDom = React.useRef(null); + const thirdDayDom = React.useRef(null); + const thirdmonthDom = React.useRef(null); + const forthDayDom = React.useRef(null); + const forthmonthDom = React.useRef(null); + const centerDom = React.useRef(null); - useEffect(()=>{ - getTodayData() - getWeekData() - getMonthData() - },[]) + useEffect(() => { + getTodayData(); + getWeekData(); + getMonthData(); + const timer = setInterval(() => { + //5分钟更新一次 + getTodayData(); + getWeekData(); + getMonthData(); + }, Number(localStorage.getItem("apiTime")) || 300000); + return () => { + clearInterval(timer); + }; + }, []); - function getTodayData(){ - todayWorkSituation() - .then(res=>{ - if(res.data.code === 200){ - setDayMap(res.data.data) + function getTodayData() { + todayWorkSituation().then((res) => { + if (res.data.code === 200) { + setDayMap(res.data.data); } - }) + }); } - function getWeekData(){ - weekMonthWorkSituation('week') - .then(res=>{ - if(res.data.code === 200){ - setWeekMap(res.data.data) + function getWeekData() { + weekMonthWorkSituation("week").then((res) => { + if (res.data.code === 200) { + setWeekMap(res.data.data); } - }) + }); } - function getMonthData(){ - weekMonthWorkSituation('month') - .then(res=>{ - if(res.data.code === 200){ - setMonthMap(res.data.data) + function getMonthData() { + weekMonthWorkSituation("month").then((res) => { + if (res.data.code === 200) { + setMonthMap(res.data.data); } - }) + }); } return (
@@ -70,27 +84,27 @@ function RightContent(props) { {/*
page1
page2
page3
*/} -
+
- - + +
- - + +
-
+
- - + +
- - + +
- +
diff --git a/src/forge/SoftwareFactory/components/Home/secondPanel.jsx b/src/forge/SoftwareFactory/components/Home/secondPanel.jsx index 180937b6f..f49553687 100644 --- a/src/forge/SoftwareFactory/components/Home/secondPanel.jsx +++ b/src/forge/SoftwareFactory/components/Home/secondPanel.jsx @@ -32,14 +32,14 @@ function SecondPanel(props) {
{secondPanelList.map((item, idx) => { return ( -
+
- +
{item.title}
{item.isNUm ? ( -
+
{cardPage === "2" ? weekMap[item.key] @@ -48,7 +48,7 @@ function SecondPanel(props) { {item.unit}
) : ( -
+
{cardPage === "2" ? weekMap[item.key] : dayMap[item.key]} diff --git a/src/forge/SoftwareFactory/components/Home/thirdPanel.jsx b/src/forge/SoftwareFactory/components/Home/thirdPanel.jsx index 6159ea7cb..895d0fea3 100644 --- a/src/forge/SoftwareFactory/components/Home/thirdPanel.jsx +++ b/src/forge/SoftwareFactory/components/Home/thirdPanel.jsx @@ -27,14 +27,14 @@ function ThirdPanel(props) {
{thirdPanelList.map((item, idx) => { return ( -
+
- +
{item.title}
{item.isNUm ? ( -
+
{cardPage === "2" ? monthMap[item.key] @@ -43,7 +43,7 @@ function ThirdPanel(props) { {item.unit}
) : ( -
+
{cardPage === "2" ? monthMap[item.key] : dayMap[item.key]} diff --git a/src/forge/SoftwareFactory/components/ProjectStatus/ProjectCard.jsx b/src/forge/SoftwareFactory/components/ProjectStatus/ProjectCard.jsx index 7cd1a1767..50408c8b5 100644 --- a/src/forge/SoftwareFactory/components/ProjectStatus/ProjectCard.jsx +++ b/src/forge/SoftwareFactory/components/ProjectStatus/ProjectCard.jsx @@ -3,51 +3,51 @@ import { Route, Switch } from "react-router-dom"; import { withRouter } from "react-router"; function ProjectCard(props) { - const {mgRight} = props; + const {mgRight,shadow,dataMap} = props; const [currentMonth, setCurrentMonth] = useState("2025年2月"); return (
-
项目名称
+
{dataMap.projectName}
-
{'开源项目组'}
-
项目经理:{'蒋宇航'}
+
{dataMap.pmsEnterpriseName}
+
项目经理:{dataMap.projectAssigneeName}
-
+
项目需求数
-
200
+
{dataMap.needCount}
项目完成数
-
150
+
{dataMap.needFinishedCount}
项目任务数
-
200
+
{dataMap.taskCount}
任务完成数
-
150
+
{dataMap.taskFinishedCount}
项目迭代数
-
200
+
{dataMap.sprintCount}
已完成迭代数
-
150
+
{dataMap.sprintFinishedCount}
测试用例数
-
927
+
{dataMap.testCaseCount}
测试缺陷数
-
58
+
{dataMap.testBugCount}
待测试数
-
623
+
{dataMap.notExecTestCaseCount}
- {props.shadow &&
} + {shadow &&
}
); } diff --git a/src/forge/SoftwareFactory/components/ProjectStatus/index.jsx b/src/forge/SoftwareFactory/components/ProjectStatus/index.jsx index c1606fcb1..aa46fae9f 100644 --- a/src/forge/SoftwareFactory/components/ProjectStatus/index.jsx +++ b/src/forge/SoftwareFactory/components/ProjectStatus/index.jsx @@ -4,16 +4,58 @@ import { withRouter } from "react-router"; import centerBg from "../../img/center_title_bg.png"; import "./index.scss"; import ProjectCard from "./ProjectCard"; - +import { projectSituation } from "../../api"; function ProjectStatus(props) { const {} = props; - const [currentMonth, setCurrentMonth] = useState("2025年2月"); + const [projectList, setProjectList] = useState([]); + + const ProjectCardDom = React.useRef(null) + + + useEffect(() => { + getProjectList(); + //项目信息五分钟更新一次 + let timer = setInterval(()=>{ + getProjectList(); + }, Number(localStorage.getItem('apiTime')) || 300000) + return ()=>{ + clearInterval(timer) + } + + }, []); + + function getProjectList() { + projectSituation().then((res) => { + if (res.data.code === 200) { + let list = + res.data.data.length > 10 + ? res.data.data.slice(0, 10) + : res.data.data; + setProjectList(list); + } + }); + } + + function getShadowCls(idx) { + switch (idx) { + case 5: + return "shadow-left"; + case 6: + case 7: + case 8: + return "shadow-center"; + case 9: + return "shadow-right"; + default: + return '' + } + } return (
-
- +
+
可控开源创新中心
Controllable open source innovation center software factory work @@ -27,10 +69,21 @@ function ProjectStatus(props) {
项目研发状态
-
+
- - + {projectList.map((item, idx) => { + return ( + + ); + })} + + {/* @@ -38,7 +91,7 @@ function ProjectStatus(props) { - + */}
diff --git a/src/forge/SoftwareFactory/components/ProjectStatus/index.scss b/src/forge/SoftwareFactory/components/ProjectStatus/index.scss index 745634e3c..186beeb8f 100644 --- a/src/forge/SoftwareFactory/components/ProjectStatus/index.scss +++ b/src/forge/SoftwareFactory/components/ProjectStatus/index.scss @@ -132,6 +132,10 @@ line-height: 27px; text-align: center; padding-top: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } .pro-group { display: flex; diff --git a/src/forge/SoftwareFactory/index.jsx b/src/forge/SoftwareFactory/index.jsx index 4d89f3f85..b7e279dbd 100644 --- a/src/forge/SoftwareFactory/index.jsx +++ b/src/forge/SoftwareFactory/index.jsx @@ -17,9 +17,9 @@ const setting = { slidesToShow: 1, slidesToScroll: 1, pauseOnDotsHover: true, - autoplaySpeed: 15000, + autoplaySpeed: Number(localStorage.getItem('pageLoopSpeed')) || 30000, // pauseOnFocus: false, - autoplay: false, + autoplay: true, arrows: false, pauseOnHover:false, dotsClass:'fac-dots' @@ -35,12 +35,23 @@ function Index(props){ const [id,setId] = useState(undefined) const [newsList,setNewsList] = useState([]) + const homeDom = React.useRef(null) + const proDom = React.useRef(null) useEffect(()=>{ getId() },[]) useEffect(()=>{ - if(id)getNewsList() + let timer = null + if(id){ + getNewsList() + timer = setInterval(()=>{ + getNewsList() + },Number(localStorage.getItem('apiTime')) || 300000) + return () =>{ + clearInterval(timer) + } + } },[id]) function getNewsList() { @@ -66,8 +77,8 @@ function Index(props){ return (
- - + +
) }