|
@@ -1,5 +1,11 @@
|
|
<template>
|
|
<template>
|
|
- <div class="comprehensive-analysis">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="comprehensive-analysis"
|
|
|
|
+ v-loading="layerLoading"
|
|
|
|
+ element-loading-text="拼命加载中"
|
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
|
+ >
|
|
<LawPopup class="comprehensive-analysis-law-popup" />
|
|
<LawPopup class="comprehensive-analysis-law-popup" />
|
|
<LabelCasePopup
|
|
<LabelCasePopup
|
|
class="comprehensive-analysis-label-popup"
|
|
class="comprehensive-analysis-label-popup"
|
|
@@ -278,9 +284,16 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ layerLoading: false,
|
|
expandedKeys: [],
|
|
expandedKeys: [],
|
|
|
|
+ // 我的模型id集合
|
|
myModelIdMap: new Map(),
|
|
myModelIdMap: new Map(),
|
|
|
|
+ // 第一层数据集合
|
|
|
|
+ firstLevelIdMap: new Map(),
|
|
|
|
+ // 下拉框镇集合
|
|
townSelectTreeMap: new Map(),
|
|
townSelectTreeMap: new Map(),
|
|
|
|
+ // 所有图层 -- 根据镇域划分的数据集合
|
|
|
|
+ allLayersByTownMap: new Map(),
|
|
labelAllVisibleChecked: true,
|
|
labelAllVisibleChecked: true,
|
|
townSelectVal: "",
|
|
townSelectVal: "",
|
|
townOptions: [],
|
|
townOptions: [],
|
|
@@ -530,9 +543,11 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.townOptions = [];
|
|
this.townOptions = [];
|
|
- this.getColumnList();
|
|
|
|
this.classDictQuery("0", "c_task_type", "任务类型");
|
|
this.classDictQuery("0", "c_task_type", "任务类型");
|
|
this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
|
|
this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.getColumnList();
|
|
|
|
+ }, 500);
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -564,9 +579,54 @@ export default {
|
|
// 勾选镇时默认展开当前镇
|
|
// 勾选镇时默认展开当前镇
|
|
changeTownEvent(val) {
|
|
changeTownEvent(val) {
|
|
if (this.townSelectTreeMap.has(val)) {
|
|
if (this.townSelectTreeMap.has(val)) {
|
|
- this.expandedKeys = [];
|
|
|
|
- this.expandedKeys.push(this.townSelectTreeMap.get(val).id);
|
|
|
|
- console.log(this.expandedKeys);
|
|
|
|
|
|
+ // let children = [{ id: 123, label: val, town: val, source: "生态资源" }];
|
|
|
|
+ let children = [];
|
|
|
|
+ let data = this.townSelectTreeMap.get(val).data;
|
|
|
|
+ if (data.length > 0) {
|
|
|
|
+ children = data.map((item1) => {
|
|
|
|
+ return {
|
|
|
|
+ id: `${item1.title}_${item1.id}`,
|
|
|
|
+ label: item1.title,
|
|
|
|
+ children:
|
|
|
|
+ !item1.columnList || item1.columnList.length === 0
|
|
|
|
+ ? []
|
|
|
|
+ : item1.columnList.map((item2) => {
|
|
|
|
+ this.rightPanelDataMap.set(`${item2.title}_${item2.id}`, {
|
|
|
|
+ id: item2.id,
|
|
|
|
+ mainType: "所有图层",
|
|
|
|
+ sourceType: item1.title,
|
|
|
|
+ });
|
|
|
|
+ this.randomColor.set(
|
|
|
|
+ `${item2.title}_${item2.id}`,
|
|
|
|
+ publicFun.getRandomColor()
|
|
|
|
+ );
|
|
|
|
+ return {
|
|
|
|
+ id: `${item2.title}_${item2.id}`,
|
|
|
|
+ label: item2.title,
|
|
|
|
+ columnId: item2.id,
|
|
|
|
+ townId: this.townSelectTreeMap.get(val).id,
|
|
|
|
+ townType: val,
|
|
|
|
+ sourceId: item1.id,
|
|
|
|
+ sourceType: item1.title,
|
|
|
|
+ mainType: "所有图层",
|
|
|
|
+ color: publicFun.getRandomColor(),
|
|
|
|
+ children: [],
|
|
|
|
+ };
|
|
|
|
+ }),
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.$refs.tree) {
|
|
|
|
+ this.$refs.tree.updateKeyChildren(
|
|
|
|
+ this.firstLevelIdMap.get("所有图层").id,
|
|
|
|
+ children
|
|
|
|
+ );
|
|
|
|
+ this.expandedKeys.push(this.firstLevelIdMap.get("所有图层").id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // this.expandedKeys.push(this.townSelectTreeMap.get(val).id);
|
|
|
|
+ // console.log(this.expandedKeys);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 清除页面所有数据
|
|
// 清除页面所有数据
|
|
@@ -581,12 +641,12 @@ export default {
|
|
this.$store.state.mapMethodsCollection
|
|
this.$store.state.mapMethodsCollection
|
|
.get("RENDER")
|
|
.get("RENDER")
|
|
.deleteGroupFromMap(group);
|
|
.deleteGroupFromMap(group);
|
|
- map2DViewer.analysisGroups[group].remove();
|
|
|
|
|
|
+ // map2DViewer.analysisGroups[group].remove();
|
|
}
|
|
}
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
}
|
|
}
|
|
|
|
|
|
- map2DViewer.analysisGroups = {};
|
|
|
|
|
|
+ // map2DViewer.analysisGroups = {};
|
|
map2DViewer.polygons = {};
|
|
map2DViewer.polygons = {};
|
|
this.attrTableShow = false;
|
|
this.attrTableShow = false;
|
|
this.updateCasePopupShow = false;
|
|
this.updateCasePopupShow = false;
|
|
@@ -632,24 +692,33 @@ export default {
|
|
* @sourceType 土地资源/林地资源/生态资源/水资源/全部
|
|
* @sourceType 土地资源/林地资源/生态资源/水资源/全部
|
|
*/
|
|
*/
|
|
displaySingleLayer(columnId, id, mainType, sourceType) {
|
|
displaySingleLayer(columnId, id, mainType, sourceType) {
|
|
- if (id !== "永久基本农田_50") {
|
|
|
|
|
|
+ // if (id !== "永久基本农田_50") {
|
|
|
|
+ let uniqueId = id;
|
|
|
|
+ if (!map2DViewer.analysisGroups[uniqueId]) {
|
|
|
|
+ if (!this.layerLoading) {
|
|
|
|
+ this.layerLoading = true;
|
|
|
|
+ }
|
|
// console.log(columnId, "columnId");
|
|
// console.log(columnId, "columnId");
|
|
let layerParams = new FormData();
|
|
let layerParams = new FormData();
|
|
layerParams = {
|
|
layerParams = {
|
|
columnId: columnId,
|
|
columnId: columnId,
|
|
states: "0,1,2,3",
|
|
states: "0,1,2,3",
|
|
- pageSize: 10,
|
|
|
|
|
|
+ pageSize: 10000,
|
|
page: 0,
|
|
page: 0,
|
|
};
|
|
};
|
|
this.$Post(this.urlsCollection.selectContentList, layerParams).then(
|
|
this.$Post(this.urlsCollection.selectContentList, layerParams).then(
|
|
(res) => {
|
|
(res) => {
|
|
if (res.code === 202 && res.content === "数据不存在") {
|
|
if (res.code === 202 && res.content === "数据不存在") {
|
|
|
|
+ this.layerLoading = false;
|
|
this.$message.info("暂无数据!");
|
|
this.$message.info("暂无数据!");
|
|
}
|
|
}
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.layerLoading = false;
|
|
|
|
+ }
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
|
|
+ console.log(res.content.count, "count");
|
|
this.paginationData.currentPage = 1;
|
|
this.paginationData.currentPage = 1;
|
|
this.paginationData.total = res.content.count;
|
|
this.paginationData.total = res.content.count;
|
|
- let uniqueId = id;
|
|
|
|
map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
this.legendTitle.push({
|
|
this.legendTitle.push({
|
|
@@ -704,9 +773,16 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ (error) => {
|
|
|
|
+ this.layerLoading = false;
|
|
|
|
+ this.$message.error("请求错误");
|
|
}
|
|
}
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+ if (map2DViewer.analysisGroups[uniqueId]) {
|
|
|
|
+ map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 切换页时改变图层数据
|
|
* 切换页时改变图层数据
|
|
@@ -790,14 +866,14 @@ export default {
|
|
this.classTextToIndex[keyName].set(v.name, v.index + "");
|
|
this.classTextToIndex[keyName].set(v.name, v.index + "");
|
|
});
|
|
});
|
|
|
|
|
|
- if (keyName === "浦东新区行政区划") {
|
|
|
|
- this.classTextToIndex[keyName].forEach((v, i) => {
|
|
|
|
- this.townOptions.push({
|
|
|
|
- value: i,
|
|
|
|
- label: i,
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // if (keyName === "浦东新区行政区划") {
|
|
|
|
+ // this.classTextToIndex[keyName].forEach((v, i) => {
|
|
|
|
+ // // this.townOptions.push({
|
|
|
|
+ // // value: i,
|
|
|
|
+ // // label: i,
|
|
|
|
+ // // });
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -808,75 +884,39 @@ export default {
|
|
if (res.code === 200 && res.content.length > 0) {
|
|
if (res.code === 200 && res.content.length > 0) {
|
|
let data = res.content.map((item1) => {
|
|
let data = res.content.map((item1) => {
|
|
if (item1.title === "所有图层" && item1.columnList.length > 0) {
|
|
if (item1.title === "所有图层" && item1.columnList.length > 0) {
|
|
- return {
|
|
|
|
|
|
+ this.firstLevelIdMap.set(item1.title, {
|
|
id: `${item1.title}_${item1.id}`,
|
|
id: `${item1.title}_${item1.id}`,
|
|
label: item1.title,
|
|
label: item1.title,
|
|
- // 镇
|
|
|
|
- children:
|
|
|
|
- !item1.columnList || item1.columnList.length === 0
|
|
|
|
- ? []
|
|
|
|
- : item1.columnList.map((item2) => {
|
|
|
|
- this.townSelectTreeMap.set(item2.title, {
|
|
|
|
- id: `${item2.title}_${item2.id}`,
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ if (item1.columnList && item1.columnList.length > 0) {
|
|
|
|
+ item1.columnList.map((item2) => {
|
|
|
|
+ //存储所有镇相关的数据
|
|
|
|
+ this.townSelectTreeMap.set(item2.title, {
|
|
|
|
+ id: item2.id,
|
|
|
|
+ data:
|
|
|
|
+ !item2.columnList || item2.columnList.length === 0
|
|
|
|
+ ? []
|
|
|
|
+ : item2.columnList,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
- return {
|
|
|
|
- id: `${item2.title}_${item2.id}`,
|
|
|
|
- label: item2.title,
|
|
|
|
- // 水资源,土地资源,林地资源
|
|
|
|
- children:
|
|
|
|
- !item2.columnList || item2.columnList.length === 0
|
|
|
|
- ? []
|
|
|
|
- : item2.columnList.map((item3) => {
|
|
|
|
- return {
|
|
|
|
- id: `${item3.title}_${item3.id}`,
|
|
|
|
- label: item3.title,
|
|
|
|
- tag: item3.tag,
|
|
|
|
- children:
|
|
|
|
- !item3.columnList ||
|
|
|
|
- item3.columnList.length === 0
|
|
|
|
- ? []
|
|
|
|
- : item3.columnList.map((item4) => {
|
|
|
|
- this.rightPanelDataMap.set(
|
|
|
|
- `${item4.title}_${item4.id}`,
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- id: item4.id,
|
|
|
|
- mainType: item1.title,
|
|
|
|
- sourceType: item3.title,
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- this.randomColor.set(
|
|
|
|
- `${item4.title}_${item4.id}`,
|
|
|
|
- publicFun.getRandomColor()
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- id: `${item4.title}_${item4.id}`,
|
|
|
|
- label: item4.title,
|
|
|
|
- children: [],
|
|
|
|
- columnId: item4.id,
|
|
|
|
- townId: item2.id,
|
|
|
|
- townType: item2.title,
|
|
|
|
- sourceId: item3.id,
|
|
|
|
- sourceType: item3.title,
|
|
|
|
- mainType: item1.title,
|
|
|
|
- color: publicFun.getRandomColor(),
|
|
|
|
- };
|
|
|
|
- }),
|
|
|
|
- };
|
|
|
|
- }),
|
|
|
|
- };
|
|
|
|
- }),
|
|
|
|
|
|
+ return {
|
|
|
|
+ id: `${item1.title}_${item1.id}`,
|
|
|
|
+ label: item1.title,
|
|
|
|
+ children: [],
|
|
};
|
|
};
|
|
}
|
|
}
|
|
if (item1.title === "预设模型" && item1.columnList.length > 0) {
|
|
if (item1.title === "预设模型" && item1.columnList.length > 0) {
|
|
|
|
+ this.firstLevelIdMap.set(item1.title, {
|
|
|
|
+ id: `${item1.title}_${item1.id}`,
|
|
|
|
+ label: item1.title,
|
|
|
|
+ });
|
|
return {
|
|
return {
|
|
id: `${item1.title}_${item1.id}`,
|
|
id: `${item1.title}_${item1.id}`,
|
|
label: item1.title,
|
|
label: item1.title,
|
|
children:
|
|
children:
|
|
- item1.columnList.length === 0
|
|
|
|
|
|
+ !item1.columnList || item1.columnList.length === 0
|
|
? []
|
|
? []
|
|
: item1.columnList.map((item2) => {
|
|
: item1.columnList.map((item2) => {
|
|
return {
|
|
return {
|
|
@@ -917,6 +957,10 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
if (item1.title === "我的模型") {
|
|
if (item1.title === "我的模型") {
|
|
|
|
+ this.firstLevelIdMap.set(item1.title, {
|
|
|
|
+ id: `${item1.title}_${item1.id}`,
|
|
|
|
+ label: item1.title,
|
|
|
|
+ });
|
|
this.myModelIdMap.set(
|
|
this.myModelIdMap.set(
|
|
`${item1.title}_${item1.id}`,
|
|
`${item1.title}_${item1.id}`,
|
|
`${item1.title}_${item1.id}`
|
|
`${item1.title}_${item1.id}`
|
|
@@ -934,13 +978,23 @@ export default {
|
|
this.modelData.unshift(v);
|
|
this.modelData.unshift(v);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
this.modelData.push({
|
|
this.modelData.push({
|
|
id: "我的图层",
|
|
id: "我的图层",
|
|
label: "我的图层",
|
|
label: "我的图层",
|
|
children: [],
|
|
children: [],
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // 获取我的模型数据
|
|
this.getMyModelData();
|
|
this.getMyModelData();
|
|
|
|
+ this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
|
|
|
|
+ if (this.townSelectTreeMap.has(i)) {
|
|
|
|
+ this.townOptions.push({
|
|
|
|
+ value: i,
|
|
|
|
+ label: i,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -955,7 +1009,6 @@ export default {
|
|
|
|
|
|
this.$Post(this.urlsCollection.selectContentList, params)
|
|
this.$Post(this.urlsCollection.selectContentList, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- // console.log(res, "判断是否有");
|
|
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
let children = res.content.data.map((ele) => {
|
|
let children = res.content.data.map((ele) => {
|
|
customModelIdMap.set(ele.title, {
|
|
customModelIdMap.set(ele.title, {
|
|
@@ -977,11 +1030,19 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
if (this.modelData.length > 0) {
|
|
if (this.modelData.length > 0) {
|
|
- this.modelData.forEach((ele) => {
|
|
|
|
- if (ele.label == "我的模型") {
|
|
|
|
- ele.children = children;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.$refs.tree) {
|
|
|
|
+ this.$refs.tree.updateKeyChildren(
|
|
|
|
+ this.firstLevelIdMap.get("我的模型").id,
|
|
|
|
+ children
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // this.expandedKeys.push(this.firstLevelIdMap.get("我的模型").id);
|
|
|
|
+ // this.modelData.forEach((ele) => {
|
|
|
|
+ // if (ele.label == "我的模型") {
|
|
|
|
+ // ele.children = children;
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -1074,7 +1135,9 @@ export default {
|
|
if (!value) return true;
|
|
if (!value) return true;
|
|
return data.label.indexOf(value) !== -1;
|
|
return data.label.indexOf(value) !== -1;
|
|
},
|
|
},
|
|
|
|
+ // 定位功能失效
|
|
locateEvent(node) {
|
|
locateEvent(node) {
|
|
|
|
+ console.log(this.layerIdMap);
|
|
if (this.layerIdMap.has(node.data.id)) {
|
|
if (this.layerIdMap.has(node.data.id)) {
|
|
let layer = this.layerIdMap.get(node.data.id);
|
|
let layer = this.layerIdMap.get(node.data.id);
|
|
// console.log(layer, "layer");
|
|
// console.log(layer, "layer");
|
|
@@ -1183,7 +1246,7 @@ export default {
|
|
data.columnId,
|
|
data.columnId,
|
|
data.id,
|
|
data.id,
|
|
data.mainType,
|
|
data.mainType,
|
|
- data.sourceType
|
|
|
|
|
|
+ data.sourceType ? data.sourceType : ""
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1197,16 +1260,21 @@ export default {
|
|
data.columnId,
|
|
data.columnId,
|
|
data.id,
|
|
data.id,
|
|
data.mainType,
|
|
data.mainType,
|
|
- data.sourceType
|
|
|
|
|
|
+ data.sourceType ? data.sourceType : ""
|
|
);
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (this.$store.state.selectSelectDataMap["singlePolygon"][data.id]) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.$store.state.selectSelectDataMap["singlePolygon"] &&
|
|
|
|
+ this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
|
|
|
|
+ ) {
|
|
delete this.$store.state.selectSelectDataMap["singlePolygon"][
|
|
delete this.$store.state.selectSelectDataMap["singlePolygon"][
|
|
data.id
|
|
data.id
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- delete this.originalData[data.id];
|
|
|
|
|
|
+ if (this.originalData && this.originalData[data.id]) {
|
|
|
|
+ delete this.originalData[data.id];
|
|
|
|
+ }
|
|
map2DViewer.map.closePopup();
|
|
map2DViewer.map.closePopup();
|
|
|
|
|
|
// 移除图例
|
|
// 移除图例
|
|
@@ -1240,82 +1308,121 @@ export default {
|
|
checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
|
|
checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 显示我的模型数据
|
|
displayMyModelData(data) {
|
|
displayMyModelData(data) {
|
|
- // 如果有叠置分析文件 -- 呈现叠置分析内容
|
|
|
|
- if (data.c_dzfx_file) {
|
|
|
|
- this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
|
|
|
|
- (response) => {
|
|
|
|
- if (response.features.length > 0) {
|
|
|
|
- response.features.forEach((v) => {
|
|
|
|
- let geojson = publicFun.standardGeojson(v.geometry.coordinates);
|
|
|
|
- // console.log(geojson, "geojson")
|
|
|
|
- this.readGeojson(geojson, data.id);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- } else {
|
|
|
|
- let params = new FormData();
|
|
|
|
- params = {
|
|
|
|
- modelId: data.id,
|
|
|
|
- userId: localStorage.getItem("USER_ID"),
|
|
|
|
- };
|
|
|
|
- // 调用我的模型查看接口读取所有图层数据
|
|
|
|
- this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
|
|
|
|
- (res) => {
|
|
|
|
- if (res.code === 201 && res.message === "未申请任务权限") {
|
|
|
|
- this.$message.info("暂无数据!");
|
|
|
|
|
|
+ debugger;
|
|
|
|
+ let uniqueId = data.id;
|
|
|
|
+ // 我的模型图层组初始化
|
|
|
|
+ if (!map2DViewer.analysisGroups[uniqueId]) {
|
|
|
|
+ map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
|
|
+ map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
|
|
+ this.layerIdMap.set(uniqueId, uniqueId);
|
|
|
|
+ if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
|
|
|
|
+ this.$store.state.selectSelectDataMap["singlePolygon"] = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 如果有叠置分析文件 -- 呈现叠置分析内容
|
|
|
|
+ if (data.c_dzfx_file) {
|
|
|
|
+ this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
|
|
|
|
+ (response) => {
|
|
|
|
+ if (response.features.length > 0) {
|
|
|
|
+ if (map2DViewer.analysisGroups[uniqueId]) {
|
|
|
|
+ // 清除当前图层组内所有图层,并读取GeoJSON数据
|
|
|
|
+ map2DViewer.analysisGroups[uniqueId].clearLayers();
|
|
|
|
+ response.features.forEach((v) => {
|
|
|
|
+ let geojson = publicFun.standardGeojson(
|
|
|
|
+ v.geometry.coordinates
|
|
|
|
+ );
|
|
|
|
+ // 读取Geojson中的数据
|
|
|
|
+ // this.$store.state.mapMethodsCollection
|
|
|
|
+ // .get("RENDER")
|
|
|
|
+ // .addSinglePolygon(
|
|
|
|
+ // geometry,
|
|
|
|
+ // cid,
|
|
|
|
+ // "#ff0",
|
|
|
|
+ // uniqueId,
|
|
|
|
+ // data.mainType,
|
|
|
|
+ // ""
|
|
|
|
+ // );
|
|
|
|
+ //等叠置分析有结果后再进行调试
|
|
|
|
+ // console.log(geojson, "geojson")
|
|
|
|
+ // this.readGeojson(geojson, data.id);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if (res.code === 200 && res.content.length > 0) {
|
|
|
|
- console.log(res.content, "查看我的模型图层数据");
|
|
|
|
- let uniqueId = `${data.label}_${data.id}`;
|
|
|
|
- map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
|
|
- map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
|
|
- this.layerIdMap.set(uniqueId, uniqueId);
|
|
|
|
- // 判断能用的数据
|
|
|
|
- // 根据column_name或 column_id判断有几个图层
|
|
|
|
- res.content.forEach((ele, index) => {
|
|
|
|
- let cid = ele.id;
|
|
|
|
- let geometry = ele.c_content;
|
|
|
|
- // this.$store.state.mapMethodsCollection
|
|
|
|
- // .get("RENDER")
|
|
|
|
- // .addSinglePolygon(
|
|
|
|
- // geometry,
|
|
|
|
- // cid,
|
|
|
|
- // // this.randomColor.get(uniqueId),
|
|
|
|
- // uniqueId,
|
|
|
|
- // mainType,
|
|
|
|
- // sourceType
|
|
|
|
- // );
|
|
|
|
- // let legendTitle = this.legendTitle.push({});
|
|
|
|
- // map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
|
|
- // map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
|
|
- });
|
|
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ let params = new FormData();
|
|
|
|
+ params = {
|
|
|
|
+ modelId: data.id,
|
|
|
|
+ userId: localStorage.getItem("USER_ID"),
|
|
|
|
+ };
|
|
|
|
+ // 调用我的模型查看接口读取所有图层数据
|
|
|
|
+ this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.code === 201 && res.message === "未申请任务权限") {
|
|
|
|
+ this.$message.info("暂无数据!");
|
|
|
|
+ }
|
|
|
|
+ if (res.code === 200 && res.content.length > 0) {
|
|
|
|
+ console.log(res.content, "查看我的模型图层数据");
|
|
|
|
+ // 清除当前图层组内所有图层,并读取GeoJSON数据
|
|
|
|
+ map2DViewer.analysisGroups[uniqueId].clearLayers();
|
|
|
|
+ // 判断能用的数据
|
|
|
|
+ // 根据column_name或 column_id判断有几个图层
|
|
|
|
+ res.content.forEach((ele, index) => {
|
|
|
|
+ let cid = ele.id;
|
|
|
|
+ let geometry = ele.c_content;
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .addSinglePolygon(
|
|
|
|
+ geometry,
|
|
|
|
+ cid,
|
|
|
|
+ "#ff0",
|
|
|
|
+ uniqueId,
|
|
|
|
+ data.mainType,
|
|
|
|
+ ""
|
|
|
|
+ );
|
|
|
|
+ // let legendTitle = this.legendTitle.push({});
|
|
|
|
+ // map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
|
|
|
|
+ // map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (map2DViewer.analysisGroups[uniqueId]) {
|
|
|
|
+ // 直接显示移除掉的图层
|
|
|
|
+ map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- readGeojson(geojson, id) {
|
|
|
|
- map2DViewer.overlay[id] = [];
|
|
|
|
- let states = [];
|
|
|
|
- states.push(geojson);
|
|
|
|
- let geojsonData = L.geoJSON(states, {
|
|
|
|
- style: function (feature) {
|
|
|
|
- // console.log(feature);
|
|
|
|
- },
|
|
|
|
- }).addTo(map2DViewer.map);
|
|
|
|
- map2DViewer.overlay[id] = geojsonData;
|
|
|
|
|
|
+ readGeojson(geojson, uniqueId) {
|
|
|
|
+ debugger;
|
|
|
|
+ // 尽量与所有图层,预设模型读取几何数据的方式一样,
|
|
|
|
+ // let states = [];
|
|
|
|
+ // states.push(geojson);
|
|
|
|
+ // let geojsonData = L.geoJSON(states, {
|
|
|
|
+ // style: function (feature) {
|
|
|
|
+ // // console.log(feature);
|
|
|
|
+ // },
|
|
|
|
+ // }).addTo(map2DViewer.map);
|
|
|
|
+ // map2DViewer.analysisGroups[uniqueId] = geojsonData;
|
|
},
|
|
},
|
|
deleteMyModelData(data) {
|
|
deleteMyModelData(data) {
|
|
- // 如果有叠置分析文件,删除叠置分析图层
|
|
|
|
- if (data.c_dzfx_file) {
|
|
|
|
- if (map2DViewer.overlay[data.id]) {
|
|
|
|
- map2DViewer.map.removeLayer(map2DViewer.overlay[data.id]);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- // 删除绘制的图层数据
|
|
|
|
|
|
+ // 直接删除图层组中的数据
|
|
|
|
+ if (map2DViewer.analysisGroups[data.id]) {
|
|
|
|
+ map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
|
|
}
|
|
}
|
|
|
|
+ // 如果有叠置分析文件,删除叠置分析图层
|
|
|
|
+ // if (data.c_dzfx_file) {
|
|
|
|
+ // if (map2DViewer.analysisGroups[data.id]) {
|
|
|
|
+ // map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // // 删除绘制的图层数据
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
//显示详细信息
|
|
//显示详细信息
|
|
viewDetailsPopup(data) {
|
|
viewDetailsPopup(data) {
|