| | |
| | | >{{ item.name }}</div> |
| | | </div> |
| | | |
| | | <div class="list-show"> |
| | | <el-tree :props="props" :load="loadNode" lazy @node-click="treeClick"></el-tree> |
| | | |
| | | <div class="list-show" v-if="false"> |
| | | <div class="car-list"> |
| | | <div class="list-box"> |
| | | <el-table |
| | |
| | | <script> |
| | | import EntityDraw from "@/utils/EntityDraw.js" |
| | | import { listQuery, accurateSearch } from "@/utils/search.js" |
| | | import { getVideoList, getDevices, getRegionList, insertRegionSaveList } from '@/api/video/index.js' |
| | | import { getVideoList, getDevices, getRegionList, insertRegionSaveList, getTreeDevices } from '@/api/video/index.js' |
| | | import { getSearchExtensively } from '@/api/dept/index.js' |
| | | import flvjs from 'flv.js' |
| | | |
| | |
| | | searchExtensivelyValue: '', |
| | | searchExtensivelyValBoxShow: false, |
| | | searchExtensivelyArray: [], |
| | | props: { |
| | | label: 'name', |
| | | children: 'zones', |
| | | isLeaf: (data, node) => { |
| | | if (node.level === 4) { |
| | | return true |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | |
| | |
| | | this.searchExtensivelyValue = '' |
| | | this.searchExtensivelyChange() |
| | | }, |
| | | |
| | | async loadNode (node, resolve) { |
| | | if (node.level === 0) { |
| | | return resolve([{ name: '信州分局' }]) |
| | | } |
| | | if (node.level === 1) { |
| | | let data = [] |
| | | await getTreeDevices({ page: 1, count: 100, parentId: 361102, onlyCatalog: false }).then(res => { |
| | | data = res.data.data.list |
| | | }) |
| | | return resolve(data) |
| | | } |
| | | if (node.level > 1) { |
| | | let data = [] |
| | | await getTreeDevices({ page: 1, count: 100, parentId: node.data.id, onlyCatalog: false }).then(res => { |
| | | data = res.data.data.list |
| | | }) |
| | | return resolve(data) |
| | | } |
| | | }, |
| | | |
| | | 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(flvUrl, 111) |
| | | if (typeof flvUrl === 'object') { |
| | | this.$message.error(flvUrl.msg) |
| | | return |
| | | } |
| | | this.dialogVisible = true |
| | | |
| | | 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() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | destroyed () { |