Browse Source

Merge branch 'dev_trial' of https://gitea.free-sun.vip/free-sun/FS-IOT into dev_trial

release_0.0.2
巴林闲侠 3 years ago
parent
commit
c8a00261a0
  1. 10
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  2. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  3. 49
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  4. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  5. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx
  6. 33
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
  7. 24
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

10
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx

@ -223,7 +223,6 @@ const VideoPlay = ({
const createJessibuca = async () => {
if (videoObj.type != 'yingshi') {
try {
//
// const inviteRes = await IotVideoServerRequest.get(VideoServeApi.invite, {
// id: '36011200002002021114',
// channel: '36011200581314002900'
@ -238,12 +237,9 @@ const VideoPlay = ({
console.log(error.response);
}
if (jessibuca) {
jessibuca.destroy()
}
let $container = document.getElementById(containerId);
const jessibuca_ = new window.Jessibuca({
const jessibuca = new window.Jessibuca({
container: $container,
videoBuffer: 0.2, //
isResize: false,
@ -260,8 +256,8 @@ const VideoPlay = ({
forceNoOffscreen: false,
isNotMute: false,
});
setjessibuca(jessibuca_)
play({ jessibuca: jessibuca_ })
setjessibuca(jessibuca)
play({ jessibuca })
}
}

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

@ -158,8 +158,6 @@ function cameraModal (props) {
let data = cascadeRef.current.cascadeList.map((v) => {
return { id: v.id, name: v.name, };
});
console.log(cascadeRef.current.cascadeList)
console.log(data)
cascadeRef.current.cascadeCameraForm().then((values) => {
console.log(values);
dispatch(equipmentWarehouse.postAddCascade({ ...values, camera: data })).then((res) => {
@ -312,12 +310,11 @@ function cameraModal (props) {
cascadeRef.current
.cascadeCameraForm()
.then((values) => {
console.log(values);
var front = new moment(); //
setloading(true);
dispatch(
equipmentWarehouse.postVerifyCascade({
sip: values.sip,
streamId: values.streamId,
})
).then((res) => {
var after = new moment(); //

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

@ -4,8 +4,9 @@ import { Form, Row, Col, Checkbox, Radio, CheckboxGroup, Input } from "@douyinfe
import { IconEdit, IconPlayCircle, } from "@douyinfe/semi-icons";
import "./cameraModal.less";
import PerfectScrollbar from "perfect-scrollbar";
let equipmentScrollbar;
import { VideoPlayModal } from "$components";
let equipmentScrollbar;
function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, testComplete, close, ashTrue, ashFalse }) {
const form = useRef();
const { equipmentWarehouse } = actions;
@ -14,13 +15,16 @@ 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)
const [videoPlay, setVideoPlay] = useState(false);//
const [videoObj, setVideoObj] = useState(); //
useEffect(() => {
dispatch(equipmentWarehouse.getCascadeSIP()).then((res) => {
setSip(res.payload.data);
if (cameraData.id) {
let sip = res.payload.data.find((item) => item.streamid == cameraData.topSerialNo)
dispatch(equipmentWarehouse.getCascadeStream({ sip: sip.sipip })).then((res) => {
console.log(sip);
dispatch(equipmentWarehouse.getCascadeStream({ streamId: sip.streamid })).then((res) => {
let oneData = res.payload.data[0];
let modifyData = res.payload.data.find(
(item) => item.id == cameraData.gbId
@ -59,7 +63,8 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
useEffect(() => {
//
if (testComplete) {
dispatch(equipmentWarehouse.getCascadeStream({ sip: formData.sip })).then((res) => {
console.log(formData);
dispatch(equipmentWarehouse.getCascadeStream({ streamId: formData.streamId })).then((res) => {
console.log(res.payload.data);
let chooseList = [];
let data = res.payload.data.map((item, index) => {
@ -115,7 +120,6 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
function NvrChangeName (e, index, id) {
//
let NvrchangeList = JSON.parse(JSON.stringify(cascadeList));
console.log(!cameraData.gbId)
if (!cameraData.gbId || cameraData.gbId == id) {
NvrchangeList[index].change = true;
setCascadeList(NvrchangeList);
@ -148,10 +152,20 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
setIsAllChoose(true);
}
}
function playVideo (e) {
function playVideo (e, id) {
//nvr
console.log("22222222222222222");
if (cameraData.gbId == id || !cameraData.gbId) {
let data = cascadeList.find((item) => item.id == id)
console.log(formData);
setVideoObj({
type: 'cascade',
audio: false,
serialNo: data.streamid,
topSerialNo: cameraData.id ? cameraData.topSerialNo : formData?.streamId,
playUrlSd: data?.playUrl?.liveUrl?.sd["WS-RAW"],
})
setVideoPlay(true);
}
e.stopPropagation();
}
function onDisabled (id) {
@ -181,7 +195,6 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
labelAlign="left"
labelWidth="115px"
onValueChange={(values) => {
console.log(values)
setFormData(values)
let setting = ["externalDomain", "cascadeType", "sip"]
let b = {}
@ -227,15 +240,16 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
<Col span={14}>
<Form.Select
label="SIP编号:"
field="sip"
field="streamId"
disabled={cameraData.id ? true : false}
initValue={parentCamera || ""}
placeholder="请选择SIP编号"
style={{ width: 307 }}
rules={[{ required: true, message: "请选择SIP编号" }]}
>
{sip.map((item, index) => (
<Form.Select.Option key={index} value={item.sipip}>
{item.sipip}
<Form.Select.Option key={index} value={item.streamid}>
{item.streamid}
</Form.Select.Option>
))}
</Form.Select>
@ -349,7 +363,7 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
<IconPlayCircle
size="extra-large"
style={{ color: "#1859C1" }}
onClick={(e) => playVideo(e)}
onClick={(e) => playVideo(e, item.id)}
/>
</div>
</div>
@ -364,6 +378,15 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData, parentCamera, tes
</Row>
</Form>
{videoPlay ?
<VideoPlayModal
visible={true}
videoObj={videoObj}
close={() => {
setVideoPlay(false)
}} />
: ""
}
</>
);
}

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

@ -466,6 +466,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue,
<Form.Input
field="serialNo"
label="设备序列号:"
disabled={cameraData.id ? true : false}
placeholder="请输入设备序列号"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备序列号" }]}
@ -476,6 +477,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData, ashTrue,
field="rtmp"
label="RTMP地址接入:"
maxLength="100"
disabled={cameraData.id ? true : false}
placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址接入" }]}
/>

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

@ -394,6 +394,7 @@ function ipcCamera ({
field="serialNo"
label="设备编号接入:"
maxLength="39"
disabled={cameraData.id ? true : false}
placeholder="请输入设备编号"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备编号" }]}
@ -403,6 +404,7 @@ function ipcCamera ({
style={{ width: 320, height: 90 }}
field="rtmp"
label="RTMP地址接入:"
disabled={cameraData.id ? true : false}
placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址" }]}
/>

33
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx

@ -14,11 +14,10 @@ import {
import { IconEdit, IconPlayCircle, IconTickCircle } from "@douyinfe/semi-icons";
import "./cameraModal.less";
import PerfectScrollbar from "perfect-scrollbar";
import { isIndexed } from "immutable";
import { useId } from "react";
import { VideoPlayModal } from "$components";
let equipmentScrollbar;
function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }) {
function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber, }) {
const { equipmentWarehouse } = actions;
const cameraDataNvr = cameraData.nvr || "";
const form = useRef();
@ -30,6 +29,8 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
const [loadingTip, setloadingTip] = useState("获取中..."); //loading tip
const [step, setstep] = useState("none");
const [stepp, setstepp] = useState("none");
const [videoPlay, setVideoPlay] = useState(false);//
const [videoObj, setVideoObj] = useState(); //
useEffect(() => {
NVRcameraList
@ -201,9 +202,20 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
setIsAllChoose(true);
}
}
function playVideo (e) {
function playVideo (e, id) {
//nvr
console.log("22222222222222222");
if (cameraData.gbId == id || !cameraData.gbId) {
let data = NVRcameraList.find((item) => item.id == id)
setVideoObj({
type: "nvr",
audio: false,
serialNo: data.streamid,
topSerialNo: cameraDataNvr ? cameraDataNvr.serialNo : addNvr ? nvrNumber : equipmentNum,
playUrlSd: data?.playUrl?.liveUrl?.sd["WS-RAW"],
})
setVideoPlay(true);
}
e.stopPropagation();
}
function onDisabled (id) {
@ -370,7 +382,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
<IconPlayCircle
size="extra-large"
style={{ color: "#1859C1" }}
onClick={(e) => playVideo(e)}
onClick={(e) => playVideo(e, item.id)}
/>
<Radio
checked={item.support}
@ -397,6 +409,15 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
</CheckboxGroup>
</Row>
</Form>
{videoPlay ?
<VideoPlayModal
visible={true}
videoObj={videoObj}
close={() => {
setVideoPlay(false)
}} />
: ""
}
</>
);
}

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

@ -188,17 +188,20 @@ const CameraHeader = (props) => {
theme="borderless"
onClick={() => {
if (row.type == "yingshi") {
// console.log(row.serialNo);
// console.log(row.secretYingshi.token);
// console.log(row.gbCamera.playUrl.liveUrl.sd.ezopen);
// console.log(row.gbCamera.playUrl.liveUrl.hd.ezopen);
setVideoObj({
type: row.type,
serialNo: row.serialNo,
yingshiToken: row.secretYingshi.token,
playUrlSd: row.gbCamera.playUrl.liveUrl.sd.ezopen,
playUrlHd: row.gbCamera.playUrl.liveUrl.hd.ezopen,
yingshiToken: row.secretYingshi?.token,
playUrlSd: row.gbCamera?.playUrl?.liveUrl?.sd?.ezopen,
playUrlHd: row.gbCamera?.playUrl?.liveUrl?.hd?.ezopen,
})
} else {
setVideoObj({
type: row.type,
audio: false,
serialNo: row.serialNo,
topSerialNo: row.topSerialNo,
playUrlSd: row.gbCamera?.playUrl?.liveUrl?.sd["WS-RAW"],
})
}
setVideoPlay(true)
@ -337,7 +340,7 @@ const CameraHeader = (props) => {
title: "设备创建时间",
dataIndex: "createTime",
key: "time",
render: (text, r, index) => {
render: (_, r, index) => {
return moment(r.createTime).format("YYYY-MM-DD HH:MM:SS");
},
},
@ -345,6 +348,9 @@ const CameraHeader = (props) => {
title: "设备添加账号",
dataIndex: "size",
key: "account",
render: (text, r, index) => {
return r.createUser?.namePresent
},
},
{
title: "项目名称",

Loading…
Cancel
Save