Browse Source

feat(): 添加大屏底部车场切换的功能

tags/PMS_Frontend_v1.0.6-develop
chenqiang 1 year ago
parent
commit
481e2d954e
  1. 198
      src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx
  2. 15
      src/services/ParkingOverview/index.js

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

@ -161,7 +161,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
align: "center",
},
];
//
//qf
const qfcolumn = [
{
title: "车牌号",
@ -227,13 +227,13 @@ const ParkingOverview = connect(function mapStateToProps(state) {
//
const [LeftShow, setLeftShow] = useState([
{
text: "车场总数",
text: "车场总数",
value: "parkTotal",
img: Lf1,
status: "",
},
{
text: "泊位总数",
text: "停车场泊位总数",
value: "berthTotal",
img: Lf2,
status: "",
@ -308,100 +308,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
total: 0,
});
//
const [qfdata, setqfdata] = useState([
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
{
cp: "鄂D24364",
je: "143",
},
]);
const [qfdata, setqfdata] = useState([]);
//
const [Zata, setZata] = useState({
@ -448,8 +355,9 @@ const ParkingOverview = connect(function mapStateToProps(state) {
//
const [CarRoad, setCarRoad] = useState([
{
text: "西海岸新区",
label: "西海岸新区",
value: "1",
type: 1,
},
]);
//
@ -945,28 +853,12 @@ const ParkingOverview = connect(function mapStateToProps(state) {
setCarShow(index + 1);
}
}
setRoadSelect("1");
};
//
const BottomTab = (val) => {
setRoadSelect(val);
};
//
const WordS = (
data = {
pl: "鄂A1234",
time: "2023.09.09 10:10:10",
road: "青岛停车场",
type: "1",
}
) => {
var str = "";
if ((data.type = 1)) {
str = `车牌号:${data.pl}入场时间${data.time}入场路段:${data.road}`;
} else {
str = `车牌号:${data.pl}出场时间${data.time}出场路段:${data.road}`;
}
return str;
};
//
const SpeakWord = (val) => {
setText(val);
@ -976,7 +868,11 @@ const ParkingOverview = connect(function mapStateToProps(state) {
//(7)
const GetOverviewData = (val) => {
ajax.ParkingOverview.GetOverviewData({ type: val }).then(
ajax.ParkingOverview.GetOverviewData({
type: val,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
setLeftDataTop({ ...res?.data });
@ -993,7 +889,11 @@ const ParkingOverview = connect(function mapStateToProps(state) {
};
//(7)
const GetUseInfo = (val) => {
ajax.ParkingOverview.GetUseInfo({ type: val }).then(
ajax.ParkingOverview.GetUseInfo({
type: val,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
setLeftDataOther({ ...res.data });
@ -1027,7 +927,6 @@ const ParkingOverview = connect(function mapStateToProps(state) {
crtimer.onmessage = function (evt) {
var data = JSON.parse(evt.data);
console.log(data);
if (data?.data?.type == "inOutNotice") {
SpeakWord(data?.data?.content);
} else if (data?.data?.type == "arrears") {
@ -1035,30 +934,13 @@ const ParkingOverview = connect(function mapStateToProps(state) {
setHoShow(true);
}
};
// ajax.ParkingOverview.GetCar({ type: val, dateType: item }).then(
// (res) => {
// if (parseInt(res?.status) === 20000) {
// SpeakWord(WordS(res?.data));
// } else {
// message.error(res?.message);
// }
// setLoading(true);
// },
// (err) => {
// console.log(err);
// setLoading(true);
// }
// );
};
//
const GetQfCar = (val, item) => {
ajax.ParkingOverview.GetQfCar({ type: val, dateType: item }).then(
//quyu
const GetAreaShop = () => {
ajax.ParkingOverview.GetAreaShop().then(
(res) => {
if (parseInt(res?.status) === 20000) {
// if () {
// setqfdata(res?.data);
// setHoShow(true)
// }
setCarRoad(res?.data || []);
} else {
message.error(res?.message);
}
@ -1090,7 +972,11 @@ const ParkingOverview = connect(function mapStateToProps(state) {
};
//
const getMapData = (val) => {
ajax.ParkingOverview.getMapData({ type: val }).then(
ajax.ParkingOverview.getMapData({
type: val,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
let arrcopy = res?.data.map((ele, index) => {
@ -1143,7 +1029,11 @@ const ParkingOverview = connect(function mapStateToProps(state) {
};
//-
const GetDataStatic = (val) => {
ajax.ParkingOverview.GetDataStatic({ type: val }).then(
ajax.ParkingOverview.GetDataStatic({
type: val,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
setZata(res?.data);
@ -1163,6 +1053,8 @@ const ParkingOverview = connect(function mapStateToProps(state) {
ajax.ParkingOverview.GetRevenueAnalysis({
type: val,
dateType: item,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
@ -1183,6 +1075,8 @@ const ParkingOverview = connect(function mapStateToProps(state) {
ajax.ParkingOverview.GetParkingEvaluate({
type: val,
dateType: item,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
@ -1200,7 +1094,12 @@ const ParkingOverview = connect(function mapStateToProps(state) {
);
}; //
const GetComplaintType = (val, item) => {
ajax.ParkingOverview.GetComplaintType({ type: val, dateType: item }).then(
ajax.ParkingOverview.GetComplaintType({
type: val,
dateType: item,
areaType: CarRoad[CarShow].type,
value: CarRoad[CarShow].value,
}).then(
(res) => {
if (parseInt(res?.status) === 20000) {
getOingOption(res?.data);
@ -1311,19 +1210,15 @@ const ParkingOverview = connect(function mapStateToProps(state) {
GetRevenueAnalysis(RoadSelect, "1");
GetParkingEvaluate(RoadSelect, "1");
GetComplaintType(RoadSelect, "1");
}, [RoadSelect]);
}, [RoadSelect, CarShow]);
useEffect(() => {
getSelectData();
// qftimer = setInterval(() => {
// GetQfCar();
// }, 2000);
// crtimer = setInterval(() => {
GetCar();
// }, 2000);
GetAreaShop();
return () => {
clearInterval(qftimer);
crtimer.close();
// clearInterval(crtimer);
};
}, []);
return (
@ -1466,6 +1361,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
""
)}
{Text && (
// CarRoad[CarShow].type == 1 &&
<div className="left_content">
<p>
<SoundOutlined />
@ -1667,8 +1563,8 @@ const ParkingOverview = connect(function mapStateToProps(state) {
<div className="q" onClick={() => BottomCar("left")}>
<img src={Pkhl} alt="" srcset="" />
</div>
<p className="taw" title={CarRoad[CarShow]?.text || ""}>
{CarRoad[CarShow]?.text || ""}
<p className="taw" title={CarRoad[CarShow]?.label || ""}>
{CarRoad[CarShow]?.label || ""}
</p>
<div className="q" onClick={() => BottomCar("right")}>
<img src={Pkhr} alt="" srcset="" />

15
src/services/ParkingOverview/index.js

@ -98,19 +98,10 @@ export default {
});
},
//获取出入
GetCar: (params) => {
//获取区域或商户
GetAreaShop: (params) => {
return ajax({
url: "/api/ana/overview/berthUseInfo",
type: "get",
data: params,
});
},
//获取欠费
GetQfCar: (params) => {
return ajax({
url: "/api/ana/overview/berthUseInfo",
url: "/api/ana/overview/getOperatorArea",
type: "get",
data: params,
});

Loading…
Cancel
Save