Commit 28918dff authored by xiexingan's avatar xiexingan

tj

parent 9d873711
...@@ -101,16 +101,44 @@ import { mapState } from 'vuex' ...@@ -101,16 +101,44 @@ import { mapState } from 'vuex'
import { isAuth } from '../../../util' import { isAuth } from '../../../util'
export default { export default {
computed: { computed: {
...mapState('d2admin/user', [ ...mapState('d2admin/user', ['info'])
'info'
])
}, },
data () { data() {
return { return {
//11=焦距变大,12=焦距变小,13=焦点前调,14=焦点后调,15=光圈扩大,16=光圈扩小 //11=焦距变大,12=焦距变小,13=焦点前调,14=焦点后调,15=光圈扩大,16=光圈扩小
//21=上仰,22=下俯,23=左转,24=右转,25=左上,26=右上,27=左下,28=右下,29=自动扫描 //21=上仰,22=下俯,23=左转,24=右转,25=左上,26=右上,27=左下,28=右下,29=自动扫描
actionList: ['', '', '', '', '', '', '', '', '', '', '', '变倍+', '变倍-', '变焦+', '变焦-', '光圈+', '光圈-', '', '', '', '', actionList: [
'上仰', '下俯', '左转', '右转', '左上', '右上', '左下', '右下', '自动扫描'], '',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'变倍+',
'变倍-',
'变焦+',
'变焦-',
'光圈+',
'光圈-',
'',
'',
'',
'',
'上仰',
'下俯',
'左转',
'右转',
'左上',
'右上',
'左下',
'右下',
'自动扫描'
],
imgUrl: '', imgUrl: '',
imgRightUrl11: false, imgRightUrl11: false,
imgRightUrl12: false, imgRightUrl12: false,
...@@ -151,11 +179,9 @@ export default { ...@@ -151,11 +179,9 @@ export default {
flvPlayer: null flvPlayer: null
} }
}, },
created () { created() {},
},
methods: { methods: {
init (id, stationId) { init(id, stationId) {
this.visible = true this.visible = true
this.clickFlag = false this.clickFlag = false
this.dataForm.id = id this.dataForm.id = id
...@@ -163,16 +189,19 @@ export default { ...@@ -163,16 +189,19 @@ export default {
this.initResource() this.initResource()
this.dataForm.operatorName = this.info.name this.dataForm.operatorName = this.info.name
}, },
initResource () { initResource() {
this.$http({ this.$http({
url: this.$http.adornUrlEq(`/liResource/getResourceDetails/${this.dataForm.id}`), url: this.$http.adornUrlEq(
`/liResource/getResourceDetails/${this.dataForm.id}`
),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(data => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm = data.bean this.dataForm = data.bean
//如果当前设备摄像头为离线状态,则不加载画面 //如果当前设备摄像头为离线状态,则不加载画面
if (data.bean.byx2 == 0 && this.flvPlayer) { //资源点状态(0=离线,1=在线) if (data.bean.byx2 == 0 && this.flvPlayer) {
//资源点状态(0=离线,1=在线)
this.flvPlayer.pause() this.flvPlayer.pause()
this.flvPlayer.unload() this.flvPlayer.unload()
this.flvPlayer.detachMediaElement() this.flvPlayer.detachMediaElement()
...@@ -198,7 +227,7 @@ export default { ...@@ -198,7 +227,7 @@ export default {
levelType: 1, levelType: 1,
controlType: 3 controlType: 3
} }
}).then(data => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.videoSrc = data.url this.videoSrc = data.url
//视频连接 //视频连接
...@@ -214,8 +243,10 @@ export default { ...@@ -214,8 +243,10 @@ export default {
enableStashBuffer: false, //播放flv时,设置是否启用播放缓存,只在直播起作用。 enableStashBuffer: false, //播放flv时,设置是否启用播放缓存,只在直播起作用。
url: this.videoSrc url: this.videoSrc
}) })
this.$nextTick(function () { this.$nextTick(function() {
this.flvPlayer.attachMediaElement(this.$refs.video) this.flvPlayer.attachMediaElement(
this.$refs.video
)
this.flvPlayer.load() this.flvPlayer.load()
}) })
} }
...@@ -224,11 +255,14 @@ export default { ...@@ -224,11 +255,14 @@ export default {
} }
}) })
}, },
closeQueryDetailVisible () { closeQueryDetailVisible() {
this.$emit('closeQ') this.$emit('closeQ')
}, },
clickPTZControl (ptz, dwStop, img) { clickPTZControl(ptz, dwStop, img) {
if (this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3' && (ptz < 11 || ptz > 16)) { if (
this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3' &&
(ptz < 11 || ptz > 16)
) {
return return
} }
if (!isAuth('ol:demo:corona')) { if (!isAuth('ol:demo:corona')) {
...@@ -269,24 +303,26 @@ export default { ...@@ -269,24 +303,26 @@ export default {
dwPtzCommand: ptz, //云台控制命令 dwPtzCommand: ptz, //云台控制命令
dwStop: dwStop //云台控制0开始和1结束 dwStop: dwStop //云台控制0开始和1结束
} }
}).then(data => { }).then((data) => {
// console.log(11) // console.log(11)
// console.log(data) // console.log(data)
if (data && data.code === 0) { if (data && data.code === 0) {
if (dwStop == 0) { //云台控制0开始和1结束 if (dwStop == 0) {
this.saveLog(1, ptz)// 执行结果 成功 1 失败 2 //云台控制0开始和1结束
this.saveLog(1, ptz) // 执行结果 成功 1 失败 2
this.$message.success(data.msg) this.$message.success(data.msg)
} }
} else { } else {
if (dwStop == 0) { //云台控制0开始和1结束 if (dwStop == 0) {
this.saveLog(2, ptz)// 执行结果 成功 1 失败 2 //云台控制0开始和1结束
this.saveLog(2, ptz) // 执行结果 成功 1 失败 2
this.$message.error(data.msg) this.$message.error(data.msg)
} }
} }
}) })
}, },
//调用日志保存记录操作指令 //调用日志保存记录操作指令
saveLog (result, ptz) { saveLog(result, ptz) {
this.$http({ this.$http({
url: this.$http.adornUrlEq('/orVideoMonitor/save'), url: this.$http.adornUrlEq('/orVideoMonitor/save'),
method: 'post', method: 'post',
...@@ -298,9 +334,7 @@ export default { ...@@ -298,9 +334,7 @@ export default {
type: this.dataForm.type, type: this.dataForm.type,
result: result result: result
} }
}).then(data => { }).then((data) => {})
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment