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. 21
      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. 36
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  5. 44
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  6. 23
      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编号" }]} rules={[{ required: true, message: "请选择SIP编号" }]}
> >
{sip.map((item, index) => ( {sip.map((item, index) => (
<Form.Select.Option key={index} value={item.streamid}> <Form.Select.Option key={index} value={item.sipip}>
{item.streamid} {item.sipip}
</Form.Select.Option> </Form.Select.Option>
))} ))}
</Form.Select> </Form.Select>

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

@ -83,22 +83,21 @@ function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) {
labelWidth="115px" labelWidth="115px"
onValueChange={(values) => console.log(values)} onValueChange={(values) => console.log(values)}
initValues={{ initValues={{
name: cameraData ? cameraData.name : "", name: cameraData.name || "",
highDefinition: cameraData ? cameraData.highDefinition : "", highDefinition: cameraData.highDefinition || "",
memoryCard: cameraData ? cameraData.memoryCard : "", memoryCard: cameraData.memoryCard || "",
position: cameraData.longitude position: cameraData.longitude
? `${cameraData.longitude},${cameraData.latitude}` ? `${cameraData.longitude},${cameraData.latitude}`
: "", : "",
kindId: cameraData ? cameraData.kindId : "", kindId: cameraData.kindId || "",
abilityId: cameraData abilityId: cameraData.cameraAbilities
? cameraData.cameraAbilities
? cameraData.cameraAbilities.map((item) => item.id) ? cameraData.cameraAbilities.map((item) => item.id)
: "" : ""
: "", ,
cloudControl: cameraData ? cameraData.cloudControl : "", cloudControl: cameraData.cloudControl || "",
voice: cameraData ? cameraData.voice : "", voice: cameraData.voice || "",
serialNo: cameraData ? cameraData.serialNo : "", serialNo: cameraData.serialNo || "",
rtmp: cameraData ? cameraData.rtmp : "", rtmp: cameraData.rtmp || "",
}} }}
getFormApi={(formApi) => (form.current = formApi)} getFormApi={(formApi) => (form.current = formApi)}
> >

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

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

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

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

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

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

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

Loading…
Cancel
Save