冲突解决-glj
This commit is contained in:
commit
a2ab80af83
|
@ -59,6 +59,10 @@ onMounted(() => {
|
|||
const mapOperations = {
|
||||
wktParseToMap: (res) => {
|
||||
let layer = omnivore.wkt.parse(res)
|
||||
if(featureLayerG_area.getLayers().length != 0||featureLayerG_point.getLayers().length != 0){
|
||||
|
||||
return;
|
||||
}
|
||||
layer.addTo(featureLayerG_point)
|
||||
|
||||
let attr = Object.values(layer._layers)
|
||||
|
@ -66,9 +70,12 @@ const mapOperations = {
|
|||
// 判断审核的数据类型,如果是点则直接flyTo
|
||||
if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) {
|
||||
homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3)
|
||||
variableStore.layerGroupPoint=res;
|
||||
return {'layer':layer,'location':[attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]]}
|
||||
}
|
||||
// 判断审核的数据类型,如果是面则计算中心点 然后再fly
|
||||
else {
|
||||
variableStore.layerGroupPoly=res;
|
||||
let polygons = [];
|
||||
for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) {
|
||||
console.log(attr[0].feature.geometry.coordinates[i])
|
||||
|
@ -83,8 +90,9 @@ const mapOperations = {
|
|||
let final_center = turf.center(turf.featureCollection(features))
|
||||
// console.log(final_center)
|
||||
homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3)
|
||||
return {'layer':layer,'location':null}
|
||||
}
|
||||
return layer
|
||||
// return layer
|
||||
|
||||
},
|
||||
/** 添加点标注
|
||||
|
@ -313,6 +321,11 @@ const mapOperations = {
|
|||
})
|
||||
e.layer.addTo(featureLayerG_area)
|
||||
polygon = e.layer
|
||||
let features = featureLayerG_area.toGeoJSON().features
|
||||
variableStore.layerGroupPoly = features.map(function (feature) {
|
||||
return WKT.convert(feature.geometry)
|
||||
})
|
||||
variableStore.layerGroupPoly = variableStore.layerGroupPoly.join('\n')
|
||||
})
|
||||
// featureLayerG_area.clearLayers()
|
||||
// variableStore.layerGroupPoly=null;
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "index"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,120 @@
|
|||
<!--灾害列表table组件-->
|
||||
<template>
|
||||
<div class="search">
|
||||
<el-select class="form-select" size="default" clearable
|
||||
placeholder="Disaster Type" v-model="state.search.disasterType">
|
||||
<el-option v-for="(item,index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue"/>
|
||||
</el-select>
|
||||
<el-input type="text"
|
||||
class="form-control" size="default" clearable
|
||||
placeholder="Disaster Country" v-model="state.search.disasterCountry"/>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
Search
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||
highlight-current-row @row-click="tableClick">
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="dictValue" label="Disaster type" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip sortable></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</template>
|
||||
|
||||
<script setup name="disasterTable">
|
||||
|
||||
import {onMounted, reactive, computed, defineProps, defineEmits} from "vue";
|
||||
import {getList} from "/@/api/system/dictbiz.js";
|
||||
import {getPage} from "/@/api/disasterInfo/index.js";
|
||||
//定义表格点击后的回调
|
||||
const emit = defineEmits(["click"]);
|
||||
//定义组件接收的参数
|
||||
const props = defineProps({
|
||||
//响应状态
|
||||
status: {
|
||||
type: Number
|
||||
},
|
||||
})
|
||||
const state = reactive({
|
||||
//查询参数
|
||||
search:{
|
||||
respondStatus:props.status
|
||||
},
|
||||
//灾害类型字典项
|
||||
dictList:[],
|
||||
//表格数据
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
})
|
||||
//灾害表格点击事件
|
||||
const tableClick = (row, column, event) => {
|
||||
emit("click", row.disasterId);
|
||||
}
|
||||
//获取字典数据
|
||||
const getDictBizData = () => {
|
||||
getList({code:'disaster'}).then(res =>{
|
||||
state.dictList = res[0].children
|
||||
})
|
||||
}
|
||||
//获取灾害列表
|
||||
const getDisasterTable = () => {
|
||||
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
})
|
||||
}
|
||||
// 分页改变
|
||||
const onHandleDisasterSizeChange = (val) => {
|
||||
state.disasterData.param.pageSize = val;
|
||||
getDisasterTable();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterCurrentChange = (val) => {
|
||||
state.disasterData.param.pageNum = val;
|
||||
getDisasterTable();
|
||||
};
|
||||
//页面加载
|
||||
onMounted(()=>{
|
||||
//获取灾害类型
|
||||
getDictBizData();
|
||||
//获取灾害列表
|
||||
getDisasterTable();
|
||||
})
|
||||
//组件对外暴露方法
|
||||
defineExpose({
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
.search{
|
||||
display: flex;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.form-control{
|
||||
margin-left: 10px;
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
|
@ -4,7 +4,7 @@ import qs from 'qs';
|
|||
import { Session } from '/@/utils/storage';
|
||||
|
||||
// export const moduleName = 'zqq-biz-vordm';
|
||||
export const moduleName = 'biz-vordm';
|
||||
export const moduleName = 'glj-biz-vordm';
|
||||
export const crawlModule = 'vordm-crawl';
|
||||
// 配置新建一个 axios 实例
|
||||
const service = axios.create({
|
||||
|
|
|
@ -256,26 +256,30 @@ const onOpenEditRole = (type, row) => {
|
|||
state.edit = JSON.parse(JSON.stringify(row));
|
||||
state.dialogVisible = true;
|
||||
setTimeout(() => {
|
||||
state.radio = "1"
|
||||
// mapRef.value.mapOperations.removeAll()
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
if (state.wktPoint_Poly) {
|
||||
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
|
||||
}
|
||||
state.wktPoint_Poly = mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
||||
// mapRef.value.mapOperations.on("click", (res)=>{
|
||||
// mapRef.value.mapOperations.clearPolygon()
|
||||
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
|
||||
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||
// })
|
||||
mapEvents('1')
|
||||
}, 100);
|
||||
state.radio = "1"
|
||||
// mapRef.value.mapOperations.removeAll()
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
if(state.wktPoint_Poly){
|
||||
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
|
||||
}
|
||||
let wkt=mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
||||
state.wktPoint_Poly= wkt.layer
|
||||
console.log(wkt.location)
|
||||
changelatlon(wkt.location[0],wkt.location[1]);
|
||||
// mapRef.value.mapOperations.on("click", (res)=>{
|
||||
// mapRef.value.mapOperations.clearPolygon()
|
||||
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
|
||||
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||
// })
|
||||
mapEvents('1')
|
||||
},100);
|
||||
|
||||
};
|
||||
const mapEvents = (ev) => {
|
||||
if (ev == '1') {
|
||||
// mapRef.value.mapOperations.clearPolygon()
|
||||
mapRef.value.mapOperations.on("click", mapClick)
|
||||
mapRef.value.mapOperations.on("mousemove", changelatlon)
|
||||
// mapRef.value.mapOperations.on("mousemove", changelatlon)
|
||||
mapRef.value.mapOperations.clearPolygon()
|
||||
|
||||
} else if (ev == '2') {
|
||||
|
@ -297,10 +301,11 @@ const ClearSubmit = () => {
|
|||
layerGroupPoly = null;
|
||||
}, 100)
|
||||
}
|
||||
const mapClick = (res) => {
|
||||
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
|
||||
changelatlon(res);
|
||||
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
|
||||
|
||||
const mapClick=(res)=>{
|
||||
mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
|
||||
changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3));
|
||||
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3))
|
||||
// console.log(state.wktPoint_Poly)
|
||||
}
|
||||
const reviews = (index) => {
|
||||
|
@ -331,20 +336,22 @@ const onHandleCurrentChange = (val) => {
|
|||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
const changelatlon = (e) => {
|
||||
const changelatlon = (lat,lon) => {
|
||||
//深拷贝e
|
||||
state.dislat = e.latlng.lat.toFixed(3);
|
||||
state.dislon = e.latlng.lng.toFixed(3);
|
||||
// if (state.lon < 0) {
|
||||
// state.lon = state.lon + 360;
|
||||
// }
|
||||
// state.lon = state.lon.toFixed(3);
|
||||
if (state.dislat < 0) {
|
||||
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||
}
|
||||
else {
|
||||
state.dislat = String(state.dislat) + "°N"
|
||||
}
|
||||
// state.dislat = e.latlng.lat.toFixed(3);
|
||||
// state.dislon= e.latlng.lng.toFixed(3);
|
||||
state.dislat = lat;
|
||||
state.dislon= lon;
|
||||
// if (state.lon < 0) {
|
||||
// state.lon = state.lon + 360;
|
||||
// }
|
||||
// state.lon = state.lon.toFixed(3);
|
||||
if (state.dislat < 0) {
|
||||
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||
}
|
||||
else {
|
||||
state.dislat = String(state.dislat) + "°N"
|
||||
}
|
||||
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
|
|
Loading…
Reference in New Issue