Browse Source

测试置灰完成

release_0.0.2
wenlele 3 years ago
parent
commit
96e04ea0db
  1. 39
      code/VideoAccess-VCMP/web/client/src/layout/components/sider/index.jsx
  2. 17
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  3. 25
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  4. 17
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  5. 28
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx
  6. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  7. 6
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  8. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

39
code/VideoAccess-VCMP/web/client/src/layout/components/sider/index.jsx

@ -45,6 +45,7 @@ const Sider = props => {
}
}
}
console.log(nextItems)
setItems(nextItems)
const { selectedKeys, openKeys } = initKeys(
@ -74,16 +75,52 @@ const Sider = props => {
}
}, [])
useEffect(()=>{
console.log(1)
let pathname_ = pathname == '/' ? homePath : pathname
const initKeys = (items, lastKeys) => {
for (let it of items) {
if (it.to && it.to == pathname_) {
lastKeys.selectedKeys.push(it.itemKey)
return lastKeys
} else if (it.items && it.items.length) {
const preLastKeys = JSON.parse(JSON.stringify(lastKeys))
preLastKeys.openKeys.push(it.itemKey)
const nextKeys = initKeys(it.items, JSON.parse(JSON.stringify(preLastKeys)))
if (nextKeys.selectedKeys.length > preLastKeys.selectedKeys.length || nextKeys.openKeys.length > preLastKeys.openKeys.length) {
return nextKeys
}
}
}
return lastKeys
return {
selectedKeys: [],
openKeys: []
}
}
const lastSelectedKeys = localStorage.getItem('vcmp_selected_sider')
console.log(lastSelectedKeys)
if (lastSelectedKeys) {
setSelectedKeys(JSON.parse(lastSelectedKeys))
}
const lastOpenKeys = localStorage.getItem('vcmp_open_sider')
if (lastOpenKeys) {
setOpenKeys(JSON.parse(lastOpenKeys))
}
},[window.localStorage.vcmp_open_sider,window.localStorage.vcmp_selected_sider])
useEffect(() => {
if (scrollbar) {
scrollbar.update();
}
})
console.log(selectedKeys,openKeys)
return (
<div id={'page-slider'} style={{ height: clientHeight, position: 'relative' }}>
<Nav
style={{}}
// defaultOpenKeys={openKeys}
// defaultSelectedKeys ={selectedKeys}
selectedKeys={selectedKeys}
openKeys={openKeys}
onSelect={({ selectedItems, selectedKeys, }) => {

17
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -35,6 +35,7 @@ function cameraModal (props) {
const [loadingTip, setloadingTip] = useState("测试中..."); //loading tip
const [okText, setokText] = useState("确定"); //oktext
const [cancelText, setcancelText] = useState("取消"); //text
const [ash, setAsh] = useState(false); //
const testComplete = useRef(false) //
const [clickNum, setclickNum] = useState(
cameraData.type == "yingshi"
@ -72,6 +73,7 @@ function cameraModal (props) {
break
}
}
cameraData.id ? setAsh(true) : ""
}, []);
const cameraList = [
//
@ -540,6 +542,7 @@ function cameraModal (props) {
border: "1px solid #1859C1",
borderRadius: "3px",
color: "#1859C1",
backgroundColor: ash ? "" : "rgba(151, 151, 151, .2)",
display: "flex",
justifyContent: "center",
alignItems: "center",
@ -567,6 +570,8 @@ function cameraModal (props) {
CameraKind={CameraKind}
CameraAbility={CameraAbility}
cameraData={cameraData}
ashTrue={() => setAsh(true)}
ashFalse={() => setAsh(false)}
/>
</Spin>
) : clickNum == 2 ? (
@ -581,11 +586,21 @@ function cameraModal (props) {
CameraAbility={CameraAbility}
venderList={venderList}
cameraData={cameraData}
ashTrue={() => setAsh(true)}
ashFalse={() => setAsh(false)}
/>
</Spin>
) : (
<Spin tip={loadingTip} spinning={isloading}>
<CascadeCamera dRef={cascadeRef} cameraData={cameraData} parentCamera={parentCamera} testComplete={testComplete.current} close={()=>testComplete.current = false} />
<CascadeCamera
dRef={cascadeRef}
cameraData={cameraData}
parentCamera={parentCamera}
testComplete={testComplete.current}
close={() => testComplete.current = false}
ashTrue={() => setAsh(true)}
ashFalse={() => setAsh(false)}
/>
</Spin>
)}
</div>

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

@ -6,7 +6,7 @@ import "./cameraModal.less";
import PerfectScrollbar from "perfect-scrollbar";
let equipmentScrollbar;
function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, testComplete, close }) {
function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, testComplete, close, ashTrue, ashFalse }) {
const form = useRef();
const { equipmentWarehouse } = actions;
const [sip, setSip] = useState([]);
@ -14,11 +14,11 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
const [CheckList, setCheckList] = useState([]); //nvr
const [isAllChoose, setIsAllChoose] = useState(false); //
const [formData, setFormData] = useState() //
console.log(cameraData.externalDomain)
useEffect(() => {
dispatch(equipmentWarehouse.getCascadeSIP()).then((res) => {
setSip(res.payload.data);
if (cameraData) {
if (cameraData.id) {
let sip = res.payload.data.find((item) => item.streamid == cameraData.topSerialNo)
dispatch(equipmentWarehouse.getCascadeStream({ sip: sip.sipip })).then((res) => {
let oneData = res.payload.data[0];
@ -155,7 +155,7 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
e.stopPropagation();
}
function onDisabled (id) {
if (id == cameraData.gbId||!cameraData.gbId) {
if (id == cameraData.gbId || !cameraData.gbId) {
return false;
} else {
return true;
@ -177,15 +177,27 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
return (
<>
<Form
allowEmpty
labelPosition="left"
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => {
console.log(values);
console.log(values)
setFormData(values)
let setting = ["externalDomain", "cascadeType", "sip"]
let b = {}
setting.map((item) => {
if (values.hasOwnProperty(item)) {
return b.true = values.hasOwnProperty(item)
} else {
return b.false = values.hasOwnProperty(item)
}
})
Object.keys(b).length == 1 ? ashTrue() : ashFalse()
}}
initValues={{
externalDomain: cameraData.externalDomain || ""
}}
getFormApi={(formApi) => (form.current = formApi)}
>
<Row>
@ -194,7 +206,6 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
field="externalDomain"
label="外域名称:"
maxLength="36"
initValue={cameraData.externalDomain || ""}
placeholder="请输入外域 名称,例如“xxx市级平台”"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入外域名称" }]}

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

@ -1,8 +1,8 @@
import React, { useState, useRef, useEffect, useImperativeHandle } from "react";
import { connect } from "react-redux";
import { Form, Row, Col,Spin } from "@douyinfe/semi-ui";
import { Form, Row, Col, Spin } from "@douyinfe/semi-ui";
import "./cameraModal.less";
function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue, ashFalse }) {
const { TextArea } = Form;
const form = useRef();
const [cloud, setcloud] = useState(""); //
@ -81,7 +81,18 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
labelPosition="left"
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => console.log(values)}
onValueChange={(values) => {
let setting = ["abilityId", "cloudControl", "highDefinition", "kindId", "name", "position", "rtmp", "serialNo",]
let b = {}
setting.map((item) => {
if (values.hasOwnProperty(item)) {
return b.true = values.hasOwnProperty(item)
} else {
return b.false = values.hasOwnProperty(item)
}
})
Object.keys(b).length == 1 ? ashTrue() : ashFalse()
}}
initValues={{
name: cameraData.name || "",
highDefinition: cameraData.highDefinition || "",

28
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx

@ -2,12 +2,14 @@ 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 ipcCamera({
function ipcCamera ({
aRef,
CameraKind,
CameraAbility,
venderList,
cameraData,
ashTrue,
ashFalse
}) {
const { TextArea } = Form;
const form = useRef();
@ -48,11 +50,11 @@ function ipcCamera({
setcloud(cameraData.cloudControl || "");
setvoice(cameraData.voice || "");
}, []);
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) {
@ -74,7 +76,7 @@ function ipcCamera({
resetIpcCamera: form.current.reset,
toempty: empty,
}));
function empty() {
function empty () {
setcloud(null);
setvoice(null);
}
@ -84,7 +86,19 @@ function ipcCamera({
labelPosition="left"
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => console.log(values)}
onValueChange={(values) => {
let setting = ["abilityId", "cloudControl", "highDefinition", "kindId", "name", "position", "rtmp", "serialNo"]
let b = {}
setting.map((item) => {
if (values.hasOwnProperty(item)) {
return b.true = values.hasOwnProperty(item)
} else {
return b.false = values.hasOwnProperty(item)
}
})
Object.keys(b).length == 1 ? ashTrue() : ashFalse()
}}
initValues={{
name: cameraData ? cameraData.name : "",
venderId: cameraData ? cameraData.venderId : "",
@ -382,6 +396,7 @@ function ipcCamera({
maxLength="39"
placeholder="请输入设备编号"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备编号" }]}
/>
</div>
<TextArea
@ -389,6 +404,7 @@ function ipcCamera({
field="rtmp"
label="RTMP地址接入:"
placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址" }]}
/>
</Col>
{/* <Col span={18}>
@ -399,7 +415,7 @@ function ipcCamera({
</>
);
}
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, global, members } = state;
return {
loading: members.isRequesting,

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

@ -393,6 +393,8 @@ function SideSheets (props) {
});
}
///
let broadcast=nvrDetails.gbCamera?nvrDetails.gbCamera.playUrl?nvrDetails.gbCamera.playUrl.liveUrl:"":""
console.log(broadcast)
if (index == 1) {
(cameraSetup ? item.liveBroadcast : item.access).map(
(item, index) => {

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

@ -46,7 +46,6 @@ const CameraHeader = (props) => {
const CAMERAS = "cameras";
useEffect(() => {
console.log(props)
//
let isAxyData = props.location.search
if (isAxyData) {
@ -119,7 +118,7 @@ const CameraHeader = (props) => {
return (
<div>
{row.name}
<sapn style={{ color: "blue" }}
<span style={{ color: "blue" }}
onClick={() => {
if (deviceClickb.current) {
if (row.type == "nvr") {
@ -139,7 +138,7 @@ const CameraHeader = (props) => {
}}
>
{row.type == "nvr" ? `@${row.nvr.name}` : row.type == "cascade" ? `@${row.externalDomain}` : ""}
</sapn>
</span>
</div >
);
},
@ -149,7 +148,6 @@ const CameraHeader = (props) => {
width: "20%",
dataIndex: "",
render: (_, row) => {
console.log(row)
return (
<div style={{ display: "flex" }}>
<Button

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

@ -109,7 +109,6 @@ const NvrHeader = (props) => {
width: "20%",
dataIndex: "",
render: (_, row) => {
console.log(row)
return (
<div style={{ display: "flex" }}>
<Button theme="borderless">
@ -599,6 +598,7 @@ const NvrHeader = (props) => {
USER={USER}
onOk={() => {
history.push({ pathname: '/equipmentWarehouse/camera', query: { addNvr: true, serialNo: nvrRef.current.nvrNumber() } });
localStorage.setItem('vcmp_selected_sider', JSON.stringify("camera"))
setReminder(false)
}}
close={() => {

Loading…
Cancel
Save