江河点位修正

This commit is contained in:
weicw
2022-02-07 11:58:36 +08:00
parent 53db46f90a
commit 98511f212a
7 changed files with 1745 additions and 1298 deletions

View File

@@ -36,6 +36,8 @@ const river = function (data) { // 江河水质数据查询
return axios.post("/water/visualiz/river", data)
}
const waterStation = function (data) { // 水站数据查询
return axios.post("/water/visualiz/waterStation", data)
}
@@ -52,6 +54,10 @@ const waterVillage = function (data) { // 农村
return axios.post("/drinkingWaterVillage/drinkingWaterVillage/villageGis", data)
}
const updateRiverCorrectLocation = function (data) { // 江河水质数据查询
return axios.post("/water/visualiz/updatePointLocation", data)
}
export {
getLakePlace,
getAirGis,
@@ -64,5 +70,6 @@ export {
waterStation,
waterCity,
waterCounty,
waterVillage
waterVillage,
updateRiverCorrectLocation
}

View File

@@ -235,6 +235,8 @@ export default {
{title: "路宽", dataIndex: "roadWidth", sorter: true,},
{title: "测点经度", dataIndex: "placeLng", sorter: true,},
{title: "测点纬度", dataIndex: "placeLat", sorter: true,},
{title: "修正经度", dataIndex: "correctLng"},
{title: "修正纬度", dataIndex: "correctLat"},
{
title: "操作",
key: "action",

View File

@@ -30,7 +30,7 @@
<a-select style="width: 200px;" v-if="currentRequestCata == '1'" @change="changeText" name="waterCate"
:default-value="currentCate">
<a-select-option v-for="(item,index) in waterCate" :key="index">
<a-select-option :value="item" v-for="(item,index) in waterCate" :key="index">
{{ item }}
</a-select-option>
</a-select>
@@ -43,11 +43,17 @@
<mapNominal :param="nominalList"></mapNominal>
<!-- <map-table-center :rowData="pointData"></map-table-center>-->
<map-table :columns="columns" :rowData="pointData"></map-table>
<a-modal @ok="updateCorrectLocation" :closable="false" :destroy-on-close="true" :width="1000" :body-style="{height:'700px'}"
v-model:visible="visibleRoadMap" :title="roadMapTitle"
>
<div style="width: 100%;height: 100%;" ref="roadMap" id="roadMap"></div>
</a-modal>
</div>
</template>
<script>
import {
river, national, waterStation, autonomous
river, national, waterStation, autonomous,updateRiverCorrectLocation
} from "@/api/gis/gisApi";
import {
getColumnOptions,
@@ -160,6 +166,10 @@ export default {
"common": "劣Ⅴ",
"desc": "劣五类"
}],
// 字典表单
visibleRoadMap: false,
roadMapTitle: "选择坐标",
form: {},
};
},
mounted() {
@@ -172,7 +182,7 @@ export default {
that.requestFun()
},
changeText: function (e) {
that.currentCate = that.waterCate[e]
that.currentCate = e
that.requestFun()
},
changeCate: function (e) {
@@ -317,6 +327,13 @@ export default {
that.currentY = 0
that.tipFlag = false
}, true)
myCompOverlay.addEventListener('contextmenu',function (e){
console.log("右键")
let currentId = e.target.getAttribute("id")
const {longitude, latitude, correctLng, correctLat,pointDictId} = that.pointData[currentId.substring(2, currentId.length)]
that.form = {longitude, latitude, correctLng, correctLat,pointDictId}
that.showRoadMap(that.form);
})
})
},
whereChange(e) {
@@ -385,6 +402,87 @@ export default {
}
})
}
},
showRoadMap(form) {
const {longitude, latitude, correctLng, correctLat} = form
this.visibleRoadMap = true
// this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BMap.Map(this.$refs.roadMap); // 创建Map实例
// eslint-disable-next-line no-undef
map.addControl(new BMap.NavigationControl()); //初始化地图控件
// eslint-disable-next-line no-undef
map.addControl(new BMap.ScaleControl());
// eslint-disable-next-line no-undef
map.addControl(new BMap.OverviewMapControl());
// eslint-disable-next-line no-undef
var point = new BMap.Point(correctLng ? correctLng : longitude ? longitude : 108.33, correctLat ? correctLat : latitude ? latitude : 22.84);
// var point = new BBMap.Point(form.longitude ? form.longitude : 108.33, form.latitude ? form.latitude : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
// eslint-disable-next-line no-undef
var marker = new BMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
// eslint-disable-next-line no-undef
var gc = new BMap.Geocoder();//地址解析类
//添加标记拖拽监听
marker.addEventListener("dragend", (e) => {
//获取地址信息
this.form['correctLng'] = e.point.lng
this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
//添加标记点击监听
marker.addEventListener("click", function (e) {
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
function showLocationInfo(pt, rs) {
var opts = {
width: 250, //信息窗口宽度
height: 100, //信息窗口高度
title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;
// eslint-disable-next-line no-undef
var infoWindow = new BMap.InfoWindow(addr, opts); //创建信息窗口对象
marker.openInfoWindow(infoWindow);
}
})
},
updateCorrectLocation(){
const {correctLng, correctLat,pointDictId} = that.form;
const reqData = {correctLng, correctLat,id:pointDictId};
if(this.currentRequestCata == "0"){
reqData.type = "river"
}else if(this.currentRequestCata == "1"){
if(this.currentCate == "国家水功能区"){
reqData.type = "national"
}else{
reqData.type = "auto"
}
}else{
reqData.type = "water"
}
updateRiverCorrectLocation(reqData).then(res=>{
if(res.data.code == 0){
this.requestFun()
}
})
}
}
}

View File

@@ -21,7 +21,8 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置
</a-button>
</a-space>
</a-col>
</a-row>
@@ -44,7 +45,7 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="新年份" name="nYear">
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050"/>
</a-form-item>
</a-form>
</a-modal>
@@ -64,58 +65,76 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="年份" name="year">
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
<a-input-number v-model:value="form.year" :min="1970" :max="2050"/>
</a-form-item>
<a-form-item label="水系" name="riverSystem">
<a-input v-model:value="form.riverSystem" placeholder="请输入水系" allow-clear />
<a-input v-model:value="form.riverSystem" placeholder="请输入水系" allow-clear/>
</a-form-item>
<a-form-item label="河流、湖库名称" name="riverLakeLibrary">
<a-input v-model:value="form.riverLakeLibrary" placeholder="请输入河流、湖库名称" allow-clear />
<a-input v-model:value="form.riverLakeLibrary" placeholder="请输入河流、湖库名称" allow-clear/>
</a-form-item>
<a-form-item label="所在地级行政区" name="cityRegionName">
<a-input v-model:value="form.cityRegionName" placeholder="请输入所在地级行政区" allow-clear />
<a-input v-model:value="form.cityRegionName" placeholder="请输入所在地级行政区" allow-clear/>
</a-form-item>
<a-form-item label="国家重要水功能区索引码" name="waterFunctionalIndexCode">
<a-input v-model:value="form.waterFunctionalIndexCode" placeholder="请输入国家重要水功能区索引码" allow-clear />
<a-input v-model:value="form.waterFunctionalIndexCode" placeholder="请输入国家重要水功能区索引码" allow-clear/>
</a-form-item>
<a-form-item label="水功能区类型" name="waterFunctionalAreaType">
<a-input v-model:value="form.waterFunctionalAreaType" placeholder="请输入水功能区类型" allow-clear />
<a-input v-model:value="form.waterFunctionalAreaType" placeholder="请输入水功能区类型" allow-clear/>
</a-form-item>
<a-form-item label="水体类型" name="waterBodyType">
<a-input v-model:value="form.waterBodyType" placeholder="请输入水体类型" allow-clear />
<a-input v-model:value="form.waterBodyType" placeholder="请输入水体类型" allow-clear/>
</a-form-item>
<a-form-item label="省级行政区名称" name="provinceRegionName">
<a-input v-model:value="form.provinceRegionName" placeholder="请输入省级行政区名称" allow-clear />
<a-input v-model:value="form.provinceRegionName" placeholder="请输入省级行政区名称" allow-clear/>
</a-form-item>
<!-- -->
<a-form-item label="水资源一级区名称" name="waterResourcesFirstLevelZoneName">
<a-input v-model:value="form.waterResourcesFirstLevelZoneName" placeholder="请输入水资源一级区名称" allow-clear />
<a-input v-model:value="form.waterResourcesFirstLevelZoneName" placeholder="请输入水资源一级区名称" allow-clear/>
</a-form-item>
<a-form-item label="一级水功能区名称" name="firstLevelWaterFunctionZoneName">
<a-input v-model:value="form.firstLevelWaterFunctionZoneName" placeholder="请输入一级水功能区名称" allow-clear />
<a-input v-model:value="form.firstLevelWaterFunctionZoneName" placeholder="请输入一级水功能区名称" allow-clear/>
</a-form-item>
<a-form-item label="二级水功能区名称" name="secondLevelWaterFunctionZoneName">
<a-input v-model:value="form.secondLevelWaterFunctionZoneName" placeholder="请输入二级水功能区名称" allow-clear />
<a-input v-model:value="form.secondLevelWaterFunctionZoneName" placeholder="请输入二级水功能区名称" allow-clear/>
</a-form-item>
<a-form-item label="水质目标" name="waterQualityGoal">
<a-input v-model:value="form.waterQualityGoal" placeholder="请输入水质目标" allow-clear />
<a-input v-model:value="form.waterQualityGoal" placeholder="请输入水质目标" allow-clear/>
</a-form-item>
<a-form-item label="数据来源" name="dataSources">
<a-input v-model:value="form.dataSources" placeholder="请输入数据来源" allow-clear />
<a-input v-model:value="form.dataSources" placeholder="请输入数据来源" allow-clear/>
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear/>
</a-form-item>
<a-form-item label="经度" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear />
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear/>
</a-form-item>
<a-form-item label="纬度" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear />
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear/>
</a-form-item>
<a-form-item label="修正位置" name="correctLocation">
<a-input-search @search="showRoadMap(form)"
:value="`[${form.correctLng},${form.correctLat}]`"
placeholder="`[${form.longitude},${form.latitude}]`" allow-clear>
<template #enterButton>
<a-button>选择位置</a-button>
</template>
</a-input-search>
</a-form-item>
<a-modal :closable="false" :destroy-on-close="true" :width="1000" :body-style="{height:'700px'}"
v-model:visible="visibleRoadMap" :title="roadMapTitle"
>
<div style="width: 100%;height: 100%;" ref="roadMap" id="roadMap"></div>
<template #footer>
<a-button key="submit" type="primary" @click="visibleRoadMap = false">确定</a-button>
</template>
</a-modal>
<a-form-item label="备注" name="remark">
<a-input v-model:value="form.remark" placeholder="请输入备注" allow-clear />
<a-input v-model:value="form.remark" placeholder="请输入备注" allow-clear/>
</a-form-item>
</a-form>
</a-modal>
@@ -161,7 +180,8 @@
>删除
</a-button>
</a-popconfirm>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出</a-button>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出
</a-button>
</a-space>
</template>
<template #action="{ record }">
@@ -171,7 +191,8 @@
type="primary"
shape="round"
size="small"
>修改</a-button
>修改
</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
@@ -180,7 +201,8 @@
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>删除
</a-button
>
</a-popconfirm>
</a-space>
@@ -294,6 +316,8 @@ export default {
title: "纬度",
dataIndex: "latitude",
},
{title: "修正经度", dataIndex: "correctLng"},
{title: "修正纬度", dataIndex: "correctLat"},
{
title: "备注",
dataIndex: "remark",
@@ -321,21 +345,23 @@ export default {
loading: false,
rules: {
year: [{required: true, message: '请输入年份'}],
waterQualityGoal:[{
required:true,message: "请输入考核目标",
waterQualityGoal: [{
required: true, message: "请输入考核目标",
}]
},
yearOptions: [],
showNYear:false,
showNYear: false,
cYear: undefined,
nYear:undefined,
nYear: undefined,
visibleRoadMap: false,
roadMapTitle: "选择坐标",
};
},
mounted() {
this.getOptions();
},
methods: {
minLeqChange(e){
minLeqChange(e) {
console.log(e)
},
/* 刷新表格 */
@@ -368,7 +394,7 @@ export default {
// }
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
console.log(form,'form');
console.log(form, 'form');
if (form.nationalLevelWaterFunctionAreaPointId) {
updateAqiRelate(form)
.then((res) => {
@@ -440,7 +466,7 @@ export default {
hide();
})
},
getOptions(){
getOptions() {
getColumnOptions("year").then(res => {
console.log(res)
if (res.data.code == 0) {
@@ -453,13 +479,13 @@ export default {
}
})
},
setCYear(e){
setCYear(e) {
this.cYear = e.key;
this.showNYear = true;
},
copyBatch(){
copyBatch() {
const hide = this.$message.loading('请求中..', 0);
copyBatchAqiRelate({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
copyBatchAqiRelate({cyear: Number(this.cYear), nyear: this.nYear}).then(res => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
@@ -474,8 +500,8 @@ export default {
hide();
})
},
exportData(){
const columns = this.columns.filter(item=>item.dataIndex);
exportData() {
const columns = this.columns.filter(item => item.dataIndex);
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
@@ -486,7 +512,67 @@ export default {
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
showRoadMap(form) {
const {longitude, latitude, correctLng, correctLat} = form
this.visibleRoadMap = true
this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BMap.Map(this.$refs.roadMap); // 创建Map实例
// eslint-disable-next-line no-undef
map.addControl(new BMap.NavigationControl()); //初始化地图控件
// eslint-disable-next-line no-undef
map.addControl(new BMap.ScaleControl());
// eslint-disable-next-line no-undef
map.addControl(new BMap.OverviewMapControl());
// eslint-disable-next-line no-undef
var point = new BMap.Point(correctLng ? correctLng : longitude ? longitude : 108.33, correctLat ? correctLat : latitude ? latitude : 22.84);
// var point = new BBMap.Point(form.longitude ? form.longitude : 108.33, form.latitude ? form.latitude : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
// eslint-disable-next-line no-undef
var marker = new BMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
// eslint-disable-next-line no-undef
var gc = new BMap.Geocoder();//地址解析类
//添加标记拖拽监听
marker.addEventListener("dragend", (e) => {
//获取地址信息
this.form['correctLng'] = e.point.lng
this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
//添加标记点击监听
marker.addEventListener("click", function (e) {
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
function showLocationInfo(pt, rs) {
var opts = {
width: 250, //信息窗口宽度
height: 100, //信息窗口高度
title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;
// eslint-disable-next-line no-undef
var infoWindow = new BMap.InfoWindow(addr, opts); //创建信息窗口对象
marker.openInfoWindow(infoWindow);
}
})
},
},

View File

@@ -21,7 +21,8 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置
</a-button>
</a-space>
</a-col>
</a-row>
@@ -44,7 +45,8 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="新年份" name="nYear">
<a-input-number autonomousWaterFunctionAreaPointId="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
<a-input-number autonomousWaterFunctionAreaPointId="inputNumber" v-model:value="nYear" :min="1970"
:max="2050"/>
</a-form-item>
</a-form>
</a-modal>
@@ -64,58 +66,76 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="年份" name="year">
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
<a-input-number v-model:value="form.year" :min="1970" :max="2050"/>
</a-form-item>
<a-form-item label="考核城市" name="assessmentCity">
<a-input v-model:value="form.assessmentCity" placeholder="请输入考核城市" allow-clear />
<a-input v-model:value="form.assessmentCity" placeholder="请输入考核城市" allow-clear/>
</a-form-item>
<a-form-item label="水资源一级区名称" name="waterResourcesFirstLevelZoneName">
<a-input v-model:value="form.waterResourcesFirstLevelZoneName" placeholder="请输入水资源一级区名称" allow-clear />
<a-input v-model:value="form.waterResourcesFirstLevelZoneName" placeholder="请输入水资源一级区名称" allow-clear/>
</a-form-item>
<a-form-item label="水资源二级区名称" name="waterResourcesTwoLevelZoneName" >
<a-input v-model:value="form.waterResourcesTwoLevelZoneName" placeholder="请输入水资源二级区名称" allow-clear />
<a-form-item label="水资源二级区名称" name="waterResourcesTwoLevelZoneName">
<a-input v-model:value="form.waterResourcesTwoLevelZoneName" placeholder="请输入水资源二级区名称" allow-clear/>
</a-form-item>
<a-form-item label="水资源三级区名称" name="waterResourcesThreeLevelZoneName">
<a-input v-model:value="form.waterResourcesThreeLevelZoneName" placeholder="请输入水资源三级区名称" allow-clear />
<a-input v-model:value="form.waterResourcesThreeLevelZoneName" placeholder="请输入水资源三级区名称" allow-clear/>
</a-form-item>
<a-form-item label="河流、湖库名称" name="riverLakeLibrary">
<a-input v-model:value="form.riverLakeLibrary" placeholder="请输入河流、湖库名称" allow-clear />
<a-input v-model:value="form.riverLakeLibrary" placeholder="请输入河流、湖库名称" allow-clear/>
</a-form-item>
<a-form-item label="二级水功能区名称" name="secondLevelWaterFunctionZoneName" >
<a-input v-model:value="form.secondLevelWaterFunctionZoneName" placeholder="请输入二级水功能区名称" allow-clear />
<a-form-item label="二级水功能区名称" name="secondLevelWaterFunctionZoneName">
<a-input v-model:value="form.secondLevelWaterFunctionZoneName" placeholder="请输入二级水功能区名称" allow-clear/>
</a-form-item>
<a-form-item label="水功能区编码" name="waterFunctionalAreaCode">
<a-input v-model:value="form.waterFunctionalAreaCode" placeholder="请输入水功能区编码" allow-clear />
<a-input v-model:value="form.waterFunctionalAreaCode" placeholder="请输入水功能区编码" allow-clear/>
</a-form-item>
<a-form-item label="水功能区等级" name="waterFunctionalAreaLevel">
<a-input v-model:value="form.waterFunctionalAreaLevel" placeholder="请输入水功能区等级" allow-clear />
<a-input v-model:value="form.waterFunctionalAreaLevel" placeholder="请输入水功能区等级" allow-clear/>
</a-form-item>
<a-form-item label="水功能区类型" name="waterFunctionalAreaType">
<a-input v-model:value="form.waterFunctionalAreaType" placeholder="请输入水功能区类型" allow-clear />
<a-input v-model:value="form.waterFunctionalAreaType" placeholder="请输入水功能区类型" allow-clear/>
</a-form-item>
<a-form-item label="水域类型" name="basinType">
<a-input v-model:value="form.basinType" placeholder="请输入水域类型" allow-clear />
<a-input v-model:value="form.basinType" placeholder="请输入水域类型" allow-clear/>
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear/>
</a-form-item>
<a-form-item label="水质目标" name="waterQualityGoal">
<a-input v-model:value="form.waterQualityGoal" placeholder="请输入水质目标" allow-clear />
<a-input v-model:value="form.waterQualityGoal" placeholder="请输入水质目标" allow-clear/>
</a-form-item>
<a-form-item label="河流长度Km" name="riverLength">
<a-input v-model:value="form.riverLength" placeholder="请输入河流长度" allow-clear />
<a-input v-model:value="form.riverLength" placeholder="请输入河流长度" allow-clear/>
</a-form-item>
<a-form-item label="湖泊面积km2" name="lakeArea">
<a-input v-model:value="form.lakeArea" placeholder="请输入湖泊面积km2" allow-clear />
<a-input v-model:value="form.lakeArea" placeholder="请输入湖泊面积km2" allow-clear/>
</a-form-item>
<a-form-item label="经度" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear />
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear/>
</a-form-item>
<a-form-item label="纬度" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear />
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear/>
</a-form-item>
<a-form-item label="修正位置" name="correctLocation">
<a-input-search @search="showRoadMap(form)"
:value="`[${form.correctLng},${form.correctLat}]`"
placeholder="`[${form.longitude},${form.latitude}]`" allow-clear>
<template #enterButton>
<a-button>选择位置</a-button>
</template>
</a-input-search>
</a-form-item>
<a-modal :closable="false" :destroy-on-close="true" :width="1000" :body-style="{height:'700px'}"
v-model:visible="visibleRoadMap" :title="roadMapTitle"
>
<div style="width: 100%;height: 100%;" ref="roadMap" id="roadMap"></div>
<template #footer>
<a-button key="submit" type="primary" @click="visibleRoadMap = false">确定</a-button>
</template>
</a-modal>
<a-form-item label="备注" name="remark">
<a-input
v-model:value="form.remark"
@@ -123,9 +143,9 @@
allow-clear
/>
</a-form-item>
<!-- <a-form-item label="排序" name="sortNumber">-->
<!-- <a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="排序" name="sortNumber">-->
<!-- <a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />-->
<!-- </a-form-item>-->
</a-form>
</a-modal>
<!-- 表格 -->
@@ -170,7 +190,8 @@
>删除
</a-button>
</a-popconfirm>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出</a-button>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出
</a-button>
</a-space>
</template>
<template #action="{ record }">
@@ -180,7 +201,8 @@
type="primary"
shape="round"
size="small"
>修改</a-button
>修改
</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
@@ -189,7 +211,8 @@
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>删除
</a-button
>
</a-popconfirm>
</a-space>
@@ -226,7 +249,7 @@ export default {
selection: [],
// 表格列配置
columns: [
{title: "年份", dataIndex: "year",sorter: true,},
{title: "年份", dataIndex: "year", sorter: true,},
{
title: "考核城市",
dataIndex: "assessmentCity",
@@ -294,6 +317,8 @@ export default {
title: "纬度",
dataIndex: "latitude",
},
{title: "修正经度", dataIndex: "correctLng"},
{title: "修正纬度", dataIndex: "correctLat"},
{
title: "备注",
dataIndex: "remark",
@@ -321,21 +346,23 @@ export default {
loading: false,
rules: {
year: [{required: true, message: '请输入年份'}],
waterQualityGoal:[{
required:true,message: "请输入考核目标",
waterQualityGoal: [{
required: true, message: "请输入考核目标",
}]
},
yearOptions: [],
showNYear:false,
showNYear: false,
cYear: undefined,
nYear:undefined,
nYear: undefined,
visibleRoadMap: false,
roadMapTitle: "选择坐标",
};
},
mounted() {
this.getOptions();
},
methods: {
minLeqChange(e){
minLeqChange(e) {
console.log(e)
},
/* 刷新表格 */
@@ -439,7 +466,7 @@ export default {
hide();
})
},
getOptions(){
getOptions() {
getColumnOptions("year").then(res => {
console.log(res)
if (res.data.code == 0) {
@@ -452,13 +479,13 @@ export default {
}
})
},
setCYear(e){
setCYear(e) {
this.cYear = e.key;
this.showNYear = true;
},
copyBatch(){
copyBatch() {
const hide = this.$message.loading('请求中..', 0);
copyBatchStandard({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
copyBatchStandard({cyear: Number(this.cYear), nyear: this.nYear}).then(res => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
@@ -473,8 +500,8 @@ export default {
hide();
})
},
exportData(){
const columns = this.columns.filter(item=>item.dataIndex);
exportData() {
const columns = this.columns.filter(item => item.dataIndex);
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
@@ -485,7 +512,67 @@ export default {
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
showRoadMap(form) {
const {longitude, latitude, correctLng, correctLat} = form
this.visibleRoadMap = true
this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BMap.Map(this.$refs.roadMap); // 创建Map实例
// eslint-disable-next-line no-undef
map.addControl(new BMap.NavigationControl()); //初始化地图控件
// eslint-disable-next-line no-undef
map.addControl(new BMap.ScaleControl());
// eslint-disable-next-line no-undef
map.addControl(new BMap.OverviewMapControl());
// eslint-disable-next-line no-undef
var point = new BMap.Point(correctLng ? correctLng : longitude ? longitude : 108.33, correctLat ? correctLat : latitude ? latitude : 22.84);
// var point = new BBMap.Point(form.longitude ? form.longitude : 108.33, form.latitude ? form.latitude : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
// eslint-disable-next-line no-undef
var marker = new BMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
// eslint-disable-next-line no-undef
var gc = new BMap.Geocoder();//地址解析类
//添加标记拖拽监听
marker.addEventListener("dragend", (e) => {
//获取地址信息
this.form['correctLng'] = e.point.lng
this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
//添加标记点击监听
marker.addEventListener("click", function (e) {
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
function showLocationInfo(pt, rs) {
var opts = {
width: 250, //信息窗口宽度
height: 100, //信息窗口高度
title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;
// eslint-disable-next-line no-undef
var infoWindow = new BMap.InfoWindow(addr, opts); //创建信息窗口对象
marker.openInfoWindow(infoWindow);
}
})
},
},

View File

@@ -104,6 +104,23 @@
<a-form-item label="纬度" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear />
</a-form-item>
<a-form-item label="修正位置" name="correctLocation">
<a-input-search @search="showRoadMap(form)"
:value="`[${form.correctLng},${form.correctLat}]`" placeholder="`[${form.longitude},${form.latitude}]`" allow-clear>
<template #enterButton>
<a-button>选择位置</a-button>
</template>
</a-input-search>
</a-form-item>
<a-modal :closable="false" :destroy-on-close="true" :width="1000" :body-style="{height:'700px'}"
v-model:visible="visibleRoadMap" :title="roadMapTitle"
>
<div style="width: 100%;height: 100%;" ref="roadMap" id="roadMap"></div>
<template #footer>
<a-button key="submit" type="primary" @click="visibleRoadMap = false">确定</a-button>
</template>
</a-modal>
<a-form-item label="序号" name="seq">
<a-input v-model:value="form.seq" placeholder="请输入序号" allow-clear />
</a-form-item>
@@ -263,6 +280,8 @@
title: "纬度",
dataIndex: "latitude",
},
{title: "修正经度", dataIndex: "correctLng"},
{title: "修正纬度", dataIndex: "correctLat"},
{
title: "序号",
dataIndex: "seq",
@@ -310,6 +329,8 @@
showNYear: false,
cYear: undefined,
nYear: undefined,
visibleRoadMap: false,
roadMapTitle: "选择坐标",
};
},
mounted() {
@@ -462,7 +483,67 @@
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
showRoadMap(form) {
const {longitude,latitude,correctLng,correctLat} = form
this.visibleRoadMap = true
this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BMap.Map(this.$refs.roadMap); // 创建Map实例
// eslint-disable-next-line no-undef
map.addControl(new BMap.NavigationControl()); //初始化地图控件
// eslint-disable-next-line no-undef
map.addControl(new BMap.ScaleControl());
// eslint-disable-next-line no-undef
map.addControl(new BMap.OverviewMapControl());
// eslint-disable-next-line no-undef
var point = new BMap.Point(correctLng?correctLng:longitude?longitude:108.33,correctLat?correctLat:latitude?latitude:22.84);
// var point = new BBMap.Point(form.longitude ? form.longitude : 108.33, form.latitude ? form.latitude : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
// eslint-disable-next-line no-undef
var marker = new BMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
// eslint-disable-next-line no-undef
var gc = new BMap.Geocoder();//地址解析类
//添加标记拖拽监听
marker.addEventListener("dragend", (e) => {
//获取地址信息
this.form['correctLng'] = e.point.lng
this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
//添加标记点击监听
marker.addEventListener("click", function (e) {
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
function showLocationInfo(pt, rs) {
var opts = {
width: 250, //信息窗口宽度
height: 100, //信息窗口高度
title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;
// eslint-disable-next-line no-undef
var infoWindow = new BMap.InfoWindow(addr, opts); //创建信息窗口对象
marker.openInfoWindow(infoWindow);
}
})
},
},
};

View File

@@ -21,7 +21,8 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置</a-button>
<a-button @click="reset" style="background: #FFA200FF; border-color: #FFA200FF;color: #FFFFFF">重置
</a-button>
</a-space>
</a-col>
</a-row>
@@ -44,7 +45,7 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="新年份" name="nYear">
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050"/>
</a-form-item>
</a-form>
</a-modal>
@@ -64,13 +65,13 @@
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="年份" name="year">
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
<a-input-number v-model:value="form.year" :min="1970" :max="2050"/>
</a-form-item>
<a-form-item label="所在河流名称" name="riverName">
<a-input v-model:value="form.riverName" placeholder="请输入所在河流名称" allow-clear />
<a-input v-model:value="form.riverName" placeholder="请输入所在河流名称" allow-clear/>
</a-form-item>
<a-form-item label="自动站名称" name="stationName">
<a-input v-model:value="form.stationName" placeholder="请输入自动站名称" allow-clear />
<a-input v-model:value="form.stationName" placeholder="请输入自动站名称" allow-clear/>
</a-form-item>
<a-form-item label="所属系统" name="system">
<a-select v-model:value="form.system" allowClear placeholder="未选择">
@@ -79,14 +80,32 @@
</a-select>
</a-form-item>
<a-form-item label="水质目标" name="waterTarget">
<a-input v-model:value="form.waterTarget" placeholder="请输入水质目标" allow-clear />
<a-input v-model:value="form.waterTarget" placeholder="请输入水质目标" allow-clear/>
</a-form-item>
<a-form-item label="经度" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear />
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear/>
</a-form-item>
<a-form-item label="纬度" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear />
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear/>
</a-form-item>
<a-form-item label="修正位置" name="correctLocation">
<a-input-search @search="showRoadMap(form)"
:value="`[${form.correctLng},${form.correctLat}]`"
placeholder="`[${form.longitude},${form.latitude}]`" allow-clear>
<template #enterButton>
<a-button>选择位置</a-button>
</template>
</a-input-search>
</a-form-item>
<a-modal :closable="false" :destroy-on-close="true" :width="1000" :body-style="{height:'700px'}"
v-model:visible="visibleRoadMap" :title="roadMapTitle"
>
<div style="width: 100%;height: 100%;" ref="roadMap" id="roadMap"></div>
<template #footer>
<a-button key="submit" type="primary" @click="visibleRoadMap = false">确定</a-button>
</template>
</a-modal>
</a-form>
</a-modal>
<!-- 表格 -->
@@ -131,7 +150,8 @@
>删除
</a-button>
</a-popconfirm>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出</a-button>
<a-button @click="exportData" style="background: #2FA524FF; border-color: #2FA524FF;color: #FFFFFF">导出
</a-button>
</a-space>
</template>
<template #action="{ record }">
@@ -141,7 +161,8 @@
type="primary"
shape="round"
size="small"
>修改</a-button
>修改
</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
@@ -150,7 +171,8 @@
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>删除
</a-button
>
</a-popconfirm>
</a-space>
@@ -186,10 +208,10 @@ export default {
selection: [],
// 表格列配置
columns: [
{title: "年份", dataIndex: "year",sorter: true,},
{title: "所在河流名称",dataIndex: "riverName",sorter: true,},
{title: "自动站名称",dataIndex: "stationName",sorter: true,},
{title: "所属系统",dataIndex: "system",sorter: true,customRender:({text})=> text == "1"?"国家水站":"广西水系统"},
{title: "年份", dataIndex: "year", sorter: true,},
{title: "所在河流名称", dataIndex: "riverName", sorter: true,},
{title: "自动站名称", dataIndex: "stationName", sorter: true,},
{title: "所属系统", dataIndex: "system", sorter: true, customRender: ({text}) => text == "1" ? "国家水站" : "广西水系统"},
{
title: "水质目标",
dataIndex: "waterTarget",
@@ -202,6 +224,8 @@ export default {
title: "纬度",
dataIndex: "latitude",
},
{title: "修正经度", dataIndex: "correctLng"},
{title: "修正纬度", dataIndex: "correctLat"},
{
title: "操作",
key: "action",
@@ -225,13 +249,15 @@ export default {
loading: false,
rules: {
year: [{required: true, message: '请输入年份'}],
stationName:[{required: true,message: '请输入自动站名称'}],
system: [{required: true,message: '请输入所属系统',},],
stationName: [{required: true, message: '请输入自动站名称'}],
system: [{required: true, message: '请输入所属系统',},],
},
yearOptions: [],
showNYear:false,
showNYear: false,
cYear: undefined,
nYear:undefined,
nYear: undefined,
visibleRoadMap: false,
roadMapTitle: "选择坐标",
};
},
mounted() {
@@ -263,7 +289,7 @@ export default {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
console.log(form,'form');
console.log(form, 'form');
if (form.waterStationPointId) {
updatePlace(form)
.then((res) => {
@@ -335,7 +361,7 @@ export default {
hide();
})
},
getOptions(){
getOptions() {
getColumnOptions("year").then(res => {
console.log(res)
if (res.data.code == 0) {
@@ -348,13 +374,13 @@ export default {
}
})
},
setCYear(e){
setCYear(e) {
this.cYear = e.key;
this.showNYear = true;
},
copyBatch(){
copyBatch() {
const hide = this.$message.loading('请求中..', 0);
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
copyBatchPlace({cyear: Number(this.cYear), nyear: this.nYear}).then(res => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
@@ -369,8 +395,8 @@ export default {
hide();
})
},
exportData(){
const columns = this.columns.filter(item=>item.dataIndex);
exportData() {
const columns = this.columns.filter(item => item.dataIndex);
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
@@ -381,7 +407,67 @@ export default {
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
},
showRoadMap(form) {
const {longitude, latitude, correctLng, correctLat} = form
this.visibleRoadMap = true
this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BMap.Map(this.$refs.roadMap); // 创建Map实例
// eslint-disable-next-line no-undef
map.addControl(new BMap.NavigationControl()); //初始化地图控件
// eslint-disable-next-line no-undef
map.addControl(new BMap.ScaleControl());
// eslint-disable-next-line no-undef
map.addControl(new BMap.OverviewMapControl());
// eslint-disable-next-line no-undef
var point = new BMap.Point(correctLng ? correctLng : longitude ? longitude : 108.33, correctLat ? correctLat : latitude ? latitude : 22.84);
// var point = new BBMap.Point(form.longitude ? form.longitude : 108.33, form.latitude ? form.latitude : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
// eslint-disable-next-line no-undef
var marker = new BMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
// eslint-disable-next-line no-undef
var gc = new BMap.Geocoder();//地址解析类
//添加标记拖拽监听
marker.addEventListener("dragend", (e) => {
//获取地址信息
this.form['correctLng'] = e.point.lng
this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
//添加标记点击监听
marker.addEventListener("click", function (e) {
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
});
});
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
function showLocationInfo(pt, rs) {
var opts = {
width: 250, //信息窗口宽度
height: 100, //信息窗口高度
title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;
// eslint-disable-next-line no-undef
var infoWindow = new BMap.InfoWindow(addr, opts); //创建信息窗口对象
marker.openInfoWindow(infoWindow);
}
})
},
},
};