From 5eb9b2163ecc0cb55d44ebe6b54cf1a0f1781b26 Mon Sep 17 00:00:00 2001 From: chenglb Date: Thu, 11 Jan 2024 00:29:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B7=AF=E5=A4=96=E8=B7=AF=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=8C=E7=BA=A7=E8=BD=A6=E5=9C=BA=20nvr?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E7=AD=BE=20=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutSegment/ConfigParking/VideoMonitor.jsx | 78 ++++++---------------- .../OutSegment/ConfigParking/index.jsx | 2 +- 2 files changed, 23 insertions(+), 57 deletions(-) diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/VideoMonitor.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/VideoMonitor.jsx index a436023..38f1d4a 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/VideoMonitor.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/VideoMonitor.jsx @@ -13,10 +13,13 @@ import { Dropdown } from "antd"; import ajax from "@/services"; +import { useSafeState } from "ahooks"; function VideoMonitor(props) { const { id } = props; const [form] = Form.useForm(); const [editform] = Form.useForm(); + + const [currentRecord, setCurrentRecord] = useState({}) // 操作-下拉 const items = [ // { key: "1", label: 查看监控 }, @@ -92,48 +95,7 @@ function VideoMonitor(props) { ); }, } - // { - // title: "操作", - // dataIndex: "action", - // key: "action", - // align: "center", - // render: (_, record) => { - // return ( - // - //
- // { - // setModalData({ ...modalData, visible: true }); - // editform.setFieldsValue({ - // vehicle_type: record.rule_id, - // vehicle_type: record.vehicle_type, - // group_ids: +record.group_ids, - // }); - // }} - // > - // 编辑 - // - //
- //
- // { - // setDelModal({ id: record.id, visible: true }); - // }} - // > - // 删除 - // - //
- // - // } - // > - // - //
- // ); - // }, - // }, + ]; // 操作 const clickDropDown = (param, record) => { @@ -145,12 +107,16 @@ function VideoMonitor(props) { } else if (param.key == "2") { // 编辑 // doEditOutNvr(record); - setModalData({ ...modalData, visible: true }); + setModalData({ status: 'edit', visible: true }); editform.setFieldsValue({ - // vehicle_type: record.rule_id, - // vehicle_type: record.vehicle_type, - // group_ids: +record.group_ids, + name: record.name, + ip_address: record.ip_address, + port: record.port, + video_port: record.video_port, + user_name: record.user_name, + password: record.password }); + setCurrentRecord(record) } else { // 删除 // doDelOutNvr(record); @@ -180,14 +146,14 @@ function VideoMonitor(props) { id: "", }); const addNvr = () => { - setModalData({ ...modalData, visible: true }); + setModalData({ status: "add", visible: true }); }; //搜索方法 name: "", // 设备名称 operator_id: "", //运营商 road_id: "", //路段名称 const search = () => { const params = form.getFieldsValue(); ajax - .getOutNvrList({ road_id: id, operator_id: '', ...pageData, ...params }) + .getOutNvrList({ road_id: '', operator_id: '', ...pageData, ...params }) .then((res) => { if (res.status === 20000) { setTableData(res.data.list); @@ -226,9 +192,9 @@ function VideoMonitor(props) { .validateFields() .then((values) => { if (modalData.status === "add") { - doAddOutNvr({ ...values, road_id: id, ...pageData }); + doAddOutNvr({ ...values, road_id: currentRecord.road_id ,operator_id: currentRecord.operator_id, address: '', lng_lat: '' }); } else if (modalData.status === "edit") { - doEditOutNvr({ ...values, road_id: id, ...pageData }); + doEditOutNvr({ ...values, road_id: currentRecord.road_id ,operator_id: currentRecord.operator_id, address: '', lng_lat: '' }); } }) .catch((err) => console.error(err)); @@ -264,13 +230,13 @@ function VideoMonitor(props) {
- +
- + @@ -298,7 +264,7 @@ function VideoMonitor(props) { > { setModalData({ ...modalData, visible: false }); @@ -309,7 +275,7 @@ function VideoMonitor(props) { @@ -323,14 +289,14 @@ function VideoMonitor(props) { diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx index 5b19145..fcd99f8 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx @@ -81,7 +81,7 @@ function ConfigParking(props) { children: , }, { - label: "视频监控管理", + label: "NVR管理", key: "2", children: , },