From a96e7a6704cb34ece8835066ff9f069014062e3d Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期二, 30 三月 2021 21:32:36 +0800 Subject: [PATCH] 文件合并方法 --- src/components/BaseNav/SolidWaste/SolidWaste.js | 2 src/api/request.js | 10 + public/static/SolidWaste.json | 176 ++++++++++++++++++++++------------- src/conf/Constants.js | 3 src/views/MapTemplate.vue | 17 --- src/components/BaseNav/SolidWaste/directive/dir.js | 2 src/components/BaseNav/PublicBounced/PublicBounced.vue | 16 +- src/components/LayerController/logic/SolidWaste.js | 51 ++++++++++ 8 files changed, 184 insertions(+), 93 deletions(-) diff --git a/public/static/SolidWaste.json b/public/static/SolidWaste.json index 3a16382..132f6bf 100644 --- a/public/static/SolidWaste.json +++ b/public/static/SolidWaste.json @@ -1,81 +1,125 @@ { "Result": { "IsSuccess": 1, - "code": 1, "ErrorMsg": "", "DataInfo": [ { - "StoragePlaceId": 124.0, - "StoragePlaceName": "鑱氶啔閮ㄥ嵄闄╁簾鐗╂殏瀛樼偣", - "HazaWasteStorageDate": "0001-01-01T00:00:00", - "HazaWasteCatgrName": null, - "SurplusQuantityWarning": 0, - "LongDayWarning": 0, - "DesignFloorArea": 95.0, - "HazaWasteName": null, - "EstimateFloorArea": 0.0, - "HazaWasteDeptName": null, - "SurplusFloorArea": 95.0, - "HazaWasteStorageDays": 0.0, - "StorageQty": 0.0, - "HazaWasteStorageQty": 0.0, - "positionX": 32.22118377685547, - "positionY": 118.78057479858398 + "StoragePlaceId": 0, + "Name": "宸撮櫟鐭冲寲 鍙栨按鍗曞厓骞叉偿鏆傚瓨搴�", + "StorageQtyMax": 0, + "Longitude": 113.38361, + "Latitude": 29.9008, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 }, { - "StoragePlaceId": 123.0, - "StoragePlaceName": "鍖栧伐閮ㄥ嵄闄╁簾鐗╂殏瀛樼偣", - "HazaWasteStorageDate": "0001-01-01T00:00:00", - "HazaWasteCatgrName": null, - "SurplusQuantityWarning": 0, - "LongDayWarning": 0, - "DesignFloorArea": 260.0, - "HazaWasteName": null, - "EstimateFloorArea": 0.0, - "HazaWasteDeptName": null, - "SurplusFloorArea": 260.0, - "HazaWasteStorageDays": 0.0, - "StorageQty": 0.0, - "HazaWasteStorageQty": 0.0, - "positionX": 32.23122596740723, - "positionY": 118.7743091583252 + "StoragePlaceId": 1, + "Name": "宸撮櫟鐭冲寲 鍚夊婀栫伆濉�", + "StorageQtyMax": 0, + "Longitude": 113.14089, + "Latitude": 29.4181, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 }, { - "StoragePlaceId": 127.0, - "StoragePlaceName": "鐐兼补閮ㄥ嵄闄╁簾鐗╂殏瀛樼偣", - "HazaWasteStorageDate": "0001-01-01T00:00:00", - "HazaWasteCatgrName": null, - "SurplusQuantityWarning": 0, - "LongDayWarning": 0, - "DesignFloorArea": 351.0, - "HazaWasteName": null, - "EstimateFloorArea": 0.0, - "HazaWasteDeptName": null, - "SurplusFloorArea": 351.0, - "HazaWasteStorageDays": 0.0, - "StorageQty": 0.0, - "HazaWasteStorageQty": 0.0, - "positionX": 32.222299575805664, - "positionY": 118.74950408935547 + "StoragePlaceId": 2, + "Name": "闀垮箔鐐煎寲 鍏瓧闂ㄥ瀮鍦惧~鍩嬪満", + "StorageQtyMax": 0, + "Longitude": 113.3916666667, + "Latitude": 29.6394444444, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 }, { - "StoragePlaceId": 126.0, - "StoragePlaceName": "鐑儍閮ㄥ嵄闄╁簾鐗╂殏瀛樼偣", - "HazaWasteStorageDate": "0001-01-01T00:00:00", - "HazaWasteCatgrName": null, - "SurplusQuantityWarning": 0, - "LongDayWarning": 1.0, - "DesignFloorArea": 54.0, - "HazaWasteName": null, - "EstimateFloorArea": 0.0, - "HazaWasteDeptName": null, - "SurplusFloorArea": 54.0, - "HazaWasteStorageDays": 0.0, - "StorageQty": 1.0, - "HazaWasteStorageQty": 0.0, - "positionX": 32.23092555999756, - "positionY": 118.75735759735107 + "StoragePlaceId": 3, + "Name": "涓煩鐭冲寲 鐏版福鍦�", + "StorageQtyMax": 0, + "Longitude": 114.5192083333, + "Latitude": 30.6201666667, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 + }, + { + "StoragePlaceId": 4, + "Name": "瀹夊簡鐭冲寲 灞卞彛搴熸福濉煁鍦�", + "StorageQtyMax": 0, + "Longitude": 116.960599, + "Latitude": 30.541509, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 + }, + { + "StoragePlaceId": 5, + "Name": "瀹夊簡鐭冲寲 鐑數闄堝鍐茬伆鍦�", + "StorageQtyMax": 0, + "Longitude": 116.986949, + "Latitude": 30.534486, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 + }, + { + "StoragePlaceId": 6, + "Name": "楂樻ˉ鐭冲寲 娴锋花鐮佸ご闄勮繎婊╂秱", + "StorageQtyMax": 0, + "Longitude": 121.55, + "Latitude": 31.63, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 + }, + { + "StoragePlaceId": 7, + "Name": "宸濈淮鍖栧伐 鐢熷寲姹℃偿鏂欎粨", + "StorageQtyMax": 0, + "Longitude": 107.02342004, + "Latitude": 29.79235333, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 + }, + { + "StoragePlaceId": 8, + "Name": "宸濈淮鍖栧伐 鎺掓偿姘存偿楗兼枡浠�", + "StorageQtyMax": 0, + "Longitude": 107.02315181, + "Latitude": 29.78832166, + "SortNum": 0, + "DesignFloorArea": 0, + "VideoCoding": null, + "VideoURL": null, + "DaysAlarm": 0, + "MarginAlarm": 0 } ] } -} +} \ No newline at end of file diff --git a/src/api/request.js b/src/api/request.js index 9f9091d..bceceb3 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -8,6 +8,13 @@ } }) } +// export const QueryStoragePlaceListByCompanyAndName = (data = {}) => { +// return $http.get('http://xearth.cn:3000/wasteSolid/getSolidWaste', Qs.stringify(data), { +// headers: { +// 'Content-Type': 'application/json' +// } +// }) +// } export const FlueGas = (data = {}) => { return $http.post('/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', Qs.stringify(data), { headers: { @@ -15,10 +22,11 @@ } }) } + export function requestWasteWater (data = {}) { return $http.post('EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', Qs.stringify(data), { headers: { 'Content-Type': 'application/json' } }) -} \ No newline at end of file +} diff --git a/src/components/BaseNav/PublicBounced/PublicBounced.vue b/src/components/BaseNav/PublicBounced/PublicBounced.vue index c751820..0b78c9c 100644 --- a/src/components/BaseNav/PublicBounced/PublicBounced.vue +++ b/src/components/BaseNav/PublicBounced/PublicBounced.vue @@ -7,8 +7,8 @@ <div class="public-bounced-content"> <div class="public-bounced-content-left"> <GasTab :displayContent="displayContent"></GasTab> - <PublicTable v-if="value === 'gufei'" :requestSolidWasteData="displayContent.StoragePlaceId"></PublicTable> - <GasECharts v-else></GasECharts> + <!-- <PublicTable v-if="value === 'gufei'" :requestSolidWasteData="displayContent.StoragePlaceId"></PublicTable>--> + <!-- <GasECharts v-else></GasECharts>--> </div> <div class="public-bounced-content-right"> <GasVideo></GasVideo> @@ -21,16 +21,16 @@ import '@/components/BaseNav/SolidWaste/directive/dir' import GasTab from '@components/BaseNav/PublicBounced/GasComponents/GasTab' -import PublicTable from '@components/BaseNav/PublicBounced/GasComponents/PublicTable' -import GasECharts from '@components/BaseNav/PublicBounced/GasComponents/GasECharts' +// import PublicTable from '@components/BaseNav/PublicBounced/GasComponents/PublicTable' +// import GasECharts from '@components/BaseNav/PublicBounced/GasComponents/GasECharts' import GasVideo from '@components/BaseNav/PublicBounced/GasComponents/GasVideo' export default { name: 'PublicBounced', components: { GasTab, - PublicTable, - GasECharts, + // PublicTable, + // GasECharts, GasVideo }, data () { @@ -40,10 +40,10 @@ } }, methods: { - setData (data, value) { + setData (data) { this.displayContent = data this.flag = true - this.value = value + // this.value = value }, closePopup () { this.flag = false diff --git a/src/components/BaseNav/SolidWaste/SolidWaste.js b/src/components/BaseNav/SolidWaste/SolidWaste.js index 85f3235..7cedfa6 100644 --- a/src/components/BaseNav/SolidWaste/SolidWaste.js +++ b/src/components/BaseNav/SolidWaste/SolidWaste.js @@ -69,7 +69,7 @@ // this.map.panTo([e.target.getLatLng().lat, e.target.getLatLng().lng], 100) this.setPanTo(e.target.getLatLng(), 250) this.EffectOfPulse(e.target.getLatLng()) - this.SolidWastePopup.setData(data[i], 'gufei') + // this.SolidWastePopup.setData(data[i], 'gufei') return this.SolidWastePopup.$el } catch (error) { console.log(error) diff --git a/src/components/BaseNav/SolidWaste/directive/dir.js b/src/components/BaseNav/SolidWaste/directive/dir.js index fde331f..d51b377 100644 --- a/src/components/BaseNav/SolidWaste/directive/dir.js +++ b/src/components/BaseNav/SolidWaste/directive/dir.js @@ -56,4 +56,4 @@ delete el._dragEnd delete el._checkPosition } -}) \ No newline at end of file +}) diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js new file mode 100644 index 0000000..c92dca2 --- /dev/null +++ b/src/components/LayerController/logic/SolidWaste.js @@ -0,0 +1,51 @@ +/** + * 鍥哄簾 + */ +const AnimalService = require('../service/AnimalService').default +const AjaxUtils = require('../../../utils/AjaxUtils').default + +module.exports = function () { + /** + * 杩斿洖marker瀵硅薄鏁扮粍 + * @param L leaflet瀵硅薄 + */ + this.init = (layer, L) => { + this.animalService = new AnimalService({ + L: L, + layer: layer, + LayerPopup: null + }) + // AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/QueryStoragePlaceListByCompanyAndName', { + // AjaxUtils.get4JsonDataByUrl('http://xearth.cn:3000/wasteSolid/getSolidWaste', { + AjaxUtils.get4JsonDataByUrl('http://localhost:8888/static/SolidWaste.json', { + companyId: 3900100145, + userCode: 'wenchun.deng', + name: '', + marginWarr: '', + longDayWarr: '' + }, function (res) { + const data = res.data.Result.DataInfo + for (let i = 0; i < data.length; i++) { + // 缁忕含搴� 浣嶇疆 + const positionX = data[i].Latitude + const positionY = data[i].Longitude + layer.addLayer(L.marker([positionX, positionY], {})) + } + }) + } + + this.bindTooltip = (layer) => { + return '娴嬭瘯鍥哄簾' + } + + this.clickListener = (e) => { + this.animalService.pulseEffect(e.latlng) + console.log(e) + console.log(this.PublicBounced) + // return this.PublicBounced.$el + } + // 鍥哄簾鐐瑰嚮杩涜鐨� 鍐呭鐨勮缃� + // SetSolidWasteContent (config, containerPopup) { + // this.SolidWastePopup = containerPopup + // } +} diff --git a/src/conf/Constants.js b/src/conf/Constants.js index 97a3af7..e2ac498 100644 --- a/src/conf/Constants.js +++ b/src/conf/Constants.js @@ -8,7 +8,8 @@ fsqy: 'Sample.js', fspfk: 'Sample.js', fsjcd: 'Sample.js', - wasteGasJcd: 'WasteGas.js' + wasteGasJcd: 'WasteGas.js', + solidWasteJcd: 'SolidWaste.js' } export const props = { diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index 0809498..dd708d9 100644 --- a/src/views/MapTemplate.vue +++ b/src/views/MapTemplate.vue @@ -16,7 +16,7 @@ <summary-sheets></summary-sheets> <enterprise></enterprise> <!-- <el-button id="map-btn" el-icon-c-scale-to-original icon="el-icon-c-scale-to-original" circle @click="isShowHidden"></el-button>--> - <el-button type="primary" @click="ChangeState" class="solid-waste">鍥哄簾</el-button> + <!-- <el-button type="primary" @click="ChangeState" class="solid-waste">鍥哄簾</el-button>--> <el-button type="primary" @click="ChangeWaterState" class="Waste-water">搴熸按</el-button> <el-button type="primary" @click="AddGasHelper" class="flue-gas">搴熸皵</el-button> <PublicBounced ref="PublicBounced"></PublicBounced> @@ -39,7 +39,6 @@ import LegendPanel from '@components/panel/LegendPanel' import Enterprise from '../components/table/enterprise' // 搴曞浘涓氬姟js閫昏緫 -import AddSolidWasteHelper from '@components/BaseNav/SolidWaste/SolidWaste' import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater' import AddGasHelper from '@components/BaseNav/flueGas/flueGas' // // 鍏叡灞曠ず鏁版嵁 @@ -102,18 +101,6 @@ AddGas.requestData(data) AddGas.SetPlueGasContent(this.config, this.$refs.PublicBounced) }, - ChangeState () { - const data = { - companyId: 3900100145, - userCode: 'wenchun.deng', - name: '', - marginWarr: '', - longDayWarr: '' - } - const AddSolidWaste = new AddSolidWasteHelper({ map: this.map }) - AddSolidWaste.requestData(data) - AddSolidWaste.SetSolidWasteContent(this.config, this.$refs.PublicBounced) - }, ChangeWaterState () { const data = { companyId: 3900100145, @@ -148,6 +135,7 @@ this.$refs.toolBox.map = this.map window.popupComp = this.$refs.popup + var layerFactory = new LayerFactory({ L: window.L, map: this.map @@ -165,7 +153,6 @@ this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.map) // 鍒濆鍖栧姩鎬佽绱犲浘灞傚姪鎵� this.vectorLayerHelper.initVectorLayers(this.config) - this.ChangeState() // this.AddGasHelper() // this.ChangeWaterState() -- Gitblit v1.8.0