From f3baff509cbd253019ad0780d053cdac0bc13cfc Mon Sep 17 00:00:00 2001 From: xingjx Date: Mon, 18 Dec 2023 00:22:43 +0800 Subject: [PATCH] =?UTF-8?q?fix():bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx | 19 ++++++------------- .../OutSegmentMgm/OutSegment/AddParking.jsx | 11 ++++++++++- .../ConfigParking/BusinessParameterConfig.jsx | 3 ++- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx index 554db83..aead4f8 100644 --- a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx @@ -261,8 +261,7 @@ function ParkingAlyPeriod() { this.random(arr) } } - const color = ['#5470c6','#91cc75','#fac858','#ee6666','#73c0de','#fc8452','#3ba272','#9a60b4','#ee7ccc'] - console.log(Math.round(Math.random()*10)) + const color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#fc8452', '#3ba272', '#9a60b4', '#ee7ccc'] //停车饱和趋势分析分析 折线图 hour 时间对比 const getParkOptionHour = (data) => { console.log(data) @@ -277,7 +276,7 @@ function ParkingAlyPeriod() { ); // 构建数据对象 let seriesData = areaNames.map((areaName, index) => { - let color2 = color[Math.round(Math.random()*10)] + let color2 = color[Math.round(Math.random() * 10)] // 获取数据 let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data // 构建数据对象 @@ -293,8 +292,8 @@ function ParkingAlyPeriod() { }, normal: { color: color2, //改变折线点的颜色 - lineStyle:{ - color:color2, + lineStyle: { + color: color2, } //改变折线颜色 } @@ -320,13 +319,7 @@ function ParkingAlyPeriod() { }; }); - setHourData({ - ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData), - // tooltip: { - // trigger: "axis", - // formatter: "{a}
{b}:{c}", - // }, - }); + setHourData({ ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData) }); }; function getParkingIncome(data) { ajax @@ -346,8 +339,8 @@ function ParkingAlyPeriod() { if (res.status === 20000) { getParkOption(res.data.list?.area_list); setKeyVal(res.data.list?.hour_list.length) + setHourData({}) getParkOptionHour(res.data.list?.hour_list); - } }) .catch((err) => console.error(err)); diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx index 451030e..fdc024d 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx @@ -44,6 +44,7 @@ function AddParking(props) { } }); const [lngLatVisible, setLngLatVisible] = useState(false); + const [topBerthNum, setTopBerthNum] = useState(); const [lngLat, setLngLat] = useState(() => { if (status === "add") return []; else { @@ -167,8 +168,12 @@ function AddParking(props) { cooperate_type, access_type, lng_lat, - area + area, + total_berth_number, + berth_number//返回一级泊位数和总泊位数 } = res.data; + let num = parseInt(total_berth_number) - parseInt(berth_number) + setTopBerthNum(num) let arr = [] arr.push(area) form.setFieldsValue({ @@ -237,6 +242,10 @@ function AddParking(props) { message.error('车场泊位数必须为数字!') return } + if (topBerthNum && parseFloat(total_berth_number) < topBerthNum) { + message.error('下级车场泊位数与一级车场泊位数之和不超过泊位总数!此处总车场泊位数不超过' + topBerthNum) + //return + } const params = { ...values, img: processImgData(fileList), diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx index 1f7a4e1..aecccd6 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx @@ -16,7 +16,8 @@ function BusinessParameterConfig(props) { ajax.getRoadServiceEdit(params).then((res) => { if (res.status === 20000) { message.success(res.message); - + }else{ + message.error("请填写完整!") } }); }