From a4259cf2d9a4ce63081b7c6b05380fb2ddbc6a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E7=A7=80=E5=9C=86?= <1393343789@qq.com> Date: Wed, 28 Sep 2022 16:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=B5=84=E6=BA=90=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=92=8C=E5=9C=B0=E5=9B=BE=E9=80=89=E4=B8=AD=E8=81=94?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/supermap/advance-init.js | 17 ++++-- front/src/supermap/image/icon_camare.png | Bin 0 -> 2050 bytes .../src/supermap/image/icon_camare_active.png | Bin 0 -> 2055 bytes front/src/views/home/infrastructurePage.vue | 49 ++++++++++++++---- .../views/home/videoSurveillance/index.vue | 24 +++++++-- 5 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 front/src/supermap/image/icon_camare.png create mode 100644 front/src/supermap/image/icon_camare_active.png diff --git a/front/src/supermap/advance-init.js b/front/src/supermap/advance-init.js index f0841cf8..1ce102db 100644 --- a/front/src/supermap/advance-init.js +++ b/front/src/supermap/advance-init.js @@ -1657,14 +1657,16 @@ export function MapFun(mapObj) { features, url, layerName, - createPopupFun + createPopupFun, + url2 ) { console.log( '_addResourceOnMapWithoutSuperMapCluster===============>', features, url, layerName, - createPopupFun + createPopupFun, + url2 ) // 如果资源要素数量为0,则说明该种资源没有记录 // if (features.length < 1) { @@ -1685,14 +1687,19 @@ export function MapFun(mapObj) { let layers = null // 判断是否是聚合图层 layers = createMarkerClusterLayer() - const icon = createDefaultFeatureStyle({ + const icon1 = createDefaultFeatureStyle({ img: url, - iconSize: [36, 36], + iconSize: [33, 33], + }) + const icon2 = createDefaultFeatureStyle({ + img: url2, + iconSize: [33, 33], }) features.map((feature) => { var bounds = map.getBounds() // console.log("看看有没有坐标",feature.latLng); if ( feature.hasOwnProperty('latLng')) { + let icon = feature.active?icon2:icon1 const marker = L.marker(feature.latLng, { icon }) if (createPopupFun !== null) { marker.uuid = feature.uuid || '' @@ -1728,6 +1735,8 @@ export function MapFun(mapObj) { } marker.on('click', e=>{ console.log('点位数据', e) + + mybus.emit('pointMarkerClick', feature) }) layers.addLayer(marker) } diff --git a/front/src/supermap/image/icon_camare.png b/front/src/supermap/image/icon_camare.png new file mode 100644 index 0000000000000000000000000000000000000000..40ee038bcb473ddc54d9523b62b0681c04d1f770 GIT binary patch literal 2050 zcmaJ?dpJ~iAD>WB36a-rd&dk*thtk!HF}w2m@?ziY=l;0<`{#SGiDA3Y2VjM4Gmc; zMeK@wwB%B)E|f|ua+zv-Nwu+AmTE&JjLn{D)4qSa_B_uyzsvLae7>LW<#~=WkmGB( z#%c`;g)(IM0l~;>t9|uXA>WW+Za~Ol3HyY?JD_MdnI{8LUIHizM6<*^As7tu1Sts} zpa%-2ixqK0;ZU|ejSq=&JS_&N5K9p@3gxj?A?5MoKo}hb3Pln+X1u8dgBA(sm=ISs zfh}c#F(SWI8Mq^r!{w*O@u>pLR!_8tf`$l)L70bDh~p)4nu3mbr%OZj+G{)p{SE@h z(J_CT3S|eP8ITM_yW-qj_(Y03dJ7dtbfXZ+Zl9n@1R@nraK{tLE(9Wt;6`)Zf`0#C zkZ3YNG%XllzK?~R=$IH7meTO}qaBtdHxc~MXzOvfNj|4czF{U9rmzb_L~FuZ~%#S?J^ZAwc(Hv8|PV(|yG z91aHm^80^<<=hl0hz|zkP@;^FG%gye4JD;9WFQZQWLyY}U#enY3~s#l}L7XV-ma= z6cWRmLR#Vi5I<22O5i1~;4dy^S*~^##8Mx|)k9PZEZjr->$p!9=B1D0tIm0XN+!dOyX;LhILS(BUEebG#Ndk(_}Z8N*ry^Uh30t|^JvDefGV@D{u zcfHN9josIC3z~JtZA^-uE8V}P_3A8~DLT_~WMXBM_XJ>U2(a2iYc}&VdTkl}auSpH z^>j?`S-wNSVSUVhs)WBEtmzHATN-Gtx`DUaxLW3JCJ+AFK(wr)4USB2*u?^<~ z;(4qhdD0x1dp2(}lg1j=(1WUh^zXtB;Kc!q*2xtuSNAymYxjHxJs9h;zsQk$!k~;) zYiCrEsp_k!(^a2txbQ}CzQOiIxTB(+t9;g-WwUo$z3Y5h9jkWcyE)qz=L&H*tt(^G z6Z^ySgU{OI49?6rjsADCYE06)Mr;*7`SYe--?$d2R^7^i08{Is*psIg(w|kdk0i-n zC-HIF(>wJW7NXU}nhL{nLj|pwHJmPhq!hn#GQUy%Iyaks|8Bcw?(d(f>K>m|v=!z( zwR8STFE3)zVE?>-sB0F%cBRs?J*?u^8^%xBfIg8IC`-~U@GNXv&(F~Njk5LNu^&Tt zzCveC-ZX1gVeS+hKjE*b zZ_>DDkIK#aGaHA)Oz)YCCcpHZiOE_SaB;Y>aYWo&*I9k@s_Jv~Zp-TWmNzAigY?eS z`(W+$p`M*3mY3|u@_+sD6*i^343KhkrV`4cXRP;K6zD!1AINm+Fn?frs0!YP%^mM? zGT!3UH0^r1jn2dLK~71`Sq8kAZWW|Z#`v3kLE#G)yLGQcqT z{;kGOs_OTq{4_j&FTnJXI+EW*ZRsn@aeLxpRDw?0|M(hLKjTK&XI=|7q)pD5iJeO2 zV8Rh#)zpS?Wt;wST$ok=MT>UfkoRroMz8d>`M!Z( zw|A>v6-Re*iaORR;h7 literal 0 HcmV?d00001 diff --git a/front/src/supermap/image/icon_camare_active.png b/front/src/supermap/image/icon_camare_active.png new file mode 100644 index 0000000000000000000000000000000000000000..1da7345964eb5dd8f81841b1e98e210cb8a88051 GIT binary patch literal 2055 zcmaJ?c~ld39#2t$QjQ9uc;HS0<LW@!sS_ zgol`!>@dM#FlLNU8Vg-N(Z9xq=r{UlCxkBBkzh7*5Q;}qI5H3uz=yaXz>shRAPeO1 z6-RqOUkql0ohXuxu$lWQJV@fo(PLawB{0gyV0`^kVGb`5L;x-*5J{=nnbvkJAmUT8 z(H=|!6Al7}qR=!McrYzIl9!g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vQXq1iKQV8hnma2B^Cq2SD{6>$~(LL!zO{SoZUr=44WU`CJv7Xf28yR zQ+&&Q%kc8N=jY3&5sJd+m*vdJ*sSG&?ALGn^E-d86MyvE{EB1Ui<9>}uuk0*N&{1j XD($E3f(k1~{jZr398RkXJfiwHU9?~_ literal 0 HcmV?d00001 diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index e5ef35d3..3b6ab3c9 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -936,8 +936,26 @@ mapSearchParam.value.gpsX = param.gpsX mapSearchParam.value.gpsY = param.gpsY mapSearchParam.value.radius = param.radius + selectedRowKeys.value = [] //清空选中的点位 + selectedList.value = [] getCamera() }) + //点位点击 + mybus.off('pointMarkerClick') + mybus.on('pointMarkerClick', (point) => { + console.log("pointMarkerClick->point", selectedList.value,point) + let check = false; //是否勾选 + if(selectedList.value&&selectedList.value.length>0){ + selectedList.value.forEach(ele=>{ + if(ele.channelCode == point.data.channelCode){ + check = true; + } + }) + } + let pointData = new Proxy(point.data, point); + onSelectChange(pointData,!check,'','','proxy'); + }) + }) const selectedList = ref([]) const selectedRowKeys = ref([]) @@ -1739,9 +1757,10 @@ pagination.value.pageSize = 10 getCamera() } - const videoClean = () => { - selectedList.value = [] - selectedRowKeys.value = [] + const videoClean = () => { + //视频预览弹窗关闭后不清除选中行 + // selectedList.value = [] + // selectedRowKeys.value = [] videoList.value = [] current.value = 1 } @@ -1926,8 +1945,9 @@ }, ]) // const allClick = ref([]) - const onSelectChange = (record, selected, selectedRows, nativeEvent) => { + const onSelectChange = (record, selected, selectedRows, nativeEvent,type) => { console.log('hahhahah', record, selected, selectedRows, nativeEvent) + record = JSON.parse(JSON.stringify(record)); if (selected) { if (selectedRowKeys.value.length == 1000) { message.warning('最多只能添加1000个摄像头!') @@ -1936,14 +1956,17 @@ selectedRowKeys.value.push(record.channelCode || record.channelId) } } else { - selectedList.value = selectedList.value.filter( - (item) => item.idtCameraChannel !== record.idtCameraChannel - ) + selectedList.value.forEach((ele,index)=>{ + if(ele.channelCode == record.channelCode){ + selectedList.value.splice(index,1) + } + }) selectedRowKeys.value.splice( selectedRowKeys.value.indexOf(record.channelCode || record.channelId), 1 ) } + mybus.emit('selectTablePoint',selectedList.value) console.log('已选中======================>', selectedList.value) } const onSelectAll = (selected, selectedRows, changeRows) => { @@ -1955,9 +1978,14 @@ if (selectedRowKeys.value.length > 1000) { message.warning('最多只能添加1000个摄像头!') changeRows.map((val) => { - selectedList.value = selectedList.value.filter( - (item) => item.idtCameraChannel !== val.idtCameraChannel - ) + // selectedList.value = selectedList.value.filter( + // (item) => item.idtCameraChannel !== val.idtCameraChannel + // ) + selectedList.value.forEach((ele,index)=>{ + if(ele.channelCode == record.channelCode){ + selectedList.value.splice(index,1) + } + }) selectedRowKeys.value.splice( selectedRowKeys.value.indexOf(val.channelCode || val.channelId), 1 @@ -1976,6 +2004,7 @@ }) } console.log('heiheiheiehiehei', selected, selectedRows, changeRows) + mybus.emit('selectTablePoint',selectedList.value) } // 切换tab diff --git a/front/src/views/home/videoSurveillance/index.vue b/front/src/views/home/videoSurveillance/index.vue index 333b6258..47002565 100644 --- a/front/src/views/home/videoSurveillance/index.vue +++ b/front/src/views/home/videoSurveillance/index.vue @@ -125,6 +125,7 @@ gpsY: '', radius: '', }, + pointAllData:[], } }, components: { @@ -158,6 +159,20 @@ this.mapSearchParam.parentId = parentId this.getCameraByParentId() }) + //表格勾选 + mybus.off('selectTablePoint') + mybus.on('selectTablePoint', (pointlist) => { + console.log("mounted -> pointlist", pointlist) + for(let i=0;i { console.log('根据parent查询摄像头', res.data.data) + this.pointAllData = res.data.data this.addResourceTomap('videoMap', res.data.data) }) } @@ -357,12 +373,13 @@ dataEvent.push({ latLng: { lat: Number(item.gpsY), lng: Number(item.gpsX) }, data: item, + active: item.active, type: 'videoSurveillance', }) } }) console.log('上图数据', dataEvent) - this.getMapPoint(dataEvent, 'videoSurveillance.png', type) + this.getMapPoint(dataEvent, 'icon_camare.png', type) }, getMapPoint(data, img, type) { // this.hiMapFun.clearAllLayers(); @@ -372,7 +389,8 @@ features, img, type, - createCameraDetailsPop + createCameraDetailsPop, + 'icon_camare_active.png' ) }, @@ -546,7 +564,7 @@ position: absolute; bottom: 0.1rem; right: 0.1rem; - z-index: 1001; + z-index: 988; cursor: pointer; } .address-auto-complete-input {