From f7ba8b6aab4a763feee8938e93c97079b52baf1d Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期二, 30 三月 2021 12:30:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/develop' into develop --- src/components/BaseNav/SolidWaste/SolidWaste.js | 27 ++++++-- src/api/request.js | 2 src/components/BaseNav/SolidWaste/directive.js | 73 ------------------------ src/conf/MapConfig.js | 2 src/components/BaseNav/PublicBounced/GasComponents/PublicTable.vue | 53 +++++++++++++++++ src/components/BaseNav/PublicBounced/GasComponents/GasTab.vue | 0 src/components/BaseNav/PublicBounced/PublicBounced.vue | 4 - src/conf/layers/LayerSolidWaste.js | 2 8 files changed, 77 insertions(+), 86 deletions(-) diff --git a/src/api/request.js b/src/api/request.js index 38364ca..9f9091d 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -21,4 +21,4 @@ 'Content-Type': 'application/json' } }) -} +} \ No newline at end of file diff --git a/src/components/BaseNav/PublicBounced/GasComponents/GasTable.vue b/src/components/BaseNav/PublicBounced/GasComponents/GasTab.vue similarity index 100% rename from src/components/BaseNav/PublicBounced/GasComponents/GasTable.vue rename to src/components/BaseNav/PublicBounced/GasComponents/GasTab.vue diff --git a/src/components/BaseNav/PublicBounced/GasComponents/PublicTable.vue b/src/components/BaseNav/PublicBounced/GasComponents/PublicTable.vue new file mode 100644 index 0000000..12f1a91 --- /dev/null +++ b/src/components/BaseNav/PublicBounced/GasComponents/PublicTable.vue @@ -0,0 +1,53 @@ +<template> + <div class="public-table"> + <el-table + :data="tableData" + style="width: 100%"> + <el-table-column + prop="date" + label="鏃ユ湡" + width="180"> + </el-table-column> + <el-table-column + prop="name" + label="濮撳悕" + width="180"> + </el-table-column> + <el-table-column + prop="address" + label="鍦板潃"> + </el-table-column> + </el-table> + </div> +</template> + +<script> +export default { + name: 'PublicTable', + data () { + return { + tableData: [{ + date: '2016-05-02', + name: '鐜嬪皬铏�', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�' + }, { + date: '2016-05-04', + name: '鐜嬪皬铏�', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�' + }, { + date: '2016-05-01', + name: '鐜嬪皬铏�', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' + }, { + date: '2016-05-03', + name: '鐜嬪皬铏�', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�' + }] + } + } +} +</script> + +<style lang="less" scoped> + +</style> diff --git a/src/components/BaseNav/PublicBounced/PublicBounced.vue b/src/components/BaseNav/PublicBounced/PublicBounced.vue index b5f3750..9bc2d71 100644 --- a/src/components/BaseNav/PublicBounced/PublicBounced.vue +++ b/src/components/BaseNav/PublicBounced/PublicBounced.vue @@ -1,5 +1,5 @@ <template> - <div class="public-bounced" style="width: auto" v-draw v-show="flag"> + <div class="public-bounced" v-draw v-show="flag"> <div class="public-bounced-title"> <span>{{ displayContent.Name }}</span> <i class="el-icon-circle-close" @click="closePopup"></i> @@ -22,12 +22,10 @@ import GasTable from '@components/BaseNav/PublicBounced/GasComponents/GasTable' import GasECharts from '@components/BaseNav/PublicBounced/GasComponents/GasECharts' import GasVideo from '@components/BaseNav/PublicBounced/GasComponents/GasVideo' -// import GasTabs from '@components/BaseNav/PublicBounced/GasComponents/GasTabs' export default { name: 'PublicBounced', components: { - // GasTabs, GasTable, GasECharts, GasVideo diff --git a/src/components/BaseNav/SolidWaste/SolidWaste.js b/src/components/BaseNav/SolidWaste/SolidWaste.js index 54107a5..6df5e3e 100644 --- a/src/components/BaseNav/SolidWaste/SolidWaste.js +++ b/src/components/BaseNav/SolidWaste/SolidWaste.js @@ -52,20 +52,24 @@ // var url = Icon.options.iconUrl const marker = this.L.marker([positionX, positionY], { icon: Icon }) - // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 marker.bindTooltip(data[i].Name, { permanent: true, - offset: [0, 16], - direction: 'bottom', + offset: [0, -16], + direction: 'top', className: '' }) // 鐐瑰嚮 浜嬩欢 marker.on('click', (e) => { try { - console.log(e) + // console.log(e) + // console.log(this.map.getCenter()) + // console.log(this.map.setCenter([e.target.getLatLng().lat, e.target.getLatLng().lng])) + // this.map.flyTo([e.target.getLatLng().lat, e.target.getLatLng().lng]) + // this.map.panTo([e.target.getLatLng().lat, e.target.getLatLng().lng], 100) + this.setPanTo(e.target.getLatLng(), 30) this.EffectOfPulse(e.target.getLatLng()) - this.SolidWastePopup.setData(data[i]) + this.SolidWastePopup.setData(data[i], 'gufei') return this.SolidWastePopup.$el } catch (error) { console.log(error) @@ -75,6 +79,16 @@ this.SolidWasteLayerGroup.addLayer(marker) } } + } + + // panTo + setPanTo (pos, value) { + var position = pos + position = this.map.latLngToLayerPoint(position) + position.y += value + position = this.map.layerPointToLatLng(position) + this.map.setView(position) + // this.map.flyTo(position) } // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� @@ -106,7 +120,7 @@ // 鑴夊啿鏁堟灉璁剧疆瀹炵幇 EffectOfPulse (position, markers, layerGroup) { - // // 鍖哄垎鐩存帴鎵ц 鍜屽垽鏂墽琛岀殑涓嶅悓鍖哄埆 + // 鍖哄垎鐩存帴鎵ц 鍜屽垽鏂墽琛岀殑涓嶅悓鍖哄埆 var differentColor = '' if (markers) { differentColor = '#ff0000' @@ -140,7 +154,6 @@ var HeightLightTime = 5 var PulseNumber = 5 const pulseinterver = setInterval((e) => { - console.log(e) if (PulseNumber > 0) { PulseNumber-- } else { diff --git a/src/components/BaseNav/SolidWaste/directive.js b/src/components/BaseNav/SolidWaste/directive.js index 773a4a8..d51b377 100644 --- a/src/components/BaseNav/SolidWaste/directive.js +++ b/src/components/BaseNav/SolidWaste/directive.js @@ -57,76 +57,3 @@ delete el._checkPosition } }) - -// v-dialogDrag: 寮圭獥鎷栨嫿 -Vue.directive('dialogDrag', { - bind (el, binding, vnode, oldVnode) { - const dialogHeaderEl = el.querySelector('.el-dialog__header') - const dragDom = el.querySelector('.el-dialog') - dialogHeaderEl.style.cursor = 'move' - - // 鑾峰彇鍘熸湁灞炴�� ie dom鍏冪礌.currentStyle 鐏嫄璋锋瓕 window.getComputedStyle(dom鍏冪礌, null); - const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null) - - dialogHeaderEl.onmousedown = (e) => { - // 榧犳爣鎸変笅锛岃绠楀綋鍓嶅厓绱犺窛绂诲彲瑙嗗尯鐨勮窛绂� - const disX = e.clientX - dialogHeaderEl.offsetLeft - const disY = e.clientY - dialogHeaderEl.offsetTop - - // 鑾峰彇鍒扮殑鍊煎甫px 姝e垯鍖归厤鏇挎崲 - let styL, styT - - // 娉ㄦ剰鍦╥e涓� 绗竴娆¤幏鍙栧埌鐨勫�间负缁勪欢鑷甫50% 绉诲姩涔嬪悗璧嬪�间负px - if (sty.left.includes('%')) { - styL = +document.body.clientWidth * (+sty.left.replace(/%/g, '') / 100) - styT = +document.body.clientHeight * (+sty.top.replace(/%/g, '') / 100) - } else { - styL = +sty.left.replace(/px/g, '') - styT = +sty.top.replace(/px/g, '') - } - - document.onmousemove = function (e) { - // 閫氳繃浜嬩欢濮旀墭锛岃绠楃Щ鍔ㄧ殑璺濈 - const l = e.clientX - disX - const t = e.clientY - disY - - // 绉诲姩褰撳墠鍏冪礌 - dragDom.style.left = `${l + styL}px` - dragDom.style.top = `${t + styT}px` - - // 灏嗘鏃剁殑浣嶇疆浼犲嚭鍘� - // binding.value({x:e.pageX,y:e.pageY}) - } - - document.onmouseup = function (e) { - document.onmousemove = null - document.onmouseup = null - } - } - } -}) - -// v-dialogDragWidth: 寮圭獥瀹藉害鎷栧ぇ 鎷栧皬 -Vue.directive('dialogDragWidth', { - bind (el, binding, vnode, oldVnode) { - const dragDom = binding.value.$el.querySelector('.el-dialog') - - el.onmousedown = (e) => { - // 榧犳爣鎸変笅锛岃绠楀綋鍓嶅厓绱犺窛绂诲彲瑙嗗尯鐨勮窛绂� - const disX = e.clientX - el.offsetLeft - - document.onmousemove = function (e) { - e.preventDefault() // 绉诲姩鏃剁鐢ㄩ粯璁や簨浠� - - // 閫氳繃浜嬩欢濮旀墭锛岃绠楃Щ鍔ㄧ殑璺濈 - const l = e.clientX - disX - dragDom.style.width = `${l}px` - } - - document.onmouseup = function (e) { - document.onmousemove = null - document.onmouseup = null - } - } - } -}) diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js index 636c051..1326a16 100644 --- a/src/conf/MapConfig.js +++ b/src/conf/MapConfig.js @@ -42,7 +42,7 @@ IntranetBaseMaps: TDT.intranet, InternetBaseMaps: TDT.internet, Layers: { - LayerSewersLine: [LayerSewersLine, LayerWasteWater, LayerWasteWater, LayerWasteGas, LayerSolidWaste], + LayerSewersLine: [LayerSewersLine, LayerWasteWater, LayerWasteGas, LayerSolidWaste], layerSewersPoint: LayerSewersPoint } // 姹¢洦姘村浘灞傞厤缃� } diff --git a/src/conf/layers/LayerSolidWaste.js b/src/conf/layers/LayerSolidWaste.js index 3a654b6..c81dc8b 100644 --- a/src/conf/layers/LayerSolidWaste.js +++ b/src/conf/layers/LayerSolidWaste.js @@ -4,7 +4,7 @@ */ export const LayerSolidWaste = { code: 'solidWaste', - name: '搴熸皵', + name: '鍥哄簾', checked: true, layers: [ { -- Gitblit v1.8.0