Browse Source

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

release_0.0.2
wenlele 3 years ago
parent
commit
e6c365494d
  1. 10
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
  2. 5
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 9
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx
  4. 5
      code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx
  5. 30
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/remarksModal.jsx
  6. 15
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

10
code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js

@ -123,7 +123,10 @@ async function getNvrSteam (ctx) {
},
include: [{
model: models.CameraRemark,
attributes: ['remark']
attributes: ['remark'],
order: [
['id', 'DESC']
],
}],
})
@ -424,7 +427,10 @@ async function getCascadeSteam (ctx) {
},
include: [{
model: models.CameraRemark,
attributes: ['remark']
attributes: ['remark'],
order: [
['id', 'DESC']
],
}],
})

5
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -33,7 +33,10 @@ async function getCameraProject (ctx, next) {
attributes: ['token']
}, {
model: models.CameraRemark,
attributes: ['remark']
attributes: ['remark'],
order: [
['id', 'DESC']
],
}],
distinct: true
}

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

@ -55,6 +55,7 @@ const VideoPlay = ({
const [isAdjustProcess, setIsAdjustProcess] = useState(false)
const [histroyTime, setHistroyTime] = useState([])
const [histroyBegain, setHistroyBegain] = useState()
const [roll, setRoll] = useState()//
const [resolution, setResolution] = useState('sd') // sd hd
// ifream
@ -65,6 +66,10 @@ const VideoPlay = ({
// ifream
const yingshiPrepareRef = useRef(null)
useEffect(() => {
setRoll(false)
}, [resolution]);
const changeSelectState = (key) => {
if (videoObj.type == 'yingshi' && yingshiPrepareRef.current) {
return
@ -157,6 +162,7 @@ const VideoPlay = ({
console.log(e);
if (origin !== 'https://open.ys7.com') return
if (data.type == "handleSuccess") {
setRoll(true)
if (yingshiPrepareRef.current == 'play') {
setIsPlaying(true)
}
@ -311,6 +317,7 @@ const VideoPlay = ({
operationState={operationState} changeSelectState={changeSelectState}
histroyTime={histroyTime}
setoperationState={setoperationState} name={name}
roll={roll}
showTime={
videoObj.type == 'yingshi' && yingshiPrepare == 'play' ?
null : (histroyBegain || moment())
@ -368,7 +375,7 @@ const VideoPlay = ({
function mapStateToProps (state) {
const { auth, global } = state;
console.log(global);
console.log('global',global);
return {
user: auth.user,
iotVideoServer: global.iotVideoServer,

5
code/VideoAccess-VCMP/web/client/src/components/videoPlayer/voiceHeader.jsx

@ -8,7 +8,7 @@ import './videoPlay.less';
const timeFormat = 'YYYY-MM-DD HH:mm:ss'
const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime,content }) => {
const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name, showTime, histroyTime,content,roll }) => {
const time = useRef(moment(showTime || undefined))
const upTimeInterval = useRef(null)
const [showTime_, setShowTime] = useState(' ')
@ -54,6 +54,8 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
}, [showTime])
return (
<div>
{roll?
<div style={{
height: 42, lineHeight: '42px', background: '#00000026',
position: 'absolute', width: '100%', zIndex: 99,
@ -82,6 +84,7 @@ const VideoHeader = ({ operationState, changeSelectState, setProcessDisX, name,
</div>
</Col>
</Row>
</div>:''}
</div>
)
}

30
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/remarksModal.jsx

@ -9,7 +9,8 @@ function remarksModal (props) {
visible,
rowId,
dispatch,
actions
actions,
cameraRemarks
} = props;
const { equipmentWarehouse } = actions;
const [ScrollList, setScrollList] = useState([{num:'01',value:''},{num:'02',value:''},{num:'03',value:''}]); //
@ -17,13 +18,19 @@ function remarksModal (props) {
const [roll,setroll] = useState(false);
const [showValueNum,setShowValueNum] = useState(0);
const valueNum = useRef(0);
// useEffect(() => {
// setShowScrollList([
// '76',
// '111111111111111111111111111111111111111111111111111111'
// ])
// }, []);
//
useEffect(() => {
let myScrollList=ScrollList
for (let index = 0; index < cameraRemarks.length; index++) {
myScrollList[index].value=cameraRemarks[index].remark
}
setScrollList(myScrollList)
let mycameraRemarks=[]
for (let index = 0; index < cameraRemarks.length; index++) {
mycameraRemarks.push(cameraRemarks[index].remark)
}
setShowScrollList(mycameraRemarks)
}, []);
function handleOk () {
//
@ -36,13 +43,11 @@ function remarksModal (props) {
close();
})
}
function handleAfterClose () {
//
}
function handleCancel () {
close();
//
}
//
function onChange(value,num){
valueNum.current=0
let myScrollList=ScrollList
@ -56,10 +61,12 @@ function remarksModal (props) {
}
setShowValueNum(valueNum.current);
}
//
function onFocus(num){
setShowScrollList([ScrollList[num].value])
setroll(true)
}
//
function onBlur(){
setShowScrollList([])
let myScrollList = []
@ -80,7 +87,6 @@ function remarksModal (props) {
visible={visible}
onOk={handleOk}
width={763}
afterClose={handleAfterClose}
onCancel={handleCancel}
>
<div style={{margin:"2px 14px 18px 29px",display:'flex'}}>

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

@ -43,6 +43,7 @@ const CameraHeader = (props) => {
const [nvrNumber, setNvrNumber] = useState();
const [videoObj, setVideoObj] = useState(); //
const [axyData, setAxyData] = useState();
const [cameraRemarks, setCameraRemarks] = useState([]);//
const { equipmentWarehouse } = actions;
const api = useRef();
const searchData = useRef({})
@ -284,13 +285,7 @@ const CameraHeader = (props) => {
<Button
theme="borderless"
onClick={() => {
setVideoObj({
type:'remarks',
// serialNo: row.serialNo,
// yingshiToken: row.secretYingshi.token,
// playUrlSd: row.gbCamera.playUrl.liveUrl.sd.ezopen,
// playUrlHd: row.gbCamera.playUrl.liveUrl.hd.ezopen,
})
setCameraRemarks(row.cameraRemarks||[])
setRowId(row.id);
setRemarksModal(true)
}}
@ -845,9 +840,11 @@ const CameraHeader = (props) => {
<RemarksModal
visible={true}
rowId={rowId}
cameraRemarks={cameraRemarks}
close={() => {
setRemarksModal(false)
setRowId()
setRemarksModal(false);
setRowId();
equipmentGetCamera();
}} >
</RemarksModal>:''
}

Loading…
Cancel
Save