Browse Source

报警记录,门禁记录定时请求,摄像头修改

master
z_yu 2 years ago
parent
commit
0f25f857b8
  1. 21
      src/views/components/SecurityDoor.vue
  2. 48
      src/views/components/WarehouseWarning.vue
  3. 17
      src/views/storeManage/warehouse3D/index.vue
  4. 44
      src/views/storeManage/warehouse3D/module/video.vue

21
src/views/components/SecurityDoor.vue

@ -38,17 +38,19 @@ export default {
}, },
data() { data() {
return { return {
tableData: [] //
tableData: [], //
time: null
} }
}, },
created() { created() {
securitydoor().then((data) => {
if (data && data.length > 0) {
this.tableData.push(...data)
}
})
this.getSecuritydoor()
this.time = setInterval(() => {
this.getSecuritydoor()
}, 1000 * 30)
}, },
destroyed() { destroyed() {
clearInterval(this.time)
this.time = null
}, },
methods: { methods: {
// //
@ -58,6 +60,13 @@ export default {
} else { } else {
return '' return ''
} }
},
getSecuritydoor() {
securitydoor().then((data) => {
if (data && data.length > 0) {
this.tableData.splice(0, data.length, ...data)
}
})
} }
} }
} }

48
src/views/components/WarehouseWarning.vue

@ -9,8 +9,8 @@
</h3> </h3>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" style="min-width: 100%;" :width="width" :height="height" :data="tableData" class="warehose-el-table" :row-class-name="rowBgColor"> <el-table ref="table" style="min-width: 100%;" :width="width" :height="height" :data="tableData" class="warehose-el-table" :row-class-name="rowBgColor">
<el-table-column prop="alarm_time" label="时间" align="center" min-width="70" />
<el-table-column prop="area_name" label="库房" align="center" min-width="35" />
<el-table-column prop="alarm_time" label="时间" align="center" min-width="60" />
<el-table-column prop="area_name" label="库房" align="center" :show-overflow-tooltip="true" min-width="30" />
<el-table-column prop="event_name" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" /> <el-table-column prop="event_name" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
</el-table> </el-table>
</div> </div>
@ -35,7 +35,10 @@ export default {
}, },
data() { data() {
return { return {
tableData: [] //
tableData: [], //
scrollTimer: null,
showComplete: false, //
getDataTimer: null
} }
}, },
watch: { watch: {
@ -45,14 +48,19 @@ export default {
} }
}, },
created() { created() {
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => {
if (data && data.length > 0) {
this.tableData.push(...data)
this.getAlarmInfo()
this.getDataTimer = setInterval(() => {
if (this.showComplete) {
this.getAlarmInfo()
this.showComplete = false
} }
})
}, 1000 * 30)
}, },
destroyed() { destroyed() {
clearInterval(this.timer)
clearInterval(this.scrollTimer)
this.scrollTimer = null
clearInterval(this.getDataTimer)
this.getDataTimer = null
}, },
methods: { methods: {
// //
@ -65,17 +73,18 @@ export default {
}, },
// table // table
tableRefScroll() { tableRefScroll() {
clearInterval(this.timer) //
clearInterval(this.scrollTimer) //
const table = this.$refs.table // DOM const table = this.$refs.table // DOM
const wrapperHeight = table.$el.offsetHeight - 30
//
this.displayNum = Math.floor(wrapperHeight / 40)
this.wrapperHeight = table.$el.offsetHeight - 30
console.log(this.wrapperHeight)
//
this.displayNum = Math.floor(this.wrapperHeight / 40)
if (this.tableData.length > this.displayNum) { if (this.tableData.length > this.displayNum) {
const bodyWrapper = table.bodyWrapper // div const bodyWrapper = table.bodyWrapper // div
this.addTableRefScroll(bodyWrapper) this.addTableRefScroll(bodyWrapper)
// //
bodyWrapper.onmouseover = () => { bodyWrapper.onmouseover = () => {
clearInterval(this.timer)
clearInterval(this.scrollTimer)
} }
// //
bodyWrapper.onmouseout = () => { bodyWrapper.onmouseout = () => {
@ -86,10 +95,12 @@ export default {
addTableRefScroll(bodyWrapper) { addTableRefScroll(bodyWrapper) {
// let scrollTop = bodyWrapper.scrollTop // let scrollTop = bodyWrapper.scrollTop
if (this.displayNum && this.displayNum > 0) { if (this.displayNum && this.displayNum > 0) {
this.timer = setInterval(() => {
this.scrollTimer = setInterval(() => {
// scrollTop = bodyWrapper.scrollTop // scrollTop = bodyWrapper.scrollTop
if (Math.round(bodyWrapper.scrollTop / 40) >= this.tableData.length - this.displayNum) {
console.log(bodyWrapper.scrollTop, bodyWrapper.scrollTop >= (this.tableData.length - this.displayNum) * 40)
if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) {
bodyWrapper.scrollTop = 0 bodyWrapper.scrollTop = 0
this.showComplete = true
} else { } else {
bodyWrapper.scrollTop += this.displayNum * 40 bodyWrapper.scrollTop += this.displayNum * 40
} }
@ -106,6 +117,13 @@ export default {
// } // }
}, 1000 * 3 * this.displayNum) }, 1000 * 3 * this.displayNum)
} }
},
getAlarmInfo() {
alarmApi.info({ storeroomId: this.storeroomId }).then((data) => {
if (data && data.length > 0) {
this.tableData.splice(0, data.length, ...data)
}
})
} }
} }
} }

17
src/views/storeManage/warehouse3D/index.vue

@ -22,7 +22,7 @@
<component :is="comName" /> <component :is="comName" />
</div> </div>
<!-- 摄像头视频 --> <!-- 摄像头视频 -->
<Video ref="camera" />
<Video ref="camera" :dialog-open.sync="open" />
</div> </div>
</template> </template>
@ -40,7 +40,8 @@ export default {
data() { data() {
return { return {
activeIndex: 0, activeIndex: 0,
camConfigData: []
camConfigData: [],
open: false
} }
}, },
computed: { computed: {
@ -95,11 +96,13 @@ export default {
if (camConfig && camConfig.isDisplay && camConfig.bindState) { if (camConfig && camConfig.isDisplay && camConfig.bindState) {
// console.log(2, camConfig) // console.log(2, camConfig)
// // ToDo.... // // ToDo....
this.$refs.camera.openVideoVisible = true
//
this.$refs.camera.camConfig = camConfig
this.$refs.camera.videoTitle = data
this.$refs.camera.play()
this.open = true
this.$nextTick(() => {
//
this.$refs.camera.camConfig = camConfig
this.$refs.camera.videoTitle = data
this.$refs.camera.play()
})
} }
} }
} }

44
src/views/storeManage/warehouse3D/module/video.vue

@ -1,10 +1,14 @@
<template> <template>
<el-dialog :close-on-click-modal="false" :visible="openVideoVisible" :before-close="handleClose" :title="videoTitle" @opened="opened">
<el-dialog :close-on-click-modal="false" :visible.sync="openVideoVisible" :before-close="handleClose" :title="videoTitle" width="1068px" @opened="opened">
<span class="dialog-right-top" /> <span class="dialog-right-top" />
<span class="dialog-left-bottom" /> <span class="dialog-left-bottom" />
<div class="setting-dialog"> <div class="setting-dialog">
<!-- :src="videoSrc" controls--> <!-- :src="videoSrc" controls-->
<div ref="canvas-wrap" />
<div ref="canvas-wrap" style="height:768px">
<template v-if="noSignal">
<div> 无信号 </div>
</template>
</div>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -14,19 +18,38 @@ import JSMpeg from '@/components/jsmpeg'
import axios from 'axios' import axios from 'axios'
import qs from 'qs' import qs from 'qs'
export default { export default {
props: {
dialogOpen: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
openVideoVisible: false,
videoTitle: '', videoTitle: '',
camConfig: null, camConfig: null,
player: null
player: null,
noSignal: true
} }
}, },
computed: { computed: {
rtspUrl: function() { rtspUrl: function() {
return 'rtsp://' + this.camConfig.deviceInfo.deviceAccount + ':' + this.camConfig.deviceInfo.devicePassword + '@' + this.camConfig.deviceInfo.deviceIp + ':' + this.camConfig.deviceInfo.devicePort + '/' + this.camConfig.deviceInfo.videoRoute + '/1' return 'rtsp://' + this.camConfig.deviceInfo.deviceAccount + ':' + this.camConfig.deviceInfo.devicePassword + '@' + this.camConfig.deviceInfo.deviceIp + ':' + this.camConfig.deviceInfo.devicePort + '/' + this.camConfig.deviceInfo.videoRoute + '/1'
},
openVideoVisible: {
get() {
return this.dialogOpen
},
set(value) {
this.$emit('update:dialogOpen', value)
}
} }
}, },
beforeDestroy() {
this.player?.stop()
this.player?.destroy()
this.player = null
},
methods: { methods: {
handleClose(done) { handleClose(done) {
this.openVideoVisible = false this.openVideoVisible = false
@ -44,7 +67,6 @@ export default {
this.player?.stop() this.player?.stop()
this.player?.destroy() this.player?.destroy()
this.player = null this.player = null
// })
done() done()
}) })
}, },
@ -65,7 +87,15 @@ export default {
// var canvas = document.getElementById('canvas') // var canvas = document.getElementById('canvas')
const opt = { const opt = {
contianer: this.$refs['canvas-wrap'], contianer: this.$refs['canvas-wrap'],
poster: '0.jpg'
poster: '0.jpg',
onSourceEstablished: (source) => {
console.log('onSourceEstablished')
// this.flags.noSignal = false
this.noSignal = false
// clearTimeout(this.timers.noSignal)
// this.timers.noSignal = null
this.$emit('source-established', source)
}
} }
this.player = new JSMpeg.Player(url, opt) this.player = new JSMpeg.Player(url, opt)
}) })
@ -76,6 +106,6 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog { ::v-deep .el-dialog {
width: auto;
height: 835xp;
} }
</style> </style>
Loading…
Cancel
Save