Browse Source

fix():bug修改

tags/PMS_Frontend_v1.0.6-develop
xingjx 1 year ago
parent
commit
f3baff509c
  1. 19
      src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx
  2. 11
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx
  3. 3
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx

19
src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyPeriod/loadable.jsx

@ -261,8 +261,7 @@ function ParkingAlyPeriod() {
this.random(arr) 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 // 线 hour
const getParkOptionHour = (data) => { const getParkOptionHour = (data) => {
console.log(data) console.log(data)
@ -277,7 +276,7 @@ function ParkingAlyPeriod() {
); );
// //
let seriesData = areaNames.map((areaName, index) => { 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 let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data
// //
@ -293,8 +292,8 @@ function ParkingAlyPeriod() {
}, },
normal: { normal: {
color: color2, //线 color: color2, //线
lineStyle:{
color:color2,
lineStyle: {
color: color2,
} }
//线 //线
} }
@ -320,13 +319,7 @@ function ParkingAlyPeriod() {
}; };
}); });
setHourData({
...lineChartOption(areaNames, xAxisData, "饱和度", seriesData),
// tooltip: {
// trigger: "axis",
// formatter: "{a}<br/>{b}{c}",
// },
});
setHourData({ ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData) });
}; };
function getParkingIncome(data) { function getParkingIncome(data) {
ajax ajax
@ -346,8 +339,8 @@ function ParkingAlyPeriod() {
if (res.status === 20000) { if (res.status === 20000) {
getParkOption(res.data.list?.area_list); getParkOption(res.data.list?.area_list);
setKeyVal(res.data.list?.hour_list.length) setKeyVal(res.data.list?.hour_list.length)
setHourData({})
getParkOptionHour(res.data.list?.hour_list); getParkOptionHour(res.data.list?.hour_list);
} }
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));

11
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx

@ -44,6 +44,7 @@ function AddParking(props) {
} }
}); });
const [lngLatVisible, setLngLatVisible] = useState(false); const [lngLatVisible, setLngLatVisible] = useState(false);
const [topBerthNum, setTopBerthNum] = useState();
const [lngLat, setLngLat] = useState(() => { const [lngLat, setLngLat] = useState(() => {
if (status === "add") return []; if (status === "add") return [];
else { else {
@ -167,8 +168,12 @@ function AddParking(props) {
cooperate_type, cooperate_type,
access_type, access_type,
lng_lat, lng_lat,
area
area,
total_berth_number,
berth_number//
} = res.data; } = res.data;
let num = parseInt(total_berth_number) - parseInt(berth_number)
setTopBerthNum(num)
let arr = [] let arr = []
arr.push(area) arr.push(area)
form.setFieldsValue({ form.setFieldsValue({
@ -237,6 +242,10 @@ function AddParking(props) {
message.error('车场泊位数必须为数字!') message.error('车场泊位数必须为数字!')
return return
} }
if (topBerthNum && parseFloat(total_berth_number) < topBerthNum) {
message.error('下级车场泊位数与一级车场泊位数之和不超过泊位总数!此处总车场泊位数不超过' + topBerthNum)
//return
}
const params = { const params = {
...values, ...values,
img: processImgData(fileList), img: processImgData(fileList),

3
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx

@ -16,7 +16,8 @@ function BusinessParameterConfig(props) {
ajax.getRoadServiceEdit(params).then((res) => { ajax.getRoadServiceEdit(params).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
message.success(res.message); message.success(res.message);
}else{
message.error("请填写完整!")
} }
}); });
} }

Loading…
Cancel
Save