Browse Source

表格设备名称的条件搜索

release_0.0.2
wenlele 3 years ago
parent
commit
53515f4a3d
  1. 4
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  2. 31
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  3. 10
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx
  4. 40
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  5. 46
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  6. 31
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

4
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx

@ -99,8 +99,8 @@ function cascadeCamera({ dRef, dispatch, actions }) {
rules={[{ required: true, message: "请选择SIP编号" }]}
>
{sip.map((item, index) => (
<Form.Select.Option key={index} value={item.streamid}>
{item.streamid}
<Form.Select.Option key={index} value={item.sipip}>
{item.sipip}
</Form.Select.Option>
))}
</Form.Select>

31
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx

@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect, useImperativeHandle } from "react";
import { connect } from "react-redux";
import { Form, Row, Col } from "@douyinfe/semi-ui";
import "./cameraModal.less";
function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
const { TextArea } = Form;
const form = useRef();
const [cloud, setcloud] = useState(""); //
@ -44,11 +44,11 @@ function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
setvoice(cameraData.voice || "");
setSwitching(cameraData.highDefinition || "");
}, []);
function handleLocation() {
function handleLocation () {
//
window.open("https://lbs.amap.com/tools/picker", "_blank");
}
function positionForm(val) {
function positionForm (val) {
//
let zz = /^(-?\d+)(\.\d+)?$/;
if (!val) {
@ -70,7 +70,7 @@ function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
resetFluoriteCamera: form.current.reset,
toempty: empty,
}));
function empty() {
function empty () {
setcloud("");
setvoice("");
setSwitching("");
@ -83,22 +83,21 @@ function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
labelWidth="115px"
onValueChange={(values) => console.log(values)}
initValues={{
name: cameraData ? cameraData.name : "",
highDefinition: cameraData ? cameraData.highDefinition : "",
memoryCard: cameraData ? cameraData.memoryCard : "",
name: cameraData.name || "",
highDefinition: cameraData.highDefinition || "",
memoryCard: cameraData.memoryCard || "",
position: cameraData.longitude
? `${cameraData.longitude},${cameraData.latitude}`
: "",
kindId: cameraData ? cameraData.kindId : "",
abilityId: cameraData
? cameraData.cameraAbilities
kindId: cameraData.kindId || "",
abilityId: cameraData.cameraAbilities
? cameraData.cameraAbilities.map((item) => item.id)
: ""
: "",
cloudControl: cameraData ? cameraData.cloudControl : "",
voice: cameraData ? cameraData.voice : "",
serialNo: cameraData ? cameraData.serialNo : "",
rtmp: cameraData ? cameraData.rtmp : "",
,
cloudControl: cameraData.cloudControl || "",
voice: cameraData.voice || "",
serialNo: cameraData.serialNo || "",
rtmp: cameraData.rtmp || "",
}}
getFormApi={(formApi) => (form.current = formApi)}
>
@ -472,7 +471,7 @@ function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
</>
);
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global, members } = state;
return {
loading: members.isRequesting,

10
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx

@ -46,9 +46,7 @@ function nvrModal(props) {
form.current
.validate()
.then((values) => {
//
console.log(values);
//
let valuesObj = JSON.parse(JSON.stringify(values));
valuesObj.longitude = values.position.split(",")[0];
valuesObj.latitude = values.position.split(",")[1];
@ -56,7 +54,7 @@ function nvrModal(props) {
if (nvrData.id) {
valuesObj.id = nvrData.id;
}
var x = new moment();
var front = new moment(); //
setloading(true);
dispatch(
actions.equipmentWarehouse.getCheck({
@ -64,8 +62,8 @@ function nvrModal(props) {
})
).then((res) => {
console.log(res);
var y = new moment();
var duration = moment.duration(y.diff(x))._data.milliseconds;
var after = new moment(); //
var duration = moment.duration(after.diff(front))._data.milliseconds;
if (res.success) {
setTimeout(
() => {

40
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -8,7 +8,7 @@ import PerfectScrollbar from "perfect-scrollbar";
let projectScrollbar;
let equipmentScrollbar;
function SideSheets(props) {
function SideSheets (props) {
const {
dispatch,
actions,
@ -48,15 +48,15 @@ function SideSheets(props) {
{
name: "接入信息",
access: [
{ name: "SIP服务编号:", key: "1111111111" },
{ name: "SIP域:", key: "KGU876J87" },
{ name: "SIP端口号:", key: "port" },
{ name: "通道数量:", key: "channelCount" },
{ name: "心跳周期:", key: "3600s" },
{ name: "最大心跳次数:", key: "3次" },
{ name: "注册密码:", key: "**********" },
{ name: "注册有效期::", key: "3600s" },
{ name: "接入识别模块:", key: "sssss" },
{ name: "SIP服务编号:", key: "Serial" },
{ name: "SIP域:", key: "Realm" },
{ name: "SIP端口号:", key: "ListenAddr" },
{ name: "通道数量:", key: "channelCount", difference: "difference" },
{ name: "心跳周期:", key: "Expires" },
{ name: "最大心跳次数:", key: "RemoveBanInterval" },
{ name: "注册密码:", key: "Password" },
{ name: "注册有效期:", key: "" },
{ name: "接入识别模块:", key: "" },
],
},
{
@ -138,16 +138,18 @@ function SideSheets(props) {
)
).then((res) => {
setNvrDetails(res.payload.data);
console.log(res.payload.data);
projectScrollbar = new PerfectScrollbar("#project_information", {
suppressScrollX: true,
});
equipmentScrollbar = new PerfectScrollbar("#equipment_information", {
suppressScrollX: true,
});
console.log(nvrDetails);
});
}, []);
useEffect(() => {
const domProject = document.getElementById("project_information");
if (domProject && projectScrollbar) {
@ -388,8 +390,7 @@ function SideSheets(props) {
}}
>
<img
src={`/assets/images/background/${
clickStyle == item.name
src={`/assets/images/background/${clickStyle == item.name
? "sewage_camera2"
: "sewage_camera1"
}.png`}
@ -398,8 +399,7 @@ function SideSheets(props) {
<div>
{item.name}
<img
src={`/assets/images/background/${
clickStyle == item.name
src={`/assets/images/background/${clickStyle == item.name
? "copy2"
: "copy1"
}.png`}
@ -440,7 +440,7 @@ function SideSheets(props) {
color: " #34383E",
}}
>
{nvrDetails[item.key]}
{item.difference == "difference" ? nvrDetails[item.key] : nvrDetails.accessInfo[item.key]}
</span>
</div>
);
@ -476,8 +476,7 @@ function SideSheets(props) {
}}
>
<img
src={`/assets/images/background/${
clickStyle == item.name
src={`/assets/images/background/${clickStyle == item.name
? "store2"
: "store1"
}.png`}
@ -486,8 +485,7 @@ function SideSheets(props) {
<div>
{item.name}
<img
src={`/assets/images/background/${
clickStyle == item.name
src={`/assets/images/background/${clickStyle == item.name
? "copy2"
: "copy1"
}.png`}
@ -559,7 +557,7 @@ function SideSheets(props) {
);
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global, members } = state;
return {
loading: members.isRequesting,

46
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -35,6 +35,7 @@ const CameraHeader = (props) => {
const [search, setearch] = useState({}); //
const [rowId, setRowId] = useState(); //id
const [cameraData, setCameraData] = useState({}); //
const [deviceClick, setDeviceClick] = useState(false); //
const { equipmentWarehouse } = actions;
const api = useRef();
@ -63,31 +64,28 @@ const CameraHeader = (props) => {
dispatch(equipmentWarehouse.getCamera({ ...query, ...search }));
}
const equipmentStatus = { ON: "在线", ONLINE: "在线", OFF: "离线", Alarmed: "未知状态" }
const columns = [
{
title: "序号",
render: (text, record, index) => {
dataIndex: "",
render: (text, r, index) => {
return index + 1;
},
},
{
title: "设备名称",
dataIndex: "name",
render: (text, record, index) => {
render: (_, row) => {
return (
<div>
<span
style={{
backgroundColor: record.avatarBg,
width: "10px",
height: "10px",
borderRadius: "50%",
display: "inline-block",
marginRight: "10px",
}}
/>
{record.name}
</div>
{row.name}
<sapn style={{ color: "blue" }}
onClick={() =>device_(row)}
>
{row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""}
</sapn>
</div >
);
},
},
@ -191,6 +189,26 @@ const CameraHeader = (props) => {
},
];
const device_ = (r) => {
console.log(deviceClick)
if (deviceClick) {
// if (r.type == "nvr") {
// console.log(search)
// setearch({ ...search, nvrId: r.nvr.id })
// } else {
// setearch({ ...search, externalDomain: r.externalDomain })
// }
setDeviceClick(false)
} else {
// if (r.type == "nvr") {
// setearch({ ...search, nvrId: null })
// } else {
// setearch({ ...search, externalDomain: null })
// }
setDeviceClick(true)
}
}
//
function attribute (data) {
const arr = localStorage.getItem(CAMERAS)

31
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -23,16 +23,15 @@ import { skeletonScreen } from "../components/skeletonScreen";
import { ReminderBox } from "../../../components/index";
export const accessType = [
{ name: "萤石云平台摄像头", key: "yingshi" },
{ name: "NVR摄像头", key: "nvr" },
{ name: "IPC 网络摄像头", key: "ipc" },
{ name: "不明厂家", key: "cascade" },
{ name: "萤石云", key: "yingshi" },
{ name: "NVR", key: "nvr" },
{ name: "IPC", key: "ipc" },
{ name: "级联", key: "cascade" },
];
const NvrHeader = (props) => {
const { dispatch, actions, user, loading, equipmentWarehouseNvr } = props;
const { equipmentWarehouse } = actions;
// const [loading, setLoading] = useState(false);
const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false);
const [setupp, setSetupp] = useState([]);
@ -40,13 +39,12 @@ const NvrHeader = (props) => {
const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [search, setearch] = useState({}); //
const [rowId, setRowId] = useState(); //id
const [load, setLoad] = useState(); //
const [reminder, setReminder] = useState(true); //
const api = useRef();
const SETUPS = "setups";
useEffect(() => {
setLoad(loading);
dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data);
attribute(res.payload.data);
@ -60,11 +58,12 @@ const NvrHeader = (props) => {
: "";
// ;
}, []);
useEffect(() => {
equipmentGetNvr();
}, [query, search]);
function equipmentGetNvr() {
function equipmentGetNvr () {
dispatch(equipmentWarehouse.getNvr({ ...query, ...search }));
}
@ -91,7 +90,7 @@ const NvrHeader = (props) => {
title: "设备名称",
dataIndex: "name",
render: (text, r, index) => {
return r.name;
return r.name
},
},
{
@ -148,7 +147,7 @@ const NvrHeader = (props) => {
];
//
function attribute(data) {
function attribute (data) {
const arr = localStorage.getItem(SETUPS)
? JSON.parse(localStorage.getItem(SETUPS))
: [];
@ -219,6 +218,7 @@ const NvrHeader = (props) => {
dataIndex: "",
key: "name",
render: (_, r, index) => {
console.log(r)
return r.station.length == 0
? ""
: r.station.map((item, index) => {
@ -271,7 +271,7 @@ const NvrHeader = (props) => {
}
//station
function station(first, whole, name) {
function station (first, whole, name) {
return (
<Popover
key="updateTime"
@ -426,13 +426,14 @@ const NvrHeader = (props) => {
<Form.Select
label="状态查询:"
labelPosition="left"
field="type2"
field="state"
style={screen}
placeholder="全部"
showClear
>
<Form.Select.Option value="yes">在线</Form.Select.Option>
<Form.Select.Option value="no">离线</Form.Select.Option>
<Form.Select.Option value="ON">在线</Form.Select.Option>
<Form.Select.Option value="OFF">离线</Form.Select.Option>
<Form.Select.Option value="UNKONW">未知</Form.Select.Option>
</Form.Select>
{/* <Form.Select
label="关联项目:"
@ -635,7 +636,7 @@ const NvrHeader = (props) => {
);
};
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global, members, equipmentWarehouseNvr } = state;
return {
loading: equipmentWarehouseNvr.isRequesting && !equipmentWarehouseNvr.data,

Loading…
Cancel
Save