From 461b1d6319bd0bda4d74d41cf3d015d861a04f41 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Thu, 25 Jan 2024 14:36:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?cmt=E6=B8=AF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/map/components/menjinCmt.vue | 416 +++++++++++++ src/views/map/components/qixiang.vue | 3 +- src/views/map/dialog/index.vue | 15 +- src/views/map/dialog/mkGateMachineCmt.vue | 208 +++++++ src/views/map/dialog/weatherstationCmt.vue | 669 +++++++++++++++++++++ src/views/map/index.vue | 33 +- 6 files changed, 1336 insertions(+), 8 deletions(-) create mode 100644 src/views/map/components/menjinCmt.vue create mode 100644 src/views/map/dialog/mkGateMachineCmt.vue create mode 100644 src/views/map/dialog/weatherstationCmt.vue 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 254b199..dc838a2 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/dialog/index.vue b/src/views/map/dialog/index.vue index 1857048..97e7837 100644 --- a/src/views/map/dialog/index.vue +++ b/src/views/map/dialog/index.vue @@ -7,10 +7,12 @@ + + @@ -63,10 +65,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' @@ -106,6 +110,7 @@ export default { temperaturestation, humiditystation, windspeedstation, + windspeedstationCmt, electricityOrder, highworkOrder, cutroadOrder, @@ -129,10 +134,10 @@ export default { videoPlayBianjieruqin, peoplePositionOne, hotworkFirst, - peoplePositionOne, peoplePositionYGS, outSourceInfo, - outSourceVideoInfo + outSourceVideoInfo, + MkGateMachineCmt }, props: { title: { @@ -166,7 +171,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/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 0c5a106..6e9b861 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -35,7 +35,7 @@ :gangkou="gangkouActive" /> @@ -44,6 +44,11 @@ :corp-info-id="CORP_INFO_ID" :area="area" :gangkou="gangkouActive"/> + @@ -219,6 +225,7 @@ import fengongsiIndex from './components/fengongsi_index.vue' import caofeidianIndex from './components/caofeidian_index.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' @@ -268,6 +275,7 @@ export default { layoutMenu, menjin, menjinCfd, + menjinCmt, xiaofang, anquan, qixiang, @@ -1105,7 +1113,7 @@ export default { } return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4() }, - keepalive(token) { + /*keepalive(token) { // 第二套方案 requestFN( '/map/loginOrKeepAlive', @@ -1159,7 +1167,7 @@ export default { console.error(err) }) }) - }, + },*/ // keepalive(token) { // axios({ // method: 'POST', @@ -1360,12 +1368,24 @@ export default { this.dialog.infoname = infoname return } + if (this.gangkouActive === '00005') { + // if (this.gangkouActive === '00004' && point_type.indexOf('标记点') !== -1 && point_id.substring(0, 1) === '0' || point_id.substring(0, 1) === '5') { + 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 (point_type.indexOf('标记点') !== -1) { const { label, point_type, data_id, corpInfoId, dialog_width, infoname } = pick.id._monitoItems.data this.dialog.visible = true this.dialog.title = label this.dialog.type = point_type.substring(3) - this.dialog.id = data_id this.dialog.corpInfoId = corpInfoId this.dialog.infoname = infoname this.dialog.width = dialog_width || '50%' @@ -1958,6 +1978,11 @@ 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 + } points.push(point) } if (this.gangkouActive === '00004' && urlType === 'carPosition') { From 520bd345e8f29426756735604a132bb82ad8baae Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Thu, 25 Jan 2024 15:56:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?cmt=E6=B8=AF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/map/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/map/index.vue b/src/views/map/index.vue index 6e9b861..e268bf6 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -347,7 +347,7 @@ export default { 'x': 118.43701, 'y': 38.9866 }, - CORP_INFO_ID: 'c077f4ed66844ed4a191a36fa1fc641c' + CORP_INFO_ID: '6aa255d41602497fa0f934a822820df4' } ], branchPoint: [], @@ -1368,7 +1368,7 @@ export default { this.dialog.infoname = infoname return } - if (this.gangkouActive === '00005') { + if (this.gangkouActive === '00005' && point_id.substring(0, 1) !== '1') { // if (this.gangkouActive === '00004' && point_type.indexOf('标记点') !== -1 && point_id.substring(0, 1) === '0' || point_id.substring(0, 1) === '5') { const { label, point_type, data_id, infoname,name, code } = pick.id._monitoItems.data this.dialog.visible = true From c769b1809eb92b72c56b4df098ff8ef7b7078378 Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Mon, 29 Jan 2024 08:47:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?cmt=E6=B8=AF=E5=9C=B0=E5=9B=BE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/map/components/renyuanCmt.vue | 413 +++++++++++++++++++++ src/views/map/dialog/index.vue | 6 + src/views/map/dialog/peoplePositionCmt.vue | 120 ++++++ src/views/map/dialog/video_play_cmt.vue | 66 ++++ src/views/map/index.vue | 147 +++++++- src/views/map/js/dragentity.js | 6 +- src/views/map/js/ry_dragentity.js | 4 +- static/config.js | 1 + 8 files changed, 751 insertions(+), 12 deletions(-) create mode 100644 src/views/map/components/renyuanCmt.vue create mode 100644 src/views/map/dialog/peoplePositionCmt.vue create mode 100644 src/views/map/dialog/video_play_cmt.vue 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 785972c..aca7806 100644 --- a/src/views/map/dialog/index.vue +++ b/src/views/map/dialog/index.vue @@ -16,6 +16,7 @@ + @@ -45,6 +46,7 @@ + @@ -80,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' @@ -91,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"; @@ -119,6 +123,7 @@ export default { hoistingOrder, videoPlay, videoPlayCfd, + videoPlayCmt, videoPlayPlat, hotworkCfdD, confinedspaceCfdD, @@ -130,6 +135,7 @@ export default { hoistingCfdD, MkGateMachineCfd, peoplePositionCfdD, + peoplePositionCmt, carPositionCfdD, videoPlayBianjieruqin, peoplePositionOne, 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/index.vue b/src/views/map/index.vue index 59cb052..0dd0913 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -39,8 +39,7 @@ :corp-info-id="CORP_INFO_ID" :gangkou="gangkouActive"/> @@ -85,7 +84,7 @@ :area="area" :gangkou="gangkouActive"/> @@ -99,6 +98,11 @@ :corp-info-id="CORP_INFO_ID" :area="area" :gangkou="gangkouActive"/> + { console.log(e) }) @@ -2457,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() { @@ -2765,6 +2860,7 @@ export default { point.empNo = data.empNo || '' // 工号 point.cardNo = data.cardNo || '' // 卡号 point.gangkou = this.gangkouActive + console.log(point) return point }, // 查询当前所有点位是否在区域内 @@ -2824,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 @@ -2985,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'