|
|
@@ -421,10 +421,45 @@ export default {
|
|
|
attr: { ...point }
|
|
|
})
|
|
|
graphicsLayer.addGraphic(graphic)
|
|
|
+ let that = this
|
|
|
+ graphic.on(this.mars3d.EventType.click, function () {
|
|
|
+ const pointData = graphic.attr
|
|
|
+ that.fetchUrl(pointData).then((res) => {
|
|
|
+ if (res.code == 4001) {
|
|
|
+ that.$message.warning(JSON.parse(res.msg).resultMsg)
|
|
|
+ } else if (res.code == 400) {
|
|
|
+ that.$message.error(res.msg)
|
|
|
+ } else {
|
|
|
+ const url = res.data.streamUrl
|
|
|
+ that.$set(pointData, 'url', url)
|
|
|
+ that.$globalEventBus.$emit('clickVideoPlay', { point: pointData, visible: true, type: 'click' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
graphicsLayer.flyTo()
|
|
|
})
|
|
|
},
|
|
|
+ fetchUrl(item) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ window
|
|
|
+ .requestSDK(
|
|
|
+ '/ttvideo/video/player/getVideoRealtimeUrl',
|
|
|
+ {
|
|
|
+ deviceCode: item.deviceCode,
|
|
|
+ channelCode: item.channelCode,
|
|
|
+ netType: '1',
|
|
|
+ protocolType: 5,
|
|
|
+ streamType: 1
|
|
|
+ },
|
|
|
+ {},
|
|
|
+ 'post'
|
|
|
+ )
|
|
|
+ .then(async (res) => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
removeMonitorData() {
|
|
|
if (graphicsLayer) {
|
|
|
graphicsLayer.show = false
|