diff --git a/src/views/rain/inspection/components/config.js b/src/views/rain/inspection/components/config.js index 4c2894d..4b2936b 100644 --- a/src/views/rain/inspection/components/config.js +++ b/src/views/rain/inspection/components/config.js @@ -141,7 +141,7 @@ const MAPCONFIGS = { Map_axisOrientation: "neu",//轴 Map_global: false, //全球 MAP_center: [120.6126391, 31.3029816],//定义中心点 - Map_Zooms: [13, 23, 13],//定义地图初始层级、最大层级、最小层级 + Map_Zooms: [12, 23, 10],//定义地图初始层级、最大层级、最小层级 Map_ID: "olMap",//地图标识ID } diff --git a/src/views/rain/inspection/components/maps.vue b/src/views/rain/inspection/components/maps.vue index c8543dc..b7f96c4 100644 --- a/src/views/rain/inspection/components/maps.vue +++ b/src/views/rain/inspection/components/maps.vue @@ -4,57 +4,85 @@ + + @@ -114,6 +141,7 @@ import proj4 from 'proj4' import {CONFIGS,MAPCONFIGS} from '@/views/rain/inspection/components/config' +import {listroad} from '../../../../api/basic/road.js' import showRainEquipmentInfo from '@/views/rain/inspection/components/showRainEquipmentInfo' import showRainSiteInfo from '@/views/rain/inspection/components/showRainSiteInfo' import dialogShow from '@/components/dialogShow' @@ -128,7 +156,9 @@ export default { }, data() { return { + showSearch:false, title: "巡查点位", + showmap:false, width: "100%", isShow: false, map: null, @@ -153,82 +183,29 @@ export default { mapCheckList:[ { id:"M1", - title:"高清影像", - checked:true + title:"高清影像" },{ id:"L1", - title:"路网", - checked:true + title:"路网" } ], configs :CONFIGS, mapConfigs:MAPCONFIGS, projection:"EPSG:4490", featuresArr:[], -flagLayer:"", - pointArr:[ - // [120.63212, 31.26249, 'suzhouas',51], - // [120.63212, 30.26249, 'suzhouwown2',50], - // [120.55590234876, 31.320813249765, 'suzhouwown2',49], - ], + flagLayer:"", + pointArr:[], searchFields: { is_export: 0, is_auth:1 }, + roadsList: [], + roaddisabled: false, + roadloading: false, + mapdatesearch:"", selects: { - sunusualList: [{ - id: "", - value: "所有" - }], - areasList: [{ - id: "", - name: "所有" - }], - typeList: [{ - id: "", - name: "所有" - }, { - id: 1, - name: "日常雨水设施" - }, { - id: 2, - name: "在建工地" - }], - statusList: [{ - id: "", - name: "所有" - }, { - id: 0, - name: "未审核" - }, { - id: 1, - name: "已审核" - }, { - id: 2, - name: "已办结" - }, { - id: 3, - name: "已退回" - }], - endTypeList: [{ - id: 0, - name: "所有" - }, { - id: 1, - name: "养护转办" - }, { - id: 2, - name: "违法转办" - }], - sequiementList: [{ - id: "", - value: "所有" - }], - maintainList: [{ - id:"", - name:"所有" - }] + }, }; @@ -248,14 +225,34 @@ flagLayer:"", // this.initMap(); }, watch:{ - // pointArr(val){ - // this.pointArr = val - // } + pointArr(newval,oldval){ + if(newval){ + // this.resetPointArr() + this.pointArr = newval + this.showmap = false + this.$nextTick(function () { + this.showmap = true + this.showMap = 'M2' + this.checkList = ['M1','L1'] + this.showMaps() + }) + } + }, + mapdatesearch(newVal, oldVal) { + if (newVal) { + this.searchFields.start_date = newVal[0] + this.searchFields.end_date = newVal[1] + } else { + this.searchFields.start_date = "" + this.searchFields.end_date = "" + } + + } }, methods: { showMaps(){ this.$nextTick(function () { - this.initMap(); + this.initMap(); }) }, initMap() { @@ -485,27 +482,39 @@ flagLayer:"", } }, loadMap(){ - console.log(this.searchFields) this.$emit('loadMap',this.searchFields) }, resetPointArr(){ - // this.map = null - // this.pointArr = [] - // // this.featuresArr=[] - // // this.flagLayer.removeFeature(this.featuresArr); - // // this.map.removeLayer(this.flagLayer); - // let _that = this; - // this.flagLayer - // .getSource() - // .getFeatures() - // .forEach(function(feature) { - // _that.flagLayer.getSource().removeFeature(feature); - // }); - // this.featuresArr = []; - // console.log(this.featuresArr); - // // this.flagLayer.getSource().removeFeature(this.features); //错误写法 - // this.map.removeLayer(this.flagLayer); - // this.flagLayer.getSource().clear(); + this.map = null + let _that = this; + this.flagLayer + .getSource() + .getFeatures() + .forEach(function(feature) { + _that.flagLayer.getSource().removeFeature(feature); + }); + this.featuresArr = []; + this.flagLayer.getSource().clear(); + }, + resetSearch(){ + this.searchFields = {} + this.mapdatesearch=['',''] + }, + remoteRoad() { + this.roadsList = [] + }, + remoteMethod(query) { + if (query != '') { + this.roadloading = true + listroad({ + name: query + }).then(res => { + this.roadloading = false + this.roadsList = res.data + }) + } else { + this.roadsList = [] + } } }, @@ -551,6 +560,15 @@ flagLayer:"", } .common-dialog{ margin:0!important; + .el-dialog__header{ + padding-top:0; + button{ + height: 28px; + padding: 0 20px; + line-height: 28px; + margin-left: 10px; + } + } } diff --git a/src/views/rain/inspection/inspection.vue b/src/views/rain/inspection/inspection.vue index 3575e51..7faa1fe 100644 --- a/src/views/rain/inspection/inspection.vue +++ b/src/views/rain/inspection/inspection.vue @@ -50,7 +50,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -480,14 +480,6 @@ if (m.rain_equipment_info) { m.askName = m.rain_equipment_info.ask_content_detail ? m.rain_equipment_info.ask_content_detail : "" - this.mapArr.push([ - m.rain_equipment_info.longitude,m.rain_equipment_info.latitude,m.rain_equipment_info.address,m.id,m.type - ]) - } - if (m.building_site_info) { - this.mapArr.push([ - m.building_site_info.building_site.longitude,m.building_site_info.building_site.latitude,m.building_site_info.building_site.address,m.id,m.type - ]) } } this.tableData = response.data; @@ -499,23 +491,23 @@ }, showMap(){ - // this.loadMap() - console.log(this.mapArr) - // return - this.$refs.maps.pointArr = this.mapArr - this.$refs.maps.isShow = true - this.$refs.maps.showMaps() - this.$refs.maps.selects = this.selects + this.loadMap(this.searchFields) + this.$nextTick(function(){ + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.isShow = true + // this.$refs.maps.showMaps() + this.$refs.maps.selects = this.selects + }) + }, - // 查询地图 + // 查询地图 点位 loadMap(search) { - console.log(search) // return this.mapArr = [] listall({ - // page: this.paginations.page, - // page_size: this.paginations.page_size, - ...this.searchFields + page: 1, + page_size: 9999999, + ...search }).then(response => { for (var m of response.data) { if (m.rain_equipment_info) { @@ -529,6 +521,9 @@ ]) } } + this.$refs.maps.showSearch = false + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.resetPointArr() }).catch(error => { console.log(error) reject(error) diff --git a/src/views/rain/maintain/components/maps.vue b/src/views/rain/maintain/components/maps.vue new file mode 100644 index 0000000..db67626 --- /dev/null +++ b/src/views/rain/maintain/components/maps.vue @@ -0,0 +1,592 @@ + + + + diff --git a/src/views/rain/maintain/maintain.vue b/src/views/rain/maintain/maintain.vue index 4132465..bc51602 100644 --- a/src/views/rain/maintain/maintain.vue +++ b/src/views/rain/maintain/maintain.vue @@ -45,7 +45,8 @@ - + + @@ -139,7 +140,8 @@ 确认 - + +
@@ -181,7 +183,9 @@ - + + +
@@ -216,7 +220,8 @@ import showMireInfo from '@/views/rain/maintain/components/showMireInfo' import editCirculation from '@/views/rain/maintain/components/editCirculation' import editMire from '@/views/rain/maintain/components/editMire' - import AvueMap from 'avue-plugin-map' + import AvueMap from 'avue-plugin-map' + import maps from '@/views/rain/maintain/components/maps' export default { components: { @@ -226,13 +231,15 @@ showDischargeInfo, showMireInfo, editCirculation, - editMire + editMire, + maps }, data() { return { tableHeight: 0, formLabelWidth: "120px", + mapArr :[], tableData: [], paginations: { page: 1, @@ -515,6 +522,38 @@ }); }, + showMap(){ + this.loadMap(this.searchFields) + this.$nextTick(function(){ + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.isShow = true + // this.$refs.maps.showMaps() + this.$refs.maps.selects = this.selects + }) + + }, + // 查询地图 点位 + loadMap(search) { + // return + this.mapArr = [] + listmain({ + page: 1, + page_size: 9999999, + ...search + }).then(response => { + for (var m of response.data) { + this.mapArr.push([ + m.longitude,m.latitude,m.address,m.id,m.old_type + ]) + } + this.$refs.maps.showSearch = false + this.$refs.maps.pointArr = this.mapArr + this.$refs.maps.resetPointArr() + }).catch(error => { + console.log(error) + reject(error) + }); + }, exportExcel() { var that = this that.searchFields.is_export = 1