坐标系
This commit is contained in:
parent
6f67e6f3eb
commit
10e9ecc4a7
|
@ -0,0 +1,38 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询坐标系管理列表
|
||||||
|
export function list(query) {
|
||||||
|
return request({
|
||||||
|
url: '/pipe/coordinateSystemConfig/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 新增坐标系管理
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: '/pipe/coordinateSystemConfig',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改坐标系管理
|
||||||
|
export function update(data) {
|
||||||
|
return request({
|
||||||
|
url: '/pipe/coordinateSystemConfig',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除坐标系管理
|
||||||
|
export function del(id) {
|
||||||
|
return request({
|
||||||
|
url: '/pipe/coordinateSystemConfig/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,339 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="坐标系名称" prop="layerName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入坐标系名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="EPSG代号" prop="layerName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.epsg"
|
||||||
|
placeholder="请输入EPSG代号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:layers:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:layers:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:layers:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="layersList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="坐标系名称"
|
||||||
|
align="center"
|
||||||
|
prop="name"
|
||||||
|
width="350"
|
||||||
|
/>
|
||||||
|
<el-table-column label="JPG文件是否生成" align="center" prop="jpgUrl">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>
|
||||||
|
EPSG:{{scope.row.epsg}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="经度最小" align="center" prop="minLng" />
|
||||||
|
<el-table-column label="经度最大" align="center" prop="maxLng" />
|
||||||
|
<el-table-column label="中央经线" align="center" prop="centerLng" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:layers:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改部门对话框 -->
|
||||||
|
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="epsgRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="坐标系名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="EPSG代号" prop="epsg">
|
||||||
|
<el-input v-model="form.epsg" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经度最小">
|
||||||
|
<el-input v-model="form.minLng" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经度最大">
|
||||||
|
<el-input v-model="form.maxLng" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="中央经线">
|
||||||
|
<el-input v-model="form.centerLng" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Layers">
|
||||||
|
import { list, del, add, update } from "@/api/system/coordinateSystem";
|
||||||
|
import { listUser } from "@/api/system/user";
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const data = reactive({
|
||||||
|
// 按钮loading
|
||||||
|
buttonLoading: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 坐标系管理表格数据
|
||||||
|
layersList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
epsg: undefined,
|
||||||
|
isAsc: "asc",
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: "坐标系名称不能为空", trigger: "blur" }],
|
||||||
|
epsg: [{ required: true, message: "EPSG代号不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
open,
|
||||||
|
showSearch,
|
||||||
|
queryParams,
|
||||||
|
form,
|
||||||
|
ids,
|
||||||
|
rules,
|
||||||
|
title,
|
||||||
|
layersList,
|
||||||
|
total,
|
||||||
|
multiple,
|
||||||
|
single,
|
||||||
|
loading,
|
||||||
|
buttonLoading,
|
||||||
|
} = toRefs(data);
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
epsg: undefined,
|
||||||
|
name: undefined,
|
||||||
|
minLng: undefined,
|
||||||
|
maxLng: undefined,
|
||||||
|
centerLng: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("epsgRef");
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加坐标系";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["epsgRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
if (form.value.id != null) {
|
||||||
|
update(form.value)
|
||||||
|
.then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
add(form.value)
|
||||||
|
.then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 取消按钮
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length !== 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 查询坐标系管理列表 */
|
||||||
|
function getList() {
|
||||||
|
// loading.value = false;
|
||||||
|
loading.value = true;
|
||||||
|
list(queryParams.value).then((response) => {
|
||||||
|
layersList.value = response.rows;
|
||||||
|
total.value = response.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm("queryForm");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const idsData = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除坐标系管理编号为"' + idsData + '"的数据项?')
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
return del(idsData);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
loading.value = false;
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
|
||||||
|
form.value = JSON.parse(JSON.stringify(row));
|
||||||
|
title.value = row.name;
|
||||||
|
open.value = true;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dialog-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -85,7 +85,7 @@
|
||||||
<el-table-column label="图层坐标体系" align="center" prop="jpgUrl">
|
<el-table-column label="图层坐标体系" align="center" prop="jpgUrl">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>
|
<span>
|
||||||
{{(coordList.filter(item=>item.value==scope.row.coordinateSystem))[0].label}}
|
{{scope.row.coordinateSystem.name}}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -187,12 +187,12 @@
|
||||||
<el-form-item label="坐标体系" prop="ascUrl">
|
<el-form-item label="坐标体系" prop="ascUrl">
|
||||||
<el-select
|
<el-select
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-model="form.coordinateSystem"
|
v-model="form.coordinateSystemId"
|
||||||
|
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
size="large"
|
size="large"
|
||||||
>
|
>
|
||||||
<el-option :label="item.label" :value="item.value" v-for="item in coordList" />
|
<el-option :label="item.name" :value="item.id" v-for="item in coordList" />
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -242,6 +242,9 @@ import {
|
||||||
tifConvert,
|
tifConvert,
|
||||||
updateLayers,
|
updateLayers,
|
||||||
} from "@/api/system/layers";
|
} from "@/api/system/layers";
|
||||||
|
import {
|
||||||
|
list,
|
||||||
|
} from "@/api/system/coordinateSystem";
|
||||||
import { listUser } from "@/api/system/user";
|
import { listUser } from "@/api/system/user";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
@ -311,31 +314,12 @@ const {
|
||||||
const userSelect = ref("图层分配用户");
|
const userSelect = ref("图层分配用户");
|
||||||
|
|
||||||
const coordList=ref([
|
const coordList=ref([
|
||||||
{ label:'WGS84',value:1},
|
|
||||||
{ label:'CGCS2000',value:2},
|
|
||||||
])
|
])
|
||||||
const openUser = ref(false);
|
const openUser = ref(false);
|
||||||
|
|
||||||
const generateData = () => {
|
|
||||||
const data = [];
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
listUser().then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
const states = res.rows;
|
|
||||||
|
|
||||||
states.forEach((item, index) => {
|
|
||||||
data.push({
|
|
||||||
label: item.nickName,
|
|
||||||
key: item.userId,
|
|
||||||
initial: item.nickName,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
console.log(data);
|
|
||||||
resolve(data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const userData = ref([]);
|
const userData = ref([]);
|
||||||
const userQuery = ref([]);
|
const userQuery = ref([]);
|
||||||
|
@ -502,9 +486,37 @@ function handleUpdate(row) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getList();
|
getList();
|
||||||
generateData().then((res) => {
|
const generateData = new Promise((resolve, reject) => {
|
||||||
userData.value = res;
|
listUser().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
let data = []
|
||||||
|
const states = res.rows;
|
||||||
|
|
||||||
|
states.forEach((item, index) => {
|
||||||
|
data.push({
|
||||||
|
label: item.nickName,
|
||||||
|
key: item.userId,
|
||||||
|
initial: item.nickName,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
console.log(data);
|
||||||
|
resolve(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const getGEPSData=new Promise((resolve,reject)=>{
|
||||||
|
list().then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
resolve(res.rows);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Promise.all([generateData, getGEPSData]).then(res=>{
|
||||||
|
|
||||||
|
userData.value = res[0];
|
||||||
|
coordList.value=res[1]
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dialog-footer {
|
.dialog-footer {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="楼层:" prop="houseFloors">
|
<el-form-item label="楼层:" prop="houseFloors">
|
||||||
<el-input v-model="form.houseFloors" type="number" placeholder="请输入" class="inputCss" />
|
<el-input v-model="form.houseFloors" type="number" placeholder="请输入" class="inputCss" />
|
||||||
|
<label for="" style="color: #fff;">({{maxHouseFloors}}~{{minHouseFloors}})</label>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="面积:" prop="area">
|
<el-form-item label="面积:" prop="area">
|
||||||
|
@ -65,7 +66,8 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {recognitionAdd} from "@map/api/exit.js"
|
import {recognitionAdd,getElevation} from "@map/api/exit.js"
|
||||||
|
import ldMap from "@map/utils/map/init";
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
layerId:String,
|
layerId:String,
|
||||||
|
@ -117,6 +119,40 @@ const rules=ref( {
|
||||||
{label:'建', value:'建'},
|
{label:'建', value:'建'},
|
||||||
{label:'未调绘', value:'未调绘'},
|
{label:'未调绘', value:'未调绘'},
|
||||||
])
|
])
|
||||||
|
const maxHouseFloors = ref('')
|
||||||
|
const minHouseFloors = ref('')
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
let lineId = form.value.geometryId
|
||||||
|
let graphics =ldMap.sketchLayer.polygonLayer.sublayers.items
|
||||||
|
let garphic = graphics.filter(element => {
|
||||||
|
return element.id == lineId
|
||||||
|
})[0];
|
||||||
|
let center = [[garphic.geometry.centroid.x,garphic.geometry.centroid.y]]
|
||||||
|
getElevation({
|
||||||
|
layersId:props.layerId,
|
||||||
|
geoJsonData:[...center,...garphic.geometry.rings[0]]
|
||||||
|
}).then(res=>{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const [maxNumber, minNumber] = getMaxAndMin(res.data);
|
||||||
|
maxHouseFloors.value=maxNumber
|
||||||
|
minHouseFloors.value=minNumber
|
||||||
|
console.log(`最大数: ${maxNumber}`);
|
||||||
|
console.log(`最小数: ${minNumber}`);
|
||||||
|
console.log(`楼层差: ${maxNumber}-${minNumber}`+(maxNumber-minNumber));
|
||||||
|
form.value.houseFloors= parseInt( (maxNumber-minNumber)/3)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
function getMaxAndMin(numbers) {
|
||||||
|
const max = Math.max(...numbers);
|
||||||
|
const min = Math.min(...numbers);
|
||||||
|
return [max, min];
|
||||||
|
}
|
||||||
function add(){
|
function add(){
|
||||||
proxy.$refs["dataRef"].validate(valid => {
|
proxy.$refs["dataRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue