diff --git a/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx index 0331cf1..086ad90 100644 --- a/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/ParkingOverview/loadable.jsx @@ -430,7 +430,7 @@ const ParkingOverview = connect(function mapStateToProps(state) { const [CarRoad, setCarRoad] = useState([ { label: "西海岸新区", - value: "1", + value: "0", type: 1, }, ]); @@ -578,12 +578,12 @@ const ParkingOverview = connect(function mapStateToProps(state) { const SelectDay = (str, val) => { if (str == 1) { setDaySel(val); - if (CarRoad[CarShow].type == 1) { + if (CarRoad[CarShow]?.type == 1) { GetComplaintType(RoadSelect, val); } } else if (str == 2) { setDaySet(val); - if (CarRoad[CarShow].type == 2) { + if (CarRoad[CarShow]?.type == 2) { GetincomeType(RoadSelect, val); } else { GetParkingEvaluate(RoadSelect, val); @@ -1374,8 +1374,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { const GetOverviewData = (val) => { ajax.ParkingOverview.GetOverviewData({ type: val, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1394,8 +1394,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { //车场总数 单独提供给区大屏 const GetParkinfo = () => { ajax.ParkingOverview.GetParkinfo({ - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1415,8 +1415,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { const GetUseInfo = (val) => { ajax.ParkingOverview.GetUseInfo({ type: val, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1464,8 +1464,17 @@ const ParkingOverview = connect(function mapStateToProps(state) { ajax.ParkingOverview.GetAreaShop().then( (res) => { if (parseInt(res?.status) === 20000) { - setCarRoad(res?.data || []); + setCarRoad( + res?.data || [ + { + label: "西海岸新区", + value: "0", + type: 1, + }, + ] + ); } else { + message.error(res?.message); } setLoading(true); @@ -1498,8 +1507,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { const getMapData = (val) => { ajax.ParkingOverview.getMapData({ type: val, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1555,8 +1564,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { const GetDataStatic = (val) => { ajax.ParkingOverview.GetDataStatic({ type: val, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1576,8 +1585,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { //获取收费top5 const GetrateRank = () => { ajax.ParkingOverview.GetrateRank({ - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1599,8 +1608,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { ajax.ParkingOverview.GetincomeType({ type: val, dateType: item, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1622,8 +1631,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { ajax.ParkingOverview.GetRevenueAnalysis({ type: val, dateType: item, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1645,8 +1654,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { ajax.ParkingOverview.GetParkingEvaluate({ type: val, dateType: item, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1668,8 +1677,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { ajax.ParkingOverview.GetComplaintType({ type: val, dateType: item, - areaType: CarRoad[CarShow].type, - value: CarRoad[CarShow].value, + areaType: CarRoad[CarShow]?.type, + value: CarRoad[CarShow]?.value, }).then( (res) => { if (parseInt(res?.status) === 20000) { @@ -1778,7 +1787,7 @@ const ParkingOverview = connect(function mapStateToProps(state) { // GetDataStatic(RoadSelect); GetUseInfo(RoadSelect); GetRevenueAnalysis(RoadSelect, "1"); - if (CarRoad[CarShow].type == 2) { + if (CarRoad[CarShow]?.type == 2) { GetrateRank(); GetincomeType(RoadSelect, "1"); GetOverviewData(RoadSelect); @@ -1812,7 +1821,7 @@ const ParkingOverview = connect(function mapStateToProps(state) {
停车业务概览
- {CarRoad[CarShow].type == 2 + {CarRoad[CarShow]?.type == 2 ? LeftShow.map((ele) => { return (
: ""}
- {CarRoad[CarShow].type == 2 ? ( + {CarRoad[CarShow]?.type == 2 ? (
收费员排行Top5
@@ -2113,8 +2122,8 @@ const ParkingOverview = connect(function mapStateToProps(state) { )}
- {CarRoad[CarShow].type == 2 ? "营业收入分析" : "车场服务评价"} - {CarRoad[CarShow].type == 1 && ( + {CarRoad[CarShow]?.type == 2 ? "营业收入分析" : "车场服务评价"} + {CarRoad[CarShow]?.type == 1 && ( 统计范围内用户对车场进行评价的不同分值占比} @@ -2138,7 +2147,7 @@ const ParkingOverview = connect(function mapStateToProps(state) { ); })}
- {CarRoad[CarShow].type == 1 ? ( + {CarRoad[CarShow]?.type == 1 ? (
) : (