From b0695114ee48ab80ceb746cf6b8afdc5ea86740f Mon Sep 17 00:00:00 2001 From: xingjx Date: Wed, 10 Jan 2024 11:15:56 +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 --- .../ConfigParking/BusinessParameterConfig.jsx | 59 ++++++------ .../ConfigParking/CarMgm/BlacklistManagement.jsx | 17 +++- .../ConfigParking/CarMgm/CarGroupMgm.jsx | 100 ++++++++++++++++----- .../ConfigParking/CarMgm/CarManagement.jsx | 73 ++++++++++----- .../CarMgm/OffPeakVehicleManagement.jsx | 16 ++-- .../ConfigParking/CarMgm/WhitelistManagement.jsx | 17 +++- .../OutSegment/ConfigParking/LEDConfiguration.jsx | 11 ++- .../OutSegment/ConfigParking/index.jsx | 2 +- .../OutRoadMgm/OutSegmentMgm/OutSegment/Detail.jsx | 3 +- .../OutSegmentMgm/OutSegment/loadable.jsx | 4 +- src/services/OutRoadMgm/OutSegment.js | 19 ++++ 11 files changed, 233 insertions(+), 88 deletions(-) diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx index d9757c9..26d9833 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx @@ -3,7 +3,8 @@ import { Button, Form, Radio, InputNumber, Select, Row, Col, message } from "ant import ajax from "@/services"; import "./BusinessParameterConfig.scss"; function BusinessParameterConfig(props) { - const { id } = props; + console.log(props) + const { id, type } = props; const [form] = Form.useForm(); const [childList, setChildList] = useState([]); @@ -123,32 +124,36 @@ function BusinessParameterConfig(props) { /> - - - - - - - - - - - - - + + + : null + }
diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx index 4b68e07..1447731 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx @@ -21,6 +21,7 @@ const { TextArea } = Input; function BlacklistManagement({ id }) { const [searchForm] = Form.useForm(); const [editForm] = Form.useForm(); + const [deleteModal, setDeleteModal] = useState(false); const columns = [ { title: "序号", @@ -113,7 +114,8 @@ function BlacklistManagement({ id }) {
{ - deleteBlackVehicle(record.id); + setCurrentId(record.id); + setDeleteModal(true) }} > 删除 @@ -205,6 +207,7 @@ function BlacklistManagement({ id }) { ajax.deleteBlackVehicle({ id }).then((res) => { if (res.status === 20000) { message.success("删除成功"); + setDeleteModal(false); submit(); } else { message.error(res.message); @@ -452,6 +455,18 @@ function BlacklistManagement({ id }) { { setDeleteModal(false) }} + onOk={() => { deleteBlackVehicle(currentId); }} + //footer={null} + className="applyCopyModal" + title='提示' + > +
+ 确认是否删除该记录! +
+
+ { setBatchUploadModal(false) }} onOk={() => { }} diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx index 8304048..781ef32 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx @@ -16,6 +16,8 @@ const { TextArea } = Input; function CarGroupMgm({ id }) { const [searchForm] = Form.useForm(); const [editForm] = Form.useForm(); + const [total, setTotal] = useState(0); + const [deleteModal, setDeleteModal] = useState(false); const columns = [ { title: "车辆组名称", @@ -25,8 +27,8 @@ function CarGroupMgm({ id }) { }, { title: "车辆类型", - dataIndex: "vehicle_type", - key: "vehicle_type", + dataIndex: "vehicle_type_name", + key: "vehicle_type_name", align: "center", }, // [ @@ -54,24 +56,49 @@ function CarGroupMgm({ id }) { align: "center", render: (_, record) => { return ( -
+ + ); }, }, @@ -88,6 +115,7 @@ function CarGroupMgm({ id }) { page_size: 10, total: 0, }); + const [currentId, setCurrentId] = useState(""); const getVehicleGroup = () => { const params = { ...searchForm.getFieldsValue(), ...pageData, road_id: id }; ajax @@ -95,6 +123,7 @@ function CarGroupMgm({ id }) { .then((res) => { if (res.status === 20000) { setCarList(res.data.list); + setTotal(res.data.total) } else { message.error(res.message); } @@ -103,7 +132,18 @@ function CarGroupMgm({ id }) { console.log(err); }); }; - + //删除接口 + const getDelCarGroup = (id) => { + ajax.getDelCarGroup({ id }).then((res) => { + if (res.status === 20000) { + message.success("删除成功"); + setDeleteModal(false); + getVehicleGroup(); + } else { + message.error(res.message); + } + }); + }; function changePage(pn, page_size) { setPageData({ pn, @@ -154,7 +194,7 @@ function CarGroupMgm({ id }) { }) : ajax - .getEditCarGroup({ ...data, road_id: id }) + .getEditCarGroup({ ...data, road_id: id, id: currentId }) .then((res) => { if (res.status === 20000) { message.success(res.message) @@ -271,7 +311,7 @@ function CarGroupMgm({ id }) { position: ["bottomCenter"], current: pageData.pn, pageSize: pageData.page_size, - total: pageData.total, + total: total, pageSizeOptions: dictionary?.pageSizeOptions, onChange: changePage, onShowSizeChange: changePage, @@ -309,8 +349,8 @@ function CarGroupMgm({ id }) { + - + {/*