|
|
@@ -9,9 +9,9 @@ |
|
|
|
/> |
|
|
|
<div class="search_box"> |
|
|
|
<div class="left"> |
|
|
|
<van-field v-model="value" left-icon="search" placeholder="请输入用户名" /> |
|
|
|
<van-field v-model="keyword" left-icon="search" placeholder="请输入用户名" /> |
|
|
|
</div> |
|
|
|
<van-button type="primary" round >搜索</van-button> |
|
|
|
<van-button type="primary" round @click="searchMap" >搜索</van-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="location" :id="locationMap"> |
|
|
@@ -80,24 +80,16 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { listLand, listLandQuery,getLand, getLandDetail, getLandDetailByDkbm, delLand, addLand, updateLand, printLand } from "@/api/resource/land" |
|
|
|
import { getOperationDetailByDkbm } from "@/api/resource/operation" |
|
|
|
import { areaSavePri, cleanSavePri } from "@/api/gis/map" |
|
|
|
import { getToken } from "@/utils/auth" |
|
|
|
import Treeselect from "@riophae/vue-treeselect"; |
|
|
|
import { Splitpanes, Pane } from "splitpanes" |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css" |
|
|
|
import "splitpanes/dist/splitpanes.css" |
|
|
|
import { deptTreeSelect } from "@/api/system/user" |
|
|
|
import { listLandQuery, getLandDetailByDkbm } from "@/api/resource/land" |
|
|
|
import {getConfigKey} from "@/api/system/config"; |
|
|
|
import {getDept,getInfoByImportCode} from "@/api/system/dept"; |
|
|
|
import {getDept} from "@/api/system/dept"; |
|
|
|
import {Toast} from "vant"; |
|
|
|
import $ from "jquery"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
name: "contractedVillageContractor", |
|
|
|
components: { Treeselect, Splitpanes, Pane}, |
|
|
|
name: "appMap", |
|
|
|
components: { }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
baseRoutingUrll:'/api', |
|
|
@@ -139,7 +131,9 @@ |
|
|
|
value:'', |
|
|
|
deptId:100, |
|
|
|
importCode:'', |
|
|
|
keyword:'', |
|
|
|
locationMap: this.guidProduct(), |
|
|
|
selectedHomesteadLayer: "", |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
@@ -158,6 +152,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
console.log(this.$store.getters) |
|
|
|
console.log(this.$store.getters.user.user.dept.deptId) |
|
|
|
this.deptId = this.$store.getters.user.user.dept.deptId; |
|
|
|
this.importCode = this.$store.getters.user.user.dept.importCode; |
|
|
@@ -364,6 +359,7 @@ |
|
|
|
fetch(url) |
|
|
|
.then(response => response.json()) |
|
|
|
.then(data => { |
|
|
|
|
|
|
|
if (data.features.length > 0) { |
|
|
|
let id = data.features[0].properties.DKBM; |
|
|
|
getLandDetailByDkbm(id).then(response => { |
|
|
@@ -372,6 +368,29 @@ |
|
|
|
this.open = true; |
|
|
|
}, 500); |
|
|
|
}); |
|
|
|
if (this.selectedHomesteadLayer) { |
|
|
|
this.map.removeLayer(this.selectedHomesteadLayer); |
|
|
|
this.selectedHomesteadLayer = ""; |
|
|
|
} |
|
|
|
this.selectedHomesteadLayer = new ol.layer.Vector({ |
|
|
|
source: new ol.source.Vector({ |
|
|
|
features: new ol.format.GeoJSON().readFeatures(data) |
|
|
|
}), |
|
|
|
name: 'selectedHomesteadLayer', |
|
|
|
style: new ol.style.Style({ |
|
|
|
fill: new ol.style.Fill({ |
|
|
|
//矢量图层填充颜色,以及透明度 |
|
|
|
color: "rgba(255,224,0,0.3)", |
|
|
|
}), |
|
|
|
stroke: new ol.style.Stroke({ |
|
|
|
//边界样式 |
|
|
|
color: "#ffd154", |
|
|
|
width: 3, |
|
|
|
}), |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.map.addLayer(this.selectedHomesteadLayer); |
|
|
|
this.map.getLayers().insertAt(4, this.selectedHomesteadLayer); |
|
|
|
// getLandDetail(id).then(response => { |
|
|
|
// // this.form = response.data; |
|
|
|
// getLandDetailByDkbm(response.data.dkbm).then(res => { |
|
|
@@ -420,22 +439,6 @@ |
|
|
|
console.log('当前选择定位超时: ' + timeout); |
|
|
|
return timeout; |
|
|
|
}, |
|
|
|
getDeptLocation(callback) { |
|
|
|
getQueryLand().then((response) => { |
|
|
|
if (response.code == 200) { |
|
|
|
let InsertCode = response.data; |
|
|
|
if (InsertCode != null) { |
|
|
|
var lat = InsertCode.lat; |
|
|
|
var lng = InsertCode.lng; |
|
|
|
if(lat !=null && lng !=null && lat !="" && lng !=""){ |
|
|
|
callback(response); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.getCurrentLocation(callback); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getCurrentLocation(callback) { |
|
|
|
// 1. 首先尝试Android宿主端 |
|
|
|
if(this.isAndroid) // Android层注入全局对象 |
|
|
@@ -530,117 +533,6 @@ |
|
|
|
}); |
|
|
|
this.map.getLayers().insertAt(2, this.mapBorder); |
|
|
|
}, |
|
|
|
saveLand() { |
|
|
|
this.$refs.landForm.validate().then(() => { |
|
|
|
if (this.form.id) { |
|
|
|
this.showSaveBtn = false; |
|
|
|
updateDk(this.form).then(response => { |
|
|
|
if (response.code == 200) { |
|
|
|
this.$toast({ |
|
|
|
icon: 'success', |
|
|
|
message: '保存成功', |
|
|
|
duration:"1000", |
|
|
|
onClose: () => { |
|
|
|
this.open = false; |
|
|
|
this.showSaveBtn = true; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.form.deptId = this.deptId; |
|
|
|
this.showSaveBtn = false; |
|
|
|
addDk(this.form).then(response => { |
|
|
|
if (response.code == 200) { |
|
|
|
this.$toast({ |
|
|
|
icon: 'success', |
|
|
|
message: '保存成功', |
|
|
|
duration:"1000", |
|
|
|
onClose: () => { |
|
|
|
this.open = false; |
|
|
|
this.showSaveBtn = true; |
|
|
|
// 移除矢量图层 |
|
|
|
this.map.removeLayer(this.vectorLayer); |
|
|
|
this.vectorLayer = ""; |
|
|
|
// 移除地块图层重新加载 |
|
|
|
this.map.removeLayer(this.landLayer); |
|
|
|
this.landLayer = ""; |
|
|
|
this.addLandLayer(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$notify({ type: 'danger', message: '请填写完整的表单项' }); |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteLand(id) { |
|
|
|
this.$dialog.confirm({ |
|
|
|
message: '是否确认删除此地块?', |
|
|
|
}).then(() => { |
|
|
|
// on confirm |
|
|
|
this.showDeleteBtn = false; |
|
|
|
deleteDk(id).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$toast({ |
|
|
|
icon: 'success', |
|
|
|
message: '删除成功', |
|
|
|
duration: "1000", |
|
|
|
onClose: () => { |
|
|
|
this.open = false; |
|
|
|
this.showDeleteBtn = true; |
|
|
|
// 移除地块图层重新加载 |
|
|
|
this.map.removeLayer(this.landLayer); |
|
|
|
this.landLayer = ""; |
|
|
|
this.addLandLayer(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}).catch(() => { |
|
|
|
// on cancel |
|
|
|
}); |
|
|
|
}, |
|
|
|
onConfirmOwnershipOptions(value){ |
|
|
|
this.form.syqxz = value.dictValue; |
|
|
|
this.syqxzText = value.dictLabel; |
|
|
|
this.showOwnership = false; |
|
|
|
}, |
|
|
|
onConfirmLandCategoryOptions(value){ |
|
|
|
this.form.dklb = value.dictValue; |
|
|
|
this.dklbText = value.dictLabel; |
|
|
|
this.showLandCategory = false; |
|
|
|
}, |
|
|
|
onConfirmLandTypeOptions(value) { |
|
|
|
this.form.tdlylx = value.dictValue; |
|
|
|
this.tdlylxText = value.dictLabel; |
|
|
|
this.showLandType = false; |
|
|
|
}, |
|
|
|
onConfirmLandGradeOptions(value) { |
|
|
|
this.form.dldj = value.dictValue |
|
|
|
this.dldjText = value.dictLabel; |
|
|
|
this.showLandGrade = false; |
|
|
|
}, |
|
|
|
onConfirmLandPurposeOptions(value){ |
|
|
|
this.form.tdyt = value.dictValue; |
|
|
|
this.tdytText = value.dictLabel; |
|
|
|
this.showLandPurpose = false; |
|
|
|
}, |
|
|
|
generateCode() { |
|
|
|
generateLandCode({deptId: this.deptId}).then(response => { |
|
|
|
this.$set(this.form, 'dkbm', response.data); |
|
|
|
}); |
|
|
|
}, |
|
|
|
closePopup() { |
|
|
|
// 移除矢量图层 |
|
|
|
if (this.vectorLayer) { |
|
|
|
this.map.removeLayer(this.vectorLayer); |
|
|
|
this.vectorLayer = ""; |
|
|
|
} |
|
|
|
this.open = false; |
|
|
|
this.reset(); |
|
|
|
}, |
|
|
|
reset() { |
|
|
|
this.form = { |
|
|
|
deptId: null, |
|
|
@@ -667,17 +559,66 @@ |
|
|
|
this.dldjText = '一等地'; |
|
|
|
this.tdytText = '种植业'; |
|
|
|
}, |
|
|
|
openLandCategoryPopup() { |
|
|
|
// 修改时 && 地块类别为承包地块 不允许打开地块类别弹出层 |
|
|
|
if (this.form.id && this.form.dklb === '10') { |
|
|
|
this.$toast({ |
|
|
|
icon: 'fail', |
|
|
|
message: '当前地块为承包地块,不能更改地块类别', |
|
|
|
duration: '2000' |
|
|
|
}) |
|
|
|
return ; |
|
|
|
// 根据搜索条件查询宅基地 |
|
|
|
searchMap() { |
|
|
|
if (this.keyword) { |
|
|
|
if (this.selectedHomesteadLayer) { |
|
|
|
this.map.removeLayer(this.selectedHomesteadLayer); |
|
|
|
this.selectedHomesteadLayer = ""; |
|
|
|
} |
|
|
|
let map_cql_filter = "DKBM = '" + this.keyword + "'"; |
|
|
|
// 定位查询位置 |
|
|
|
let param_dw = { |
|
|
|
// srsName: "EPSG:3857", |
|
|
|
service: "WFS", |
|
|
|
version: "1.0.0", |
|
|
|
request: "GetFeature", |
|
|
|
typename: this.landLayerName, |
|
|
|
// maxFeatures:1000, |
|
|
|
cql_filter: map_cql_filter, |
|
|
|
outputFormat: "application/json", |
|
|
|
}; |
|
|
|
let url_dw = this.mapGeoServerUrl + "/ows"; //wfsurl; |
|
|
|
url_dw = url_dw + "?"; |
|
|
|
for (let key in param_dw) { |
|
|
|
url_dw = url_dw + key + "=" + param_dw[key] + "&"; |
|
|
|
} |
|
|
|
url_dw = url_dw.substr(0, url_dw.length - 1); |
|
|
|
fetch(url_dw, { |
|
|
|
method: "GET", // *GET, POST, PUT, DELETE, etc. |
|
|
|
}).then((res) => { |
|
|
|
return res.json(); |
|
|
|
}).then((data) => { |
|
|
|
if (data.features.length > 0) { |
|
|
|
this.selectedHomesteadLayer = new ol.layer.Vector({ |
|
|
|
source: new ol.source.Vector({ |
|
|
|
features: new ol.format.GeoJSON().readFeatures(data) |
|
|
|
}), |
|
|
|
name: 'selectedHomesteadLayer', |
|
|
|
style: new ol.style.Style({ |
|
|
|
fill: new ol.style.Fill({ |
|
|
|
//矢量图层填充颜色,以及透明度 |
|
|
|
color: "rgba(255,224,0,0.3)", |
|
|
|
}), |
|
|
|
stroke: new ol.style.Stroke({ |
|
|
|
//边界样式 |
|
|
|
color: "#ffd154", |
|
|
|
width: 3, |
|
|
|
}), |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.map.addLayer(this.selectedHomesteadLayer); |
|
|
|
this.map.getLayers().insertAt(4, this.selectedHomesteadLayer); |
|
|
|
|
|
|
|
let resolution = this.map.getView().getResolutionForExtent(data.bbox, this.map.getSize()); |
|
|
|
this.map.getView().fit(data.bbox); |
|
|
|
this.map.getView().setResolution(resolution); |
|
|
|
// this.map.getView().setZoom(16); |
|
|
|
} else { |
|
|
|
this.msgError("没有搜索到该用户的宅基地") |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
this.showLandCategory = true; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|