Compare commits

..

2 Commits

5 changed files with 104 additions and 19 deletions

View File

@ -41,6 +41,8 @@ enum Api {
LoadTaskIllegalDetailList = '/api/DroneCaseInfoSingle/LoadTaskIllegalDetailList',
// 分割图斑
SplitCase = '/api/DroneCaseInfoSingle/CaseSplit',
// 恢复还原
RecoverCase = '/api/DroneCaseInfoSingle/CaseRecover',
}
/**
@ -107,4 +109,8 @@ export function getLoadTaskIllegalDetailList(params?: taskInfoParams) {
export function splitCase(params){
return defHttp.post({ url: Api.SplitCase, data: params });
}
export function recoverCase(params){
return defHttp.post({ url: Api.RecoverCase, data: params });
}

View File

@ -528,11 +528,9 @@
}
}
let splitPolygon = currentGeoJson.value;
console.log("splitPolygon",splitPolygon);
try{
// let features = polygonCut(splitPolygon,splitLineString,0.1,"meters");
let features = splitPolygonByLine(splitLineString,splitPolygon);
let features = splitPolygonByLine(splitLineString,splitPolygon);
let splitAfterFeatures = {
"type": "FeatureCollection",
@ -927,7 +925,6 @@
geometry: featureTemp,
};
geo.features.push(feature);
//
if(i == 0){
let lngLat = getGeometryCenter(feature);
@ -966,7 +963,7 @@
let lineLayerName = layer+"Line";
if(source == 'detailsSource'){
console.log("currentGeoJson",geojson)
//
let coordinates = null;
if(geojson.features[0].geometry.type == "MultiPolygon"){
@ -974,6 +971,11 @@
}else if(geojson.features[0].geometry.type == "Polygon"){
coordinates = geojson.features[0].geometry.coordinates;
}
if(coordinates){
if(coordinates[0][coordinates[0].length-1][0]==coordinates[0][coordinates[0].length-2][0]){
coordinates[0]?.pop();
}
}
let singleFeature = {
"type": "Feature",
"properties": {},
@ -983,6 +985,8 @@
}
}
currentGeoJson.value = singleFeature;
console.log("currentGeoJson",currentGeoJson.value)
}
if(map.getSource(source)){

View File

@ -14,7 +14,7 @@ import { generateUUID } from "../src/tool";
if (intersectCollection.features.length < 2) {
return null;
}
//将点合并成MultiPoint
let intersectCombined = turf.combine(intersectCollection).features[0];
@ -27,12 +27,16 @@ import { generateUUID } from "../src/tool";
//使用turf将闭合线组成多边形
let polygonCollection = turf.polygonize(pieceCollection);
//对多边形进行判断,切割外的多边形丢弃
let innerPolygons = polygonCollection.features.filter(polygon => {
let center = turf.centroid(polygon);
return turf.booleanWithin(center, outerPolygon);
});
// let innerPolygons = polygonCollection.features.filter(polygon => {
// let center = turf.centroid(polygon);
// return turf.booleanWithin(center, outerPolygon);
// });
let innerPolygons = polygonCollection.features;
//处理镂空数据多处镂空数据会导致计算错误因为polygonize方法无法正常的返回数据
if(outerPolygon.geometry.coordinates?.length > 1){

View File

@ -51,7 +51,7 @@
<a-menu @click="handleOperateClick">
<a-menu-item key="1">图斑分割</a-menu-item>
<a-menu-item key="2">分割还原</a-menu-item>
<a-menu-item key="3">分宗示意图</a-menu-item>
<!-- <a-menu-item key="3">分宗示意图</a-menu-item> -->
</a-menu>
</template>
<a-button type="primary" class="item-button" style="background: #0CBD62">
@ -147,7 +147,7 @@
</div>
</div>
<div class="data-list-div" style="padding-top: 1px;">
<div v-for="(item, index) in infoDataList" :key="index" :class="classFun(item)">
<div v-for="(item, index) in infoDataList" :key="index" @click="selectAreaId(item)" :class="classFun(item)">
<div class="data-list-layout-div">
<div class="data-list-title-div">
<img
@ -165,7 +165,7 @@
</div>
<div class="item-mark" v-if="item.isbuildname">{{ item.isbuildname }}</div>
</div>
<div class="data-item-type-div" style="cursor: pointer">
<div class="data-item-type-div" style="cursor: pointer" @click="goAudit(item)">
{{ item.unitname }}
</div>
</div>
@ -247,6 +247,38 @@
</div>
</a-modal>
<a-modal
width="100%"
wrap-class-name="full-modal"
v-model:open="auditOpen"
title="审核"
footer=""
:destroyOnClose="true"
>
<template #footer> </template>
<div class="handoff">
<a-button
type="primary"
style="margin-right: 25px;"
@click="prevData"
>上一条</a-button>
<a-button
type="primary"
@click="nextData"
>下一条</a-button>
</div>
<Audit
v-if="handoffShow"
ref="posRef"
:processId="processId"
:taskId="taskId"
:isRead="isRead"
:type="type"
@closeModel="closeMolder"
/>
</a-modal>
<a-modal
style="width:100vw;top:0px;left:0px;margin:0px;padding:0px;"
wrap-class-name="full-modal"
@ -279,8 +311,10 @@ import Amend from './amend.vue';
import { Empty, message } from 'ant-design-vue';
import ShowInfoModal from '@/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue';
import SplitPolygonModal from '@/views/demo/tiankongdi/curbspotcity/MapList/SplitPolygonModal/index.vue';
import {recoverCase} from '@/api/tiankongdi'
import { flowStore } from '@/store/modules/flow';
import { getDetail } from '@/api/sys/WFSchemeInfo';
import { Audit } from '@/views/demo/workflow/task/process/page';
const modalShow = ref(false);
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
@ -427,7 +461,20 @@ const getCollectList = () => {
};
const showSplitPolygon = ref(false);
const handlerRevertPolygon = (item)=>{
let params = {
"caseid": selectItem.value.id,
"parts": [
{
"caseid": null
}
],
"type": 0,
};
recoverCase(params).then(res=>{
if(res){
message.info(res)
}
})
}
const handlerSplitPolygon = (item) => {
getCaseInfoById({id:item.processid}).then(res => {
@ -459,6 +506,29 @@ const dataListSort = (type) => {
}
getInfoList();
};
const showDataIndex = ref()
const auditOpen = ref(false);
const processId = ref('');
const taskId = ref('');
const type = ref('');
const handoffShow = ref(true)
const isRead: any = ref(0);
const flowWfDataStore = flowStore();
async function goAudit(record) {
// showDataIndex.value = props.infoDataList.findIndex(item => item.taskid === record.taskid)
let data = await getDetail({ code: record.processcode });
let scheme = JSON.parse(data.scheme.content);
let wfData = scheme.wfData;
flowWfDataStore.setWfDataAll(wfData);
auditOpen.value = true;
processId.value = record.processid;
taskId.value = record.taskid;
type.value = record.type;
}
const showInfo = (item) => {
getCaseInfoById({ id: item.processid }).then((res) => {
showInfoData.value = res;
@ -500,7 +570,7 @@ const handleOperateClick = (e: Event) => {
if(e['key'] == 1){
handlerSplitPolygon(selectItem.value);
}else if(e['key'] == 2){
handlerRevertPolygon(selectItem.value)
handlerRevertPolygon(selectItem.value);
}
};

View File

@ -94,8 +94,9 @@
}
function perviewImage(e): void {
alert(e);
}
const spinning = ref(false);
const showInfo = ref(false);