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. 23
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  4. 15
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  5. 18
      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) setItems(nextItems)
const { selectedKeys, openKeys } = initKeys( 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(() => { useEffect(() => {
if (scrollbar) { if (scrollbar) {
scrollbar.update(); scrollbar.update();
} }
}) })
console.log(selectedKeys,openKeys)
return ( return (
<div id={'page-slider'} style={{ height: clientHeight, position: 'relative' }}> <div id={'page-slider'} style={{ height: clientHeight, position: 'relative' }}>
<Nav <Nav
style={{}} style={{}}
// defaultOpenKeys={openKeys}
// defaultSelectedKeys ={selectedKeys}
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
openKeys={openKeys} openKeys={openKeys}
onSelect={({ selectedItems, selectedKeys, }) => { 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 [loadingTip, setloadingTip] = useState("测试中..."); //loading tip
const [okText, setokText] = useState("确定"); //oktext const [okText, setokText] = useState("确定"); //oktext
const [cancelText, setcancelText] = useState("取消"); //text const [cancelText, setcancelText] = useState("取消"); //text
const [ash, setAsh] = useState(false); //
const testComplete = useRef(false) // const testComplete = useRef(false) //
const [clickNum, setclickNum] = useState( const [clickNum, setclickNum] = useState(
cameraData.type == "yingshi" cameraData.type == "yingshi"
@ -72,6 +73,7 @@ function cameraModal (props) {
break break
} }
} }
cameraData.id ? setAsh(true) : ""
}, []); }, []);
const cameraList = [ const cameraList = [
// //
@ -540,6 +542,7 @@ function cameraModal (props) {
border: "1px solid #1859C1", border: "1px solid #1859C1",
borderRadius: "3px", borderRadius: "3px",
color: "#1859C1", color: "#1859C1",
backgroundColor: ash ? "" : "rgba(151, 151, 151, .2)",
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
alignItems: "center", alignItems: "center",
@ -567,6 +570,8 @@ function cameraModal (props) {
CameraKind={CameraKind} CameraKind={CameraKind}
CameraAbility={CameraAbility} CameraAbility={CameraAbility}
cameraData={cameraData} cameraData={cameraData}
ashTrue={() => setAsh(true)}
ashFalse={() => setAsh(false)}
/> />
</Spin> </Spin>
) : clickNum == 2 ? ( ) : clickNum == 2 ? (
@ -581,11 +586,21 @@ function cameraModal (props) {
CameraAbility={CameraAbility} CameraAbility={CameraAbility}
venderList={venderList} venderList={venderList}
cameraData={cameraData} cameraData={cameraData}
ashTrue={() => setAsh(true)}
ashFalse={() => setAsh(false)}
/> />
</Spin> </Spin>
) : ( ) : (
<Spin tip={loadingTip} spinning={isloading}> <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> </Spin>
)} )}
</div> </div>

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

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

15
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 { 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"; import "./cameraModal.less";
function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) { function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue, ashFalse }) {
const { TextArea } = Form; const { TextArea } = Form;
const form = useRef(); const form = useRef();
const [cloud, setcloud] = useState(""); // const [cloud, setcloud] = useState(""); //
@ -81,7 +81,18 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
labelPosition="left" labelPosition="left"
labelAlign="left" labelAlign="left"
labelWidth="115px" 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={{ initValues={{
name: cameraData.name || "", name: cameraData.name || "",
highDefinition: cameraData.highDefinition || "", highDefinition: cameraData.highDefinition || "",

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

@ -8,6 +8,8 @@ function ipcCamera({
CameraAbility, CameraAbility,
venderList, venderList,
cameraData, cameraData,
ashTrue,
ashFalse
}) { }) {
const { TextArea } = Form; const { TextArea } = Form;
const form = useRef(); const form = useRef();
@ -84,7 +86,19 @@ function ipcCamera({
labelPosition="left" labelPosition="left"
labelAlign="left" labelAlign="left"
labelWidth="115px" 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={{ initValues={{
name: cameraData ? cameraData.name : "", name: cameraData ? cameraData.name : "",
venderId: cameraData ? cameraData.venderId : "", venderId: cameraData ? cameraData.venderId : "",
@ -382,6 +396,7 @@ function ipcCamera({
maxLength="39" maxLength="39"
placeholder="请输入设备编号" placeholder="请输入设备编号"
style={{ width: 307 }} style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备编号" }]}
/> />
</div> </div>
<TextArea <TextArea
@ -389,6 +404,7 @@ function ipcCamera({
field="rtmp" field="rtmp"
label="RTMP地址接入:" label="RTMP地址接入:"
placeholder="请输入RTMP地址接入" placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址" }]}
/> />
</Col> </Col>
{/* <Col span={18}> {/* <Col span={18}>

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) { if (index == 1) {
(cameraSetup ? item.liveBroadcast : item.access).map( (cameraSetup ? item.liveBroadcast : item.access).map(
(item, index) => { (item, index) => {

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

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

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

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

Loading…
Cancel
Save