|
|
@ -16,16 +16,15 @@ const Right = (props) => { |
|
|
|
const [shuzu, setShuzu] = useState([]) |
|
|
|
useEffect(() => { |
|
|
|
const daolus = dispatch(getRoadmaintain()).then((res) => { |
|
|
|
// console.log(res);
|
|
|
|
setList(res.payload.data.reportList.filter((item, index) => { |
|
|
|
|
|
|
|
return item.projectType == "road" |
|
|
|
})) |
|
|
|
setNums(res.payload.data.reportCount.filter((item, index) => { |
|
|
|
return item.projectType == "road" |
|
|
|
return item.projectType == "road" || item.projectType == "countyRoad" || item.projectType == "villageRoad" || item.projectType == "rusticRoad" |
|
|
|
})) |
|
|
|
// console.log(res.payload.data);
|
|
|
|
|
|
|
|
setNums(res.payload.data.reportCount.reduce((count, item) => { |
|
|
|
if (item.projectType == "road" || item.projectType == "countyRoad" || item.projectType == "villageRoad" || item.projectType == "rusticRoad") { |
|
|
|
count += parseInt(item.count) |
|
|
|
} |
|
|
|
return count |
|
|
|
}, 0)) |
|
|
|
}) |
|
|
|
}, []) |
|
|
|
useEffect(() => { |
|
|
@ -35,7 +34,7 @@ const Right = (props) => { |
|
|
|
// const
|
|
|
|
}) |
|
|
|
}, []) |
|
|
|
// console.log("1211", nums);
|
|
|
|
console.log("1211", nums); |
|
|
|
const renderBody = () => { |
|
|
|
return ( |
|
|
|
|
|
|
@ -64,18 +63,19 @@ const Right = (props) => { |
|
|
|
<p style={{ textAlign: "left", width: "25%", position: "absolute", left: "5%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }} >{item.road ? item.road : "--"}</p> |
|
|
|
<p style={{ textAlign: "right", width: "30%", position: "absolute", right: "3%", color: beijing == index ? "#ffffff" : "rgba(216,240,255,0.8)" }}>{moment(item.time).format("YYYY-MM-DD HH:mm:ss") ? moment(item.time).format("YYYY-MM-DD HH:mm:ss") : "--"}</p> |
|
|
|
{ |
|
|
|
num == index ? <div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "50%", marginTop: "0", top: "35%" }}> |
|
|
|
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> |
|
|
|
<div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}> |
|
|
|
<Hua shuzu={[{ "imgs": item.conserveAfterPic ? item.conserveAfterPic[0] : "" }, { "imgs": item.conserveBeforePic ? item.conserveBeforePic[0] : "" }, { "imgs": item.conserveUnderwayPic ? item.conserveUnderwayPic[0] : "" }]} /> |
|
|
|
</div> |
|
|
|
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> |
|
|
|
<p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "——" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}</p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>养护类型<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>日常养护</span></p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>负责人<span style={{ color: "#EEF4FF", marginLeft: "45px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.user?.name ? item.user.name : "--"}</span></p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "60px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{moment(item.time).format("YYYY-MM-DD") ? moment(item.time).format("YYYY-MM-DD") : "--"}</span></p> |
|
|
|
</div> |
|
|
|
</div> : "" |
|
|
|
num == index ? |
|
|
|
<div style={{ position: "fixed", width: "400px", height: "200px", zIndex: 100, left: "50%", marginTop: "0", top: "35%" }}> |
|
|
|
<img src='/assets/images/leadership/beijinglan.png' style={{ width: "100%", height: "100%" }} /> |
|
|
|
<div style={{ width: "50%", height: "100%", position: "absolute", top: "0", }}> |
|
|
|
<Hua shuzu={[{ "imgs": item.conserveAfterPic ? item.conserveAfterPic[0] : "" }, { "imgs": item.conserveBeforePic ? item.conserveBeforePic[0] : "" }, { "imgs": item.conserveUnderwayPic ? item.conserveUnderwayPic[0] : "" }]} /> |
|
|
|
</div> |
|
|
|
<div style={{ position: "absolute", top: "0", width: "50%", left: "50%", paddingRight: "10px" }}> |
|
|
|
<p style={{ marginTop: "20px", color: "#FFFFFF", fontSize: "16px", fontFamily: "YouSheBiaoTiHei" }}>{item.roadSectionStart ? item.roadSectionStart : ""}{item.roadSectionStart && item.roadSectionEnd ? "——" : ""}{item.roadSectionEnd ? item.roadSectionEnd : ""}{item.roadSectionStart || item.roadSectionEnd ? "" : "--"}</p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>养护类型<span style={{ color: "#EEF4FF", marginLeft: "30px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>日常养护</span></p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>负责人<span style={{ color: "#EEF4FF", marginLeft: "45px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{item.user?.name ? item.user.name : "--"}</span></p> |
|
|
|
<p style={{ color: "rgba(216,240,255,0.8)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC" }}>日期<span style={{ color: "#EEF4FF", marginLeft: "60px", fontFamily: " PingFangSC-Medium, PingFang SC" }}>{moment(item.time).format("YYYY-MM-DD") ? moment(item.time).format("YYYY-MM-DD") : "--"}</span></p> |
|
|
|
</div> |
|
|
|
</div> : "" |
|
|
|
} |
|
|
|
</li> |
|
|
|
) |
|
|
@ -88,7 +88,6 @@ const Right = (props) => { |
|
|
|
} |
|
|
|
return ( |
|
|
|
<> |
|
|
|
{/* <Spin spinning={!nums && list && roads} tip="Loading" size="large" > */} |
|
|
|
<div style={{ width: "100%", height: "100%", float: "right", marginRight: "1%", position: "relative" }}> |
|
|
|
|
|
|
|
<div style={{ width: "100%", height: "43%", position: "relative", left: "1%" }}> |
|
|
@ -118,7 +117,7 @@ const Right = (props) => { |
|
|
|
{/* <p>{title || []}</p> */} |
|
|
|
<img src='/assets/images/quanju/icon.png' style={{ width: "24px", position: "absolute", left: "-1%", top: "18%" }} /> |
|
|
|
<span style={{ position: "absolute", color: "#FFFFFF", fontSize: "24px", fontFamily: "YouSheBiaoTiHei", left: "19px" }}>养护事件</span> |
|
|
|
<p style={{ position: "absolute", color: "#D8F0FF", fontSize: "14px", right: "6%" }}><span style={{ marginLeft: "-20%" }}>道路</span><span style={{ fontSize: "18px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", marginLeft: "10%" }}>{nums ? nums[0]?.count : 0}</span><span style={{ marginLeft: "10%" }}>次</span></p> |
|
|
|
<p style={{ position: "absolute", color: "#D8F0FF", fontSize: "14px", right: "6%" }}><span style={{ marginLeft: "-20%" }}>道路</span><span style={{ fontSize: "18px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", marginLeft: "10%" }}>{nums}</span><span style={{ marginLeft: "10%" }}>次</span></p> |
|
|
|
{/* <img src='/assets/images/leadership/zibiaoti.png' style={{ width: "95%", height: "34px", position: "absolute", top: "12px", left: "6%" }} /> */} |
|
|
|
</div> |
|
|
|
{/* <Spin spinning={true} style={{ height: "80%" }}> */} |
|
|
|