庞东旭 il y a 1 semaine
Parent
révision
bacbd14768
4 fichiers modifiés avec 93 ajouts et 31 suppressions
  1. +49
    -0
      src/api/gis/map.js
  2. +8
    -8
      src/api/resource/land.js
  3. +2
    -2
      src/api/system/dept.js
  4. +34
    -21
      src/views/resource/land/index.vue

+ 49
- 0
src/api/gis/map.js Voir le fichier

@@ -0,0 +1,49 @@
import request from '@/utils/request'
// 坐标点 更新 通用
export function pointSave(data) {
return request({
url: '/gis/map/point/do',
method: 'post',
data: data
})
}
// 坐标点 更新 通用 自己指定主键ID
export function pointSavePri(data) {
return request({
url: '/gis/map/point/private/do',
method: 'post',
data: data
})
}
// 多边形面 更新 通用
export function areaSave(data) {
return request({
url: '/gis/map/polygon/do',
method: 'post',
data: data
})
}
// 多边形面 更新 通用 - 自己指定主键ID
export function areaSavePri(data) {
return request({
url: '/gis/map/polygon/private/do',
method: 'post',
data: data
})
}
// 清空 geo 通用
export function cleanSave(data) {
return request({
url: '/gis/map/clean/do',
method: 'post',
data: data
})
}
// 清空 geo 通用 自己指定主键ID
export function cleanSavePri(data) {
return request({
url: '/gis/map/clean/private/do',
method: 'post',
data: data
})
}

+ 8
- 8
src/api/resource/land.js Voir le fichier

@@ -8,6 +8,14 @@ export function listLand(query) {
params: query
})
}
// 查询地块属性列表 ,用于空间字段专属查询,避免敏感泄露
export function listLandQuery(query) {
return request({
url: '/resource/land/query',
method: 'get',
params: query
})
}

// 查询地块属性详细
export function getLand(fid) {
@@ -68,11 +76,3 @@ export function printLand(query) {
params: query
})
}

// 清空空间字段
export function clearTheGeom(fid) {
return request({
url: '/resource/land/clear/' + fid,
method: 'get',
})
}

+ 2
- 2
src/api/system/dept.js Voir le fichier

@@ -25,9 +25,9 @@ export function getDept(deptId) {
})
}
// 查询部门详细
export function getDeptByOrgCode(orgCode) {
export function getInfoByImportCode(importCode) {
return request({
url: '/system/dept/getInfoByCode/' + orgCode,
url: '/system/dept/getInfoByImportCode/' + importCode,
method: 'get'
})
}


+ 34
- 21
src/views/resource/land/index.vue Voir le fichier

@@ -326,7 +326,7 @@

<!-- 地图对话框 -->
<el-dialog :title="title" :visible.sync="openMap" width="1200px" append-to-body>
<el-divider><h3 class="header-anchor">地图信息:绿色地块表示该地块,蓝色表示本账套已标记的其他地块</h3></el-divider>
<el-divider><h3 class="header-anchor">地图信息:绿色地块表示该地块,青色表示本组织已标记的其他地块</h3></el-divider>
<div id="full-screen-acceptance" style="width: 100%;height:65vh;">
<!--<div id="landMapDiv"></div>-->
<div id="mapWrap"></div>
@@ -348,7 +348,8 @@
</template>

<script>
import { listLand, getLand, getLandDetail, getLandDetailByDkbm, delLand, addLand, updateLand, printLand,clearTheGeom } from "@/api/resource/land"
import { listLand, listLandQuery,getLand, getLandDetail, getLandDetailByDkbm, delLand, addLand, updateLand, printLand } from "@/api/resource/land"
import { areaSavePri, cleanSavePri } from "@/api/gis/map"
import { getToken } from "@/utils/auth"
import Treeselect from "@riophae/vue-treeselect";
import { Splitpanes, Pane } from "splitpanes"
@@ -356,7 +357,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import "splitpanes/dist/splitpanes.css"
import { deptTreeSelect } from "@/api/system/user"
import {getConfigKey} from "@/api/system/config";
import {getDept,getDeptByOrgCode} from "@/api/system/dept";
import {getDept,getInfoByImportCode} from "@/api/system/dept";
import MapField from "@/components/house/MapField";
import $ from "jquery";

@@ -764,8 +765,11 @@ export default {
},
// 获取当前部门的位置
getCurrentDeptLocation() {
var id = 100;
getDept(id).then(response => {
var deptId = this.queryParams.deptId;
if(deptId){
deptId = 100;
}
getDept(deptId).then(response => {
let insertCode = response.data;
if (insertCode != null) {
this.tGeoOrganizationLat = insertCode.latitude;
@@ -776,18 +780,21 @@ export default {
/** 地图修改按钮操作 */
handleMap(row) {
this.mapTheGeomId = row;
getDeptByOrgCode(row.importCode).then((res) => {
let insertCode = res.data;
if (insertCode != null) {
this.tGeoOrganizationLat = insertCode.latitude;
this.tGeoOrganizationLng = insertCode.longitude;
}
listLand().then(response => {
this.openMap = true;
this.title = "修改地图";
setTimeout(() => {
this.pointDarw(response.rows);
}, 500);
getLandDetail(row.fid).then((res) => {
getInfoByImportCode(row.importCode).then((res) => {
let insertCode = res.data;
if (insertCode != null) {
this.tGeoOrganizationLat = insertCode.latitude;
this.tGeoOrganizationLng = insertCode.longitude;
}
const tableRow = { importCode: row.importCode };
listLandQuery(tableRow).then(response => {
this.openMap = true;
this.title = "修改地图";
setTimeout(() => {
this.pointDarw(response.rows);
}, 500);
});
});
});
},
@@ -797,8 +804,9 @@ export default {
if(this.drawInsert !=null && this.drawInsert !=""){
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert);
}
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid,theGeom: this.mapTheGeomId.theGeom };
if (this.mapTheGeomId != null) {
updateLand(this.mapTheGeomId).then(response => {
areaSavePri(sysGis).then(response => {
this.$modal.msgSuccess("修改成功");
this.openMap = false;
this.getList();
@@ -808,7 +816,8 @@ export default {
},
/** 清除坐标点图层 */
clearMapLayer() {
clearTheGeom(this.mapTheGeomId.fid).then(response => {
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid};
cleanSavePri(sysGis).then(response => {
this.$modal.msgSuccess("清除成功");
this.openMap = false;
this.getList();
@@ -823,6 +832,10 @@ export default {
var vector_drawing;
var startDarw =false;
var openDarw = false;
this.mapTheGeomId = resourceList.find((land) => {
//model就是上面的数据源
return land.fid === this.mapTheGeomId.fid; //筛选出匹配数据
});
if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != ""
&& this.mapTheGeomId.theGeom != undefined) {
startDarw = true;
@@ -879,7 +892,7 @@ export default {
url: this.mapGeoServerUrl + '/wms',
params: {
LAYERS: this.villageBorderLayerName,
cql_filter: "dept_id = '" + this.$store.state.user.loginDeptId + "'",
cql_filter: "import_code = '" + this.mapTheGeomId.importCode + "'",
SRID: 3857,
},
}),
@@ -1049,7 +1062,7 @@ export default {
url: this.mapGeoServerUrl + '/wms',
params: {
LAYERS: this.villageBorderLayerName,
cql_filter: "dept_id = '" + this.$store.state.user.loginDeptId + "'",
cql_filter: "import_code = '" + this.mapTheGeomId.importCode + "'",
SRID: 3857,
},
}),


Chargement…
Annuler
Enregistrer