From 481e2d954e2f94967e3992835ea8966d96b9fd74 Mon Sep 17 00:00:00 2001 From: chenqiang Date: Tue, 12 Dec 2023 16:25:59 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E6=B7=BB=E5=8A=A0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E8=BD=A6=E5=9C=BA=E5=88=87=E6=8D=A2=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingOverview/loadable.jsx | 198 +++++---------------- src/services/ParkingOverview/index.js | 15 +- 2 files changed, 50 insertions(+), 163 deletions(-) diff --git a/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx index d287edc..3ab441c 100644 --- a/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx +++ b/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 &&

@@ -1667,8 +1563,8 @@ const ParkingOverview = connect(function mapStateToProps(state) {

BottomCar("left")}>
-

- {CarRoad[CarShow]?.text || ""} +

+ {CarRoad[CarShow]?.label || ""}

BottomCar("right")}> diff --git a/src/services/ParkingOverview/index.js b/src/services/ParkingOverview/index.js index 9cfc098..9d43bd2 100644 --- a/src/services/ParkingOverview/index.js +++ b/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, });