Merge branch 'gitlink_ssr_head' of https://gitlink.org.cn/Gitlink/forgeplus-react into pre_gitlink_ssr

This commit is contained in:
qiukai 2025-03-14 14:17:26 +08:00
commit 3bafce21e8
38 changed files with 1897 additions and 5 deletions

View File

@ -56,4 +56,4 @@ export const deepRoutes = [
]
// 不进行组织或个人判断
export const specialRoute = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "undefined", "admins", "oauth", "competitions", "hiagent"]
export const specialRoute = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "undefined", "admins", "oauth", "competitions", "hiagent","softwareFactory"]

View File

@ -51,6 +51,10 @@ const Information = Loadable({
loader: () => import('./forge/Information/index'),
loading: Loading,
})
const SoftwareFactory = Loadable({
loader: () => import('./forge/SoftwareFactory/index'),
loading: Loading,
})
//forge安全设置
const Security = Loadable({
loader: () => import('./forge/SecuritySetting/Index'),
@ -165,7 +169,7 @@ const Iframe = Loadable({
});
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent"];
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent","softwareFactory"];
class App extends Component {
constructor(props) {
@ -335,7 +339,16 @@ class App extends Component {
render() {
const { pathType, pathName, mygetHelmetapi } = this.state;
return (
// <Route
// path={"/softwareFactory/:type"}
// render={
// (props) => {
// return (<SoftwareFactory {...this.props} {...props} {...this.state} />)
// }
// }>
// </Route>
<ConfigProvider locale={zhCN}>
<MuiThemeProvider theme={theme}>
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
@ -404,6 +417,14 @@ class App extends Component {
}
}>
</Route>
<Route
path={"/softwareFactory/home"}
render={
(props) => {
return (<SoftwareFactory {...this.props} {...props} {...this.state} />)
}
}>
</Route>
<Route
path={"/settings"}
render={

View File

@ -15,7 +15,7 @@ function beforeFetch(actionUrl){
service.interceptors.request.use(request => {
let deptId = sessionStorage.getItem('deptId')
// request.headers.Authorization = 'be06b98eb11dc58de93ab4d9de5b673ebae935bd'
if (deptId) {
// 用于权限区分
request.headers['Dept-Id'] = deptId

View File

@ -0,0 +1,25 @@
import fetch from '../Information/fetch'
//今日工作态势
export function todayWorkSituation() {
return fetch({
url: `/pms/open/specialArea/softwareFact/statis/todayWorkSituation`,
method: 'get',
});
}
//月、周工作态势
export function weekMonthWorkSituation(type) {
return fetch({
url: `/pms/open/specialArea/softwareFact/statis/weekMonthWorkSituation?type=${type}`,
method: 'get',
});
}
//项目研发状态
export function projectSituation() {
return fetch({
url: `/pms/open/specialArea/softwareFact/statis/projectSituation`,
method: 'get',
});
}

View File

@ -0,0 +1,25 @@
import React, { useEffect, useState } from "react";
import centerBg from "../../img/center_title_bg.png";
function FactoryHead(props) {
const {} = props;
const [currentMonth, setCurrentMonth] = useState("2025年2月");
return (
<div className="project-wrap">
<div className="project-head">
<div className="center-title-wrap">
<img src={centerBg} alt="" />
<div className="center-title">可控开源创新中心</div>
<div className="center-sub-title">
Controllable open source innovation center software factory work
situation
</div>
</div>
<div className="soft-title">软件工厂工作态势</div>
</div>
</div>
);
}
export default FactoryHead;

View File

@ -0,0 +1,49 @@
import React, { useEffect, useState } from "react";
import duoyun from "../../img/duoyun.png";
import fengsu from "../../img/fengsu.png";
import shidu from "../../img/shidu.png";
import ziwaixian from "../../img/ziwaixian.png";
function CenterPanel(props) {
let { timeObj,weatherObj } = props;
return (
<div className="center-panel">
<div className="first-section">
<div className="content">
<img src={duoyun} alt="" />
<div>{weatherObj.text}</div>
</div>
</div>
<div className="second-section">
<div className="content">
<img src={ziwaixian} alt="" />
<div>{weatherObj.temp}</div>
</div>
</div>
<div className="third-section">
<div className="content">
<img src={fengsu} alt="" />
<div>{weatherObj.windDir}</div>
</div>
</div>
<div className="forth-section">
<div className="content">
<img src={shidu} alt="" />
<div>{weatherObj.humidity}%</div>
</div>
</div>
<div className="center-section">
<div>{timeObj.week}</div>
<div>
<span className="month">{timeObj.month}/</span>
<span className="date">{timeObj.day}</span>
</div>
<div>{timeObj.lunar}</div>
</div>
</div>
);
}
export default CenterPanel;

View File

@ -0,0 +1,109 @@
import React, { useEffect, useState } from "react";
import right from "../../img/right.png";
let firstPanelList1 = [
{
title: "需求待评审数",
key: "needNotFinishCount",
num: 50,
isNUm: true,
unit: "个",
},
{
title: "任务待完成数",
key: "taskNotFinishCount",
num: 10,
isNUm: true,
unit: "个",
},
{
title: "缺陷待修复数",
key: "bugNotFinishCount",
num: 5,
isNUm: true,
unit: "个",
},
{
title: "测试用例未执行数",
key: "notExecTestCaseCount",
num: 8,
isNUm: true,
unit: "个",
},
];
let firstPanelList2 = [
{
title: "本周完结任务数",
key: "yesterdayFinishTask",
num: 50,
isNUm: true,
unit: "个",
},
{
title: "本周关闭缺陷数",
key: "yesterdayFinishBug",
num: 10,
isNUm: true,
unit: "个",
},
{
title: "本周需求评审数",
key: "yesterdayFinishNeed",
num: 5,
isNUm: true,
unit: "个",
},
{ title: "本周最活跃项目", key: "zonePmsProjectMax", num: 8, isNUm: false },
];
function FirstPanel(props) {
const { cardPage, dayMap, weekMap } = props;
const [firstPanelList, setFirstPanelList] = useState([]);
useEffect(() => {
let list = cardPage === "1" ? firstPanelList1 : firstPanelList2;
setFirstPanelList(list);
}, []);
return (
<div className="first-panel">
<div className="white-panel-out">
<div className="white-panel-center">
<div className="white-panel-inner">
{firstPanelList.map((item, idx) => {
return (
<div className="panel-item" key={idx}>
<div className="panel-item-content">
<div className="panel-item-content-left">
<img src={right} alt="" />
<div>{item.title}</div>
</div>
{item.isNUm ? (
<div className="panel-item-content-right">
<span className="panel-num">
{cardPage === "2"
? weekMap[item.key]
: dayMap[item.key]}
</span>
<span className="panel-unit">{item.unit}</span>
</div>
) : (
<div className="panel-item-content-right-text">
{cardPage === "2"
? weekMap[item.key]
: dayMap[item.key]}
</div>
)}
</div>
<div className="panel-item-line"></div>
</div>
);
})}
</div>
</div>
</div>
<div className="panel-title">
{cardPage === "2" ? "本周完结工作" : "今日项目状态"}
</div>
</div>
);
}
export default FirstPanel;

View File

@ -0,0 +1,68 @@
import React, { useEffect, useState } from "react";
import right from "../../img/right.png";
let forthPanelList1 = [
{ title: "昨日新增任务数",key:'yesterdayAddTask', isNUm: true, unit: "个" },
{ title: "昨日新增缺陷数",key:'yesterdayAddBug', isNUm: true, unit: "个" },
{ title: "昨日新增需求数",key:'yesterdayAddNeed', isNUm: true, unit: "个" },
{ title: "昨日测试执行数",key:'yesterdayTestCase', isNUm: true, unit: "个" },
];
let forthPanelList2 = [
{ title: "本月新增任务数",key:'yesterdayAddTask', isNUm: true, unit: "个" },
{ title: "本月新增缺陷数",key:'yesterdayAddBug', isNUm: true, unit: "个" },
{ title: "本月新增需求数",key:'yesterdayAddNeed', isNUm: true, unit: "个" },
{ title: "本月测试执行数",key:'yesterdayTestCase', isNUm: true, unit: "个" },
];
function ForthPanel(props) {
const { cardPage,dayMap,monthMap } = props;
const [forthPanelList, setForthPanelList] = useState([]);
useEffect(() => {
let list = cardPage === "1" ? forthPanelList1 : forthPanelList2;
setForthPanelList(list);
}, []);
return (
<div className="forth-panel">
<div className="panel-title">
{cardPage === "2" ? "本月新增工作" : "昨日新增工作"}
</div>
<div className="white-panel-out">
<div className="white-panel-center">
<div className="white-panel-inner">
{forthPanelList.map((item, idx) => {
return (
<div className="panel-item" key={idx}>
<div className="panel-item-content">
<div className="panel-item-content-left">
<img src={right} alt="" />
<div>{item.title}</div>
</div>
{item.isNUm ? (
<div className="panel-item-content-right">
<span className="panel-num">
{cardPage === "2"
? monthMap[item.key]
: dayMap[item.key]}
</span>
<span className="panel-unit">{item.unit}</span>
</div>
) : (
<div className="panel-item-content-right-text">
{cardPage === "2"
? monthMap[item.key]
: dayMap[item.key]}
</div>
)}
</div>
<div className="panel-item-line"></div>
</div>
);
})}
</div>
</div>
</div>
</div>
);
}
export default ForthPanel;

View File

@ -0,0 +1,181 @@
import React, { useEffect, useState } from "react";
import { Route, Switch } from "react-router-dom";
import { withRouter } from "react-router";
import bj1 from "../../img/bj1.png";
import newsLine from "../../img/news_line.png";
import next from "../../img/next.png";
import right from "../../img/right.png";
import centerBg from "../../img/center_title_bg.png";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import Slider from "react-slick";
import RightContent from "./rightContent";
// let focuseWorkList = [
// {
// name: "page1",
// list: [
// { num: 1, content: "IDRL/IDRLnet.." },
// { num: 2, content: "IDRL/IDRLnet.." },
// { num: 3, content: "IDRL/IDRLnet.." },
// { num: 4, content: "IDRL/IDRLnet.." },
// { num: 5, content: "IDRL/IDRLnet.." },
// ],
// },
// {
// name: "page2",
// list: [
// { num: 6, content: "IDRL/IDRLnet.." },
// { num: 7, content: "IDRL/IDRLnet.." },
// { num: 8, content: "IDRL/IDRLnet.." },
// { num: 9, content: "IDRL/IDRLnet.." },
// { num: 10, content: "IDRL/IDRLnet.." },
// ],
// },
// {
// name: "page3",
// list: [
// { num: 11, content: "IDRL/IDRLnet.." },
// { num: 12, content: "IDRL/IDRLnet.." },
// { num: 13, content: "IDRL/IDRLnet.." },
// { num: 14, content: "IDRL/IDRLnet.." },
// { num: 15, content: "IDRL/IDRLnet.." },
// ],
// },
// ];
const CalendarData = [
0x66aaa, 0x4aab5, 0x25d55, 0x52aad, 0x75557, 0x3aaa5, 0xad556, 0x55555,
0x5ab6a, 0xb56d5,
];
const monString = "正二三四五六七八九十冬腊";
const setting = {
dots: false,
infinite: true,
speed: 2000,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnDotsHover: true,
autoplaySpeed: Number(localStorage.getItem('homeLoopSpeed')) || 8000,
pauseOnFocus: true,
autoplay: true,
arrows: true,
prevArrow: <img className="slick-prev slick-arrow" src={next} alt="" />,
nextArrow: <img className="slick-next slick-arrow" src={next} alt="" />,
// afterChange: (index) => setTag(index),
};
function Home(props) {
const { newsList,timeObj,dayMap,weekMap,monthMap,weatherObj,currentMonth } = props;
const [firstNews, setFirstNews] = useState({});
const [focuseWorkList, setFocuseWorkList] = useState([]);
const rightContentDom = React.useRef(null)
// const [focuseWorkList, setFocuseWorkList] = useState([]);
useEffect(() => {
if (newsList && newsList.length) {
// //
let allList = [];
newsList.map((item) => {
if (item.name === "开源中心要闻") {
item.cmsDocList.map((item) => {
allList.push(item);
});
}
if (item.name === "开源中心活动") {
//
setFirstNews(item.cmsDocList[0]);
}
});
allList.map((item, idx) => (item.num = idx + 1));
let splitList = []; //
let finalList = [];
let allPageNum = (allList.length - (allList.length % 5)) / 5;
let num = 0;
allList.map((item, idx) => {
if (num !== allPageNum) {
if (splitList.length < 5) {
splitList.push(item);
if (splitList.length === 5) {
finalList.push(splitList);
splitList = [];
num += 1;
}
}
} else {
splitList.push(item);
if (idx === allList.length - 1) {
finalList.push(splitList);
}
}
});
setFocuseWorkList(finalList);
}
}, newsList);
return (
<div className="home-wrap">
<div className="home-left">
<div className="news-wrap">
<div className="left-title">要闻概览:</div>
<div className="left-subTitle">Overview of important news</div>
<div className="news-month">{currentMonth}</div>
<div className="news-content-title">{firstNews.name}</div>
<img className="news-line" src={newsLine} alt="" />
<div className="news-pic-wrap">
<img className="news-pic" src={firstNews.headImg} alt="" />
</div>
<div className="news-content">{firstNews.summary}</div>
<div className="point-work">
<div className="left-title">重点工作:</div>
<div className="left-subTitle">Focus on work</div>
<div className="point-work-wrap">
<Slider {...setting}>
{focuseWorkList && focuseWorkList.length > 0
? focuseWorkList.map((page, idx) => {
return (
<div className="point-work-page" key={idx}>
{page.map((item, index) => {
return (
<div className="point-work-item" key={item.num}>
<div className="point-work-item-num">
{item.num}
</div>
<div className="point-work-item-content">
{item.summary}
</div>
</div>
);
})}
</div>
);
})
: ""}
</Slider>
</div>
</div>
</div>
</div>
<div className="home-right">
<div className="right-head">
<div className="center-title-wrap">
<img src={centerBg} alt="" />
<div className="center-title">可控开源创新中心</div>
<div className="center-sub-title">
Controllable open source innovation center software factory work
situation
</div>
</div>
<div className="soft-title">软件工厂工作态势</div>
</div>
<RightContent dayMap={dayMap} weekMap={weekMap} monthMap={monthMap} timeObj={timeObj} ref={rightContentDom} weatherObj={weatherObj}/>
</div>
</div>
);
}
export default Home;

View File

@ -0,0 +1,74 @@
import React, { useEffect, useState } from "react";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import Slider from "react-slick";
import FirstPanel from "./firstPanel";
import SecondPanel from "./secondPanel";
import ThirdPanel from "./thirdPanel";
import ForthPanel from "./forthPanel";
import CenterPanel from "./centerPanel";
const setting = {
dots: false,
infinite: true,
speed: 2000,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnDotsHover: false,
autoplaySpeed: Number(localStorage.getItem("homeLoopSpeed")) || 8000,
pauseOnFocus: false,
autoplay: true,
arrows: false,
fade: false,
pauseOnHover: false,
// prevArrow: <img className="slick-prev slick-arrow" src={next} alt="" />,
// nextArrow: <img className="slick-next slick-arrow" src={next} alt="" />,
// afterChange: (index) => setTag(index),
};
function RightContent(props) {
const { timeObj,dayMap,weekMap,monthMap,weatherObj } = props;
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);
return (
<div style={{ width: 1330, height: "100%" }}>
<Slider {...setting}>
{/* <div key={0}>page1</div>
<div key={1}>page2</div>
<div key={2}>page3</div> */}
<div className="right-content" key="card1">
<div className="top-section">
<FirstPanel cardPage="1" dayMap={dayMap} ref={firstDayDom}/>
<SecondPanel cardPage="1" dayMap={dayMap} ref={secondDayDom} />
</div>
<div className="bottom-section">
<ThirdPanel cardPage="1" dayMap={dayMap} ref={thirdDayDom}/>
<ForthPanel cardPage="1" dayMap={dayMap} ref={forthDayDom} />
</div>
<CenterPanel timeObj={timeObj} weatherObj={weatherObj} ref={centerDom}/>
</div>
<div className="right-content" key="card2">
<div className="top-section">
<FirstPanel cardPage="2" weekMap={weekMap} ref={firstweekDom}/>
<SecondPanel cardPage="2" weekMap={weekMap} ref={secondWeekDom} />
</div>
<div className="bottom-section">
<ThirdPanel cardPage="2" monthMap={monthMap} ref={thirdmonthDom} />
<ForthPanel cardPage="2" monthMap={monthMap} ref={forthmonthDom} />
</div>
<CenterPanel timeObj={timeObj} weatherObj={weatherObj} ref={centerDom}/>
</div>
</Slider>
</div>
);
}
export default RightContent;

View File

@ -0,0 +1,69 @@
import React, { useEffect, useState } from "react";
import right from "../../img/right.png";
let secondPanelList1 = [
{ title: "任务最多项目", key:'taskMaxProject', isNUm: false, unit: "个" },
{ title: "任务最多个人",key:'taskMaxAssigner', isNUm: false, unit: "个" },
{ title: "缺陷最多项目",key:'bugMaxProject', isNUm: false, unit: "个" },
{ title: "缺陷最多个人",key:'bugMaxAssigner', isNUm: false, unit: "个" },
];
let secondPanelList2 = [
{ title: "本周新增任务数",key:'yesterdayAddTask', isNUm: true, unit: "个" },
{ title: "本周新增缺陷数", key:'yesterdayAddBug',isNUm: true, unit: "个" },
{ title: "本周新增需求数",key:'yesterdayAddNeed', isNUm: true, unit: "个" },
{ title: "本周测试执行数", key:'yesterdayTestCase', isNUm: true, unit: "个" },
];
function SecondPanel(props) {
const { cardPage,dayMap,weekMap } = props;
const [secondPanelList, setSecondPanelList] = useState([]);
useEffect(() => {
let list = cardPage === "1" ? secondPanelList1 : secondPanelList2;
setSecondPanelList(list);
}, []);
return (
<div className="second-panel">
<div className="panel-title">
{cardPage === "2" ? "本周新增工作" : "今日项目状态"}
</div>
<div className="white-panel-out">
<div className="white-panel-center">
<div className="white-panel-inner">
{secondPanelList.map((item, idx) => {
return (
<div className="panel-item" key={idx}>
<div className="panel-item-content">
<div className="panel-item-content-left">
<img src={right} alt="" />
<div>{item.title}</div>
</div>
{item.isNUm ? (
<div className="panel-item-content-right">
<span className="panel-num">
{cardPage === "2"
? weekMap[item.key]
: dayMap[item.key]}
</span>
<span className="panel-unit">{item.unit}</span>
</div>
) : (
<div className="panel-item-content-right-text">
{cardPage === "2"
? weekMap[item.key]
: dayMap[item.key]}
</div>
)}
</div>
<div className="panel-item-line"></div>
</div>
);
})}
</div>
</div>
</div>
</div>
);
}
export default SecondPanel;

View File

@ -0,0 +1,67 @@
import React, { useEffect, useState } from "react";
import right from "../../img/right.png";
let thirdPanelList1 = [
{ title: "昨日完结任务数", key:'yesterdayFinishTask', isNUm: true, unit: "个" },
{ title: "昨日关闭缺陷数", key:'yesterdayFinishBug', isNUm: true, unit: "个" },
{ title: "昨日需求评审数", key:'yesterdayFinishNeed', isNUm: true, unit: "个" },
{ title: "昨日最活跃项目", key:'zonePmsProjectMax', isNUm: false, unit: "个" },
];
let thirdPanelList2 = [
{ title: "本月完结任务数", key:'yesterdayFinishTask', isNUm: true, unit: "个" },
{ title: "本月关闭缺陷数", key:'yesterdayFinishBug', isNUm: true, unit: "个" },
{ title: "本月需求评审数", key:'yesterdayFinishNeed', isNUm: true, unit: "个" },
{ title: "本月最活跃项目", key:'zonePmsProjectMax', isNUm: false, unit: "个" },
];
function ThirdPanel(props) {
const { cardPage,dayMap,monthMap } = props;
const [thirdPanelList, setThirdPanelList] = useState([]);
useEffect(() => {
let list = cardPage === "1" ? thirdPanelList1 : thirdPanelList2;
setThirdPanelList(list);
}, []);
return (
<div className="third-panel">
<div className="white-panel-out">
<div className="white-panel-center">
<div className="white-panel-inner">
{thirdPanelList.map((item, idx) => {
return (
<div className="panel-item" key={idx}>
<div className="panel-item-content">
<div className="panel-item-content-left">
<img src={right} alt="" />
<div>{item.title}</div>
</div>
{item.isNUm ? (
<div className="panel-item-content-right">
<span className="panel-num">
{cardPage === "2"
? monthMap[item.key]
: dayMap[item.key]}
</span>
<span className="panel-unit">{item.unit}</span>
</div>
) : (
<div className="panel-item-content-right-text">
{cardPage === "2"
? monthMap[item.key]
: dayMap[item.key]}
</div>
)}
</div>
<div className="panel-item-line"></div>
</div>
);
})}
</div>
</div>
</div>
<div className="panel-title">
{cardPage === "2" ? "本月完结工作" : "昨日完结工作"}
</div>
</div>
);
}
export default ThirdPanel;

View File

@ -0,0 +1,54 @@
import React, { useEffect, useState } from "react";
import { Route, Switch } from "react-router-dom";
import { withRouter } from "react-router";
function ProjectCard(props) {
const {mgRight,shadow,dataMap} = props;
const [currentMonth, setCurrentMonth] = useState("2025年2月");
return (
<div className="project-card-wrap" style={{marginRight:mgRight?'20px':0}}>
<div className="pro-title">{dataMap.projectName}</div>
<div className="pro-group">
<div style={{opacity:1}}>{dataMap.pmsEnterpriseName}</div>
<div style={{marginLeft:26}}>项目经理{dataMap.projectAssigneeName}</div>
</div>
<div className="pro-center">
<div className="pro-center-item">
<div className="pro-center-name">项目需求数</div>
<div className="pro-center-num">{dataMap.needCount}</div>
<div className="pro-center-name" style={{marginTop:6}}>项目完成数</div>
<div className="pro-center-num">{dataMap.needFinishedCount}</div>
</div>
<div className="pro-center-item" style={{marginLeft:6}}>
<div className="pro-center-name">项目任务数</div>
<div className="pro-center-num">{dataMap.taskCount}</div>
<div className="pro-center-name" style={{marginTop:6}}>任务完成数</div>
<div className="pro-center-num">{dataMap.taskFinishedCount}</div>
</div>
<div className="pro-center-item" style={{marginLeft:6}}>
<div className="pro-center-name">项目迭代数</div>
<div className="pro-center-num">{dataMap.sprintCount}</div>
<div className="pro-center-name" style={{marginTop:6}}>已完成迭代数</div>
<div className="pro-center-num">{dataMap.sprintFinishedCount}</div>
</div>
</div>
<div className="pro-bottom">
<div className="pro-bottom-item">
<div className="pro-bt-name">测试用例数</div>
<div className="pro-bt-num">{dataMap.testCaseCount}</div>
</div>
<div className="pro-bottom-item">
<div className="pro-bt-name">测试缺陷数</div>
<div className="pro-bt-num">{dataMap.testBugCount}</div>
</div>
<div className="pro-bottom-item">
<div className="pro-bt-name">待测试数</div>
<div className="pro-bt-num">{dataMap.notExecTestCaseCount}</div>
</div>
</div>
{shadow && <div className={`card-shadow ${shadow}`} ></div>}
</div>
);
}
export default ProjectCard;

View File

@ -0,0 +1,72 @@
import React, { useEffect, useState } from "react";
import { Route, Switch } from "react-router-dom";
import { withRouter } from "react-router";
import centerBg from "../../img/center_title_bg.png";
import "./index.scss";
import ProjectCard from "./ProjectCard";
function ProjectStatus(props) {
const {projectList} = props;
const ProjectCardDom = React.useRef(null)
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 (
<div className="project-wrap">
<div className="project-head">
<div className="center-title-wrap">
<img src={centerBg} alt="" />
<div className="center-title">可控开源创新中心</div>
<div className="center-sub-title">
Controllable open source innovation center software factory work
situation
</div>
</div>
<div className="soft-title">软件工厂工作态势</div>
</div>
<div className="project-sub-t-wrap">
<div className="project-sub-t">
<div className="project-sub-inner">项目研发状态</div>
</div>
</div>
<div className="project-bottom-wrap">
<div className="project-list-wrap">
{projectList.map((item, idx) => {
return (
<ProjectCard
ref={ProjectCardDom}
key={idx}
mgRight={idx !== 4 && idx !== 9}
shadow={getShadowCls(idx)}
dataMap={item}
/>
);
})}
{/* <ProjectCard mgRight={true} />
<ProjectCard mgRight={true} />
<ProjectCard mgRight={true} />
<ProjectCard mgRight={false} />
<ProjectCard mgRight={true} shadow="shadow-left" />
<ProjectCard mgRight={true} shadow="shadow-center" />
<ProjectCard mgRight={true} shadow="shadow-center" />
<ProjectCard mgRight={true} shadow="shadow-center" />
<ProjectCard mgRight={false} shadow="shadow-right" /> */}
</div>
</div>
</div>
);
}
export default ProjectStatus;

View File

@ -0,0 +1,215 @@
.project-wrap {
width: 1920px;
height: 1080px;
overflow-x: scroll;
background-image: url(../../img/bj2.png);
background-size: 100% 100%;
display: flex;
flex-direction: column;
.project-head {
display: flex;
padding-top: 50px;
padding-left: 36px;
.center-title-wrap {
position: relative;
img {
width: 308px;
}
.center-title {
position: absolute;
color: #fff;
font-family: "shuheiTi";
font-size: 28px;
line-height: 46px;
top: 0;
left: 28px;
letter-spacing: 3px;
}
.center-sub-title {
position: absolute;
font-family: FangSong;
color: #2648df;
font-size: 20px;
bottom: 0;
left: 60px;
width: 740px;
line-height: 20px;
}
}
.soft-title {
color: rgba(38, 72, 223, 1);
font-family: "shuheiTi";
font-size: 52px;
align-items: flex-start;
line-height: 52px;
padding-left: 24px;
}
}
.project-sub-t-wrap {
padding-top: 20px;
display: flex;
justify-content: center;
.project-sub-t {
width: 350px;
height: 54px;
background-color: rgba(39, 133, 214, 0.17);
border-radius: 2px 24px 2px 24px;
.project-sub-inner {
width: 350px;
height: 48px;
line-height: 48px;
background: #2648df;
border-radius: 2px 24px 2px 24px;
text-align: center;
font-size: 27px;
font-family: "alibaba";
color: #fff;
}
}
}
.project-bottom-wrap {
flex: 1;
padding-top: 11px;
background-image: url("../../img/bootm_bg.png");
background-size: 100% auto;
background-repeat: no-repeat;
background-position: bottom;
.project-list-wrap {
display: flex;
flex-wrap: wrap;
padding: 0 35px;
.project-card-wrap {
.card-shadow {
position: absolute;
left: 0;
bottom: -62px;
height: 62px;
width: 354px;
// border-radius: 4px 4px 25px 4px;
}
.shadow-left{
// width:calc( 354px - 180px);
// left: 180px;
bottom: -30px;
height: 30px;
opacity: 46%;
border-bottom-right-radius: 6px;
background: linear-gradient(
-90deg,
rgba(38, 72, 223, 0.19) 0%,
rgba(255, 255, 255, 0) 52%
);
}
.shadow-center{
background: linear-gradient(
180deg,
rgba(38, 72, 223, 0.19) 0%,
rgba(255, 255, 255, 0) 52%
);
}
.shadow-right{
bottom: -30px;
height: 30px;
border-bottom-left-radius: 6px;
opacity: 46%;
background: linear-gradient(
90deg,
rgba(38, 72, 223, 0.19) 0%,
rgba(255, 255, 255, 0) 52%
);
}
position: relative;
width: 354px;
height: 353px;
background: linear-gradient(90.26deg, #2785d6 0.21%, #2648df 98.9%);
border-radius: 4px 25px 4px 4px;
margin-top: 20px;
padding: 0 15px;
.pro-title {
font-family: "alibaba";
color: #f6d8b0;
font-size: 27px;
line-height: 27px;
text-align: center;
padding-top: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pro-group {
display: flex;
width: 324px;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
font-family: "alibabaReg";
border-radius: 6px;
background: linear-gradient(
91.3deg,
rgba(184, 198, 255, 0.22) 0%,
rgba(255, 255, 255, 0.22) 54.4%,
rgba(126, 149, 255, 0) 100%,
rgba(108, 135, 255, 0.31) 100%
);
border: 1px solid rgba(255, 255, 255, 0.2);
color: rgba(255, 255, 255, 0.8);
margin-top: 15px;
}
.pro-center {
padding-top: 12px;
display: flex;
.pro-center-item {
width: 104px;
height: 155px;
background: linear-gradient(90.98deg, #ffffff 2.78%, #d4ebff 98.6%);
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
padding: 15px 0;
.pro-center-name {
font-family: "alibabaReg";
color: #27254c;
font-size: 15px;
line-height: 21px;
height: 21px;
}
.pro-center-num {
font-family: "yousheTi";
color: #2648df;
font-size: 32px;
line-height: 42px;
height: 42px;
}
}
}
.pro-bottom {
display: flex;
justify-content: space-between;
padding: 14px 9px 0;
.pro-bottom-item {
color: rgba(255, 255, 255, 0.8);
font-family: "alibabaReg";
display: flex;
flex-direction: column;
align-items: center;
font-size: 15px;
.pro-bt-name {
line-height: 21px;
height: 21px;
}
.pro-bt-num {
font-family: "pangmen";
font-size: 26px;
color: #fff;
line-height: 26px;
padding-top: 5px;
}
}
}
}
}
}
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,211 @@
import React ,{ useEffect , useState } from "react";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
import { withRouter } from "react-router";
import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
import Home from './components/Home/index'
import ProjectStatus from './components/ProjectStatus/index'
import { getNewsAllList, getMainInfos } from '../Information/api';
import next from "./img/next.png";
import Slider from "react-slick";
import './index.scss';
import { getLunar } from "./utils";
import { todayWorkSituation, weekMonthWorkSituation,projectSituation } from "./api";
const setting = {
dots: false,
infinite: true,
speed: 2000,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnDotsHover: true,
autoplaySpeed: Number(localStorage.getItem('pageLoopSpeed')) || 30000,
// pauseOnFocus: false,
autoplay: true,
arrows: false,
pauseOnHover:false,
dotsClass:'fac-dots'
// prevArrow: <img className="slick-prev slick-arrow" src={next} alt="" />,
// nextArrow: <img className="slick-next slick-arrow" src={next} alt="" />,
// afterChange: (index) => setTag(index),
};
function Index(props){
const [id,setId] = useState(undefined)
const [newsList,setNewsList] = useState([])
const homeDom = React.useRef(null)
const proDom = React.useRef(null)
const [timeObj, setTimeObj] = useState({});
const [dayMap, setDayMap] = useState({});
const [weekMap, setWeekMap] = useState({});
const [monthMap, setMonthMap] = useState({});
const [weatherObj, setWetherObj] = useState({});
const [currentMonth, setCurrentMonth] = useState("");
const [projectList, setProjectList] = useState([]);
useEffect(()=>{
getId()
getDay()
getTodayData();
getWeekData();
getMonthData();
getWether();
getProjectList();
const timer = setInterval(() => {
//5
getTodayData();
getWeekData();
getMonthData();
getDay();
getWether();
getProjectList();
}, Number(localStorage.getItem('apiTime')) || 300000);
return () => {
clearInterval(timer);
};
},[])
useEffect(()=>{
let timer = null
if(id){
getNewsList()
timer = setInterval(()=>{
getNewsList()
},Number(localStorage.getItem('apiTime')) || 300000)
return () =>{
clearInterval(timer)
}
}
},[id])
function getNewsList() {
getNewsAllList(id).then(result => {
if (result) {
let rows = result.data.rows;
setNewsList(rows);
}
}).catch(error => { })
}
function getId(){
getMainInfos('xjykyzx').then(result=>{
console.log('result', result)
if(result){
let data = result.data.data;
if(data && data.id){
setId(data.id);
}
}
}).catch(console.error())
}
function getWether() {
// fxLink 便
// now.obsTime
// now.temp
// now.feelsLike
// now.icon
// now.text
// now.wind360 360
// now.windDir
// now.windScale
// now.windSpeed /
// now.humidity 湿
// now.precip 1
// now.pressure
// now.vis
// now.cloud
// now.dew
fetch(
`https://devapi.qweather.com/v7/weather/now?location=112.87,28.22&key=18a193299e4944a7bf3ccf23b38474c2`
)
.then((response) => response.json())
.then((data) => {
setWetherObj({
text: data.now.text,
temp: data.now.temp,
windDir: data.now.windDir,
humidity: data.now.humidity,
});
})
.catch((err) => {});
}
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 getMonthData() {
weekMonthWorkSituation("month").then((res) => {
if (res.data.code === 200) {
setMonthMap(res.data.data);
}
});
}
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 getDay() {
//
const days = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
];
let time = new Date();
let year = time.getFullYear();
let month = time.getMonth() + 1;
let day = time.getDate();
let obj = {
month: month < 10 ? "0" + month : month.toString(),
day: day < 10 ? "0" + day : day.toString(),
week: days[time.getDay()],
lunar: getLunar(time),
};
setCurrentMonth(`${year}${month}`);
setTimeObj(obj);
}
return (<div className="softFc-wrap">
<Slider {...setting} >
<Home newsList={newsList} timeObj={timeObj} dayMap={dayMap} weekMap={weekMap} monthMap={monthMap} weatherObj={weatherObj} currentMonth={currentMonth} key="home" ref={homeDom}/>
<ProjectStatus key="project" ref={proDom} projectList={projectList}/>
</Slider>
</div>)
}
export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(ImageLayerOfCommentHOC({
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
parentSelector: ".newContainer",
})(Index)))))
);

View File

@ -0,0 +1,502 @@
$yellow-color: rgba(246, 216, 176, 1);
$blue-color-light: rgba(39, 118, 217, 1);
.softFc-wrap {
.fac-dots {
position: absolute;
bottom: 60px;
display: block;
width: 100%;
padding: 0;
margin: 0;
list-style: none;
text-align: center;
li {
position: relative;
display: inline-block;
width: 50px;
height:6px;
margin: 0 5px;
padding: 0;
background-color: #f00;
cursor: pointer;
button {
font-size: 0;
line-height: 0;
display: block;
width: 50px;
height: 6px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
}
.slick-active{
background-color: #0f0;
}
}
@font-face {
font-family: "shuheiTi";
src: url("./fonts/AlimamaShuHeiTi-Bold.ttf");
}
@font-face {
font-family: "yousheTi";
src: url("./fonts/YouSheBiaoTiHei-2.ttf");
}
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 99;
height: 100vh;
width: 100vw;
.home-wrap {
height: 100vh;
width: 100vw;
background-image: url(./img/bj1.png);
background-size: 100% 100%;
display: flex;
flex-direction: row;
.home-left {
width: 578px;
height: 100%;
background-image: url(./img/leftBg.png);
background-size: 100% 100%;
padding-left: 48px;
padding-top: 54px;
.slick-prev {
width: 74px;
height: 54px;
left: 0;
bottom: -58px !important;
top: auto;
transform: rotate(180deg);
}
.slick-next {
width: 74px;
height: 54px;
right: 0;
top: auto;
bottom: -86px !important;
// transform: rotate(180deg);
}
.left-title,
.left-subTitle {
color: $yellow-color;
}
.left-title {
font-family: "shuheiTi";
font-size: 32px;
line-height: 32px;
}
.left-subTitle {
font-family: "FangSong";
font-size: 20px;
line-height: 20px;
padding-top: 4px;
}
.news-wrap {
.news-month {
width: 108px;
height: 32px;
line-height: 32px;
border-radius: 16px;
text-align: center;
color: $blue-color-light;
font-family: "alibaba";
background-color: $yellow-color;
font-size: 16px;
margin-top: 30px;
}
.news-content-title {
width: 414px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-family: "alibaba";
color: #fff;
font-size: 21px;
line-height: 21px;
margin-top: 14px;
}
.news-line {
width: 385px;
height: 16px;
margin-top: 12px;
}
.news-pic-wrap {
margin-top: 5px;
width: 379px;
height: 205px;
background: linear-gradient(
90.36deg,
rgba(238, 219, 181, 0.35) 1.9%,
rgba(246, 216, 176, 0) 99.81%
);
border-radius: 8px;
padding: 6px;
.news-pic {
height: 192px;
width: 367px;
border-radius: 3px;
}
}
.news-content {
margin-top: 11px;
color: rgba(255, 255, 255, 0.8);
font-family: "alibabaReg";
font-size: 18px;
height: 75px;
width: 390px;
line-height: 25px;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 限制显示的行数为3行 */
overflow: hidden;
text-overflow: ellipsis;
font-weight: 400;
}
}
.point-work {
padding-top: 47px;
.point-work-wrap {
width: 380px;
.point-work-page {
padding-top: 21px;
.point-work-item {
margin-top: 27px;
display: flex;
height: 40px;
width: 380px;
background: linear-gradient(
90.07deg,
rgba(238, 219, 181, 0.35) 1.77%,
rgba(246, 216, 176, 0) 99.99%
);
border-radius: 8px;
.point-work-item-num {
width: 38px;
height: 40px;
line-height: 41px;
background: linear-gradient(
180deg,
#f6d8b0 0%,
rgba(255, 255, 255, 0.32) 133.32%
);
border-radius: 8px 8px 0px 8px;
color: rgba(38, 90, 220, 1);
text-align: center;
}
.point-work-item-content {
font-family: "alibabaReg";
color: #fff;
font-size: 18px;
padding-left: 5px;
height: 40px;
line-height: 40px;
flex: 1;
flex-wrap: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
}
.home-right {
flex: 1;
padding-left: 10px;
padding-top: 54px;
.right-head {
display: flex;
.center-title-wrap {
position: relative;
img {
width: 308px;
}
.center-title {
position: absolute;
color: #fff;
font-family: "shuheiTi";
font-size: 28px;
line-height: 46px;
top: 0;
left: 28px;
letter-spacing: 3px;
}
.center-sub-title {
position: absolute;
font-family: FangSong;
color: #2648df;
font-size: 20px;
bottom: 0;
left: 60px;
width: 740px;
line-height: 20px;
}
}
.soft-title {
color: rgba(38, 72, 223, 1);
font-family: "shuheiTi";
font-size: 52px;
align-items: flex-start;
line-height: 52px;
padding-left: 24px;
}
}
.right-content {
width: 100%;
height: 100%;
padding-top: 86px;
position: relative;
.panel-title {
width: 27px;
// height: 187px;
font-family: "shuheiTi";
font-weight: 700;
color: #f6d8b0;
font-size: 27px;
line-height: 33px;
}
.top-section,
.bottom-section {
display: flex;
}
.first-panel,
.second-panel,
.third-panel,
.forth-panel {
width: 567px;
height: 337px;
background-size: 100%;
padding: 20px;
}
.top-section {
.first-panel {
background-image: url(./img/first_panel.png);
display: flex;
justify-content: flex-start;
.panel-title {
margin-left: 41px;
}
}
.second-panel {
background-image: url(./img/second_panel.png);
margin-left: 55px;
display: flex;
justify-content: flex-end;
.panel-title {
margin-right: 41px;
}
.white-panel-out {
display: flex;
justify-content: flex-end;
.white-panel-center {
display: flex;
justify-content: flex-end;
}
}
}
}
.bottom-section {
padding-top: 53px;
.third-panel {
background-image: url(./img/third_panel.png);
display: flex;
justify-content: flex-start;
align-items: flex-end;
.panel-title {
margin-left: 41px;
}
}
.forth-panel {
background-image: url(./img/forth_panel.png);
margin-left: 55px;
display: flex;
justify-content: flex-end;
align-items: flex-end;
.panel-title {
margin-right: 41px;
}
.white-panel-out {
display: flex;
justify-content: flex-end;
.white-panel-center {
display: flex;
justify-content: flex-end;
}
}
}
}
.white-panel-out {
width: 347px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 6px;
.white-panel-center {
width: 335px;
background-color: rgba(255, 255, 255, 0.5);
border-radius: 6px;
.white-panel-inner {
width: 323px;
height: 297px;
background-color: #fff;
border-radius: 6px;
padding: 20px;
.panel-item {
width: 100%;
.panel-item-content {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 0 6px;
.panel-item-content-left {
display: flex;
align-items: center;
font-family: "alibaba";
font-weight: 500;
color: #27254c;
font-size: 18px;
line-height: 18px;
img {
width: 15px;
height: 13px;
margin-right: 16px;
}
}
.panel-item-content-right-text{
color: #2648df;
width: 120px;
text-align: right;
font-family: "yousheTi";
font-size: 24px;
line-height: 36px;
height: 36px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.panel-item-content-right {
color: #2648df;
display: flex;
align-items: flex-end;
line-height: 36px;
height: 36px;
.panel-num {
font-family: "yousheTi";
font-size: 36px;
line-height: 36px;
}
.panel-unit {
font-family: "alibaba";
font-size: 13px;
line-height: 28px;
margin-left: 4px;
}
}
}
.panel-item-line {
height: 1px;
width: 100%;
background: linear-gradient(
90.21deg,
#2648df 2.02%,
#f6d8b0 98.88%
);
}
}
}
}
}
.center-panel {
position: absolute;
left: 50%;
top: 50%;
background-image: url(./img/center_panel.png);
background-size: 100%;
width: 402px;
height: 404px;
transform: translate(-50%, -50%);
margin-top: 43px;
margin-left: -68px;
display: flex;
flex-wrap: wrap;
.first-section,
.second-section,
.third-section,
.forth-section {
width: 50%;
height: 50%;
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 16px;
font-family: "alibabaReg";
.content {
display: flex;
flex-direction: column;
align-items: center;
}
img {
width: 32px;
}
}
.first-section {
.content {
margin-left: 26px;
margin-top: 26px;
}
}
.second-section {
.content {
margin-right: 26px;
margin-top: 26px;
}
}
.third-section {
.content {
margin-left: 26px;
margin-bottom: 26px;
}
}
.forth-section {
.content {
margin-right: 26px;
margin-bottom: 26px;
}
}
.center-section {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
color: #fff;
font-size: 13px;
font-family: "alibabaReg";
.month {
font-family: "shuheiTi";
font-size: 32px;
line-height: 32px;
}
.date {
font-size: 19px;
line-height: 32px;
}
}
}
}
}
}
}

View File

@ -0,0 +1,149 @@
/**
* 获取某个日期的农历
* @parmas {newDate} 日期 --
*/
export const getLunar = function (newDate){
var nyear;
var nmonth;
var nday = -1;
var nwday;
var nhrs;
var nmin;
var nsec;
var newDate = newDate;
var lmonth, lday, lleap; //农历参数
function Draw() {
NewTick();
//显示时间
var s = nyear + '年' + nmonth + '月' + nday + '日 ' + '星期' + cweekday(nwday) + ' ' + shapetime(nhrs, nmin, nsec);
s += " 农历" + lmonth + "月" + lday; //农历
var lunar_month_day=lmonth + "月" + lday;
return lunar_month_day;
}
function NewTick() {
var noww = newDate ? new Date(newDate) : new Date();
if (noww.getDate() != nday) {
nyear = noww.getFullYear();
nmonth = noww.getMonth() + 1;
nwday = noww.getDay();
nday = noww.getDate();
getlunar(); //获取农历
}
nhrs = noww.getHours();
nmin = noww.getMinutes();
nsec = noww.getSeconds();
}
//辅助函数
var hzWeek = new Array("日", "一", "二", "三", "四", "五", "六", "日");
function cweekday(wday) {
return hzWeek[wday];
}
function shapetime(vhrs, vmin, vsec) {
if (vsec <= 9) vsec = "0" + vsec;
if (vmin <= 9) vmin = "0" + vmin;
if (vhrs <= 9) vhrs = "0" + vhrs;
return vhrs + ":" + vmin + ":" + vsec
}
//农历函数开始
var lunarInfo = new Array(0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, //1990
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, 0x14b63);
function lYearDays(y) {
var i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) sum += (lunarInfo[y - 1900] & i) ? 1 : 0;
return (sum + leapDays(y));
}
function leapDays(y) {
if (leapMonth(y)) return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
else return (0);
}
function leapMonth(y) {
return (lunarInfo[y - 1900] & 0xf);
}
function monthDays(y, m) {
return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
}
function Lunar(y, m, d) {
var i, leap = 0,
temp = 0;
var offset = (Date.UTC(y, m, d) - Date.UTC(1900, 0, 31)) / 86400000;
for (i = 1900; i < 2050 && offset > 0; i++) {
temp = lYearDays(i);
offset -= temp;
}
if (offset < 0) {
offset += temp;
i--;
}
this.year = i;
leap = leapMonth(i);
this.isLeap = false;
for (i = 1; i < 13 && offset > 0; i++) {
if (leap > 0 && i == (leap + 1) && this.isLeap == false) {--i;
this.isLeap = true;
temp = leapDays(this.year);
} else {
temp = monthDays(this.year, i);
}
if (this.isLeap == true && i == (leap + 1)) this.isLeap = false;
offset -= temp;
}
if (offset == 0 && leap > 0 && i == leap + 1) if (this.isLeap) {
this.isLeap = false;
} else {
this.isLeap = true; --i;
}
if (offset < 0) {
offset += temp; --i;
}
this.month = i;
this.day = offset + 1;
}
var nStr1 = new Array('', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二');
var nStr2 = new Array('初', '十', '廿', '卅', '□');
function GetcDay(d) {
var s;
switch (d) {
case 10:
s = '初十';
break;
case 20:
s = '二十';
break;
case 30:
s = '三十';
break;
default:
s = nStr2[Math.floor(d / 10)];
s += nStr1[d % 10];
break;
}
return (s);
}
function GetcMon(m) {
if (m == 1) return '正';
else return nStr1[m];
}
function getlunar() {
var lObj = new Lunar(nyear, nmonth - 1, nday);
lmonth = GetcMon(lObj.month);
lday = GetcDay(lObj.day);
lleap = lObj.isLeap;
if (lleap == 1) {
lmonth = "闰" + lmonth;
}
}
//农历函数结束
return Draw();
}

View File

@ -296,6 +296,7 @@ export function TPMIndexHOC(WrappedComponent) {
};
let path =this.props.location.pathname;
let pathCheck = path.indexOf("/zone")>-1 && path.indexOf("/newdetail")>-1 && isPhone();
let notFullPage = !path.includes('softwareFactory')
return (
<div className="indexHOC">
{(!path || (path && !path.includes('glcc') )) && <SiderBar {...this.props} {...this.state}/>}
@ -318,7 +319,7 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.state}
/> : ""}
{npsModalVisible && <NpsModal closeNpsModal={()=>{this.closeNpsModal()}} npsActionType={npsActionType} npsActionId={npsActionId}/>}
{ !pathCheck && <Header {...this.state} {...this.props} {...common} publicNav={publicNav} mygetHelmetapi={ mygetHelmetapi }></Header> }
{ !pathCheck && notFullPage && <Header {...this.state} {...this.props} {...common} publicNav={publicNav} mygetHelmetapi={ mygetHelmetapi }></Header> }
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large" tip={this._gLoadingTip || "加载中..."}
>
@ -332,7 +333,7 @@ export function TPMIndexHOC(WrappedComponent) {
}
</div>
</Spin>
{!pathCheck && <NewFooter {...this.state} {...this.props} /> }
{!pathCheck && notFullPage && !path.includes('softwareFactory') && <NewFooter {...this.state} {...this.props} /> }
</div>
);
}