|
@@ -102,7 +102,11 @@
|
|
|
>
|
|
|
<span class="custom-tree-node" slot-scope="{ node }">
|
|
|
<template
|
|
|
- v-if="node.level < 4 && node.parent.label !== '预设模型'"
|
|
|
+ v-if="
|
|
|
+ node.level < 4 &&
|
|
|
+ node.parent.label !== '预设模型' &&
|
|
|
+ node.parent.label !== '我的模型'
|
|
|
+ "
|
|
|
>
|
|
|
<div
|
|
|
:class="{
|
|
@@ -128,25 +132,34 @@
|
|
|
style="position: absolute; right: -30px; top: -12px"
|
|
|
></el-button
|
|
|
></span>
|
|
|
- <span style="position: absolute; right: -85px; top: -8px">
|
|
|
- <el-button
|
|
|
- v-if="node.parent.label === '我的模型'"
|
|
|
- size="small"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(node)"
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- v-if="node.parent.label === '我的模型'"
|
|
|
- size="small"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(node)"
|
|
|
- ></el-button>
|
|
|
- </span>
|
|
|
</el-checkbox>
|
|
|
</template>
|
|
|
- <!-- <template v-else>
|
|
|
+ <template v-else-if="node.parent.label === '我的模型'">
|
|
|
+ <div
|
|
|
+ :class="{
|
|
|
+ 'tree-arrow': !node.expanded,
|
|
|
+ 'tree-arrow-expanded': node.expanded,
|
|
|
+ }"
|
|
|
+ ></div>
|
|
|
+ <span
|
|
|
+ >{{ node.label }}
|
|
|
+ <el-button
|
|
|
+ v-if="node.parent.label === '我的模型'"
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(node)"
|
|
|
+ ></el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="node.parent.label === '我的模型'"
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(node)"
|
|
|
+ ></el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
<div
|
|
|
:class="{
|
|
|
'tree-arrow': !node.expanded,
|
|
@@ -154,7 +167,7 @@
|
|
|
}"
|
|
|
></div>
|
|
|
<span>{{ node.label }}</span>
|
|
|
- </template> -->
|
|
|
+ </template>
|
|
|
</span>
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -324,8 +337,21 @@ export default {
|
|
|
this.$store.state.updateCasePopupShow = val;
|
|
|
},
|
|
|
},
|
|
|
+ uploadDataArr() {
|
|
|
+ return uploadDataIdArr;
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
+ uploadDataArr: {
|
|
|
+ handler(val) {
|
|
|
+ if (val.length > 0) {
|
|
|
+ console.log(val, "uploadDataIdArr");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ // console.log(val,"uploadDataIdArr");
|
|
|
+ },
|
|
|
getLeftMenuTitle: {
|
|
|
handler(val) {
|
|
|
this.$nextTick(() => {
|
|
@@ -358,6 +384,7 @@ export default {
|
|
|
getCustomModel: {
|
|
|
handler(val) {
|
|
|
console.log(val, "目前存在的自定义模型");
|
|
|
+ this.getMyModelData();
|
|
|
// let myModelRef = this.$refs.tree.data[2];
|
|
|
// if (myModelRef.label === "我的模型") {
|
|
|
// this.$refs.tree.data[2].children = val.map((ele) => {
|
|
@@ -423,6 +450,7 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
treeIdMap.clear();
|
|
|
+ uploadDataIdArr = [];
|
|
|
this.treeCoordMap.clear();
|
|
|
map2DViewer.map.off("move");
|
|
|
if (Object.getOwnPropertyNames(map2DViewer.polygons).length > 0) {
|
|
@@ -567,7 +595,6 @@ export default {
|
|
|
label: item2.title,
|
|
|
children: [],
|
|
|
mainType: item1.title,
|
|
|
- // color: publicFun.getRandomColor(),
|
|
|
};
|
|
|
}),
|
|
|
};
|
|
@@ -593,13 +620,77 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.modelData.push({
|
|
|
- id:"我的图层",
|
|
|
- label:"我的图层",
|
|
|
- children:[]
|
|
|
- })
|
|
|
+ id: "我的图层",
|
|
|
+ label: "我的图层",
|
|
|
+ children: [],
|
|
|
+ });
|
|
|
+
|
|
|
+ this.getMyModelData();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ getMyModelData() {
|
|
|
+ // 我的模型栏目信息
|
|
|
+ // {
|
|
|
+ // "level": 0,
|
|
|
+ // "modelId": 94,
|
|
|
+ // "updateTime": 1671432804228,
|
|
|
+ // "authorId": 4,
|
|
|
+ // "title": "我的模型",
|
|
|
+ // "type": 1,
|
|
|
+ // "content": "浦东审计-我的模型",
|
|
|
+ // "parentId": -1,
|
|
|
+ // "modelName": "pdsj_wdmx_m_ysmx_wdmx",
|
|
|
+ // "createTime": 1671432804228,
|
|
|
+ // "authorName": "user001",
|
|
|
+ // "id": 89,
|
|
|
+ // "state": 0,
|
|
|
+ // "tag": "pdsj_wdmx"
|
|
|
+ // },
|
|
|
+ let params = new FormData();
|
|
|
+ params = {
|
|
|
+ columnId: 89,
|
|
|
+ states: "0,1,2,3",
|
|
|
+ pageSize: 10,
|
|
|
+ page: 0,
|
|
|
+ };
|
|
|
+
|
|
|
+ this.$Post(this.urlsCollection.selectContentList, params)
|
|
|
+ .then((res) => {
|
|
|
+ // console.log(res, "判断是否有");
|
|
|
+ if (res.code === 200 && res.content.data.length > 0) {
|
|
|
+ console.log(res.content.data, "我的模型 - 最终数据");
|
|
|
+ let children = res.content.data.map((ele) => {
|
|
|
+ customModelIdMap.set(ele.title, {
|
|
|
+ column_id: ele.column_id,
|
|
|
+ id: ele.id,
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ id: ele.id,
|
|
|
+ label: ele.title,
|
|
|
+ children: [],
|
|
|
+ column_id: ele.column_id,
|
|
|
+ model_name: ele.model_name,
|
|
|
+ model_id: ele.model_id,
|
|
|
+ state: ele.state,
|
|
|
+ mainType: "我的模型",
|
|
|
+ c_bind_layer: ele.c_bind_layer,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (this.modelData.length > 0) {
|
|
|
+ this.modelData.forEach((ele) => {
|
|
|
+ if (ele.label == "我的模型") {
|
|
|
+ console.log(ele, "我的模型");
|
|
|
+ ele.children = children;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err, "getMyModelData");
|
|
|
+ });
|
|
|
+ },
|
|
|
// 调用我的标记接口
|
|
|
getUserMarkers() {
|
|
|
if (localStorage.getItem("USER_ID")) {
|
|
@@ -690,255 +781,231 @@ export default {
|
|
|
},
|
|
|
handleDelete(node) {
|
|
|
console.log(node, "删除节点");
|
|
|
+ let deleteParams = {
|
|
|
+ id: customModelIdMap.get(node.data.label).id,
|
|
|
+ columnId: 89,
|
|
|
+ state: 4,
|
|
|
+ };
|
|
|
+ this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.info("模型已删除!");
|
|
|
+ this.$store.state.customModelsArr =
|
|
|
+ this.$store.state.customModelsArr =
|
|
|
+ this.$store.state.customModelsArr.filter((v) => {
|
|
|
+ return v.name !== node.data.label;
|
|
|
+ });
|
|
|
+
|
|
|
+ // this.getMyModelData();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
handleNodeClick(node) {
|
|
|
// console.log(node, "node");
|
|
|
},
|
|
|
// 节点change事件
|
|
|
handleCheckChange(data, checked) {
|
|
|
- let guid = data.id;
|
|
|
- if (checked) {
|
|
|
- console.log(data, "选中的数据");
|
|
|
- this.showRightBox = true;
|
|
|
- if (data.mainType === "所有图层") {
|
|
|
- this.rightPanelTitle = data.label;
|
|
|
- this.originalData[`${data.label}_${data.town}`] =
|
|
|
- this.rightPanelDataMap.get(data.label);
|
|
|
+ if (data.mainType && data.mainType !== "我的模型") {
|
|
|
+ if (checked) {
|
|
|
+ console.log(data, "选中的数据");
|
|
|
+ this.showRightBox = true;
|
|
|
+ if (data.mainType === "所有图层") {
|
|
|
+ this.rightPanelTitle = data.label;
|
|
|
+ this.originalData[`${data.label}_${data.town}`] =
|
|
|
+ this.rightPanelDataMap.get(data.label);
|
|
|
|
|
|
- let searchParam = [];
|
|
|
- let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
|
|
|
- data.town
|
|
|
- );
|
|
|
- let targetType = this.classTextToIndex["任务类型"].get(data.type);
|
|
|
+ let searchParam = [];
|
|
|
+ let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
|
|
|
+ data.town
|
|
|
+ );
|
|
|
+ let targetType = this.classTextToIndex["任务类型"].get(data.type);
|
|
|
|
|
|
- let paramUser = {
|
|
|
- field: "c_user_id",
|
|
|
- searchType: "2",
|
|
|
- content: {
|
|
|
- value: localStorage.getItem("USER_ID"),
|
|
|
- },
|
|
|
- };
|
|
|
- searchParam.push(paramUser);
|
|
|
- let paramTown = {
|
|
|
- field: "c_area_code",
|
|
|
- searchType: "1",
|
|
|
- content: {
|
|
|
- value: targetTown,
|
|
|
- },
|
|
|
- };
|
|
|
- searchParam.push(paramTown);
|
|
|
- let paramType = {
|
|
|
- field: "c_task_type",
|
|
|
- searchType: "1",
|
|
|
- content: {
|
|
|
- value: targetType,
|
|
|
- },
|
|
|
- };
|
|
|
- searchParam.push(paramType);
|
|
|
+ let paramUser = {
|
|
|
+ field: "c_user_id",
|
|
|
+ searchType: "2",
|
|
|
+ content: {
|
|
|
+ value: localStorage.getItem("USER_ID"),
|
|
|
+ },
|
|
|
+ };
|
|
|
+ searchParam.push(paramUser);
|
|
|
+ let paramTown = {
|
|
|
+ field: "c_area_code",
|
|
|
+ searchType: "1",
|
|
|
+ content: {
|
|
|
+ value: targetTown,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ searchParam.push(paramTown);
|
|
|
+ let paramType = {
|
|
|
+ field: "c_task_type",
|
|
|
+ searchType: "1",
|
|
|
+ content: {
|
|
|
+ value: targetType,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ searchParam.push(paramType);
|
|
|
|
|
|
- let params = new FormData();
|
|
|
- params = {
|
|
|
- columnId: 61,
|
|
|
- states: "2,3",
|
|
|
- pageSize: 10,
|
|
|
- page: 0,
|
|
|
- search: JSON.stringify(searchParam),
|
|
|
- };
|
|
|
- console.log(params, "所有图层不显示");
|
|
|
+ let params = new FormData();
|
|
|
+ params = {
|
|
|
+ columnId: 61,
|
|
|
+ states: "2,3",
|
|
|
+ pageSize: 10,
|
|
|
+ page: 0,
|
|
|
+ search: JSON.stringify(searchParam),
|
|
|
+ };
|
|
|
+ console.log(params, "所有图层不显示");
|
|
|
|
|
|
- this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
- (res) => {
|
|
|
- // console.log(res, "获取数据");
|
|
|
- // debugger
|
|
|
- if (res.code === 202 && res.content === "数据不存在") {
|
|
|
- this.$message.info("当前用户无权限!");
|
|
|
- }
|
|
|
+ this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
+ (res) => {
|
|
|
+ // console.log(res, "获取数据");
|
|
|
+ // debugger
|
|
|
+ if (res.code === 202 && res.content === "数据不存在") {
|
|
|
+ this.$message.info("当前用户无权限!");
|
|
|
+ }
|
|
|
|
|
|
- if (res.code === 200 && res.content.data.length > 0) {
|
|
|
- console.log("有权限");
|
|
|
- console.log(data, "有权限的图层");
|
|
|
- this.$store.state.treeDataCollection.set(data.id, {
|
|
|
- mainType: data.mainType,
|
|
|
- town: data.town,
|
|
|
- type: data.type,
|
|
|
- });
|
|
|
+ if (res.code === 200 && res.content.data.length > 0) {
|
|
|
+ console.log("有权限");
|
|
|
+ console.log(data, "有权限的图层");
|
|
|
+ this.$store.state.treeDataCollection.set(data.id, {
|
|
|
+ mainType: data.mainType,
|
|
|
+ town: data.town,
|
|
|
+ type: data.type,
|
|
|
+ });
|
|
|
|
|
|
- let layerParams = new FormData();
|
|
|
- layerParams = {
|
|
|
- columnId: data.columnId,
|
|
|
- states: 3,
|
|
|
- pageSize: 10,
|
|
|
- page: 0,
|
|
|
- };
|
|
|
- this.$Post(
|
|
|
- this.urlsCollection.selectContentList,
|
|
|
- layerParams
|
|
|
- ).then((res) => {
|
|
|
- if (res.code === 200 && res.content.data.length > 0) {
|
|
|
- console.log(res.content, "获取到的数据");
|
|
|
- let uniqueId = `${data.label}_${data.town}`;
|
|
|
- this.originalData[uniqueId] = res.content.data.map(
|
|
|
- (ele) => {
|
|
|
- let cid = `${data.label}_${ele.id}`;
|
|
|
+ let layerParams = new FormData();
|
|
|
+ layerParams = {
|
|
|
+ columnId: data.columnId,
|
|
|
+ states: 3,
|
|
|
+ pageSize: 10,
|
|
|
+ page: 0,
|
|
|
+ };
|
|
|
+ this.$Post(
|
|
|
+ this.urlsCollection.selectContentList,
|
|
|
+ layerParams
|
|
|
+ ).then((res) => {
|
|
|
+ if (res.code === 200 && res.content.data.length > 0) {
|
|
|
+ console.log(res.content, "获取到的数据");
|
|
|
+ let uniqueId = `${data.label}_${data.town}`;
|
|
|
+ this.originalData[uniqueId] = res.content.data.map(
|
|
|
+ (ele) => {
|
|
|
+ let cid = `${data.label}_${ele.id}`;
|
|
|
|
|
|
- let geometry = ele.c_geometry;
|
|
|
- map2DViewer.polygons[`${cid}_polygon`] = [];
|
|
|
- this.layerIdMap.set(data.id, `${cid}_polygon`);
|
|
|
- // 激活当前展开面板
|
|
|
- this.activeNames = [
|
|
|
- "myLabel",
|
|
|
- `${data.label}_${data.town}`,
|
|
|
- ];
|
|
|
- this.$store.state.mapMethodsCollection
|
|
|
- .get("RENDER")
|
|
|
- .addSinglePolygon(
|
|
|
- geometry,
|
|
|
- cid,
|
|
|
- this.randomColor.get(uniqueId)
|
|
|
- );
|
|
|
- return {
|
|
|
- id: ele.id,
|
|
|
- name: ele.c_yichang,
|
|
|
- columnName: ele.column_name,
|
|
|
- town: data.town,
|
|
|
- area: ele.c_c_shui_area,
|
|
|
- nature: ele.c_yichang,
|
|
|
- // year: ele.c_c_year,
|
|
|
- };
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
+ let geometry = ele.c_geometry;
|
|
|
+ map2DViewer.polygons[`${cid}_polygon`] = [];
|
|
|
+ this.layerIdMap.set(data.id, `${cid}_polygon`);
|
|
|
+ // 激活当前展开面板
|
|
|
+ this.activeNames = [
|
|
|
+ "myLabel",
|
|
|
+ `${data.label}_${data.town}`,
|
|
|
+ ];
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
+ .get("RENDER")
|
|
|
+ .addSinglePolygon(
|
|
|
+ geometry,
|
|
|
+ cid,
|
|
|
+ this.randomColor.get(uniqueId)
|
|
|
+ );
|
|
|
+ return {
|
|
|
+ id: ele.id,
|
|
|
+ name: ele.c_yichang,
|
|
|
+ columnName: ele.column_name,
|
|
|
+ town: data.town,
|
|
|
+ area: ele.c_c_shui_area,
|
|
|
+ nature: ele.c_yichang,
|
|
|
+ // year: ele.c_c_year,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- if (data.mainType === "预设模型") {
|
|
|
- this.rightPanelTitle = `${data.label}(${data.mainType})`;
|
|
|
- let params = new FormData();
|
|
|
- params = {
|
|
|
- columnId: data.id.split("_")[1],
|
|
|
- states: "3",
|
|
|
- pageSize: 10,
|
|
|
- page: 0,
|
|
|
- };
|
|
|
+ if (data.mainType === "预设模型") {
|
|
|
+ this.rightPanelTitle = `${data.label}(${data.mainType})`;
|
|
|
+ let params = new FormData();
|
|
|
+ params = {
|
|
|
+ columnId: data.id.split("_")[1],
|
|
|
+ states: "3",
|
|
|
+ pageSize: 10,
|
|
|
+ page: 0,
|
|
|
+ };
|
|
|
|
|
|
- this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
- (res) => {
|
|
|
- if (res.code === 200 && res.content.data.length > 0) {
|
|
|
- console.log(res.content.data, "点击预设模型后获取到的数据");
|
|
|
- this.$store.state.treeDataCollection.set(data.id, {
|
|
|
- mainType: data.mainType,
|
|
|
- });
|
|
|
- // id: "水资源_88"
|
|
|
- let uniqueId = data.id;
|
|
|
- this.originalData[uniqueId] = res.content.data.map((ele) => {
|
|
|
- let cid = uniqueId;
|
|
|
- let geometry = ele.c_geometry;
|
|
|
- map2DViewer.polygons[`${cid}_polygon`] = [];
|
|
|
- this.layerIdMap.set(data.id, `${cid}_polygon`);
|
|
|
- // 激活当前展开面板
|
|
|
- this.activeNames = ["myLabel", data.id];
|
|
|
- console.log(this.randomColor.get(uniqueId), "check color");
|
|
|
- this.$store.state.mapMethodsCollection
|
|
|
- .get("RENDER")
|
|
|
- .addSinglePolygon(
|
|
|
- geometry,
|
|
|
- cid,
|
|
|
- this.randomColor.get(uniqueId)
|
|
|
- );
|
|
|
+ this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.code === 200 && res.content.data.length > 0) {
|
|
|
+ console.log(res.content.data, "点击预设模型后获取到的数据");
|
|
|
+ this.$store.state.treeDataCollection.set(data.id, {
|
|
|
+ mainType: data.mainType,
|
|
|
+ });
|
|
|
+ // id: "水资源_88"
|
|
|
+ let uniqueId = data.id;
|
|
|
+ this.originalData[uniqueId] = res.content.data.map((ele) => {
|
|
|
+ let cid = uniqueId;
|
|
|
+ let geometry = ele.c_geometry;
|
|
|
+ map2DViewer.polygons[`${cid}_polygon`] = [];
|
|
|
+ this.layerIdMap.set(data.id, `${cid}_polygon`);
|
|
|
+ // 激活当前展开面板
|
|
|
+ this.activeNames = ["myLabel", data.id];
|
|
|
+ console.log(this.randomColor.get(uniqueId), "check color");
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
+ .get("RENDER")
|
|
|
+ .addSinglePolygon(
|
|
|
+ geometry,
|
|
|
+ cid,
|
|
|
+ this.randomColor.get(uniqueId)
|
|
|
+ );
|
|
|
|
|
|
- return {
|
|
|
- id: ele.id,
|
|
|
- name: ele.c_yichang,
|
|
|
- columnName: ele.column_name,
|
|
|
- area: ele.c_c_shui_area,
|
|
|
- nature: ele.c_xingzhi,
|
|
|
- };
|
|
|
- });
|
|
|
+ return {
|
|
|
+ id: ele.id,
|
|
|
+ name: ele.c_yichang,
|
|
|
+ columnName: ele.column_name,
|
|
|
+ area: ele.c_c_shui_area,
|
|
|
+ nature: ele.c_xingzhi,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 设置右侧折叠面板item数量
|
|
|
+ delete this.originalData[`${data.label}_${data.town}`];
|
|
|
+ this.layerIdMap.delete(data.id);
|
|
|
+ //关联自定义模型
|
|
|
+ this.$store.state.treeDataCollection.delete(data.id);
|
|
|
+ console.log(
|
|
|
+ this.$store.state.treeDataCollection,
|
|
|
+ "treeDataCollection"
|
|
|
);
|
|
|
- }
|
|
|
-
|
|
|
- // 选中所有图层
|
|
|
- // if (guid.indexOf("defaultLayer") > -1) {
|
|
|
- // // 渲染当前模块下的面图层
|
|
|
- // let cid = defaultLayers[data.label].cid;
|
|
|
- // let color = defaultLayers[data.label].color;
|
|
|
-
|
|
|
- // let passData = {
|
|
|
- // name: data.label,
|
|
|
- // value: cid,
|
|
|
- // };
|
|
|
-
|
|
|
- // // 存放当前选中的图层,方便关联自定义模型
|
|
|
- // this.$store.commit("changeTreeData", passData);
|
|
|
- // get(`./static/json/${cid}.json`).then((geoJson) => {
|
|
|
- // map2DViewer.polygons[`${cid}_layer`] = [];
|
|
|
- // this.originalData[data.label] = geoJson.map((v, index) => {
|
|
|
- // return {
|
|
|
- // id: publicFun.buildGuid("abnormal"),
|
|
|
- // name: v.properties["异常"] + "_" + index,
|
|
|
- // geometry: v.geometry,
|
|
|
- // properties: v.properties,
|
|
|
- // };
|
|
|
- // });
|
|
|
- // // console.log(this.originalData[data.label], "label");
|
|
|
-
|
|
|
- // this.activeNames = ["myLabel", data.label];
|
|
|
-
|
|
|
- // // 地图定位
|
|
|
- // let firstPolygon = JSON.parse(JSON.stringify(geoJson[0]));
|
|
|
- // let coordinates = firstPolygon.geometry.coordinates[0][0][0];
|
|
|
- // this.treeCoordMap.set(data.label, coordinates);
|
|
|
-
|
|
|
- // this.$store.state.mapMethodsCollection
|
|
|
- // .get("RENDER")
|
|
|
- // .addPolygonLayer(geoJson, cid, color);
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // let passData = {
|
|
|
- // name: data.label,
|
|
|
- // value: data.label,
|
|
|
- // };
|
|
|
- // // 存放当前选中的图层,方便关联自定义模型
|
|
|
- // this.$store.commit("changeTreeData", passData);
|
|
|
- // }
|
|
|
- } else {
|
|
|
- // 设置右侧折叠面板item数量
|
|
|
- delete this.originalData[`${data.label}_${data.town}`];
|
|
|
- this.layerIdMap.delete(data.id);
|
|
|
- //关联自定义模型
|
|
|
- this.$store.state.treeDataCollection.delete(data.id);
|
|
|
- console.log(this.$store.state.treeDataCollection, "treeDataCollection");
|
|
|
|
|
|
- // 只激活我的标记
|
|
|
- this.activeNames = ["myLabel"];
|
|
|
+ // 只激活我的标记
|
|
|
+ this.activeNames = ["myLabel"];
|
|
|
|
|
|
- for (let key in map2DViewer.polygons) {
|
|
|
- console.log(key, "现在的面数据");
|
|
|
- if (key.indexOf(data.label) > -1) {
|
|
|
- this.$store.state.mapMethodsCollection
|
|
|
- .get("RENDER")
|
|
|
- .deleteSinglePolygon(map2DViewer.polygons[key]);
|
|
|
+ for (let key in map2DViewer.polygons) {
|
|
|
+ console.log(key, "现在的面数据");
|
|
|
+ if (key.indexOf(data.label) > -1) {
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
+ .get("RENDER")
|
|
|
+ .deleteSinglePolygon(map2DViewer.polygons[key]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- this.legendTitle = Object.keys(this.originalData).map((v) => {
|
|
|
- return { name: v, info: v };
|
|
|
- });
|
|
|
- console.log(this.legendTitle, "legendTitle");
|
|
|
- this.legendIcon = this.legendTitle.map((c) => {
|
|
|
- let a = this.randomColor.get(c.name);
|
|
|
- console.log(a, "a");
|
|
|
- return {
|
|
|
- background: "transparent",
|
|
|
- border: `1px solid ${this.randomColor.get(c.name)}`,
|
|
|
- };
|
|
|
- });
|
|
|
+ this.legendTitle = Object.keys(this.originalData).map((v) => {
|
|
|
+ return { name: v, info: v };
|
|
|
+ });
|
|
|
+ // console.log(this.legendTitle, "legendTitle");
|
|
|
+ this.legendIcon = this.legendTitle.map((c) => {
|
|
|
+ let a = this.randomColor.get(c.name);
|
|
|
+ // console.log(a, "a");
|
|
|
+ return {
|
|
|
+ background: "transparent",
|
|
|
+ border: `1px solid ${this.randomColor.get(c.name)}`,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
// 右侧面板项点击事件
|
|
|
listItemClick(type, data) {
|