From 50c5301b1d375bfa001e38164e6004f7cac8013e Mon Sep 17 00:00:00 2001
From: zhufu <17863654727@163.com>
Date: Thu, 20 Mar 2025 14:33:28 +0800
Subject: [PATCH 1/4] =?UTF-8?q?log=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/FormViewer/index.vue | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/components/FormViewer/index.vue b/src/components/FormViewer/index.vue
index 295ee3f0..dabb2f52 100644
--- a/src/components/FormViewer/index.vue
+++ b/src/components/FormViewer/index.vue
@@ -331,7 +331,6 @@
}
}, 10);
}
- console.log(111111111111,cardGroupData.value)
}
function tabsChange(e) {
tabsKey.value = e;
From 51d783eac7eaae65c8212f924cdcc69c50b3998d Mon Sep 17 00:00:00 2001
From: helloxujingliang <3225043@qq.com>
Date: Fri, 21 Mar 2025 09:41:18 +0800
Subject: [PATCH 2/4] merge:
---
src/api/sys/layerManagement.ts | 32 ++-
src/api/sys/model/layerModel.ts | 13 ++
src/components/MapboxMaps/MapComponent.vue | 210 +++++++++++++++++-
src/components/MapboxMaps/lib/splitpolygon.ts | 10 +-
.../MapboxMaps/src/WktGeojsonTransform.ts | 31 ++-
.../MapList/SplitPolygonModal/index.vue | 149 ++++++++-----
.../MapList/SplitPolygonModal/index.vue | 144 ++++++++----
.../MapList/SplitPolygonModal/index.vue | 142 ++++++++----
.../MapList/SplitPolygonModal/index.vue | 141 ++++++++----
src/views/demo/onlineform/formCall/index.vue | 56 ++++-
.../onlineform/formModule/config/btns.vue | 4 +-
.../onlineform/formModule/modalDesign.vue | 9 +
.../MapList/SplitPolygonModal/index.vue | 146 ++++++++----
.../MapList/SplitPolygonModal/index.vue | 150 ++++++++-----
14 files changed, 926 insertions(+), 311 deletions(-)
diff --git a/src/api/sys/layerManagement.ts b/src/api/sys/layerManagement.ts
index 1748f85a..6ac114e1 100644
--- a/src/api/sys/layerManagement.ts
+++ b/src/api/sys/layerManagement.ts
@@ -1,5 +1,13 @@
import { defHttp } from '@/utils/http/axios';
-import { AddLayerParams,GetLayerListParams,AddGeomParams,GetGeomParams,LoginResultModel, GetUserInfoModel } from './model/layerModel';
+import {
+ AddLayerParams,
+ GetLayerListParams,
+ AddGeomParams,
+ GetGeomParams,
+ LoginResultModel,
+ GetUserInfoModel,
+ CalTubanAreaModel
+} from './model/layerModel';
import { ErrorMessageMode } from '#/axios';
@@ -14,6 +22,8 @@ enum Api {
GetLayerList = "/api/ShpLayerSource/LoadPage",
AddGeom = "/api/ShpLayerSource/SaveShapeData",
GetGeom = "/api/ShpLayerSource/GetShapeData",
+ CalTubanArea = "/api/DroneCaseInfoSingle/CalTubanArea",
+ SplitAndCalTubanArea = "/api/DroneCaseInfoSingle/SplitAndCalTubanArea",
GetPermCode = '/getPermCode',
TestRetry = '/testRetry',
Login = '/api/Check/Login',
@@ -106,6 +116,26 @@ export function getGeom(params:GetGeomParams) {
)
}
+export function calTubanArea(params:CalTubanAreaModel){
+ return defHttp.post(
+ {
+ url: Api.CalTubanArea,
+ params,
+ }
+ )
+}
+
+export function splitAndCalTubanArea(params:CalTubanAreaModel){
+ return defHttp.post(
+ {
+ url: Api.SplitAndCalTubanArea,
+ params,
+ }
+ )
+}
+
+
+
export function getConfig(params) {
return defHttp.get(
diff --git a/src/api/sys/model/layerModel.ts b/src/api/sys/model/layerModel.ts
index 45206b11..e1411724 100644
--- a/src/api/sys/model/layerModel.ts
+++ b/src/api/sys/model/layerModel.ts
@@ -33,6 +33,19 @@ export interface GetGeomParams {
limit:number,
key:string | null,
}
+
+export interface CalTubanAreaModel{
+ wktgeom: string | null;
+ gengdi: number | null,
+ nongyongdi: number | null,
+ jibennongtian: number | null,
+ shengtaihongxian: number | null,
+ gengdituban:string,
+ nongyongdituban:string | null,
+ jibennongtiantuban:string | null,
+ shengtaihongxiantuban:string | null,
+ remaintuban:string | null
+}
export interface RoleInfo {
roleName: string;
diff --git a/src/components/MapboxMaps/MapComponent.vue b/src/components/MapboxMaps/MapComponent.vue
index 531629a7..12d74bb1 100644
--- a/src/components/MapboxMaps/MapComponent.vue
+++ b/src/components/MapboxMaps/MapComponent.vue
@@ -107,7 +107,7 @@
导入图层分割
-
+ 地类图斑分割
@@ -323,6 +323,10 @@
import { message, Modal } from 'ant-design-vue';
import { useCloudQueryStore } from '@/store/modules/cloudquery';
+ // 地类分割
+ import { splitAndCalTubanArea } from '@/api/sys/layerManagement';
+ import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
+
import { AddDroneTask, LoadLandType, AddDroneLandTask, LoadCloudQueryByCaseNo } from '@/api/demo/cloudQuery';
import { signal } from '@/utils/signalR';
// 坐标系转换
@@ -401,13 +405,200 @@
caseid:null,
})
- // 选择地类类型
+ // 地类分割图斑
const handlerSelectLandType = ()=>{
- splitPanelVisible.value = false;
- LoadLandType().then(res=>{
- landTypeList.value = res;
- })
- landTypeVisible.value = true;
+
+
+ emit('handlerStartSpliting',true);
+
+ try{
+
+ let geom = GeojsonToWkt(JSON.parse(JSON.stringify(currentGeoJson.value.geometry)));
+
+ let calAreaParams = {
+ "wktgeom":geom,
+ "type":"gengdi"
+ }
+ splitAndCalTubanArea(calAreaParams).then(res=>{
+ if(res){
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+
+ // 耕地
+ if(res.gengdituban && !res.gengdituban.match("EMPTY")){
+ let geometry = WktToGeojson(res.gengdituban)
+ // let geometry = WktToGeojson("POLYGON((118.20453045 34.61493194,118.2043834 34.61496477,118.20439868 34.61503472,118.20453843 34.61501303,118.20453045 34.61493194))");
+
+ let feature = {
+ "type": "Feature",
+ "properties": {
+ "id": generateUUID()
+ },
+ "geometry": geometry
+ }
+ splitAfterFeatures.features.push(feature)
+ }
+ // 农用地
+ if(res.nongyongdituban && !res.nongyongdituban.match("EMPTY")){
+ let geometry = WktToGeojson(res.nongyongdituban)
+ // let geometry = WktToGeojson("POLYGON((118.20453902 34.61501903,118.20453045 34.61493194,118.20453843 34.61501303,118.20439868 34.61503472,118.2043834 34.61496477,118.20441053 34.61508898,118.20387087 34.61518892,118.20387087 34.61526887,118.20442195 34.61517464,118.20442195 34.61515465,118.2048474 34.61509184,118.20482741 34.61498048,118.20453902 34.61501903))")
+ let feature = {
+ "type": "Feature",
+ "properties": {
+ "id": generateUUID()
+ },
+ "geometry": geometry
+ }
+ splitAfterFeatures.features.push(feature)
+ }
+ // 基本农田
+ if(res.jibennongtiantuban && !res.jibennongtiantuban.match("EMPTY")){
+ let geometry = WktToGeojson(res.jibennongtiantuban)
+ let feature = {
+ "type": "Feature",
+ "properties": {
+ "id": generateUUID()
+ },
+ "geometry": geometry
+ }
+ splitAfterFeatures.features.push(feature)
+ }
+ //
+ if(res.remaintuban && !res.remaintuban.match("EMPTY")){
+ let geometry = WktToGeojson(res.remaintuban)
+ let feature = {
+ "type": "Feature",
+ "properties": {
+ "id": generateUUID()
+ },
+ "geometry": geometry
+ }
+ splitAfterFeatures.features.push(feature)
+ }
+ // 生态保护红线
+ if(res.shengtaihongxiantuban && !res.shengtaihongxiantuban.match("EMPTY")){
+ let geometry = WktToGeojson(res.shengtaihongxiantuban)
+ let feature = {
+ "type": "Feature",
+ "properties": {
+ "id": generateUUID()
+ },
+ "geometry": geometry
+ }
+ splitAfterFeatures.features.push(feature)
+ }
+
+ console.log("splitAfterFeatures",splitAfterFeatures);
+ // 分割数据返回父组件中
+ emit('handlerSplitPolygon', splitAfterFeatures.features);
+ handlerUnDraw();
+ }
+ }).catch((e)=>{
+ emit('handlerStartSpliting',false);
+ })
+
+ }catch(e){
+
+ emit('handlerStartSpliting',false);
+
+ }
+
+ // let res = {
+ // "wktgeom": null,
+ // "gengdi": 0.17,
+ // "nongyongdi": 1.64,
+ // "jibennongtian": 0,
+ // "shengtaihongxian": 0,
+ // "gengdituban": "POLYGON((118.204530452946 34.6149319373947,118.204383402255 34.6149647739564,118.20439867709747 34.6150347166548,118.2045384290743 34.61501302803828,118.204530452946 34.6149319373947))",
+ // "nongyongdituban": "POLYGON((118.204827409679 34.6149804783991,118.204539019005 34.6150190256674,118.204530452946 34.6149319373947,118.204383402255 34.6149647739564,118.204410528111 34.615088981821,118.203870866355 34.6151889191832,118.203870866355 34.6152688690729,118.204421949524 34.6151746424171,118.204421949524 34.6151546549447,118.204847397152 34.6150918371741,118.204827409679 34.6149804783991))",
+ // "jibennongtiantuban": "",
+ // "shengtaihongxiantuban": "",
+ // "remaintuban": "POLYGON EMPTY"
+ // }
+
+ // if(res){
+ // let splitAfterFeatures = {
+ // type: 'FeatureCollection',
+ // features: [],
+ // };
+
+ // // 耕地
+ // if(res.gengdituban && !res.gengdituban.match("EMPTY")){
+ // let geometry = WktToGeojson(res.gengdituban)
+
+ // let feature = {
+ // "type": "Feature",
+ // "properties": {
+ // "id": generateUUID()
+ // },
+ // "geometry": geometry
+ // }
+ // splitAfterFeatures.features.push(feature)
+ // }
+ // // 农用地
+ // if(res.nongyongdituban && !res.nongyongdituban.match("EMPTY")){
+ // let geometry = WktToGeojson(res.nongyongdituban)
+ // let feature = {
+ // "type": "Feature",
+ // "properties": {
+ // "id": generateUUID()
+ // },
+ // "geometry": geometry
+ // }
+ // splitAfterFeatures.features.push(feature)
+ // }
+ // // 基本农田
+ // if(res.jibennongtiantuban && !res.jibennongtiantuban.match("EMPTY")){
+ // let geometry = WktToGeojson(res.jibennongtiantuban)
+ // let feature = {
+ // "type": "Feature",
+ // "properties": {
+ // "id": generateUUID()
+ // },
+ // "geometry": geometry
+ // }
+ // splitAfterFeatures.features.push(feature)
+ // }
+ // //
+ // if(res.remaintuban && !res.remaintuban.match("EMPTY")){
+ // let geometry = WktToGeojson(res.remaintuban)
+ // let feature = {
+ // "type": "Feature",
+ // "properties": {
+ // "id": generateUUID()
+ // },
+ // "geometry": geometry
+ // }
+ // splitAfterFeatures.features.push(feature)
+ // }
+ // // 生态保护红线
+ // if(res.shengtaihongxiantuban && !res.shengtaihongxiantuban.match("EMPTY")){
+ // let geometry = WktToGeojson(res.shengtaihongxiantuban)
+ // let feature = {
+ // "type": "Feature",
+ // "properties": {
+ // "id": generateUUID()
+ // },
+ // "geometry": geometry
+ // }
+ // splitAfterFeatures.features.push(feature)
+ // }
+
+ // // 分割数据返回父组件中
+ // emit('handlerSplitPolygon', splitAfterFeatures.features);
+ // handlerUnDraw();
+ // }
+ // splitAndCalTubanArea(calAreaParams).then(res=>{
+
+ // })
+
+ // splitPanelVisible.value = false;
+ // LoadLandType().then(res=>{
+ // landTypeList.value = res;
+ // })
+ // landTypeVisible.value = true;
}
// 使用地类分割
@@ -589,6 +780,7 @@
'handlerDrawComplete',
'handlerGetFormDetail',
'handlerSplitPolygon',
+ 'handlerStartSpliting',
'onFeatureClick',
]);
@@ -967,7 +1159,7 @@
splitPolygon.geometry.coordinates[0][index] = [item[0],item[1]];
})
- //console.log("editGeoJson",editGeoJson.value);
+ console.log("splitLineString",splitLineString);
let features = splitPolygonByLine(splitLineString, JSON.parse(JSON.stringify(editGeoJson.value)));
if(features){
@@ -979,6 +1171,7 @@
splitAfterFeatures.features = tempFeatures;
+ console.log("tempFeatures",tempFeatures);
// 分割数据返回父组件中
emit('handlerSplitPolygon', tempFeatures);
@@ -1370,6 +1563,7 @@
};
const handlerCancleDraw = () => {
+
if (drawTool) {
map.removeControl(drawTool);
drawTool = null;
diff --git a/src/components/MapboxMaps/lib/splitpolygon.ts b/src/components/MapboxMaps/lib/splitpolygon.ts
index 4d6c780d..5d988997 100644
--- a/src/components/MapboxMaps/lib/splitpolygon.ts
+++ b/src/components/MapboxMaps/lib/splitpolygon.ts
@@ -41,6 +41,7 @@ export function splitPolygonByLine(line, outerPolygon) {
}else if(outerPolygon.geometry.type == "Polygon"){
// 如果是Polygon的单图斑 直接获取分割结果
let splitRes = splitByLine(line,outerPolygon);
+
// 如果有数据就拼接数据
if(splitRes){
splitAfterFeatures = splitAfterFeatures.concat(splitRes);
@@ -49,7 +50,6 @@ export function splitPolygonByLine(line, outerPolygon) {
splitAfterFeatures = splitAfterFeatures.concat(outerPolygon);
}
}
- //console.log("splitAfterFeatures",splitAfterFeatures)
return splitAfterFeatures;
@@ -163,7 +163,7 @@ function splitByLine(line,outerPolygon){
//console.log("第1步:传入的分割线数据",line);
- //console.log("第2步:传入的分割面数据",outerPolygon)
+ // console.log("第2步:传入的分割面数据",outerPolygon)
// 处理被分割的面数据坐标小数点保留多少位
@@ -180,7 +180,7 @@ function splitByLine(line,outerPolygon){
//将点合并成MultiPoint
let intersectCombined = turf.combine(intersectCollection).features[0];
- //console.log("第5步:分割后所有点数据",intersectCombined)
+ console.log("第5步:分割后所有点数据",intersectCombined)
//分别获取切割线
@@ -195,11 +195,11 @@ function splitByLine(line,outerPolygon){
let pieceCollection = turf.featureCollection(
outerPieceCollection.features.concat(splitterPieceCollection.features),
);
- //console.log("第8步:所有分割线段",pieceCollection);
+ console.log("第8步:所有分割线段",pieceCollection);
//使用turf将闭合线组成多边形
let polygonCollection = turf.polygonize(pieceCollection);
- //console.log("第9步:分割线合并面数据",polygonCollection)
+ // console.log("第9步:分割线合并面数据",polygonCollection)
//对多边形进行判断,切割外的多边形丢弃
let innerPolygons = polygonCollection.features.filter((polygon) => {
diff --git a/src/components/MapboxMaps/src/WktGeojsonTransform.ts b/src/components/MapboxMaps/src/WktGeojsonTransform.ts
index 10a689ed..c62a0620 100644
--- a/src/components/MapboxMaps/src/WktGeojsonTransform.ts
+++ b/src/components/MapboxMaps/src/WktGeojsonTransform.ts
@@ -15,4 +15,33 @@ const GeojsonToWkt = (geojsonData)=> {
}
-export {WktToGeojson,GeojsonToWkt}
\ No newline at end of file
+const removeZM = (geoJSON) => {
+
+ function removeZMFromCoords(coords) {
+ return coords.map((coord) => [coord[0], coord[1]]); // 只保留 X 和 Y
+ }
+
+ switch (geoJSON.type) {
+ case 'Point':
+ geoJSON.coordinates = removeZMFromCoords([geoJSON.coordinates]).flat();
+ break;
+ case 'LineString':
+ case 'MultiPoint':
+ geoJSON.coordinates = removeZMFromCoords(geoJSON.coordinates);
+ break;
+ case 'Polygon':
+ case 'MultiLineString':
+ geoJSON.coordinates = geoJSON.coordinates.map((ring) => removeZMFromCoords(ring));
+ break;
+ case 'MultiPolygon':
+ geoJSON.coordinates = geoJSON.coordinates.map((polygon) =>
+ polygon.map((ring) => removeZMFromCoords(ring))
+ );
+ break;
+ default:
+ throw new Error(`Unsupported geometry type: ${geoJSON.type}`);
+ }
+ return geoJSON;
+ }
+
+export {WktToGeojson,GeojsonToWkt,removeZM}
\ No newline at end of file
diff --git a/src/views/demo/degraining/curbspotcity/MapList/SplitPolygonModal/index.vue b/src/views/demo/degraining/curbspotcity/MapList/SplitPolygonModal/index.vue
index 02f5143c..48f78b51 100644
--- a/src/views/demo/degraining/curbspotcity/MapList/SplitPolygonModal/index.vue
+++ b/src/views/demo/degraining/curbspotcity/MapList/SplitPolygonModal/index.vue
@@ -1,5 +1,10 @@
+
+
+
图斑信息
@@ -7,6 +12,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:caseid="id"
:caseno="props.showInfoData.case_no"
@@ -691,14 +697,14 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
import { CaseSplit } from '@/api/degraining/index';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt,removeZM } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
illegalTypeOptions,
@@ -952,6 +958,7 @@
///////// File Preview && Download ////////
import FilePreview from '@/components/Upload/src/components/FilePreview.vue';
+ import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
const previewFileModalVisible = ref(false);
const previewFileUrl = ref("");
@@ -974,74 +981,100 @@
return document.getElementById('info-container');
};
+
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
+
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
- // splitPolygonForm.value = [];
+
// 删除被分割的图斑
if(currentPolygon.value){
splitPolygonForm.value?.splice(currentPolygon.value,1);
splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
- let sumArea = 0.0;
- e?.forEach((item, index) => {
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
- }
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
+ let sumArea = 0.0;
+
+ e?.forEach((item, index) => {
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
+
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- sumArea = sumArea + are;
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked:false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom)
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
+
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
+
+
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item,idnex)=>{
- splitAfterFeatures.features.push(item.geom);
- })
-
- // splitAfterFeatures.features = e;
-
-
-const areKeyDownChange =
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
-
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
features: [],
};
+
MapboxComponent.value.handlerDetails(geoms, 'splitPolygonSource', 'splitPolygonLayer', {
lineStyle: { 'line-color': '#408eff', 'line-width': 3 },
fillStyle: { 'fill-color': '#408eff', 'fill-opacity': 0.1 },
@@ -1051,6 +1084,7 @@ const areKeyDownChange =
};
+
const handlerEditPolygonInfo = (e) => {
console.log(e);
};
@@ -1377,6 +1411,21 @@ const areKeyDownChange =
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
diff --git a/src/views/demo/inspectionaudit/curbspotcity/MapList/SplitPolygonModal/index.vue b/src/views/demo/inspectionaudit/curbspotcity/MapList/SplitPolygonModal/index.vue
index 298ce5a0..f4d6fb19 100644
--- a/src/views/demo/inspectionaudit/curbspotcity/MapList/SplitPolygonModal/index.vue
+++ b/src/views/demo/inspectionaudit/curbspotcity/MapList/SplitPolygonModal/index.vue
@@ -1,5 +1,11 @@
+
+
+
+
图斑信息
@@ -7,6 +13,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:caseid="id"
:caseno="case_no"
@@ -376,7 +383,7 @@
-
+
图斑分割结果
@@ -619,14 +626,15 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
+ import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
import { splitCase } from '@/api/inspectionaudit';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt,removeZM } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
illegalTypeOptions,
@@ -903,76 +911,99 @@ import { itemProps } from '@/components/Menu/src/props';
return document.getElementById('info-container');
};
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
+
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
- // splitPolygonForm.value = [];
+
// 删除被分割的图斑
if(currentPolygon.value){
splitPolygonForm.value?.splice(currentPolygon.value,1);
splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
+
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
let sumArea = 0.0;
+
e?.forEach((item, index) => {
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
- }
- sumArea = sumArea + are;
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked:false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom)
+
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item,idnex)=>{
- splitAfterFeatures.features.push(item.geom);
- })
-
- // splitAfterFeatures.features = e;
-
-
-const areKeyDownChange =
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
-
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
features: [],
};
+
MapboxComponent.value.handlerDetails(geoms, 'splitPolygonSource', 'splitPolygonLayer', {
lineStyle: { 'line-color': '#408eff', 'line-width': 3 },
fillStyle: { 'fill-color': '#408eff', 'fill-opacity': 0.1 },
@@ -1296,6 +1327,21 @@ const areKeyDownChange =
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
diff --git a/src/views/demo/keyproblem/keyissuesI/curbspotcity/MapList/SplitPolygonModal/index.vue b/src/views/demo/keyproblem/keyissuesI/curbspotcity/MapList/SplitPolygonModal/index.vue
index a0d04003..eef1e208 100644
--- a/src/views/demo/keyproblem/keyissuesI/curbspotcity/MapList/SplitPolygonModal/index.vue
+++ b/src/views/demo/keyproblem/keyissuesI/curbspotcity/MapList/SplitPolygonModal/index.vue
@@ -1,5 +1,10 @@
+
+
+
图斑信息
@@ -9,6 +14,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:splitPlugin="true"
@onFeatureClick="onFeatureClick"
@@ -506,14 +512,14 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
import { splitCase } from '@/api/keyproblem/keyissuesI';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt,removeZM } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
illegalTypeOptions,
@@ -782,74 +788,101 @@ import { itemProps } from '@/components/Menu/src/props';
return document.getElementById('info-container');
};
+
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
+
+
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
- // splitPolygonForm.value = [];
+
// 删除被分割的图斑
if(currentPolygon.value){
splitPolygonForm.value?.splice(currentPolygon.value,1);
splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
+
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
let sumArea = 0.0;
+
e?.forEach((item, index) => {
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
- }
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- sumArea = sumArea + are;
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked:false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom)
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
+
+
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item,idnex)=>{
- splitAfterFeatures.features.push(item.geom);
- })
-
- // splitAfterFeatures.features = e;
-
-
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
-
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
features: [],
};
+
MapboxComponent.value.handlerDetails(geoms, 'splitPolygonSource', 'splitPolygonLayer', {
lineStyle: { 'line-color': '#408eff', 'line-width': 3 },
fillStyle: { 'fill-color': '#408eff', 'fill-opacity': 0.1 },
@@ -1173,6 +1206,21 @@ import { itemProps } from '@/components/Menu/src/props';
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
diff --git a/src/views/demo/keyproblem/keyissuesII/curbspotcity/MapList/SplitPolygonModal/index.vue b/src/views/demo/keyproblem/keyissuesII/curbspotcity/MapList/SplitPolygonModal/index.vue
index d3c09c4e..e22125ac 100644
--- a/src/views/demo/keyproblem/keyissuesII/curbspotcity/MapList/SplitPolygonModal/index.vue
+++ b/src/views/demo/keyproblem/keyissuesII/curbspotcity/MapList/SplitPolygonModal/index.vue
@@ -1,5 +1,10 @@
+
+
+
图斑信息
@@ -9,6 +14,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:splitPlugin="true"
@onFeatureClick="onFeatureClick"
@@ -506,14 +512,14 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
import { splitCase } from '@/api/keyproblem/keyissuesII';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt,removeZM } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
illegalTypeOptions,
@@ -780,74 +786,100 @@ const handleCancelPreviewFile = ()=>{
return document.getElementById('info-container');
};
+
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
+
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
- // splitPolygonForm.value = [];
+
// 删除被分割的图斑
if(currentPolygon.value){
splitPolygonForm.value?.splice(currentPolygon.value,1);
splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
+
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
let sumArea = 0.0;
+
e?.forEach((item, index) => {
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
- }
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- sumArea = sumArea + are;
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked:false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom)
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
+
+
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item,idnex)=>{
- splitAfterFeatures.features.push(item.geom);
- })
-
- // splitAfterFeatures.features = e;
-
-
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
-
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
features: [],
};
+
MapboxComponent.value.handlerDetails(geoms, 'splitPolygonSource', 'splitPolygonLayer', {
lineStyle: { 'line-color': '#408eff', 'line-width': 3 },
fillStyle: { 'fill-color': '#408eff', 'fill-opacity': 0.1 },
@@ -1171,6 +1203,21 @@ const handleCancelPreviewFile = ()=>{
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
diff --git a/src/views/demo/onlineform/formCall/index.vue b/src/views/demo/onlineform/formCall/index.vue
index 323100f2..ee63710f 100644
--- a/src/views/demo/onlineform/formCall/index.vue
+++ b/src/views/demo/onlineform/formCall/index.vue
@@ -159,6 +159,7 @@
const btnArr: any = ref([
{ label: '新增', prop: 'Add', class: 'primary' },
{ label: '编辑', prop: 'Edit', class: 'success' },
+ { label: '审核', prop: 'Examine', class: 'success' },
{ label: '删除', prop: 'Delete', class: 'error' },
{ label: '详情', prop: 'Details', class: 'default' },
]);
@@ -562,6 +563,59 @@
isUpdate.value = true;
}
break;
+
+ case 'Examine':
+ if (rows.length == 0) {
+ return createMessage.warn('请选择一条数据进行审核');
+ }
+ // console.log('rowsrows',formConfig,rows);
+
+ btnList.value.forEach((element) => {
+ if (element.prop === 'Examine' && element.isWFlow) {
+ flowCode.value = element.wFlowCode;
+ }
+ });
+ if (flowCode.value == '') {
+ let toProps = {
+ isDetail: false,
+ isUpdate: true,
+ tab: config.schemas,
+ record: rows[0],
+ recordChildren: formData.value,
+ query: query.value,
+ btnList: btnList.value,
+ beforeSetData: config.beforeSetData,
+ afterValidateForm: config.afterValidateForm,
+ afterSaveEvent: config.afterSaveEvent,
+ changeDataEvent: config.changeDataEvent,
+ infoUseMainTableData: infoUseMainTableData.value,
+ infoUseSubTableData: infoUseSubTableData.value,
+ };
+ if (haveMap.value) {
+ // showFormModalData.value = toProps;
+ // openShowFormModal.value = true;
+ // openMapFormModal(true,toProps);
+ // mapFormShow.value = true;
+ // mapFormData.value = toProps;
+ // MapboxComponent.value.handlerDraw(
+ // status,
+ // mapgemoList.value,
+ // mapSetData.value?.isAllowEditPolygon,
+ // );
+ // openModal(true, toProps);
+ // previewOpen.value = true;
+ // flowFormData.value = rows[0];
+ // isUpdate.value = true;
+ openModal(true, toProps);
+ } else {
+ openModal(true, toProps);
+ }
+ } else {
+ previewOpen.value = true;
+ flowFormData.value = rows[0];
+ isUpdate.value = true;
+ }
+ break;
case 'Delete':
if (rows.length == 0) {
return createMessage.warn('请选择一条数据进行删除');
@@ -584,7 +638,7 @@
});
},
});
- break;
+ break;
case 'Details':
if (rows.length == 0) {
return createMessage.warn('请选择一条数据查看详情');
diff --git a/src/views/demo/onlineform/formModule/config/btns.vue b/src/views/demo/onlineform/formModule/config/btns.vue
index c13dec17..016774dd 100644
--- a/src/views/demo/onlineform/formModule/config/btns.vue
+++ b/src/views/demo/onlineform/formModule/config/btns.vue
@@ -21,12 +21,12 @@
/>
-
+
-
+
+
+
+
+
图斑信息
@@ -9,6 +15,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:splitPlugin="true"
@onFeatureClick="onFeatureClick"
@@ -537,14 +544,15 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
+ import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
import { splitCase } from '@/api/redlinesupervision/index';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt,removeZM } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
illegalTypeOptions,
@@ -812,79 +820,106 @@
return document.getElementById('info-container');
};
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
+
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
- // splitPolygonForm.value = [];
+
// 删除被分割的图斑
- if (currentPolygon.value) {
- splitPolygonForm.value?.splice(currentPolygon.value, 1);
- splitAfterPolygon.value?.splice(currentPolygon.value, 1);
+ if(currentPolygon.value){
+ splitPolygonForm.value?.splice(currentPolygon.value,1);
+ splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
+
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
let sumArea = 0.0;
+
e?.forEach((item, index) => {
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
- }
- sumArea = sumArea + are;
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked: false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom);
+
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item, idnex) => {
- splitAfterFeatures.features.push(item.geom);
- });
-
- // splitAfterFeatures.features = e;
-
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
features: [],
};
+
MapboxComponent.value.handlerDetails(geoms, 'splitPolygonSource', 'splitPolygonLayer', {
lineStyle: { 'line-color': '#408eff', 'line-width': 3 },
fillStyle: { 'fill-color': '#408eff', 'fill-opacity': 0.1 },
});
currentPolygon.value = null;
+
};
const handlerEditPolygonInfo = (e) => {
@@ -1192,6 +1227,21 @@
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
diff --git a/src/views/demo/tiankongdi/curbspotcity/MapList/SplitPolygonModal/index.vue b/src/views/demo/tiankongdi/curbspotcity/MapList/SplitPolygonModal/index.vue
index 96a00823..6671606c 100644
--- a/src/views/demo/tiankongdi/curbspotcity/MapList/SplitPolygonModal/index.vue
+++ b/src/views/demo/tiankongdi/curbspotcity/MapList/SplitPolygonModal/index.vue
@@ -1,5 +1,10 @@
+
+
+
图斑信息
@@ -7,6 +12,7 @@
:geomsList="geomsList"
:mapConfig="mapConfig"
@handlerSplitPolygon="handlerSplitPolygon"
+ @handlerStartSpliting="handlerStartSpliting"
@mapOnLoad="onMapboxLoad"
:caseid="id"
:caseno="case_no"
@@ -616,14 +622,14 @@
import axios from 'axios';
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue';
import { getConfig } from '@/api/sys/layerManagement';
- import { getGeom } from '@/api/sys/layerManagement';
+ import { getGeom,calTubanArea } from '@/api/sys/layerManagement';
import { splitCase } from '@/api/tiankongdi';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import Icon from '@/components/Icon/Icon.vue';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL, VITE_GLOB_INFO_IMAGE_URL } = getAppEnvConfig();
- import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
+ import { GeojsonToWkt, removeZM} from '@/components/MapboxMaps/src/WktGeojsonTransform';
import {
mapTypeOptions,
@@ -859,6 +865,7 @@ import { itemProps } from '@/components/Menu/src/props';
geomsList.value = geoms;
});
}
+
// MapboxComponent.value.handlerDraw(status,mapgemoList.value, false);
MapboxComponent.value.handlerDraw('Details', geoms, false);
} else {
@@ -876,6 +883,7 @@ import { itemProps } from '@/components/Menu/src/props';
///////// File Preview && Download ////////
import FilePreview from '@/components/Upload/src/components/FilePreview.vue';
+ import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
const previewFileModalVisible = ref(false);
const previewFileUrl = ref("");
@@ -898,75 +906,95 @@ import { itemProps } from '@/components/Menu/src/props';
const getContainer = () => {
return document.getElementById('info-container');
};
+
+
+ const isLandTypeSpliting = ref
(false);
+ // 开始分割
+ const handlerStartSpliting = (e)=> {
+ isLandTypeSpliting.value = e;
+ }
const splitPolygonForm = ref([]);
const splitAfterPolygon = ref([]);
const handlerSplitPolygon = (e) => {
+
// 删除被分割的图斑
if(currentPolygon.value){
splitPolygonForm.value?.splice(currentPolygon.value,1);
splitAfterPolygon.value?.splice(currentPolygon.value,1);
}
+
+ isLandTypeSpliting.value = false;
+
+ // 面积计算
let sumArea = 0.0;
+
e?.forEach((item, index) => {
- var polygon = null;
- if(item.geometry.type == 'Polygon'){
- polygon = turf.polygon(item.geometry.coordinates)
- }else if(item.geometry.type == 'MultiPolygon'){
- polygon = turf.multiPolygon(item.geometry.coordinates)
+ // 去除GeoJSON Z坐标
+ let afterItem = removeZM(item['geometry'])
+
+ let calAreaParams:CalTubanAreaModel = {
+ "wktgeom": GeojsonToWkt(item['geometry']),
}
- let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ calTubanArea(calAreaParams).then(resultItem=>{
+ if(resultItem){
+
+ let form = {
+ fid: null,
+ unitname: '',
+ createdate: createtime,
+ caseno: case_no + ' 分割图斑',
+ countyname: countyname,
+ streetname: streetname,
+ isbuildname: '',
+ nongyongdi_area: resultItem.nongyongdi > 0 ? resultItem.nongyongdi : 0.00,
+ gengdi_area: resultItem.gengdi > 0 ? resultItem.gengdi : 0.00,
+ yongjiujibennongtian_area: resultItem.jibennongtian > 0 ? resultItem.jibennongtian : 0.00,
+ shengtaibaohuhongxian_area: resultItem.shengtaihongxian > 0 ? resultItem.shengtaihongxian : 0.00,
+ guotukongjianguihua_area: null,
+ area: resultItem.totalmianji > 0 ? resultItem.totalmianji : 0.00,
+ geom: item,
+ checked:false,
+ };
- if(index == e.length-1){
- are = (parseFloat(area) - sumArea).toFixed(2);
- }
- sumArea = sumArea + are;
+ splitPolygonForm.value?.push(form);
+ splitAfterPolygon.value?.push(form.geom)
- let form = {
- fid: null,
- unitname: '',
- createdate: createtime,
- caseno: case_no + ' 分割图斑',
- countyname: countyname,
- streetname: streetname,
- isbuildname: '',
- nongyongdi_area: null,
- gengdi_area: null,
- yongjiujibennongtian_area: null,
- shengtaibaohuhongxian_area: null,
- guotukongjianguihua_area: null,
- area: are > 0 ? are : 0.00,
- geom: item,
- checked:false,
- };
- splitPolygonForm.value?.push(form);
- splitAfterPolygon.value?.push(form.geom)
+ // 分割完成后重新渲染面数据
+ let splitAfterFeatures = {
+ type: 'FeatureCollection',
+ features: [],
+ };
+ splitPolygonForm.value?.forEach((item,idnex)=>{
+ splitAfterFeatures.features.push(item.geom);
+ })
+
+ const areKeyDownChange = MapboxComponent.value.handlerDetails(splitAfterFeatures);
+
+ }
+ })
+
+ // var polygon = null;
+ // if(item.geometry.type == 'Polygon'){
+ // polygon = turf.polygon(item.geometry.coordinates)
+ // }else if(item.geometry.type == 'MultiPolygon'){
+ // polygon = turf.multiPolygon(item.geometry.coordinates)
+ // }
+ // let are = (turf.area(polygon) / 666.666666666667).toFixed(2);
+
+ // if(index == e.length-1){
+ // are = (parseFloat(area) - sumArea).toFixed(2);
+ // }
+ // sumArea = sumArea + are;
+
+
});
-
- // 分割完成后重新渲染面数据
- let splitAfterFeatures = {
- type: 'FeatureCollection',
- features: [],
- };
-
- splitPolygonForm.value?.forEach((item,idnex)=>{
- console.log("item.geom",item.geom);
-
- splitAfterFeatures.features.push(item.geom);
- })
-
- // splitAfterFeatures.features = e;
-
-
-const areKeyDownChange =
- MapboxComponent.value.handlerDetails(splitAfterFeatures);
-
-
// 清空选中图斑
let geoms = {
type: 'FeatureCollection',
@@ -1238,6 +1266,9 @@ const areKeyDownChange =
};
params.parts.push(polygon);
});
+
+
+
try{
splitCase(params).then((res) => {
if (res) {
@@ -1257,7 +1288,7 @@ const areKeyDownChange =
nongyongdi_area: false,
gengdi_area: false,
yongjiujibennongtian_area: false,
- shengtaibaohuhongxian_area: false,
+ shengtaibaohuhongxian_area: false,
guotukongjianguihua_area: false,
zhongdianquyu_area: false,
area: false,
@@ -1318,6 +1349,21 @@ const areKeyDownChange =
width: calc(100vw - 15px);
height: calc(100vh - 120px);
display: flex;
+ .load-mask{
+ width:100%;
+ height:100%;
+ position:absolute;
+ top:0px;
+ left:0px;
+ background:rgba(0,0,0,0.5);
+ z-index:9999;
+ .loader-block{
+ position: absolute;
+ left:50%;
+ top:50%;
+ transform:translate(-50%,-50%);
+ }
+ }
.left-container {
flex: 1;
height: 100%;
From 15d173c547580393dd951c8e3bb03eea57844219 Mon Sep 17 00:00:00 2001
From: helloxujingliang <3225043@qq.com>
Date: Fri, 21 Mar 2025 16:08:51 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=9C=B0=E7=B1=BB?=
=?UTF-8?q?=E5=88=86=E5=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
src/components/MapboxMaps/MapComponent.vue | 29 +++++++++++++++++--
.../MapList/ShowInfoModal/index.vue | 2 +-
.../MapList/SplitPolygonModal/index.vue | 2 +-
4 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index e6ea2fa1..dc43b46d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ tests/server/static/upload
.env.*.local
.eslintcache
.env
+.env.tiankongdi
.env.analyze
.env.development
.env.lindidiaocha
diff --git a/src/components/MapboxMaps/MapComponent.vue b/src/components/MapboxMaps/MapComponent.vue
index 12d74bb1..83457cd5 100644
--- a/src/components/MapboxMaps/MapComponent.vue
+++ b/src/components/MapboxMaps/MapComponent.vue
@@ -107,7 +107,29 @@
导入图层分割
- 地类图斑分割
+
+
+
+
+
+ 地类图斑分割
+
+
+
+
+
+
+ 耕地地类分割
+
+
+
+ 建设用地地类分割
+
+
+
+
+
+
@@ -274,6 +296,7 @@
SplitCellsOutlined,
CloudUploadOutlined,
Loading3QuartersOutlined,
+ DownOutlined,
} from '@ant-design/icons-vue';
import mapboxgl, { Map, Popup } from 'mapbox-gl';
import Icon from '@/components/Icon/Icon.vue';
@@ -406,7 +429,7 @@
})
// 地类分割图斑
- const handlerSelectLandType = ()=>{
+ const handlerSelectLandType = (type)=>{
emit('handlerStartSpliting',true);
@@ -417,7 +440,7 @@
let calAreaParams = {
"wktgeom":geom,
- "type":"gengdi"
+ "type":type
}
splitAndCalTubanArea(calAreaParams).then(res=>{
if(res){
diff --git a/src/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue b/src/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue
index ec2eca3a..90b19d54 100644
--- a/src/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue
+++ b/src/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue
@@ -178,7 +178,7 @@
style="width: 100px; height: 100px"
:src="`${VITE_GLOB_INFO_IMAGE_URL}/${item}`"
:preview="{ getContainer }"
- >
+ >
Date: Fri, 21 Mar 2025 16:54:58 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E6=97=B6=20=E6=8E=A5=E5=8F=A3=E4=BC=A0=E5=8F=82=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/tiankongdi/index.ts | 2 +-
.../Upload/src/components/ImageUploadSelectOtherModal.vue | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/api/tiankongdi/index.ts b/src/api/tiankongdi/index.ts
index ce630a0b..62c6b45f 100644
--- a/src/api/tiankongdi/index.ts
+++ b/src/api/tiankongdi/index.ts
@@ -188,7 +188,7 @@ export function rebackzhuantipic(params:{ zhuanti, CaseId }){
params
});
}
-export function CopyImg(params:string[]){
+export function CopyImg(params: { caseId, images}){
return defHttp.post({
url: Api.CopyImg,
data:params,
diff --git a/src/components/Upload/src/components/ImageUploadSelectOtherModal.vue b/src/components/Upload/src/components/ImageUploadSelectOtherModal.vue
index eb4fa45c..9e53c007 100644
--- a/src/components/Upload/src/components/ImageUploadSelectOtherModal.vue
+++ b/src/components/Upload/src/components/ImageUploadSelectOtherModal.vue
@@ -61,7 +61,11 @@ const save = () => {
return
}
loading.value = true
- CopyImg(selectImage.value).then(res => {
+ let params = {
+ caseId: sessionStorage.getItem('SelectOtherId'),
+ images: selectImage.value
+ }
+ CopyImg(params).then(res => {
emits('save', res)
}).finally(() => {
loading.value = false