master
lion 3 years ago
parent ee4001251d
commit 661a9166a9

@ -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
}

@ -4,57 +4,85 @@
<dialogShow :title="title" :is-show.sync="isShow" :width="width" @resetform="resetPointArr">
<template v-slot:searchtype>
<el-popover
placement="right"
width="400"
trigger="click">
<!-- <div>
<Input class="vm10" style="width: 200px; margin-right: 10px" v-model="searchFields.keyword"
placement="right-start"
width="500"
trigger="click"
v-model="showSearch"
>
<div>
<el-row>
<el-col :span="11">
<Input class="vm10" style="width: 93%;" v-model="searchFields.keyword"
placeholder="关键字搜索" />
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" v-model="searchFields.road_id" filterable remote reserve-keyword clearable
@focus="remoteRoad" placeholder="请输入关键词查找道路" :remote-method="remoteMethod" :loading="roadloading">
<el-option v-for="item in roadsList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@focus="remoteRoad" placeholder="请输入关键词查找道路" :remote-method="remoteMethod" :loading="roadloading">
<el-option v-for="item in roadsList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11">
<el-select class="vm10" filterable v-model="searchFields.area_id" placeholder="请选择所属片区">
<el-option v-for="item in selects.areasList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.maintain_id" placeholder="请选择所属养护单位">
<el-option v-for="item in selects.maintainList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11">
<el-select class="vm10" filterable v-model="searchFields.status" placeholder="请选择状态">
<el-option v-for="item in selects.statusList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.unusual_type_id" placeholder="请选择异常类型">
<el-option v-for="item in selects.sunusualList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" >
<el-select class="vm10" filterable v-model="searchFields.type" placeholder="请选择类型">
<el-option v-for="item in selects.typeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.end_type" placeholder="请选择结办类型">
<el-option v-for="item in selects.endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11">
<el-select class="vm10" filterable v-model="searchFields.ask_content_id" placeholder="请选择巡查内容">
<el-option v-for="item in selects.sequiementList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<el-date-picker class="vm10" v-model="datesearch" type="daterange" range-separator=""
</el-col>
<el-col :span="24">
<el-date-picker class="vm10" v-model="mapdatesearch" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
</el-col>
<el-col :span="24">
<Button type="primary" @click="loadMap(false)" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="resetSearch" style="margin-left: 10px">重置</Button>
</el-col>
</el-row>
</div>
<el-button slot="reference">搜索</el-button>
-->
<el-button type="primary" slot="reference">多项搜索</el-button>
</el-popover>
</template>
<!-- 地图 -->
<template v-slot:content>
<div class="wrapper">
<div class="wrapper" v-if="showmap">
<div class="chooseMap">
<div>
<el-radio-group v-model="showMap" @change="changeMap">
@ -68,7 +96,7 @@
</div>
</div>
<!-- 地图 -->
<div class="map" id="olMap"></div>
<!-- 弹框 -->
<div ref="popup" class="popup" v-show="shopPopup">
@ -77,7 +105,6 @@
<div class="showinfo" @click='showInfo(nowId,types)'>查看详情</div>
</div>
</div>
<!-- 查看详情 -->
</div>
</template>
@ -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;
}
}
}
</style>

@ -50,7 +50,7 @@
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
<Button type="primary" @click="review()" style="margin-left: 10px">批量复核</Button>
<Button type="primary" @click="exportExcel()" style="margin-left: 10px">导出</Button>
<Button type="primary" v-if="true" @click="showMap()" style="margin-left: 10px"></Button>
<Button type="primary" @click="showMap()" style="margin-left: 10px"></Button>
</div>
</slot>
</LxHeader>
@ -119,7 +119,7 @@
</el-pagination>
</div>
</div>
<!-- 地图 -->
<maps ref="maps" @loadMap="loadMap"></maps>
<!-- 初始选择 -->
<el-dialog title="雨管养护类型选择" :visible.sync="rainTypeVisible" width="60%">
@ -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)

@ -0,0 +1,592 @@
<template>
<div>
<dialogShow :title="title" :is-show.sync="isShow" :width="width" @resetform="resetPointArr">
<template v-slot:searchtype>
<el-popover
placement="right-start"
width="500"
trigger="click"
v-model="showSearch"
>
<div>
<el-row>
<el-col :span="11">
<Input class="vm10" style="width: 93%;" v-model="searchFields.keyword"
placeholder="关键字搜索" />
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" v-model="searchFields.road_id" filterable remote reserve-keyword clearable
@focus="remoteRoad" placeholder="请输入关键词查找道路" :remote-method="remoteMethod" :loading="roadloading">
<el-option v-for="item in roadsList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11">
<el-select class="vm10" filterable v-model="searchFields.area_id" placeholder="请选择所属片区">
<el-option v-for="item in selects.areasList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.maintain_id" placeholder="请选择所属养护单位">
<el-option v-for="item in selects.maintaingroupList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11">
<el-select class="vm10" filterable v-model="searchFields.status" placeholder="请选择状态">
<el-option v-for="item in selects.statusList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.type" placeholder="请选择类型">
<el-option v-for="item in selects.typeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" >
<el-select class="vm10" filterable v-model="searchFields.end_type" placeholder="请选择结办类型">
<el-option v-for="item in selects.endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="11" :offset="2">
<el-select class="vm10" filterable v-model="searchFields.title_id" placeholder="请选择养护内容">
<el-option v-for="item in allmaintaninList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="24">
<el-date-picker class="vm10" v-model="mapdatesearch" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
</el-col>
<el-col :span="24">
<Button type="primary" @click="loadMap(false)" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="resetSearch" style="margin-left: 10px">重置</Button>
</el-col>
</el-row>
</div>
<el-button type="primary" slot="reference">多项搜索</el-button>
</el-popover>
</template>
<!-- 地图 -->
<template v-slot:content>
<div class="wrapper" v-if="showmap">
<div class="chooseMap">
<div>
<el-radio-group v-model="showMap" @change="changeMap">
<el-radio v-for="item in mapRadioList" :label="item.id">{{item.title}}</el-radio>
</el-radio-group>
</div>
<div>
<el-checkbox-group v-model="checkList" @change="changeCheck">
<el-checkbox v-for="item in mapCheckList" :label="item.id">{{item.title}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
<!-- 地图 -->
<div class="map" id="olMap"></div>
<!-- 弹框 -->
<div ref="popup" class="popup" v-show="shopPopup">
<div class="info">
<div class="address">地址{{nowAddress}}</div>
<div class="showinfo" @click='showInfo(nowId,types)'>查看详情</div>
</div>
</div>
</div>
</template>
</dialogShow>
<showCirculationInfo ref="showCirculationInfo"></showCirculationInfo>
<showDischargeInfo ref="showDischargeInfo"></showDischargeInfo>
<showMireInfo ref="showMireInfo"></showMireInfo>
</div>
</template>
<script>
import "ol/ol.css";
import {Tile as TileLayer,Vector as VectorLayer } from "ol/layer";
import XYZ from "ol/source/XYZ";
import {TileArcGISRest} from "ol/source"
import tilegrid from "ol/tilegrid/TileGrid"
import { defaults as defaultControls } from "ol/control";
import {get as getprojection} from "ol/proj"
import {Projection,addProjection} from "ol/proj"
import Map from "ol/Map.js";
import View from "ol/View.js";
//
import { Vector as VectorSource } from "ol/source";
import * as olProj from "ol/proj";
import {Feature, Overlay} from "ol"
import { Point } from "ol/geom";
import { Style, Fill, Stroke, Circle as sCircle } from "ol/style";
import proj4 from 'proj4'
import {CONFIGS,MAPCONFIGS} from '@/views/rain/inspection/components/config'
import {listroad} from '../../../../api/basic/road.js'
import showCirculationInfo from '@/views/rain/maintain/components/showCirculationInfo'
import showDischargeInfo from '@/views/rain/maintain/components/showDischargeInfo'
import showMireInfo from '@/views/rain/maintain/components/showMireInfo'
import dialogShow from '@/components/dialogShow'
export default {
components: {
showCirculationInfo,
showDischargeInfo,
showMireInfo,
CONFIGS,
MAPCONFIGS,
dialogShow
},
data() {
return {
showSearch:false,
title: "养护点位",
showmap:false,
width: "100%",
isShow: false,
map: null,
shopPopup:false,
nowAddress:"",
nowId:"",
types:"",
showMap:"M2",
mapRadioList:[
{
id:"M2",
title:"天地图"
},{
id:"S1",
title:"水利图"
},{
id:"H1",
title:"河道图"
}
],
checkList:['M1','L1'],
mapCheckList:[
{
id:"M1",
title:"高清影像"
},{
id:"L1",
title:"路网"
}
],
configs :CONFIGS,
mapConfigs:MAPCONFIGS,
projection:"EPSG:4490",
featuresArr:[],
flagLayer:"",
pointArr:[],
searchFields: {
is_export: 0,
is_auth:1
},
roadsList: [],
roaddisabled: false,
roadloading: false,
mapdatesearch:"",
allmaintaninList:[{
id:"",
value:"所有"
}],
selects: {
},
};
},
created() {
},
mounted() {
//
proj4.defs("EPSG:4490", '+proj=longlat +ellps=GRS80 +no_defs')
this.projection = new Projection({
code: this.mapConfigs.Map_Code,
units: this.mapConfigs.Map_units,
axisOrientation: this.mapConfigs.Map_axisOrientation,
global: this.mapConfigs.Map_global,
});
addProjection(this.projection);
// this.initMap();
},
watch:{
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 = ""
}
},
'searchFields.type': function(val) {
if (val == 1 || val == 2 || val == 3 || val == 5 || val == 6 || val == 7) {
getparameteritem('maintainContent_' + val).then(res => {
for (var m of res.detail) {
this.allmaintaninList.push(m)
}
})
} else {
this.allmaintaninList = [{
id: "",
value: "所有"
}]
}
},
},
methods: {
showMaps(){
this.$nextTick(function () {
this.initMap();
})
},
initMap() {
let map = new Map({
target: "olMap",
view: new View({
center: this.mapConfigs.MAP_center, //
zoom: this.mapConfigs.Map_Zooms[0], //
maxZoom:this.mapConfigs.Map_Zooms[1],
minZoom:this.mapConfigs.Map_Zooms[2],
projection: this.projection,
}),
layers:[],
// interactions: defaultControls({
// doubleClickZoom: false,
// }),
});
this.map = map;
//
let url = "http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}";
url = `${url}&T=vec_c&tk=82526d64e8504a0341f775c087863825`;
let tdtLayer = new TileLayer({
title: "天地图",
id: "M2",
type: "overlay",
visible: true,
layerType: "TD地图",
opacity: 1,
source: new XYZ({
crossOrigin:'anonymous',
url: url,
projection:"EPSG:4326"
})
});
this.map.addLayer(tdtLayer);
this.ShowLayers()
this.setMarker()
this.addOverlay()
this.singleclick()
// this.map.layer2.setVisible(false)
},
//
ShowLayers() {
for (var i = 0; i < this.configs.length; i++) {
var result = this.configs[i];
if (result.layerType == "GIS地图") {
let projection = getprojection(result.projection);
let origin = [-400.0, 399.9999999999998];
let resolutions = [0.0027465820824835565,0.0013732910412417782,6.866455206208891E-4,3.4332276031044456E-4,1.7166138015522228E-4,8.583069007761114E-5,4.291534503880557E-5,2.1457672519402785E-5,1.0728836259701392E-5];
let fullExtent = [118.63622216442072, 30.12564516975147, 122.81217622965288, 32.74305227616479];
let tileGrid = new tilegrid({
tileSize: 256,
origin: origin,
extent: fullExtent,
resolutions: resolutions
});
let layer = new TileLayer({
title: result.title,
id: result.id,
type: result.type,
visible: result.visible,
layerType: result.layerType,
opacity: result.opacity,
source: new XYZ({
tileGrid: tileGrid,
url: result.url,
projection: projection
})
})
this.map.addLayer(layer);
}else {
let layer = new TileLayer({
title: result.title,
id: result.id,
type: result.type,
visible: result.visible,
layerType: result.layerType,
opacity: result.opacity,
source: new TileArcGISRest({
url: result.url,
projection: result.projection
}),
});
this.map.addLayer(layer);
}
}
},
//
setMarker() {
//
this.flagLayer = new VectorLayer({
source: new VectorSource()
});
//
this.map.addLayer(this.flagLayer);
// feature
for (let i = 0; i < this.pointArr.length; i++) {
// featurefeature
let feature = new Feature({
geometry: new Point([this.pointArr[i][0], this.pointArr[i][1]])
});
//
feature.set('address',this.pointArr[i][2])
feature.set('types',this.pointArr[i][4])
// ID
feature.setId(this.pointArr[i][3])
feature.setStyle(
new Style({
image: new sCircle({
fill: new Fill({
color: '#0f9b0f',
}),
radius: 6,
}),
})
);
this.featuresArr.push(feature);
} // for
this.flagLayer.getSource().addFeatures(this.featuresArr);
},
addOverlay() {
// Overlay
let elPopup = this.$refs.popup;
this.popup = new Overlay({
element: elPopup,
positioning: "bottom-center",
stopEvent: false,
offset: [0, -20],
});
this.map.addOverlay(this.popup);
},
singleclick() {
//
this.map.on("singleclick", (e) => {
//
let feature = this.map.forEachFeatureAtPixel(
e.pixel,
(feature) => feature
);
if (feature) {
this.shopPopup = true;
//
let coordinates = feature.getGeometry().getCoordinates();
this.nowAddress = feature.get('address');
this.nowId = feature.getId()
this.types = feature.get('types');
this.popup.setPosition(coordinates);
} else {
this.shopPopup = false;
}
});
},
showInfo(id,type){
//
if (type == 1 || type == 2 || type == 6 || type == 7 || type == 5) {
this.$refs.showCirculationInfo.isShow = true
this.$refs.showCirculationInfo.infoId = id
this.$refs.showCirculationInfo.formType = "showform"
this.$refs.showCirculationInfo.getInfo(id)
} else if (type == 3) {
this.$refs.showDischargeInfo.isShow = true
this.$refs.showDischargeInfo.infoId = id
this.$refs.showDischargeInfo.formType = "showform"
this.$refs.showDischargeInfo.getInfo(id)
} else if (type == 4) {
this.$refs.showMireInfo.isShow = true
this.$refs.showMireInfo.infoId = id
this.$refs.showMireInfo.formType = "showform"
this.$refs.showMireInfo.getInfo(id)
}
},
changeMap(val){
for(var m of this.mapRadioList){
if(m.id==val){
console.log("val",val)
this.checkLayers(val,true)
}else{
this.checkLayers(m.id,false)
}
}
},
changeCheck(val){
if(val.length==0){
for(var m of this.mapCheckList){
this.checkLayers(m.id,false)
}
}else if(val.length==this.mapCheckList.length){
console.log(val)
for(var m of this.mapCheckList){
this.checkLayers(m.id,true)
}
}else{
for(var m of this.mapCheckList){
if(m.id==val[0]){
this.checkLayers(m.id,true)
}else{
this.checkLayers(m.id,false)
}
}
}
},
//
checkLayers(id, bool) {
let layers = this.map.getLayers().getArray();
for (let i = 0; i < layers.length; i++) {
if (layers[i].get("id") == id) {
if (bool) {
console.log(id)
layers[i].setVisible(true);
}else{
layers[i].setVisible(false);
}
}
}
},
loadMap(){
this.$emit('loadMap',this.searchFields)
},
resetPointArr(){
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 = []
}
}
},
};
</script>
<style lang="scss" scoped>
.chooseMap{
position: absolute;
margin: 15px 20px;
// width: 350px;
background-color: #fff;
border-radius: 4px;
border: 0.8px solid hsla(0,0%,60%,.2);
z-index:99;
top: 0;
right: 0;
line-height: 40px;
// text-align: center;
padding:0 40px 0 20px;
}
.map {
width: 100vw;
height: 100vh;
}
.popup {
width: 200px;
background-color: white;
padding: 18px;
border-radius: 10px;
box-shadow: 0 0 15px rgb(177, 177, 177);
.info {
font-size: 14px;
text-align: left;
ul {
padding-left: 0;
}
.showinfo{
color:red;
cursor: pointer;
}
}
}
.common-dialog{
margin:0!important;
.el-dialog__header{
padding-top:0;
button{
height: 28px;
padding: 0 20px;
line-height: 28px;
margin-left: 10px;
}
}
}
</style>

@ -45,7 +45,8 @@
<Button type="primary" @click="load(false)" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
<Button type="primary" @click="review()" style="margin-left: 10px">批量复核</Button>
<Button type="primary" @click="exportExcel()" style="margin-left: 10px">导出</Button>
<Button type="primary" @click="exportExcel()" style="margin-left: 10px">导出</Button>
<Button type="primary" @click="showMap()" style="margin-left: 10px">地图</Button>
</div>
</slot>
</LxHeader>
@ -139,7 +140,8 @@
<el-button type="primary" v-preventReClick @click="submitRainType()"></el-button>
</div>
</el-dialog>
<!-- 地图 -->
<maps ref="maps" @loadMap="loadMap"></maps>
<el-dialog class="common-dialog" title="批量复核" :visible.sync="reviewFormVisible" width="40%">
<div class="dialogConcent">
@ -181,7 +183,9 @@
<!-- 查看 审核 办结 -->
<showCirculationInfo ref="showCirculationInfo" @auditSuccess="load"></showCirculationInfo>
<showDischargeInfo ref="showDischargeInfo" @auditSuccess="load"></showDischargeInfo>
<showMireInfo ref="showMireInfo" @auditSuccess="load"></showMireInfo>
<showMireInfo ref="showMireInfo" @auditSuccess="load"></showMireInfo>
</div>
</div>
@ -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

Loading…
Cancel
Save