diff --git a/src/views/map/components/menjinCmt.vue b/src/views/map/components/menjinCmt.vue new file mode 100644 index 0000000..c2a0170 --- /dev/null +++ b/src/views/map/components/menjinCmt.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/src/views/map/components/qixiang.vue b/src/views/map/components/qixiang.vue index c6d5695..3516d28 100644 --- a/src/views/map/components/qixiang.vue +++ b/src/views/map/components/qixiang.vue @@ -203,7 +203,8 @@ export default { requestFN( '/map/listbymeteorological', { - CORPINFO_ID: this.corpInfoId || '035958e685cf4850bc40151c5e0617a6' + CORPINFO_ID: this.corpInfoId || '035958e685cf4850bc40151c5e0617a6', + GANGKOU: this.gangkou } ).then((data) => { this.listLoading = false diff --git a/src/views/map/components/renyuanCmt.vue b/src/views/map/components/renyuanCmt.vue new file mode 100644 index 0000000..87d28f2 --- /dev/null +++ b/src/views/map/components/renyuanCmt.vue @@ -0,0 +1,413 @@ + + + + + diff --git a/src/views/map/dialog/index.vue b/src/views/map/dialog/index.vue index 64b3cc2..3c86778 100644 --- a/src/views/map/dialog/index.vue +++ b/src/views/map/dialog/index.vue @@ -7,13 +7,16 @@ + + + @@ -43,6 +46,7 @@ + @@ -63,10 +67,12 @@ import weatherstation from './weatherstation.vue' import temperaturestation from './weatherstation.vue' import humiditystation from './weatherstation.vue' import windspeedstation from './weatherstation.vue' +import windspeedstationCmt from './weatherstationCmt.vue' import XfControl from './xfControl.vue' import XfPoint from './xfPoint.vue' import MkGateMachine from './mkGateMachine.vue' import MkGateMachineCfd from './mkGateMachineCfd.vue' +import MkGateMachineCmt from './mkGateMachineCmt.vue' import Zhong_da_info from './zhong_da_info.vue' import electricityOrder from './electricityOrder.vue' import highworkOrder from './highworkOrder.vue' @@ -76,6 +82,7 @@ import breakgroundOrder from './breakgroundOrder.vue' import hoistingOrder from './hoistingOrder.vue' import videoPlay from './video_play.vue' import videoPlayCfd from './video_play_cfd.vue' +import videoPlayCmt from './video_play_cmt.vue' import videoPlayPlat from './video_play_plat.vue' import videoPlayBianjieruqin from './video_play_bianjieruqin.vue' import hotworkCfdD from './hotworkCfdD.vue' @@ -87,6 +94,7 @@ import cutroadCfdD from './cutroadCfdD.vue' import breakgroundCfdD from './breakgroundCfdD.vue' import hoistingCfdD from './hoistingCfdD.vue' import peoplePositionCfdD from './peoplePositionCfdD.vue' +import peoplePositionCmt from './peoplePositionCmt.vue' import carPositionCfdD from './carPositionCfdD.vue' import peoplePositionOne from './peoplePositionOne.vue' import hotworkFirst from './hotworkFirst' @@ -106,6 +114,7 @@ export default { temperaturestation, humiditystation, windspeedstation, + windspeedstationCmt, electricityOrder, highworkOrder, cutroadOrder, @@ -114,6 +123,7 @@ export default { hoistingOrder, videoPlay, videoPlayCfd, + videoPlayCmt, videoPlayPlat, hotworkCfdD, confinedspaceCfdD, @@ -125,13 +135,15 @@ export default { hoistingCfdD, MkGateMachineCfd, peoplePositionCfdD, + peoplePositionCmt, carPositionCfdD, videoPlayBianjieruqin, peoplePositionOne, hotworkFirst, peoplePositionYGS, outSourceInfo, - outSourceVideoInfo + outSourceVideoInfo, + MkGateMachineCmt }, props: { title: { @@ -165,7 +177,11 @@ export default { infoname: { type: String, default: '' - } + }, + name: { + type: String, + default: '' + }, }, methods: { closeDialog() { diff --git a/src/views/map/dialog/mkGateMachineCmt.vue b/src/views/map/dialog/mkGateMachineCmt.vue new file mode 100644 index 0000000..f28a24d --- /dev/null +++ b/src/views/map/dialog/mkGateMachineCmt.vue @@ -0,0 +1,208 @@ + + + + diff --git a/src/views/map/dialog/peoplePositionCmt.vue b/src/views/map/dialog/peoplePositionCmt.vue new file mode 100644 index 0000000..d2c0a0c --- /dev/null +++ b/src/views/map/dialog/peoplePositionCmt.vue @@ -0,0 +1,120 @@ + + + + diff --git a/src/views/map/dialog/video_play_cmt.vue b/src/views/map/dialog/video_play_cmt.vue new file mode 100644 index 0000000..706f9b7 --- /dev/null +++ b/src/views/map/dialog/video_play_cmt.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/views/map/dialog/weatherstationCmt.vue b/src/views/map/dialog/weatherstationCmt.vue new file mode 100644 index 0000000..ef93b02 --- /dev/null +++ b/src/views/map/dialog/weatherstationCmt.vue @@ -0,0 +1,669 @@ + + + + diff --git a/src/views/map/index.vue b/src/views/map/index.vue index 2a95f59..09ea1e4 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -39,7 +39,7 @@ :corp-info-id="CORP_INFO_ID" :gangkou="gangkouActive"/> @@ -48,6 +48,11 @@ :corp-info-id="CORP_INFO_ID" :area="area" :gangkou="gangkouActive"/> + @@ -93,6 +98,11 @@ :corp-info-id="CORP_INFO_ID" :area="area" :gangkou="gangkouActive"/> + @@ -241,11 +252,13 @@ import menjinCzks from './components/menjinCzks.vue' import renyuanCzks from './components/renyuanCzks.vue' import menjin from './components/menjin.vue' import menjinCfd from './components/menjinCfd.vue' +import menjinCmt from './components/menjinCmt.vue' import xiaofang from './components/xiaofang.vue' import anquan from './components/anquan.vue' import anquanCfd from './components/anquanCfd.vue' import qixiang from './components/qixiang.vue' import renyuan from './components/renyuan.vue' +import renyuanCmt from './components/renyuanCmt.vue' import bianjieruqin from './components/bianjieruqin.vue' import renyuanCfd from './components/renyuanCfd.vue' import zhongda from './components/zhongda.vue' @@ -267,6 +280,9 @@ let drag = null let ry_drag = null var tiandituTk = 'e8a16137fd226a62a23cc7ba5c9c78ce' var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7'] +var PI = 3.1415926535897932384626 +var a = 6378245.0 // 卫星椭球坐标投影到平面地图坐标系的投影因子。 +var ee = 0.00669342162296594323 // 椭球的偏心率。//判断是否在国内,在中国国内的经纬度才需要做偏移 // 沧州矿石人员定位数组 let czksPerLocArr = [] const Cesium = window.Cesium @@ -292,10 +308,12 @@ export default { layoutMenu, menjin, menjinCfd, + menjinCmt, xiaofang, anquan, qixiang, renyuan, + renyuanCmt, renyuanCfd, zhongda, layoutDialog, @@ -365,7 +383,7 @@ export default { 'x': 118.43701, 'y': 38.9866 }, - CORP_INFO_ID: 'c077f4ed66844ed4a191a36fa1fc641c' + CORP_INFO_ID: '6aa255d41602497fa0f934a822820df4' } ], branchPoint: [], @@ -1389,6 +1407,31 @@ export default { this.dialog.infoname = infoname return } + if (this.gangkouActive === '00005' && point_id.substring(0, 1) !== '1' && point_type !== 'peoplePosition') { + const { label, point_type, data_id, infoname,name, code } = pick.id._monitoItems.data + this.dialog.visible = true + this.dialog.title = label + this.dialog.type = point_type.substring(3) + this.gangkouActive + this.dialog.id = data_id + this.dialog.name = name + this.dialog.id = point_type.substring(3) === 'CAMERA' ? code : point_type.substring(3) === 'platcamera' ? code : data_id + this.dialog.infoname = infoname + console.log(this.dialog) + return + } + if (this.gangkouActive === '00005' && point_type === 'peoplePosition') { + const { label, point_type, id, corpInfoId, name, infoname } = pick.id._monitoItems.data + console.log(pick.id._monitoItems.data) + this.dialog.visible = true + this.dialog.title = label + this.dialog.type = point_type+'00005' + console.log(this.dialog.type) + this.dialog.id = id + this.dialog.name = name + this.dialog.infoname = infoname + this.dialog.corpInfoId = corpInfoId + return + } if (point_type.indexOf('标记点') !== -1) { const { label, point_type, data_id, corpInfoId, dialog_width, infoname } = pick.id._monitoItems.data this.dialog.visible = true @@ -1898,6 +1941,7 @@ export default { }, bottomOptionsItemsClick(pindex, index, label, urlType, pointUrl, dialog_width) { + var _this = this if (this.bottomOptionsList[pindex].list[index].check || this.gangkouActive === '00004' && this.cfdBottomOptionsList[pindex].list[index].check) { // 取消选中 // 沧州矿石人员定位关闭 @@ -2001,6 +2045,12 @@ export default { } else { point.infoname = varList[i].NAME } + //曹煤炭数据 + if (this.gangkouActive === '00005') { + point.name = varList[i].MAP_POINT_NAME + point.infoname = varList[i].MAP_POINT_NAME + } + console.log(point) points.push(point) } if (this.gangkouActive === '00004' && urlType === 'carPosition') { @@ -2022,6 +2072,13 @@ export default { } else { this.dragEntity(points, pindex, index) } + // 人员定位开启实时获取定位websocket + if (this.gangkouActive === '00005' && urlType === 'peoplePosition') { + if (!this.fwebsocket.url) { + this.cmtinitNinePerLocWebsocket() + } + } + _this.dragEntity(points, pindex, index) }).catch((e) => { console.log(e) }) @@ -2430,6 +2487,71 @@ export default { } } }, + // 曹煤炭人员定位websocket + cmtinitNinePerLocWebsocket() { + const _this = this + console.info(config.perRealTimeLocUrl) + if (window.WebSocket) { + this.fwebsocket = new WebSocket(encodeURI('ws://' + config.cmtperRealTimeLocUrl)) // oladress在main.jsp页面定义 + this.fwebsocket.onopen = () => { + console.info('人员定位监听成功') + } + this.fwebsocket.onerror = function() { + console.info('连接失败') + } + this.fwebsocket.onclose = function() { + console.info('onclose') + } + this.fwebsocket.onmessage = function(message) { + const mockData = JSON.parse(message.data) + console.log(mockData) + + // 将地图上的点与最新的定位人员点进行对比 删除地图上多的点 + const ninePerLoc = _this.ninePerLocArr.filter(item => { + const index = mockData.findIndex(item1 => { + return item.id.toString() === item1.cardno.toString() + }) + return index !== -1 + }) + + // 将地图上剩余的点与最新的定位人员点进行对比 更新地图上已存在的点 新增地图上之前没有的点 + for (const item of mockData) { + console.log(item) + const wgs84 = _this.gcj02towgs84(parseFloat(item.longitude), parseFloat(item.latitude)) + item.longitude = wgs84[0] + item.latitude = wgs84[1] + const index = ninePerLoc.findIndex(item1 => { + return item1.id.toString() === item.cardno.toString() + }) + + const pointColor = _this.isPointxyWithinTheArea(_this.pointBox, item.longitude, item.latitude) + if (index !== -1) { + ninePerLoc[index].x = item.longitude + ninePerLoc[index].y = item.latitude + ninePerLoc[index].icon_type = 'img4_0' + pointColor + ry_drag.getPosition(ninePerLoc[index]) + } else { + const perLoc = { + id: item.cardno, + name: item.name, + x: item.longitude, + y: item.latitude, + point_type: 'peoplePosition', + icon_type: 'img4_0' + pointColor + } + ninePerLoc.push(perLoc) + ry_drag.delEntity(perLoc) + ry_drag.addEntity(perLoc) + var qianzhui = 'person' + _this.allOrientationPoint[qianzhui + item.cardno] = item.cardno + // qianzhui 前缀是点位的前缀,用于区分不同类型的点(如一公司人员、二公司人员),删除时,可根据点位前缀进行删除点 + } + } + // 最后更新ninePerLocArr + _this.ninePerLocArr = ninePerLoc + } + } + }, /* 一公司人员定位 mqtt务必使用4.2.1版本*/ // 九公司人员定位websocket initNinePerLocWebsocket() { @@ -2738,6 +2860,7 @@ export default { point.empNo = data.empNo || '' // 工号 point.cardNo = data.cardNo || '' // 卡号 point.gangkou = this.gangkouActive + console.log(point) return point }, // 查询当前所有点位是否在区域内 @@ -2797,7 +2920,42 @@ export default { } }) }, - + gcj02towgs84(lng, lat) { + if (this.out_of_china(lng, lat)) { + return [lng, lat] + } else { + var dlat = this.transformlat(lng - 105.0, lat - 35.0) + var dlng = this.transformlng(lng - 105.0, lat - 35.0) + var radlat = lat / 180.0 * PI + var magic = Math.sin(radlat) + magic = 1 - ee * magic * magic + var sqrtmagic = Math.sqrt(magic) + dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI) + dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI) + const mglat = lat + dlat + const mglng = lng + dlng + return [lng * 2 - mglng, lat * 2 - mglat] + } + }, + out_of_china(lng, lat) { + return (lng < 72.004 || lng > 137.8347 || (lat < 0.8293 || lat > 55.8271 || false)) + }, + // 转化经度 + transformlng(lng, lat) { + var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng)) + ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0 + ret += ((20.0 * Math.sin(lng * PI) + 40.0 * Math.sin((lng / 3.0) * PI)) * 2.0) / 3.0 + ret += ((150.0 * Math.sin((lng / 12.0) * PI) + 300.0 * Math.sin((lng / 30.0) * PI)) * 2.0) / 3.0 + return ret + }, + // 转化纬度 + transformlat(lng, lat) { + var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng)) + ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0 + ret += ((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) / 3.0 + ret += ((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) * 2.0) / 3.0 + return ret + }, // 重新加载人员定位点位信息 localtionReload(pindex, index) { var _this = this @@ -2958,8 +3116,8 @@ export default { } this.bottomClickDisable = false done() - } - } + }, + }, } diff --git a/src/views/map/js/dragentity.js b/src/views/map/js/dragentity.js index 01b4e6f..9445d96 100644 --- a/src/views/map/js/dragentity.js +++ b/src/views/map/js/dragentity.js @@ -9,8 +9,8 @@ const img0_2 = require('../../../assets/map/gangkou_index/point/ico3.png') const img1_0 = require('../../../assets/map/gangkou_index/point/ico4.png') const img1_1 = require('../../../assets/map/gangkou_index/point/ico5.png') const img1_2 = require('../../../assets/map/gangkou_index/point/ico6.png') -// const img1_3 = require('../../../assets/map/gangkou_index/point/ico7.png') -const img1_3 = require('../../../assets/map/gangkou_index/point/ico8.png') +const img1_3 = require('../../../assets/map/gangkou_index/point/ico7.png') +const img1_4 = require('../../../assets/map/gangkou_index/point/ico8.png') const img2_0 = require('../../../assets/map/gangkou_index/point/ico9.png') const img2_1 = require('../../../assets/map/gangkou_index/point/ico10.png') @@ -53,7 +53,7 @@ const img8_3 = require('../../../assets/map/gangkou_index/point/ico26.png') const imgMap = { img0_0, img0_1, img0_2, - img1_0, img1_1, img1_2, img1_3, + img1_0, img1_1, img1_2, img1_3, img1_4, img2_0, img2_1, img2_2, img2_3, img2_4, img2_5, img2_6, img2_7, cfd_img2_8, cfd_img3_0, img3_0, img3_1, img4_0, img4_0_1, img4_0_2, img4_0_3, img4_1, diff --git a/src/views/map/js/ry_dragentity.js b/src/views/map/js/ry_dragentity.js index 4472aad..f63fb12 100644 --- a/src/views/map/js/ry_dragentity.js +++ b/src/views/map/js/ry_dragentity.js @@ -43,7 +43,9 @@ export default class DragEntity { this.viewer.clock.clockRange = Cesium.ClockRange.CLAMPED this.viewer.clock.shouldAnimate = false } - + delEntity(point) { + this.viewer.entities.remove(point) + } getPosition(point) { if (this.viewer.clock.shouldAnimate === false) { this.viewer.clock.shouldAnimate = true diff --git a/static/config.js b/static/config.js index c002a23..fe3e613 100644 --- a/static/config.js +++ b/static/config.js @@ -11,6 +11,7 @@ const config = { weburlNaiwang: 'http://192.168.192.201:8992/', // 附件服务器地址, httpurlNaiwang: 'http://192.168.192.201:8992//qa-prevention-gwj/', // 附件服务器地址, perRealTimeLocUrl: '192.168.210.32:8084/netty/test.io', + cmtperRealTimeLocUrl: '192.168.0.247:8899', cfdfileUrl: 'http://60.2.209.238:8991/file', xfgUrl: 'https://skqhdg.porthebei.com:9006/static/qrcode/views/xgf_hgz/index.html', messageUrl: 'http://192.168.151.56:8082/static/qrcode/views/xgf_hgz/index.html'