From 78b643de0b8690d566146858cd781be98d01777d Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期一, 29 三月 2021 10:00:50 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/BaseNav/SolidWaste/SolidWasteTable.vue | 0 src/api/request.js | 31 +-- src/components/BaseNav/WireSurface/index.js | 23 ++ src/components/BaseNav/SolidWaste/Popup.vue | 111 +++++++++++ src/components/plugin/MagicMarker.js | 72 ++---- src/views/MapTemplate.vue | 20 + src/components/BaseNav/PublicBounced/PublicBounced.vue | 80 ++++++++ src/Sgis.js | 24 -- src/components/plugin/pulse/Pulse.js | 0 src/components/BaseNav/SolidWaste/SolidWaste.js | 88 ++++---- /dev/null | 4 src/components/BaseNav/SolidWaste/directive.js | 0 src/assets/images/map-pages/basenav/solidwaste/voc.png | 0 src/assets/images/map-pages/basenav/solidwaste/gf_green.png | 0 src/conf/MapConfig.js | 8 src/utils/axios.js | 3 package.json | 1 src/components/BaseNav/SolidWaste/SolidContent.vue | 82 ++++++++ src/components/plugin/pulse/Pulse.css | 0 19 files changed, 398 insertions(+), 149 deletions(-) diff --git a/package.json b/package.json index 1004223..abf1a54 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "leaflet.markercluster": "^1.4.1", "lodash": "^4.17.10", "nprogress": "^0.2.0", + "qs": "^6.10.1", "rbush": "^3.0.1", "screenfull": "^3.3.3", "style-resources-loader": "^1.4.1", diff --git a/src/Sgis.js b/src/Sgis.js index f908709..6e794e0 100644 --- a/src/Sgis.js +++ b/src/Sgis.js @@ -16,13 +16,9 @@ import './components/plugin/Editable' // 鏍囩粯鎿嶄綔 import './components/plugin/MagicMarker' // 鍔ㄧ敾Marker import './assets/css/map/magic.min.css' // 鍔ㄧ敾Marker css -import './components/BaseNav/Pulse' -import './components/BaseNav/Pulse.css' - -// import WmtsSupport from '@components/plugin/wmts_plugins' -// import CanvasMarkers from '@components/plugin/CanvasMarkers' -// import FullScreen from '@components/plugin/FullScreen' -// import 'leaflet-canvas-markers' +import '@/components/plugin/magicMarker.css' +import '@components/plugin/pulse/Pulse' // marker 澶栧湀娉� +import '@components/plugin/pulse/Pulse.css' // marker 澶栧湀娉� css let map = null const L = window.L @@ -30,18 +26,6 @@ if (map != null) { map.remove() } - - // Leaflet鎵╁睍浠g爜 - // Editable.init(L) // 鍥惧眰缂栬緫 - // PathDrag.init(L) // 璺緞鎷栨嫿 - // MagicMarker.init(L) // 鍔ㄧ敾Marker - // WmtsSupport.init(L) // 鎵╁睍锛屼娇鏀寔WMTS - // CustomPopup.init(L) // 鑷畾涔夊脊鍑烘 - // CanvasMarkers.init(L)// 鐢诲竷鍥惧眰 - // 鍏ㄥ睆 - // FullScreen.init(L) - // 涓嬭浇 - // LeafletMeasurePath.init(L) DownLoad.init(L) map = L.map(div, MapConfig.mapOptions) @@ -52,8 +36,6 @@ window.map = map window.L = L - - // L.sgis = L.sgis || L initTileLayersHelper(map) diff --git a/src/api/request.js b/src/api/request.js index 52c549f..c1016cf 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -4,25 +4,14 @@ // export const requestSolidWaste = (url, data = {}) => { // return $http.post('./static/SolidWaste.json', data) // } -export const requestSolidWaste = (url) => { - return $http.get('./static/SolidWaste.json') +// export const requestSolidWaste = (url) => { +// return $http.get('./static/SolidWaste.json') +import Qs from 'qs' + +export const QueryStoragePlaceListByCompanyAndName = (data = {}) => { + return $http.post('/EPInterface/DataService/EPMapService.asmx/QueryStoragePlaceListByCompanyAndName', Qs.stringify(data), { + headers: { + 'Content-Type': 'application/json' + } + }) } -export const FlueGas = (url) => { - return $http.get('./static/airQuality.json') -} -// export function FlueGas () { -// return axios.post('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', { -// companyId: 3900100145, -// id: '', -// monType: 2, -// userCode: 'wenchun.deng', -// monDuration: '', -// epName: '', -// secdDeptId: '', -// contrLevel: '', -// dataStatus: '', -// dataFlag: '', -// runStatus: '', -// emissTypeId: '' -// }) -// } diff --git a/src/components/BaseNav/magicMarker.png b/src/assets/images/map-pages/basenav/solidwaste/gf_green.png similarity index 100% rename from src/components/BaseNav/magicMarker.png rename to src/assets/images/map-pages/basenav/solidwaste/gf_green.png Binary files differ diff --git a/src/components/BaseNav/voc.png b/src/assets/images/map-pages/basenav/solidwaste/voc.png similarity index 100% rename from src/components/BaseNav/voc.png rename to src/assets/images/map-pages/basenav/solidwaste/voc.png Binary files differ diff --git a/src/components/BaseNav/PublicBounced/PublicBounced.vue b/src/components/BaseNav/PublicBounced/PublicBounced.vue new file mode 100644 index 0000000..550e6e8 --- /dev/null +++ b/src/components/BaseNav/PublicBounced/PublicBounced.vue @@ -0,0 +1,80 @@ +<template> + <div class="public-bounced" v-show="flag"> + <div class="popup_title">{{ displayContent.Name }}</div> + <div class="popup_bottom"> + <button @click="closePopup">纭畾</button> + </div> + </div> +</template> + +<script> + +export default { + name: 'PublicBounced', + data () { + return { + displayContent: [], + flag: false + } + }, + methods: { + setData (data) { + this.displayContent = data + this.flag = true + }, + closePopup () { + this.flag = false + } + } +} +</script> + +<style scoped> +.public-bounced { + width: 80%; + z-index: 499; + position: absolute; + top: 15%; + left: 10%; + background-color: rgba(128, 128, 128, 0.507); + padding: 1%; + border-radius: 20px; + margin: 10% auto; +} + +.popup_title { + text-align: center; + font-weight: 600; + font-size: 30px; +} + +.popup_center { + padding: 10%; + font-size: 20px; +} + +.popup_bottom { + display: flex; + justify-content: space-around; +} + +button { + width: 25%; + height: 20%; + padding: 2%; + border: 1px solid gray; + border-radius: 10px; +} + +button:nth-child(1) { + background-color: orangered; + color: white; + font-size: 20px; +} + +button:nth-child(2) { + background-color: gray; + color: black; + font-size: 20px; +} +</style> diff --git a/src/components/BaseNav/SolidContent.vue b/src/components/BaseNav/SolidContent.vue deleted file mode 100644 index ab6fbf0..0000000 --- a/src/components/BaseNav/SolidContent.vue +++ /dev/null @@ -1,53 +0,0 @@ -<template> - <div class="solid-content"> - <div class="content-left"> - <span>{{ displayContent.StoragePlaceName }}</span> - </div> - <div class="content-right"> - <SolidWasteTable :displayContent="displayContent"></SolidWasteTable> - </div> - </div> -</template> - -<script> - -import SolidWasteTable from '@components/BaseNav/SolidWasteTable' - -export default { - name: 'SolidContent', - components: { SolidWasteTable }, - data () { - return { - displayContent: [] - } - }, - methods: { - setDate (data) { - // console.log(data) - this.displayContent = data - } - } -} -</script> - -<style lang="less" scoped> -span { - font-size: 22px; - color: red; -} - -.solid-content { - width: 100%; - display: flex; - align-items: center; - justify-content: space-around; - - .content-left { - width: 35%; - } - - .content-right { - width: 60%; - } -} -</style> diff --git a/src/components/BaseNav/SolidWaste/Popup.vue b/src/components/BaseNav/SolidWaste/Popup.vue new file mode 100644 index 0000000..79a1a6d --- /dev/null +++ b/src/components/BaseNav/SolidWaste/Popup.vue @@ -0,0 +1,111 @@ +<template> + <div class="box" @click.stop="clo_box"> + <div class="popup_content"> + <div class="popup_title">{{ this.title }}</div> + <div class="popup_center"> + <div v-if="this.content_text">{{ this.content_text }}</div> + <slot></slot> + </div> + <div class="popup_bottom"> + <button @click="popup_sub">纭畾{{ displayContent.Name }}</button> + <button @click="popup_clo">鍙栨秷</button> + </div> + </div> + </div> +</template> + +<script> +export default { + name: 'SolidContent', + data () { + return { + displayContent: [] + } + }, + props: { + title: { + type: String, + default: '榛樿鏍囬' + }, + content_text: { + type: String, + default: '' + }, + hidden: { + type: Boolean, + default: false + } + }, + methods: { + // 鐐瑰嚮纭畾浜嬩欢 + popup_sub () { + this.$emit('popup_sub') + }, + // 鐐瑰嚮浜嗗彇娑堜簨浠� + popup_clo () { + this.$emit('popup_clo') + }, + // 鐐瑰嚮浜嗗脊鍑烘浠ュ鍖哄煙 + clo_box (e) { + if (e.target._prevClass === 'box') { + this.$emit('clo_box') + } + } + } +} +</script> + +<style scoped> +.box { + width: 80%; + z-index: 999; + position: absolute; + top: 50%; + left: 25%; + background-color: rgba(128, 128, 128, 0.507); +} + +.popup_content { + background-color: white; + padding: 1%; + border-radius: 20px; + width: 40%; + margin: 10% auto; +} + +.popup_title { + text-align: center; + font-weight: 600; + font-size: 30px; +} + +.popup_center { + padding: 10%; + font-size: 20px; +} + +.popup_bottom { + display: flex; + justify-content: space-around; +} + +button { + width: 25%; + height: 20%; + padding: 2%; + border: 1px solid gray; + border-radius: 10px; +} + +button:nth-child(1) { + background-color: orangered; + color: white; + font-size: 20px; +} + +button:nth-child(2) { + background-color: gray; + color: black; + font-size: 20px; +} +</style> diff --git a/src/components/BaseNav/SolidWaste/SolidContent.vue b/src/components/BaseNav/SolidWaste/SolidContent.vue new file mode 100644 index 0000000..804fa5f --- /dev/null +++ b/src/components/BaseNav/SolidWaste/SolidContent.vue @@ -0,0 +1,82 @@ +<template> + <div class="public-bounced" v-show="flag"> + <div class="popup_title">{{ displayContent.Name }}</div> + <div class="popup_bottom"> + <button @click="closePopup">纭畾</button> + <button @click="closePopup">鍙栨秷</button> + </div> + </div> +</template> + +<script> +import '@components/BaseNav/SolidWaste/directive' + +export default { + name: 'SolidContent', + data () { + return { + displayContent: [], + flag: false + } + }, + methods: { + setData (data) { + this.displayContent = data + this.flag = true + }, + closePopup () { + this.flag = false + } + } +} +</script> + +<style scoped> +.public-bounced { + width: 80%; + z-index: 499; + position: absolute; + top: 15%; + left: 10%; + background-color: rgba(128, 128, 128, 0.507); + padding: 1%; + border-radius: 20px; + margin: 10% auto; +} + +.popup_title { + text-align: center; + font-weight: 600; + font-size: 30px; +} + +.popup_center { + padding: 10%; + font-size: 20px; +} + +.popup_bottom { + display: flex; + justify-content: space-around; +} + +button { + width: 25%; + height: 20%; + padding: 2%; + border: 1px solid gray; + border-radius: 10px; +} + +button:nth-child(1) { + background-color: orangered; + color: white; + font-size: 20px; +} + +button:nth-child(2) { + background-color: gray; + color: black; + font-size: 20px; +} +</style> diff --git a/src/components/BaseNav/SolidWaste.js b/src/components/BaseNav/SolidWaste/SolidWaste.js similarity index 67% rename from src/components/BaseNav/SolidWaste.js rename to src/components/BaseNav/SolidWaste/SolidWaste.js index a32b0bb..8968cc9 100644 --- a/src/components/BaseNav/SolidWaste.js +++ b/src/components/BaseNav/SolidWaste/SolidWaste.js @@ -1,7 +1,7 @@ -import { requestSolidWaste } from '@/api/request' +import { QueryStoragePlaceListByCompanyAndName } from '@/api/request' // 灞曠ず鍥剧墖 -import defaultImg from '@components/BaseNav/magicMarker.png' -import Setting from '@components/BaseNav/voc.png' +import defaultImg from '@assets/images/map-pages/basenav/solidwaste/voc.png' +import Setting from '@assets/images/map-pages/basenav/solidwaste/gf_green.png' // 搴曞浘涓氬姟灞曠ず鐐� class AddSolidWasteHelper { @@ -16,9 +16,9 @@ } // 璇锋眰鏁版嵁 data 涓哄弬鏁帮紝 璇锋眰鍚庡彴鏁版嵁鏃� 鎼哄甫data鍙傛暟 - requestData () { - requestSolidWaste().then(res => { - // console.log(res) + requestData (data) { + QueryStoragePlaceListByCompanyAndName(data).then(res => { + console.log(res) this.DrawTheSolidWasteContent(res.Result.DataInfo) }).catch(err => { console.log(err) @@ -36,51 +36,44 @@ } for (let i = 0; i < data.length; i++) { // 缁忕含搴� 浣嶇疆 - const positionX = data[i].positionX - const positionY = data[i].positionY + const positionX = data[i].Latitude + const positionY = data[i].Longitude // 鍒ゆ柇 缁忕含搴︿綅缃俊鎭槸鍚﹀瓨鍦� - // if (positionX != null && positionY != null) { - // 鐢ㄤ簬 鍒ゆ柇 => 鍒ゆ柇鏄惁灞曠ず鑴夊啿鏁堟灉 => temp(涓存椂) - const determineValueOne = data[i].LongDayWarning - var determineValueTwo = data[i].StorageQty - const positionArea = [positionX, positionY] + if (positionX != null && positionY != null) { + // 鐢ㄤ簬 鍒ゆ柇 => 鍒ゆ柇鏄惁灞曠ず鑴夊啿鏁堟灉 => temp(涓存椂) + const determineValueOne = data[i].LongDayWarning + var determineValueTwo = data[i].StorageQty + const positionArea = [positionX, positionY] - // 鍥炬爣灞曠ず - var iconUrl = this.SolidWasteIconUrl(determineValueOne, determineValueTwo, positionArea) - var Icon = new SolidWasteIcon({ iconUrl: iconUrl }) - // var url = Icon.options.iconUrl + // 鍥炬爣灞曠ず + var iconUrl = this.SolidWasteIconUrl(determineValueOne, determineValueTwo, positionArea) + var Icon = new SolidWasteIcon({ iconUrl: iconUrl }) + // var url = Icon.options.iconUrl - const marker = this.L.marker([positionX, positionY], { icon: Icon }) + const marker = this.L.marker([positionX, positionY], { icon: Icon }) - marker.bindPopup(() => { - return this.SolidWastePopup.$el - }, { - className: 's-map-popup', - minWidth: 600, - closeButton: true, - autoClose: false - }) - // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 - marker.bindTooltip(data[i].StoragePlaceName, { - permanent: true, - offset: [0, -16], - direction: 'top', - className: '' - }) - // 鐐瑰嚮 浜嬩欢 - marker.on('click', (e) => { - try { - // console.log(e) - this.EffectOfPulse(e.target.getLatLng()) - this.SolidWastePopup.setDate(data[i]) - } catch (error) { - console.log(error) - } - }) - // 璁剧疆鍐呭娣诲姞鍒板浘灞� - this.SolidWasteLayerGroup.addLayer(marker) - // } + // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 + marker.bindTooltip(data[i].Name, { + permanent: true, + offset: [0, 16], + direction: 'bottom', + className: '' + }) + // 鐐瑰嚮 浜嬩欢 + marker.on('click', (e) => { + try { + // console.log(e) + this.EffectOfPulse(e.target.getLatLng()) + this.SolidWastePopup.setData(data[i]) + return this.SolidWastePopup.$el + } catch (error) { + console.log(error) + } + }) + // 璁剧疆鍐呭娣诲姞鍒板浘灞� + this.SolidWasteLayerGroup.addLayer(marker) + } } } @@ -146,7 +139,8 @@ PulseCountSetting () { var HeightLightTime = 5 var PulseNumber = 5 - const pulseinterver = setInterval(() => { + const pulseinterver = setInterval((e) => { + console.log(e) if (PulseNumber > 0) { PulseNumber-- } else { diff --git a/src/components/BaseNav/SolidWasteTable.vue b/src/components/BaseNav/SolidWaste/SolidWasteTable.vue similarity index 100% rename from src/components/BaseNav/SolidWasteTable.vue rename to src/components/BaseNav/SolidWaste/SolidWasteTable.vue diff --git a/src/components/BaseNav/directive.js b/src/components/BaseNav/SolidWaste/directive.js similarity index 100% rename from src/components/BaseNav/directive.js rename to src/components/BaseNav/SolidWaste/directive.js diff --git a/src/components/BaseNav/SolidWasteExtend.js b/src/components/BaseNav/SolidWasteExtend.js deleted file mode 100644 index b778c47..0000000 --- a/src/components/BaseNav/SolidWasteExtend.js +++ /dev/null @@ -1,363 +0,0 @@ -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// import { requestSolidWaste } from '@/api/request' -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// import '@components/BaseNav/style.css' -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// // 灞曠ず鍥剧墖 -// import defaultImg from '@components/BaseNav/magicMarker.png' -// import Setting from '@components/BaseNav/voc.png' -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 搴曞浘涓氬姟灞曠ず鐐� -// class AddSolidWasteHelper { -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// constructor (options) { -// this.map = options.map -// this.L = window.L -// this.SolidWasteLayerGroup = this.L.layerGroup().addTo(this.map) -// this.SolidWastePopup = null -// this.L.sgis = this.L.sgis || this.L -// this.solidWasteMarkersLabels = [] -// this.pulseHeighLightMarker = null -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 璇锋眰鏁版嵁 data 涓哄弬鏁帮紝 璇锋眰鍚庡彴鏁版嵁鏃� 鎼哄甫data鍙傛暟 -// requestData () { -// requestSolidWaste().then(res => { -// // console.log(res) -// this.DrawTheSolidWasteContent(res.Result.DataInfo) -// }).catch(err => { -// console.log(err) -// }) -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鏍规嵁鑾峰彇鏁版嵁 鐢诲嚭 鍐呭 -// DrawTheSolidWasteContent (data) { -// // 鍥炬爣鏍峰紡鎵╁睍 -// var SolidWasteIcon = this.SolidWasteIcon() -// -// // //鍔犺浇鏁版嵁鍓嶅鏋滃瓨鍦ㄥ浘灞傜粍 閭d箞娓呴櫎鎺� -// if (this.SolidWasteLayerGroup) { -// this.SolidWasteLayerGroup.clearLayers() -// } -// for (let i = 0; i < data.length; i++) { -// // 缁忕含搴� 浣嶇疆 -// const positionX = data[i].positionX -// const positionY = data[i].positionY -// -// // 鍒ゆ柇 缁忕含搴︿綅缃俊鎭槸鍚﹀瓨鍦� -// if (positionX != null && positionY != null) { -// // 鐢ㄤ簬 鍒ゆ柇 => 鍒ゆ柇鏄惁灞曠ず鑴夊啿鏁堟灉 => temp(涓存椂) -// const determineValueOne = data[i].LongDayWarning -// var determineValueTwo = data[i].StorageQty -// const positionArea = [positionX, positionY] -// -// // 鍥炬爣灞曠ず -// var iconUrl = this.SolidWasteIconUrl(determineValueOne, determineValueTwo, positionArea) -// var Icon = new SolidWasteIcon({ iconUrl: iconUrl }) -// // var url = Icon.options.iconUrl -// -// // 寮瑰嚭妗哾iv鍐呭 -// // var storevoinfo=null,storevodelinfo=[]; -// // for(var j=0;j<storevo.length;j++){ -// // if(itm.StoragePlaceId==storevo[j].StoragePlaceId){ -// // storevoinfo=storevo[j]; -// // } -// // } -// // for(var k=0;k<storedel.length;k++){ -// // if(itm.StoragePlaceId==storedel[k].StoragePlaceId){ -// // storevodelinfo.push(storedel[k]); -// // } -// // } -// const content = this.solidWastePpopupContent(data[i], 'c', 'z') -// // console.log(content) -// -// const marker = this.L.marker([positionX, positionY], { icon: Icon }) -// -// marker.bindPopup(content, () => { -// return this.SolidWastePopup.$el -// }, { -// className: 's-map-popup', -// minWidth: 200, -// closeButton: true, -// autoClose: false -// }) -// // // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 -// marker.bindTooltip(data[i].StoragePlaceName, { -// permanent: true, -// offset: [0, -16], -// direction: 'top', -// className: '' -// }) -// // 鐐瑰嚮 浜嬩欢 -// marker.on('click', (e) => { -// try { -// // console.log(e) -// // this.SolidWastePopup.SetDisplayContent(content) -// this.EffectOfPulse(e.target.getLatLng()) -// } catch (error) { -// console.log(error) -// } -// }) -// marker.on('popupopen', (e) => { -// try { -// this.solidWastePpopupContent(content) -// } catch (e) { -// console.log(e) -// } -// }) -// // 璁剧疆鍐呭娣诲姞鍒板浘灞� -// // this.solidWasteMarkersLabels.push(marker) -// this.SolidWasteLayerGroup.addLayer(marker) -// } -// } -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� -// SetSolidWasteContent (config, containerPopup) { -// this.SolidWastePopup = containerPopup -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鍥炬爣鏍峰紡鎵╁睍 => 鍏夊湀 鍥炬爣鑴夊啿 -// SolidWasteIcon () { -// return this.L.Icon.extend({ -// options: { -// iconSize: [40, 40], -// iconAnchor: [20, 20] -// } -// }) -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鏍规嵁绫诲瀷杩斿洖鍥剧墖鍔犺浇url -// SolidWasteIconUrl (determineValueOne, determineValueTwo, position) { -// var EffectOfChange -// if (determineValueOne === 1 || determineValueTwo === 1) { -// EffectOfChange = defaultImg -// this.EffectOfPulse(position, 'SolidWaste', this.solidWasteMarkersLabels, this.SolidWasteLayerGroup) -// } else { -// EffectOfChange = Setting -// } -// return EffectOfChange -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鑴夊啿鏁堟灉璁剧疆瀹炵幇 -// EffectOfPulse (position, name, markers, layerGroup) { -// // // 鍖哄垎鐩存帴鎵ц 鍜屽垽鏂墽琛岀殑涓嶅悓鍖哄埆 -// var differentColor = '' -// if (markers) { -// differentColor = '#ff0000' // 鏈夊唴瀹� 锛岀洿鎺ヤ负鎶ヨ 鎵ц鎶ヨ鐨勫唴瀹� -// } else { -// differentColor = '#98FB98' // 鍚﹀垯 涓虹偣鍑绘墽琛� -// } -// // 鍧愭爣鏁版嵁锛氭姤璀︿紶杩涙潵鐨勬槸鏁扮粍 / 鐐瑰嚮浼犺繘鏉ョ殑鏄痮bject -// var FinalPosition = position instanceof Array ? { -// lat: position[0], -// lng: position[1] -// } : position -// // 鎻掍欢 鏁堟灉瀹炵幇 -// var pulsingIcon = this.L.icon.pulse({ -// iconSize: [25, 25], -// color: differentColor, -// fillColor: ' ' -// }) -// if (markers) { -// markers.push(this.L.marker(FinalPosition, { icon: pulsingIcon })) -// this.L.layerGroup(markers).addLayer(layerGroup) -// } else { -// var picGroupMarker = new this.L.FeatureGroup() -// this.L.marker(FinalPosition, { icon: pulsingIcon }).addTo(picGroupMarker) -// this.pulseHeighLightMarker = picGroupMarker.addTo(this.SolidWasteLayerGroup) -// this.PulseCountSetting() -// } -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 瀵瑰浘鏍囪剦鍐� 杩涜set璁剧疆 // 楂樹寒鍥惧眰 -// PulseCountSetting () { -// var HeightLightTime = 1 -// var PulseNumber = 5 -// const pulseinterver = setInterval(() => { -// if (PulseNumber > 0) { -// PulseNumber-- -// } else { -// this.pulseClear(pulseinterver) -// PulseNumber = HeightLightTime -// } -// }, 1000) -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 娓呴櫎 鍥惧眰 -// pulseClear (pulseinterver) { -// clearInterval(pulseinterver) -// pulseinterver = null -// -// if (this.SolidWasteLayerGroup) { -// // this.SolidWasteLayerGroup.clearLayers() -// } else { -// this.SolidWasteLayerGroup = this.L.layerGroup().addTo(this.map) -// } -// if ((this.pulseHeighLightMarker)) { -// this.pulseHeighLightMarker.remove() -// } -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// -// // 鐐瑰嚮涓氬姟鍐呭 寮瑰嚭鏁版嵁鐨勬暟鎹繘琛屼慨鏀� -// solidWastePpopupContent (data) { -// console.log(data) -// const html = data.StoragePlaceName -// return html -// } -// -// /* -------------------------------------------------------------------------------------------------------------------------- */ -// } -// -// export default AddSolidWasteHelper - -// <template> -// <div class="full-screen"> -// <div id="map" ref="rootmap"></div> -// <el-button type="primary" @click="ChangeState">鍥哄簾</el-button> -// <SolidContent ref="SolidWastePopup" @callPopup="callPopup"></SolidContent> -// </div> -// </template> -// -// <script> -// import 'leaflet/dist/leaflet.css' -// import Sgis from '@/Sgis' -// -// // 搴曞浘涓氬姟js閫昏緫 -// import AddSolidWasteHelper from '@components/BaseNav/SolidWaste' -// -// // 搴曞浘缁戝畾 鐐瑰嚮 寮瑰嚭鐨勬暟鎹� -// import SolidContent from '@components/BaseNav/SolidContent' -// -// export default { -// name: 'HomePage', -// components: { -// SolidContent -// }, -// data () { -// return { -// map: null, -// lcServiceLayerVisible: false, -// basemapHelper: {}, -// serviceLayerHelper: {}, -// vectorLayerHelper: {} -// } -// }, -// computed: { -// config () { -// return this.$store.state.map.config -// }, -// SolidWasteConfig () { -// return this.$store.state.map.SolidWasteConfig -// } -// }, -// beforeMount () { -// this.$nextTick(() => { -// this.init() -// }) -// }, -// methods: { -// init () { -// const mapcontainer = this.$refs.rootmap -// this.map = Sgis.initMap(mapcontainer) -// -// this.basemapHelper = Sgis.initBasemapsHelper(this.map) // 鍒濆鍖栧熀纭�搴曞浘鍔╂墜 -// this.basemapHelper.initBasemap(this.config, false) // 绗簩涓弬鏁帮紝琛ㄧず鏄惁鍐呯綉搴曞浘 -// -// this.ChangeState() -// }, -// ChangeState () { -// // 璇锋眰鏁版嵁 鎼哄甫鍙傛暟 data -// // const data = { -// // // companyId: 3900100145, -// // // companyCode: 31800000, -// // // monDuration: 4 -// // } -// // 寮曞叆涓氬姟閫昏緫 js -// const AddSolidWaste = new AddSolidWasteHelper({ map: this.map }) -// // 涓氬姟閫昏緫js 鐨勮姹傛暟鎹� // 骞朵笖浼犻�掑浘鐗� 鐢ㄤ簬鍒涘缓鐐圭殑 icon -// AddSolidWaste.requestData() -// // // 鐐瑰嚮 璁剧疆 寮瑰嚭鍐呭浜嬩欢 de 璁剧疆 console.log(this.$refs.popup.$el) -// // AddSolidWaste.SetSolidWasteContent(this.SolidWasteConfig, this.$refs.SolidWastePopup) -// }, -// callPopup (val) { -// console.log(val) -// }, -// displayDefault () { -// // this.serviceLayerHelper = Sgis.initTileLayersHelper(this.map) // 鍒濆鍖栦笟鍔″簳鍥惧姪鎵� -// // this.serviceLayerHelper.initServiceLayers(this.config, this.$refs.popup) -// -// // this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.map) // 鍒濆鍖栧姩鎬佽绱犲浘灞傚姪鎵� -// // this.vectorLayerHelper.initVectorLayers(this.config) -// } -// } -// } -// </script> -// -// <style lang="less"> -// -// .leaflet-div-icon { -// background: none; -// border: none; -// } -// -// .full-screen { -// width: 100%; -// height: 100%; -// margin: 0; -// padding: 0; -// position: absolute; -// -// button { -// position: absolute; -// top: 88px; -// left: 88px; -// z-index: 999; -// } -// -// #map { -// height: 100%; -// width: 100%; -// } -// -// .barline { -// //width: 100%; -// //height: 1px; -// //background-color: #0661AE; -// border-top: 1px solid #0661AE; -// } -// -// #map-btn { -// position: fixed; -// top: 20px; -// left: 100px; -// z-index: 9999; -// } -// -// .leaflet-custom-icon { -// background: white; -// } -// } -// </style> diff --git a/src/components/BaseNav/WireSurface/index.js b/src/components/BaseNav/WireSurface/index.js new file mode 100644 index 0000000..6d04ade --- /dev/null +++ b/src/components/BaseNav/WireSurface/index.js @@ -0,0 +1,23 @@ + +// 寮曞叆鐢ㄤ簬澶勭悊鎺ュ彛鏁版嵁鑾峰彇鐨勬柟娉� +import { getDataInitWireSurface } from '@src/api/request' + +class initWireSurface { + constructor (options) { + this.map = options.map + this.L = window.L + this.initWireSurfaceMap = new Map() + this.initWireSurfacePopup = this.L.layerGroup().addTo(this.map) + } + + // 鑾峰彇椤甸潰绾�/闈㈡暟鎹� + getDataInitWireSurface () { + getDataInitWireSurface().then(res => { + console.log(res) + }).catch(error => { + console.log(error) + }) + } +} + +export default initWireSurface diff --git a/src/components/BaseNav/style.css b/src/components/BaseNav/style.css deleted file mode 100644 index dd710a6..0000000 --- a/src/components/BaseNav/style.css +++ /dev/null @@ -1,4 +0,0 @@ -.s-map-popup { - background: red; - height: 100px; -} diff --git a/src/components/plugin/MagicMarker.js b/src/components/plugin/MagicMarker.js index f74a2a4..afe9916 100644 --- a/src/components/plugin/MagicMarker.js +++ b/src/components/plugin/MagicMarker.js @@ -1,49 +1,27 @@ -const init = (L) => { - (function (window) { - console.log(window) - const setOptions = function (obj, options) { - for (const i in options) { - obj[i] = options[i] - } - return obj +/* eslint-disable */ +!(function (i) { + var c = function (i, c) { + for (var n in c) i[n] = c[n] + return i + } + L.Icon.Magic = function (i) { + if (i.iconUrl) { + var n = { html: '<div class=\'magicDiv\'><div class=\'magictime ' + i.magic + '\'>' + i.html + '<img id=\'migic\' src=\'' + i.iconUrl + '\'/></div></div>' } + } else { + var n = { html: '<div class=\'magicDiv\'><div class=\'magictime ' + i.magic + '\'>' + i.html + '</div></div>' } } - L.Icon.Magic = function (options) { - let opts - if (options.iconUrl) { - opts = { - html: "<div class='magicDiv'><div class='magictime " + options.magic + "'><img id='migic' src='" + options.iconUrl + "'/></div></div>" - // className: 'magicDiv', - } - } else { - opts = { - html: "<div class='magicDiv'><div class='magictime " + options.magic + "'>" + options.html + '</div></div>' - // className: 'magicDiv', - } - } - delete options.html - const magicIconOpts = setOptions(opts, options) - // console.log(magicIconOpts) - const magicIcon = L.divIcon(magicIconOpts) - return magicIcon + delete i.html + var a = c(n, i) + console.log(a) + var r = L.divIcon(a) + return r + }, L.icon.magic = function (i) { + return new L.Icon.Magic(i) + }, L.Marker.Magic = L.Marker.extend({ + initialize: function (i, c) { + c.icon = L.icon.magic(c), L.Marker.prototype.initialize.call(this, i, c) } - - L.icon.magic = function (options) { - return new L.Icon.Magic(options) - } - - L.Marker.Magic = L.Marker.extend({ - initialize: function (latlng, options) { - options.icon = L.icon.magic(options) - L.Marker.prototype.initialize.call(this, latlng, options) - } - }) - - L.marker.magic = function (latlng, options) { - return new L.Marker.Magic(latlng, options) - } - })(window) -} - -export default { - init -} + }), L.marker.magic = function (i, c) { + return new L.Marker.Magic(i, c) + } +}(window)) diff --git a/src/components/BaseNav/Pulse.css b/src/components/plugin/pulse/Pulse.css similarity index 100% rename from src/components/BaseNav/Pulse.css rename to src/components/plugin/pulse/Pulse.css diff --git a/src/components/BaseNav/Pulse.js b/src/components/plugin/pulse/Pulse.js similarity index 100% rename from src/components/BaseNav/Pulse.js rename to src/components/plugin/pulse/Pulse.js diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js index e01a715..98ff85c 100644 --- a/src/conf/MapConfig.js +++ b/src/conf/MapConfig.js @@ -2,6 +2,7 @@ import TDT from './TDT' import { LayerSewersLine, LayerSewersPoint } from './LayerSewers' import { LayerWasteWater } from './LayerWasteWater' + const curWwwPath = window.document.location.href const pathname = window.document.location.pathname const pos = curWwwPath.indexOf(pathname) @@ -22,7 +23,7 @@ minZoom: 3, maxZoom: 18, // center: [26, 104], - center: [32.224016189575195, 118.77070426940918], + center: [38.828558921813965, 117.41676807403564], zoom: 14, worldCopyJump: true, inertia: true, @@ -38,7 +39,10 @@ // defaultBasemapCode: 'tianditu_img', // 榛樿鏄剧ず 鍦板浘绫诲瀷 IntranetBaseMaps: TDT.intranet, InternetBaseMaps: TDT.internet, - Layers: { LayerSewersLine: [LayerSewersLine, LayerWasteWater], layerSewersPoint: LayerSewersPoint } // 姹¢洦姘村浘灞傞厤缃� + Layers: { + LayerSewersLine: [LayerSewersLine, LayerWasteWater], + layerSewersPoint: LayerSewersPoint + } // 姹¢洦姘村浘灞傞厤缃� } /** diff --git a/src/utils/axios.js b/src/utils/axios.js index 20047e2..69078ed 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -83,7 +83,8 @@ // 鍒涘缓axios瀹炰緥 const Service = axios.create({ - timeout: 1000 + timeout: 1000, + baseURL: 'http://10.246.162.140:8080/' }) const CancelToken = axios.CancelToken diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index eb3437c..9e972be 100644 --- a/src/views/MapTemplate.vue +++ b/src/views/MapTemplate.vue @@ -20,6 +20,7 @@ <SolidContent ref="SolidWastePopup"></SolidContent> <el-button type="primary" @click="AddGasHelper" class="flue-gas">搴熸皵</el-button> <popup-gas ref="FlueGas"></popup-gas> + <PublicBounced ref="PublicBounced"></PublicBounced> </div> </template> @@ -38,12 +39,15 @@ // import MenuSpecial from '@components/panel/MenuTopic' import LegendPanel from '@components/panel/LegendPanel' import Enterprise from '../components/table/enterprise' -import SolidContent from '@components/BaseNav/SolidContent' // 搴曞浘涓氬姟js閫昏緫 import AddSolidWasteHelper from '@components/BaseNav/SolidWaste' // 搴熸皵 import AddGasHelper from '@components/flueGas/flueGas' import PopupGas from '@/components/flueGas/popup-gas' +import AddSolidWasteHelper from '@components/BaseNav/SolidWaste/SolidWaste' +// 鍏叡灞曠ず鏁版嵁 +import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced' + export default { name: 'MapTemplate', components: { @@ -76,9 +80,6 @@ return this.$store.state.map.config } }, - // created () { - // this.FlueGas() - // }, beforeMount () { this.$nextTick(() => { this.init() @@ -91,9 +92,16 @@ AddGas.SetPlueGasContent(this.config, this.$refs.FlueGas) }, ChangeState () { + const data = { + companyId: 3900100145, + userCode: 'wenchun.deng', + name: '', + marginWarr: '', + longDayWarr: '' + } const AddSolidWaste = new AddSolidWasteHelper({ map: this.map }) - AddSolidWaste.requestData() - AddSolidWaste.SetSolidWasteContent(this.config, this.$refs.SolidWastePopup) + AddSolidWaste.requestData(data) + AddSolidWaste.SetSolidWasteContent(this.config, this.$refs.PublicBounced) }, saveMapStatus () { window.serviceLayerHelper = this.serviceLayerHelper -- Gitblit v1.8.0