Browse Source

feat(): 增加时间显示

tags/PMS_Frontend_v1.0.6-develop
chenqiang 1 year ago
parent
commit
73218786c1
  1. 11
      src/pages/DataAnalysisPrediction/ParkingOverview/index.scss
  2. 21
      src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx

11
src/pages/DataAnalysisPrediction/ParkingOverview/index.scss

@ -381,6 +381,17 @@ $color-primary : var(--color-primary);
} }
} }
.r_xd {
z-index: 1000;
width: max-content;
height: 30px;
position: absolute;
top: 40px;
right: 120px;
color: #fff;
white-space: nowrap;
}
.r_xld { .r_xld {
z-index: 1000; z-index: 1000;
width: 30px; width: 30px;

21
src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx

@ -56,12 +56,13 @@ import Kx from "@/assets/images/equip/home/kx.png";
import Yc from "@/assets/images/equip/home/yc.png"; import Yc from "@/assets/images/equip/home/yc.png";
import Poto from "@/assets/images/equip/home/poto.png"; import Poto from "@/assets/images/equip/home/poto.png";
import BaseMap from "./Map"; import BaseMap from "./Map";
import moment from "moment";
// import errorImg from "@/assets/images/layout/error.png" // import errorImg from "@/assets/images/layout/error.png"
// import { useLocation } from "react-router-dom"; // import { useLocation } from "react-router-dom";
let timer = null; let timer = null;
let qftimer = null; let qftimer = null;
let crtimer = null; let crtimer = null;
let option = null;
let timerption = null;
const ParkingOverview = connect(function mapStateToProps(state) { const ParkingOverview = connect(function mapStateToProps(state) {
return { return {
user: state.user, user: state.user,
@ -477,7 +478,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
]); ]);
// //
const [CarShow, setCarShow] = useState(0); const [CarShow, setCarShow] = useState(0);
const [DayDa, setDayDa] = useState("");
// //
function onShowSizeChange(pn, size) { function onShowSizeChange(pn, size) {
let temFormData = {}; let temFormData = {};
@ -614,7 +615,10 @@ const ParkingOverview = connect(function mapStateToProps(state) {
setOption([]); setOption([]);
} }
}; };
//
const DateDay = () => {
return moment().format("YYYY/MM/DD HH:mm");
};
// //
const SelectDay = (str, val) => { const SelectDay = (str, val) => {
if (str == 1) { if (str == 1) {
@ -752,7 +756,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
}; };
// //
const getRevenueOption = ( const getRevenueOption = (
data = [
datas = [
{ {
key: "", key: "",
value: 0, value: 0,
@ -760,7 +764,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
] ]
) => { ) => {
// //
let data = datas.sort((a, b) => a.key - b.key);
setRightThree({ setRightThree({
title: { title: {
text: "", text: "",
@ -847,7 +851,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
grid: { grid: {
x: 50, x: 50,
y: 35, y: 35,
x2: 20,
x2: 30,
y2: 30, y2: 30,
}, },
}); });
@ -1298,8 +1302,12 @@ const ParkingOverview = connect(function mapStateToProps(state) {
getSelectData(); getSelectData();
GetCar(); GetCar();
GetAreaShop(); GetAreaShop();
timerption = setInterval(() => {
setDayDa(DateDay());
}, 1000);
return () => { return () => {
clearInterval(qftimer); clearInterval(qftimer);
clearInterval(timerption);
crtimer.close(); crtimer.close();
}; };
}, []); }, []);
@ -1551,6 +1559,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
</div> </div>
</div> </div>
</div> </div>
<div className="r_xd">{DayDa}</div>
<div <div
className="r_xld" className="r_xld"
onClick={() => { onClick={() => {

Loading…
Cancel
Save