Browse Source

fix: 路外路段管理二级车场 nvr管理页签 问题处理

tags/PMS_V1.0.0_Alpha5
chenglb 1 year ago
parent
commit
5eb9b2163e
  1. 78
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/VideoMonitor.jsx
  2. 2
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx

78
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: <span></span> },
@ -92,48 +95,7 @@ function VideoMonitor(props) {
);
},
}
// {
// title: "",
// dataIndex: "action",
// key: "action",
// align: "center",
// render: (_, record) => {
// return (
// <Popover
// trigger="hover"
// content={
// <div>
// <div>
// <a
// onClick={() => {
// setModalData({ ...modalData, visible: true });
// editform.setFieldsValue({
// vehicle_type: record.rule_id,
// vehicle_type: record.vehicle_type,
// group_ids: +record.group_ids,
// });
// }}
// >
//
// </a>
// </div>
// <div>
// <a
// onClick={() => {
// setDelModal({ id: record.id, visible: true });
// }}
// >
//
// </a>
// </div>
// </div>
// }
// >
// <Button type="primary"></Button>
// </Popover>
// );
// },
// },
];
//
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) {
<Form form={form}>
<Row gutter={[30]}>
<Col span="4_8" style={{ width: "30%" }}>
<Form.Item label="视频设备名称" name="device_name">
<Form.Item label="视频设备名称" name="name">
<Input></Input>
</Form.Item>
</Col>
<Form.Item>
<div className="bottom-button">
<Button type="primary">查询</Button>
<Button type="primary" onClick={search}>查询</Button>
<Button type="primary" onClick={addNvr}>
添加
</Button>
@ -298,7 +264,7 @@ function VideoMonitor(props) {
></Table>
</main>
<Modal
title="添加监控设备"
title="添加设备"
open={modalData.visible}
onCancel={() => {
setModalData({ ...modalData, visible: false });
@ -309,7 +275,7 @@ function VideoMonitor(props) {
<Form labelCol={{ span: 6 }} form={editform}>
<Form.Item
label="设备名称"
name="device_name"
name="name"
rules={[{ required: true }]}
>
<Input></Input>
@ -323,14 +289,14 @@ function VideoMonitor(props) {
</Form.Item>
<Form.Item
label="端口号"
name="port_id"
name="port"
rules={[{ required: true }]}
>
<Input></Input>
</Form.Item>
<Form.Item
label="视频端口号"
name="video_port_id"
name="video_port"
rules={[{ required: true }]}
>
<Input></Input>

2
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx

@ -81,7 +81,7 @@ function ConfigParking(props) {
children: <BusinessParameterConfig id={itemData.id} />,
},
{
label: "视频监控管理",
label: "NVR管理",
key: "2",
children: <VideoMonitor />,
},

Loading…
Cancel
Save