-
@@ -318,10 +325,11 @@ import leftIcon from "@map/assets/tool/left.png";
import rightIcon from "@map/assets/tool/right.png";
import useMapDataStore from "@map/store/modules/mapData";
import useDistStore from "@map/store/modules/dist";
-import emitter from "@map/utils/emitter"
+import emitter from "@map/utils/emitter";
+import log from "./component/log";
import { toRaw } from "vue";
const { proxy } = getCurrentInstance();
-const emit = defineEmits(["changeExit", "lineExit","uploadShow"]);
+const emit = defineEmits(["changeExit", "lineExit", "uploadShow"]);
let mapdata = useMapDataStore();
const {
house,
@@ -332,6 +340,7 @@ const {
setLineStyle,
watertotal,
layerId,
+ layerName,
checkedLegend,
} = storeToRefs(mapdata);
const tableDate = ref();
@@ -344,7 +353,7 @@ const $ldMap = inject("$ldMap"); // 调用全局变量
const treeHeight = ref("");
treeHeight.value = window.innerHeight - 258;
const layerslist = ref();
-const layerDate = ref([])
+const layerDate = ref([]);
const props = {
value: "id",
label: "label",
@@ -357,59 +366,69 @@ onMounted(() => {
};
tableDate.value = house.value;
$ldMap.initMap().then((e) => {
- getLayerList().then(()=>{
+ getLayerList().then(() => {
if (layerslist.value) {
selectLayer(layerslist.value[0].id);
}
- })
+ });
getlegend();
});
- emitter.on('loadLayer',() => {
- getLayerList()
- })
- emitter.on('polyon',(e)=>{
- if(e&&e.action!=2){
- proxy.$refs["refTable"].setCurrentRow(e);
- tableDate.value.forEach((item,index)=>{
-
- if(item == e){
- tableScrollToRow(proxy.$refs["refTable"],index+1,false)
- }
- })
+ emitter.on("loadLayer", () => {
+ getLayerList();
+ });
+ emitter.on("polyon", (e) => {
+ if (e && e.action != 2 && selectId.value == 2) {
+ try {
+ proxy.$refs["refTable"].setCurrentRow(e);
+ tableDate.value.forEach((item, index) => {
+ if (item == e) {
+ tableScrollToRow(proxy.$refs["refTable"], index + 1, false);
+ }
+ });
+ } catch (error) {
+ console.log(error);
+ }
}
-
- })
-})
+ });
+});
//定位到表格某一行
function tableScrollToRow(tableElement, rowindex, isprecise = false) {
- const theTableRows = tableElement.$el.querySelectorAll('.el-table__body tbody .el-table__row')
+ const theTableRows = tableElement.$el.querySelectorAll(
+ ".el-table__body tbody .el-table__row"
+ );
let scrollTop = 0;
for (let i = 0; i < theTableRows.length; i++) {
if (i === rowindex) {
- break
- }
- scrollTop += theTableRows[i].offsetHeight
- if (!isprecise) {
- scrollTop *= (rowindex - 1);
break;
}
-
+ scrollTop += theTableRows[i].offsetHeight;
+ if (!isprecise) {
+ scrollTop *= rowindex - 1;
+ break;
+ }
}
- tableElement.scrollTo(0, scrollTop)
+ tableElement.scrollTo(0, scrollTop);
}
+const getColor = (node) => {
+ node = node.data;
+ let flag =
+ node.startAltitude ||
+ node.startElevation ||
+ node.endAltitude ||
+ node.endElevation;
+ return flag == true ? "rgb(64,158,255, 0.8)" : "rgb(251,213,2, 0.8)";
+};
//获取图层列表
-const getLayerList=()=>{
- return new Promise((resolve,reject)=>{
-
- mapdata.getMylayerList().then((res) => {
+const getLayerList = () => {
+ return new Promise((resolve, reject) => {
+ mapdata.getMylayerList().then((res) => {
layerslist.value = res.data;
- layerDate.value = res.data.filter(item=>item.layerUrl)
- resolve()
+ layerDate.value = res.data.filter((item) => item.layerUrl);
+ resolve();
});
- })
-
-}
+ });
+};
let dist = useDistStore();
const { deviceDist, standard } = storeToRefs(dist);
@@ -444,10 +463,9 @@ const getlegend = () => {
legendlineData.value.push(line[i]);
}
for (let i in point) {
- if(point[i].visible ){
+ if (point[i].visible) {
legendPointeData.value.push(point[i]);
}
-
}
});
};
@@ -464,6 +482,7 @@ function selectLayer(e) {
if (item.id == e) {
console.log(item);
layerId.value = item.id;
+ layerName.value = item.layerName
$ldMap.addLayer({
url: item.layerUrl,
id: e,
@@ -472,11 +491,9 @@ function selectLayer(e) {
});
}
-watch([house, road, river], (newhouse, newroad, newriver) => {
- console.log(newhouse);
- selectId.value = 2;
-
- tableDate.value = newhouse[selectType.value];
+watch([house, river, road], (newData) => {
+ selectId.value != 4 && (selectId.value = 2);
+ tableDate.value = newData[selectType.value];
});
const lineNowData = ref([]);
watch(lineArray, (val) => {
@@ -542,6 +559,8 @@ watch(checkedLegend, (val) => {
});
async function showLineArrMap(data) {
+ $ldMap.removePoint();
+ $ldMap.removeLine()
let treeData = await $ldMap.addDefaultByline(data);
setTreeData(treeData);
}
@@ -653,12 +672,7 @@ const tabList = reactive([
background: transparent;
color: #fff;
}
-:deep(.el-table) {
- width: 90%;
- margin: 0 auto;
- background: transparent;
- height: calc(100vh - 170px);
-}
+
:deep(.el-table tr):hover {
background: transparent;
}
diff --git a/src/ldmap/components/comRight/costSet.vue b/src/ldmap/components/comRight/costSet.vue
index a65d7ca..797c44a 100644
--- a/src/ldmap/components/comRight/costSet.vue
+++ b/src/ldmap/components/comRight/costSet.vue
@@ -39,12 +39,12 @@
修改
删除
@@ -89,7 +89,7 @@
@@ -188,7 +188,6 @@ const {
} = toRefs(data);
queryParams.value.layersId = props.layerId
-alert(queryParams.value.layersId)
// 表单重置
function reset() {
form.value = {
diff --git a/src/ldmap/components/comRight/right.vue b/src/ldmap/components/comRight/right.vue
index c28fca4..25dca76 100644
--- a/src/ldmap/components/comRight/right.vue
+++ b/src/ldmap/components/comRight/right.vue
@@ -23,45 +23,88 @@
>
数据核验 -->
特征物保存
新增房屋
新增河流
新增道路
新增站点
-
-
+ 切割特征物
+ 导 出
+
+ 展示
+ 关闭道路高程
+
+
@@ -127,30 +233,91 @@ import rightIcon from "@map/assets/tool/right.png";
import upIcon from "@map/assets/tool/up.png";
import downIcon from "@map/assets/tool/down.png";
import useMapDataStore from "@map/store/modules/mapData";
-import { ElMessageBox } from "element-plus";
+import { ElMessageBox, ElMessage } from "element-plus";
+import useMapLogStore from "@map/store/modules/mapLog";
+
+import cut from "@map/utils/map/cut";
+import exporGis from "@map/utils/map/export";
+let mapLog = useMapLogStore();
let mapdata = useMapDataStore();
import { storeToRefs } from "pinia";
const $ldMap = inject("$ldMap"); // 调用全局变量
const value = ref(null);
-
+const pipeline = ref(true);
+const recognition = ref(true);
const { proxy } = getCurrentInstance();
-const { showCheck, pointArray, checkedLegend, checkedpoint,layerId } =
- storeToRefs(mapdata);
+const {
+ showCheck,
+ pointArray,
+ maxPointIndex,
+ checkedLegend,
+ checkedpoint,
+ layerName,
+ layerId,
+ profilesId,
+ secen,
+} = storeToRefs(mapdata);
onMounted(() => {
getlegend();
document.addEventListener("keyup", (e) => {
if (e.key == "Delete") {
let layerVal = $ldMap.delSketch();
- mapdata.delData(layerVal);
+ if (layerVal) {
+ mapdata.delData(layerVal);
+ }
}
});
});
+watch(profilesId, (val) => {
+ if(secen.value=='recognition'){
+ recognition.value = val == null;
+ pipeline.value = true
+ }else{
+ pipeline.value = val ==null;
+ recognition.value=true
+ }
+
+});
const legendlineData = ref([]);
const legendPointeData = ref([]);
const checkAll = ref(true);
+watch(layerId, (val) => {
+ if (checkedqdf.value) {
+ mapdata.getSetpointStyle().then((e) => {
+ septicTank.value = e;
+ imgUlr.value = e.img;
+ $ldMap.addsepticTank(e);
+ });
+ } else {
+ septicTank.value = null;
+ }
+});
+const checkedqdf = ref(false);
+const septicTank = ref();
+const imgUlr = ref();
+watch(checkedqdf, (val) => {
+ console.log(val);
+ if (val) {
+ if (septicTank.value) {
+ $ldMap.setPngPoint(true);
+ } else {
+ mapdata.getSetpointStyle().then((e) => {
+ septicTank.value = e;
+ imgUlr.value = e.img;
+ $ldMap.addsepticTank(e);
+ });
+ }
+ } else {
+ $ldMap.setPngPoint(false);
+ }
+});
+function addPointByPng(type) {
+ $ldMap.addOpionPoint(type, imgUlr.value);
+}
+
const isIndeterminate = ref(true);
const handleCheckAllChange = (val) => {
checkedLegend.value = val
@@ -189,8 +356,7 @@ const getlegend = () => {
legendlineData.value.push(line[i]);
}
for (let i in point) {
- if(point[i].visible)
- legendPointeData.value.push(point[i]);
+ if (point[i].visible) legendPointeData.value.push(point[i]);
}
});
};
@@ -205,10 +371,25 @@ const lineThird = ref(false);
const emit = defineEmits();
const a = ref("");
function emitFind() {
+ secen.value = "recognition";
emit("update:findValue", true);
- //叠加图层
+}
+function optimizeMaxLength(){
+ $ldMap.ponitBindByFivety()
+}
+function optimizePoline() {
+
+ let length = 5;
+ let num = $ldMap.pointBindByLength(length);
+ ElMessageBox.alert(
+ `检查井相近距离${length}米优化,已经优化点位:${num}个`,
+ "优化提示",
+ {
+ confirmButtonText: "确定",
+ callback: (action) => {},
+ }
+ );
- // 高层文件 航拍文件
}
function exportPng() {
$ldMap.arcgisPrint();
@@ -216,14 +397,26 @@ function exportPng() {
function mergeOpt() {
$ldMap.MergeOptimization();
}
-function addPointBy() {
- $ldMap.addOpionPoint()
+function addPointBy(type) {
+ mapdata.setMaxPointIndex(1);
+ $ldMap.addOpionPoint(type, maxPointIndex.value);
}
-function addLine() {
- $ldMap.startDrawLine();
+function addLine(type) {
+ $ldMap.startDrawLine(type);
+}
+const isShow = ref(false)
+function elevationPolygon(){
+
+ mapdata.getfindSkeleton().then(res=>{
+ isShow.value = !isShow.value
+ $ldMap.elevationData(isShow.value,res.data);
+ })
+
+
}
function addPointMap(val) {
$ldMap.removePoint();
+
val.forEach((data) => {
$ldMap.addDefaultByPoint(data);
});
@@ -231,7 +424,13 @@ function addPointMap(val) {
function getAllMapData() {
$ldMap.getAllData();
}
-
+function cutPolygon() {
+ let { flag, data } = cut();
+ if (flag) {
+ } else {
+ ElMessage({ message: "请选择需要切割区域", type: "error" });
+ }
+}
function addPolygon(type) {
// console.log(mapdata.house)
$ldMap.DrawSketch("polygon", type);
@@ -257,10 +456,33 @@ function addPointDevice() {
function verificationChange() {
emit("changeVerification");
}
-function setPolineData(){
- let data = $ldMap.getpointByStart()
+function setPolineData() {
+ let data = $ldMap.getpointByStart();
- console.log(JSON.stringify(data))
+ console.log(JSON.stringify(data));
+
+ let lineList = data.line.filter((item) => {
+ return item[item.length - 1][2] != "s";
+ });
+
+ if (lineList.length) {
+ $ldMap.hightLineLayer(lineList[0]);
+ ElMessageBox.confirm("当前所以管线未连接到设备点,是否继续保存", {
+ confirmButtonText: "保存",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ mapdata.saveLine(data).then(() => {
+ mapLog.clearExitContent();
+ });
+ })
+ .catch(() => {});
+ } else {
+ mapdata.saveLine(data).then(() => {
+ mapLog.clearExitContent();
+ });
+ }
}
//保存特征物
function setPolygonData() {
@@ -303,6 +525,7 @@ function setPolygonData() {
peopleNum,
};
}
+
arrParam.push({
id,
layersId,
@@ -310,51 +533,67 @@ function setPolygonData() {
geometryId,
type,
extend,
- path: JSON.stringify(path),
- innerings: JSON.stringify(innerings),
+ path: path,
+ innerings: innerings,
});
}
}
});
- let deviceObj = {}
- if(pointdata.length){
+ let deviceObj = {};
+ if (pointdata.length) {
pointdata.forEach((res) => {
- deviceObj={
- action:1,
+ deviceObj = {
+ action: 1,
type: "Station",
- path: JSON.stringify([[res.geometry.x, res.geometry.y]]),
- layersId:layerId.value,
- geometryId: Date.now()
+ path: [[res.geometry.x, res.geometry.y]],
+ layersId: layerId.value,
+ geometryId: "Station:" + Date.now(),
};
- });
-
- }else{
- deviceObj={
- action:0,
+ });
+ } else {
+ deviceObj = {
+ action: 0,
};
-
}
- console.log(arrParam,deviceObj);
- mapdata.updateRecon(arrParam,deviceObj).then((res) => {
- $ldMap.removeAllLayer();
- $ldMap.addDefaultData(mapdata.road, "Road");
- $ldMap.addDefaultData(mapdata.house, "House");
- $ldMap.addDefaultData(mapdata.river, "River");
- $ldMap.addDeviceData(mapdata.station, "Station");
+ console.log(arrParam, deviceObj);
+ mapdata.updateRecon(arrParam, deviceObj).then((res) => {
+ mapLog.clearExitContent();
+ mapLog.addContent({
+ mapType: "regon", //regon:特征物,line:线
+ actionType: "data", //add,exit,del,
+ isrevoke: false, //是否允许撤回,
+ });
+ $ldMap.removeAllLayer();
+ $ldMap.addDefaultData(mapdata.road, "Road");
+ $ldMap.addDefaultData(mapdata.house, "House");
+ $ldMap.addDefaultData(mapdata.river, "River");
+ $ldMap.addDeviceData(mapdata.station, "Station");
});
}
+function exportCad(){
+ // exporGis()
+ if(profilesId.value){
+ proxy.download("/pipe/recognition/exportCad?profilesId="+profilesId.value, {},
+ `${layerName.value}.dxf`,{
+ baseURL: "/map-api"
+ },true);
+
+ }else{
+ ElMessage({ message: "请先选择特征物数据", type: "error" });
+ }
+
+}
function setPrice() {
mapdata.createcsvFile().then((res) => {
emit("update:priceFlag", true);
});
}
-function set() {
-
-}
+function set() {}
function emitLine() {
+ secen.value = "pipeline";
emit("update:lineValue", true);
}
diff --git a/src/ldmap/components/index.vue b/src/ldmap/components/index.vue
index 599dde0..a4adc2b 100644
--- a/src/ldmap/components/index.vue
+++ b/src/ldmap/components/index.vue
@@ -1,36 +1,22 @@
-
-
+
+ @change-exit="regconChange"
+ ref="leftComponent"
+ @line-exit="lineDataChange"
+ @cad-add="openCadDialog"
+ @cad-show="openCadShowDialog"
+ @upload-show="uploadShowDialog"
+ class="left"
+ :is="componentId"
+ >
{
- findValue = e;
- sseData = [];
- }
- "
- @update:lineValue="
- (e) => {
- lineValue = e;
- sseData = [];
- }
- "
+ @update:findValue="setFindVal"
+ @update:lineValue="setLineVal"
@update:priceFlag="
(e) => {
priceFlag = e;
@@ -39,7 +25,6 @@
>