| | |
| | | props: { |
| | | label: 'name', |
| | | children: 'zones', |
| | | isLeaf: (data, node) => { |
| | | if (node.level === 4) { |
| | | return true |
| | | } |
| | | } |
| | | isLeaf: true |
| | | // isLeaf: (data, node) => { |
| | | // if (node.level === 4) { |
| | | // return true |
| | | // } |
| | | // } |
| | | }, |
| | | } |
| | | }, |
| | |
| | | sitePitch: -90 |
| | | }) |
| | | }, |
| | | |
| | | |
| | | async siteClick (e) { |
| | | if (this.flvPlayer != null) { |
| | |
| | | |
| | | async treeClick (node) { |
| | | if (node.parent == false) { |
| | | console.log(node, node.name, node.id, node.basicData.channelId) |
| | | let flvUrl = '' |
| | | await this.getDevices(node.id).then(res => { |
| | | flvUrl = res |
| | | console.log(node, node.name, node.id, node.basicData.channelId, node.basicData.longitude, node.basicData.latitude) |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: node.basicData.longitude, |
| | | siteWd: node.basicData.latitude, |
| | | siteGd: 600, |
| | | }) |
| | | console.log(flvUrl, 111) |
| | | if (typeof flvUrl === 'object') { |
| | | this.$message.error(flvUrl.msg) |
| | | return |
| | | } |
| | | this.dialogVisible = true |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'searchLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'searchLayer', |
| | | type: 'label', |
| | | params: { |
| | | lng: node.basicData.longitude, |
| | | lat: node.basicData.latitude, |
| | | alt: 0, |
| | | text: node.name |
| | | } |
| | | }) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'searchLayer', |
| | | type: "billboard", |
| | | params: { |
| | | name: node.name, |
| | | lng: node.basicData.longitude, |
| | | lat: node.basicData.latitude, |
| | | alt: 100, |
| | | url: '/img/icon/video.png', |
| | | channelId: node.id |
| | | }, |
| | | incident: this.siteClick |
| | | }) |
| | | |
| | | if (flvjs.isSupported()) { |
| | | this.$nextTick(() => { |
| | | var videoElement = document.getElementById('videoElement') |
| | | this.flvPlayer = flvjs.createPlayer({ |
| | | type: 'flv', |
| | | isLive: true, |
| | | hasAudio: false, |
| | | url: flvUrl |
| | | }) |
| | | this.flvPlayer.attachMediaElement(videoElement) |
| | | this.flvPlayer.load() |
| | | this.flvPlayer.play() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | }, |