@@ -116,7 +116,7 @@ export default {
name: 'MapPlayer',
components: { LivePlayer },
props: {
- videoUrl: {
+ videoURL: {
type: String
},
deviceName: {
@@ -125,14 +125,20 @@ export default {
},
data() {
return {
- play: true
+ url: ''
}
},
- created() {},
+ created() {
+ console.log('this.videoURL', this.videoURL)
+ },
mounted() {},
methods: {
handleClose() {
this.$emit('updateClose')
+ },
+ get_url(item) {
+ console.log('item', item)
+ this.url = item
}
}
}
diff --git a/src/views/videoMonitor/components/mapVideo.vue b/src/views/videoMonitor/components/mapVideo.vue
index 848a007..963f6bb 100644
--- a/src/views/videoMonitor/components/mapVideo.vue
+++ b/src/views/videoMonitor/components/mapVideo.vue
@@ -8,20 +8,28 @@ import {
addLayers,
onClickDevice
} from '../utils/deviceLayer'
+import { get_channel_data } from '@/api/videoMonitor/index'
+// import { addImages } from '@/utils/point'
+//import villageLine from '../../../../public/villageLine.geojson'
+import villageLine from '../../../../public/coastal.geojson'
export default {
name: 'MapBody',
data() {
return {
// * 地图实例
- mapContainer: null
+ mapContainer: null,
+ channel_data: []
}
},
+ // created() {
+
+ // },
mounted() {
this.init_map()
},
methods: {
// 地图初始化
- init_map() {
+ init_map(searchname, isflag) {
const minemap = window.minemap
minemap.domainUrl = 'http://50.144.11.244:21009'
minemap.dataDomainUrl = 'http://50.144.11.244:21009'
@@ -29,39 +37,322 @@ export default {
minemap.spriteUrl =
'http://50.144.11.244:21009/minemapapi/v2.1.0/sprite/sprite'
minemap.serviceUrl = 'http://50.144.11.244:21009/service/'
- minemap.key = '16be596e00c44c86bb1569cb53424dc9'
- minemap.solution = 12878
- // * 地图实例化
- this.mapContainer = new minemap.Map({
- container: 'map',
- style: 'http://50.144.11.244:21009/service/solu/style/id/12878',
- center: [120.336617, 33.766037],
- zoom: 12,
- pitch: 60,
- maxZoom: 17,
- minZoom: 3,
- projection: 'LATLON'
+ minemap.key = '493f15a08a7d4d588f56d030709a2221'
+ minemap.solution = 12620
+ let device_data = []
+ let center_num = []
+ let params = {
+ gbsChannelNo: 131,
+ pageSize: 1600,
+ pageNum: 1,
+ deviceName: searchname
+ }
+ get_channel_data(params).then((res) => {
+ console.log('resss111', res)
+ // 所有点位数据
+ device_data = res.rows
+ console.log('1', device_data)
+ if (isflag) {
+ center_num = [res.rows[0].longitude, res.rows[0].latitude]
+ } else {
+ center_num = [120.235604, 33.765408]
+ }
+ this.mapContainer = new minemap.Map({
+ container: 'map',
+ style: 'http://50.144.11.244:21009/service/solu/style/id/12620',
+ center: center_num,
+ zoom: 17,
+ maxZoom: 17,
+ minZoom: 3,
+ projection: 'LATLON'
+ })
+
+ this.mapContainer.on('load', () => {
+ addSources(this.mapContainer, device_data)
+ addImages(this.mapContainer)
+ addLayers(this.mapContainer)
+ addline()
+ addlineLayers()
+ // 公安局点位
+ addPolicePoint()
+ addPolicePointText()
+ addPolicePointTextLayer()
+ })
+ onClickDevice(this.mapContainer)
+ // this.mapContainer.on('moveend', () => {
+ // let bounds = this.mapContainer.getBounds()
+ // let sw = bounds.getSouthWest()
+ // let ne = bounds.getNorthEast()
+ // let obj = {
+ // swlng: sw.lng,
+ // swlat: sw.lat,
+ // nelng: ne.lng,
+ // nelat: ne.lat
+ // }
+ // console.log('obj', obj)
+ // })
+ const addline = () => {
+ // 声明一个空的存储数组
+ let features_list = []
+ // 开始遍历图层数据
+ for (let i = 0; i < villageLine.features.length; i++) {
+ // 把每个区域的线数据加进去
+ features_list.push({
+ type: 'Feature',
+ properties: {
+ color: '#92c7f7',
+ id: i,
+ name: villageLine.features[i].properties.XZQMC
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: villageLine.features[i].geometry.coordinates[0]
+ }
+ })
+ }
+ // 遍历以后把最后的features_list放入对应api所需值里
+ let jsonData = {
+ type: 'FeatureCollection',
+ // 实际边界数据赋值进去
+ features: features_list
+ }
+ // 鼠标经过区块
+ this.mapContainer.on('mousemove', (e) => {
+ // console.log('e',e);
+ // mousemove事件可以直接抓捕到鼠标移动的坐标
+ // 即为mousemove的入参e为鼠标的实时坐标
+ // queryRenderedFeatures官方定义函数
+ // 这个函数的作用就是根据mousemove捕捉到的坐标来确定这个坐标是那个区域里的,为后续更改颜色做准备
+ let areas = this.mapContainer.queryRenderedFeatures(
+ [
+ [e.point.x - 5, e.point.y - 5],
+ [e.point.x + 5, e.point.y + 5]
+ ],
+ {
+ layers: ['fillLayer']
+ }
+ )
+ // areas.length = 0 说明鼠标没有移入所画的边界区域
+ // areas.length > 0 说明鼠标移入所画的边界区域
+ if (areas.length > 0) {
+ this.mapContainer.getCanvas().style.cursor = areas.length
+ ? 'pointer'
+ : ''
+ let area = areas[0]
+ // 不在鼠标移入的边界多边形维持原色
+ jsonData.features.forEach((v) => (v.properties.color = '#92c7f7'))
+ // 颜色的切换是靠对象属性逐层找到color的
+ // 光在此处声明切换颜色是不够的,还需要在addLayers里 paint下的fill-color注明 是要get到color的 ['get','color']
+ // 一定要声明,否则切换颜色是出不来的
+ // 在鼠标停留的边界多边形切换颜色
+ // console.log('name',area.properties.name);
+ jsonData.features[area.properties.id].properties.color = '#fcdc3b'
+ this.mapContainer.getSource('fillSource').setData(jsonData)
+ } else {
+ jsonData.features.forEach((v) => (v.properties.color = '#92c7f7'))
+ this.mapContainer.getSource('fillSource').setData(jsonData)
+ }
+ })
+ this.mapContainer.addSource('fillSource', {
+ type: 'geojson',
+ data: jsonData
+ })
+ }
+ // 边界数据开始渲染
+ const addlineLayers = () => {
+ this.mapContainer.addLayer({
+ id: 'fillLayer',
+ type: 'fill',
+ source: 'fillSource',
+ layout: {
+ visibility: 'visible'
+ },
+ paint: {
+ 'fill-color': ['get', 'color'],
+ 'fill-opacity': 0.5,
+ 'fill-outline-color': '#03447f'
+ // "text-color": "#fff"
+ },
+ minzoom: 7,
+ maxzoom: 17.5
+ })
+ }
+ // 射阳公安局点位
+ const addPolicePoint = () => {
+ let el = document.createElement('div')
+ el.id = 'police_marker'
+ el.style.background = `url(${require('@/assets/icon-hza/06.png')})` // 背景
+ el.style['background-size'] = 'cover'
+ el.style.width = '40px' // 宽高
+ el.style.height = '60px'
+ // 设定点位坐标
+ let lnglat = [120.235604, 33.765408]
+ var _marker = new minemap.Marker(el, { offset: [-25, -25] })
+ .setLngLat(lnglat)
+ .addTo(this.mapContainer)
+ // 防止define but not use
+ console.log('_marker', _marker)
+ }
+ // 射阳公安局点位文本
+ const addPolicePointText = () => {
+ let text_data = {
+ type: 'FeatureCollection',
+ features: [
+ {
+ type: 'Feature',
+ geometry: {
+ type: 'Point',
+ coordinates: [120.235604, 33.765408]
+ },
+ properties: {
+ title: '射阳县公安局'
+ }
+ }
+ ]
+ }
+ this.mapContainer.addSource('pointSource', {
+ type: 'geojson',
+ data: text_data
+ })
+ }
+ // 射阳公安局点位文本覆盖
+ const addPolicePointTextLayer = () => {
+ this.mapContainer.addLayer({
+ id: 'symbolLayer',
+ type: 'symbol',
+ source: 'pointSource',
+ layout: {
+ visibility: 'visible',
+ 'icon-image': 'marker-15-6',
+ 'text-field': '{title}',
+ 'text-offset': [0, -2],
+ 'text-anchor': 'bottom',
+ 'text-size': 16,
+ 'icon-allow-overlap': true, //图标允许压盖
+ 'text-allow-overlap': true //图标覆盖文字允许压盖
+ },
+ paint: {
+ 'icon-color': {
+ type: 'categorical',
+ property: 'kind',
+ stops: [
+ ['school', '#ff0000'],
+ ['park', '#00ff00'],
+ ['hospital', '#0000ff']
+ ],
+ default: '#fff'
+ },
+ 'text-color': {
+ type: 'categorical',
+ property: 'kind',
+ stops: [
+ ['school', '#ff0000'],
+ ['park', '#00ff00'],
+ ['hospital', '#0000ff']
+ ],
+ default: '#fff'
+ },
+ 'text-halo-color': '#000000',
+ 'text-halo-width': 0.5
+ },
+ minzoom: 7,
+ maxzoom: 17.5
+ })
+ }
})
+
+ // let params = {
+ // gbsChannelNo:131,
+ // pageSize:1600,
+ // pageNum:1
+ // }
+ // let result = await get_channel_data(params)
+ // this.channel_data = result.
// * 地图加载事件
- this.mapContainer.on('load', () => {
- addSources(this.mapContainer)
- addImages(this.mapContainer)
- addLayers(this.mapContainer)
- })
+
+ // const addImages = () => {
+ // this.mapContainer.loadImage(
+ // require('@/assets/picture/point_sea_video.png'),
+ // (error, image) => {
+ // if (error) throw error
+ // this.mapContainer.addImage('device_image', image)
+ // }
+ // )
+ // }
+ // const addSources_new = () => {
+ // // 声明一个空的存储数组
+ // let features_list = []
+ // for (let i = 0; i < this.channel_data.length; i++) {
+ // features_list.push({
+ // "type": "Feature",
+ // "geometry": {
+ // "type": "Point",
+ // "coordinates": [this.channel_data[i].longitude, this.channel_data[i].latitude]
+ // },
+ // properties: {
+ // // * 通道号
+ // channel: this.channel_data[i].channelNo,
+ // // * 设备名称
+ // deviceName: this.channel_data[i].deviceName,
+ // // * 设备IP
+ // deviceIp: this.channel_data[i].deviceIp,
+ // // * 设备类型
+ // monitoringType: this.channel_data[i].monitoringType,
+ // // * 国标编码
+ // gbsChannelNo: this.channel_data[i].gbsChannelNo,
+ // // * 设备方位
+ // orientation: this.channel_data[i].orientation,
+ // // * 设备品牌
+ // deviceBrand: this.channel_data[i].deviceBrand,
+ // // * 设备经度
+ // longitude: this.channel_data[i].longitude,
+ // // * 设备纬度
+ // latitude: this.channel_data[i].latitude
+ // }
+ // })
+ // }
+ // let point_data = {
+ // type: 'FeatureCollection',
+ // features: features_list
+ // }
+ // this.mapContainer.addSource('data-point',{
+ // type: 'geojson',
+ // data: point_data,
+ // cluster: true,
+ // clusterMaxZoom: 15 /* 最大聚合层级 */,
+ // clusterRadius: 50 /* 聚合半径 */
+ // })
+ // }
+ // const addLayers_new = () => {
+ // this.mapContainer.addLayer({
+ // id: 'unclustered-points',
+ // type: 'symbol',
+ // // * 图层数据源 - 可以更改数据
+ // source: 'data-point',
+ // // * 图层过滤器
+ // filter: ['!has', 'point_count'],
+ // // * 图层布局样式
+ // layout: {
+ // 'icon-image': 'device_image'
+ // }
+ // })
+ // }
// * 图层点击事件
- onClickDevice(this.mapContainer)
+
// * 地图移动事件
- this.mapContainer.on('moveend', () => {
- let bounds = this.mapContainer.getBounds()
- let sw = bounds.getSouthWest()
- let ne = bounds.getNorthEast()
- let obj = {
- swlng: sw.lng,
- swlat: sw.lat,
- nelng: ne.lng,
- nelat: ne.lat
- }
- console.log('obj', obj)
+ },
+ // 1. 先做区域 -->根据某个点位的坐标做区域 需要查询的区域
+ // 2. 通过做出的这个区域里反查询,是否有点位,有多少,有就做成数组
+
+ get_channel() {
+ let params = {
+ gbsChannelNo: 131,
+ pageSize: 1600,
+ pageNum: 1
+ }
+ get_channel_data(params).then((res) => {
+ console.log('ddd', res)
+ this.channel_data = res.rows
})
}
}
diff --git a/src/views/videoMonitor/components/sixVideoDialog.vue b/src/views/videoMonitor/components/sixVideoDialog.vue
new file mode 100644
index 0000000..a131701
--- /dev/null
+++ b/src/views/videoMonitor/components/sixVideoDialog.vue
@@ -0,0 +1,284 @@
+
+
+
+
+
+
{{ this.new_point_list[0].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
{{ this.new_point_list[1].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
{{ this.new_point_list[2].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
{{ this.new_point_list[3].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
{{ this.new_point_list[4].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
{{ this.new_point_list[5].deviceName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/videoMonitor/components/videoDialog.vue b/src/views/videoMonitor/components/videoDialog.vue
new file mode 100644
index 0000000..a6ffbf5
--- /dev/null
+++ b/src/views/videoMonitor/components/videoDialog.vue
@@ -0,0 +1,387 @@
+
+
+
+
+
+
+
重点人员信息
+
+
+
设备名称:
+
设备IP:
+
监控类型:
+
国际编码:
+
设备方位:
+
设备品牌:
+
设备经度:
+
设备纬度:
+
+
+
+ {{ this.in.channel_name }}
+
+
{{ this.in.device_ip }}
+
+ {{ this.in.monitoringTypeCn }}
+
+
{{ this.in.gbsChannelNo }}
+
{{ this.in.orientationCn }}
+
{{ this.in.manufactor }}
+
{{ this.in.longitude }}
+
{{ this.in.latitude }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/videoMonitor/index.vue b/src/views/videoMonitor/index.vue
index 848dedf..9cca154 100644
--- a/src/views/videoMonitor/index.vue
+++ b/src/views/videoMonitor/index.vue
@@ -27,7 +27,7 @@