|
@@ -19,7 +19,12 @@
|
|
</div>
|
|
</div>
|
|
<div class="comprehensive-analysis-searchbox">
|
|
<div class="comprehensive-analysis-searchbox">
|
|
<el-input placeholder="请输入地名地址" v-model="addressInput">
|
|
<el-input placeholder="请输入地名地址" v-model="addressInput">
|
|
- <el-button type="primary" slot="append" icon="el-icon-search" style="vertical-align: bottom"></el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ slot="append"
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
+ style="vertical-align: bottom"
|
|
|
|
+ ></el-button>
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
<!-- 属性弹窗 -->
|
|
<!-- 属性弹窗 -->
|
|
@@ -46,7 +51,7 @@
|
|
legendTitle: legendTitle,
|
|
legendTitle: legendTitle,
|
|
leftWidth: '30%',
|
|
leftWidth: '30%',
|
|
rightWidth: '70%',
|
|
rightWidth: '70%',
|
|
- rightItemWidth: '120'
|
|
|
|
|
|
+ rightItemWidth: '120',
|
|
}"
|
|
}"
|
|
/>
|
|
/>
|
|
|
|
|
|
@@ -66,9 +71,21 @@
|
|
<div @click="leftPanelDisplay('hide')"><div></div></div>
|
|
<div @click="leftPanelDisplay('hide')"><div></div></div>
|
|
</div>
|
|
</div>
|
|
<div class="control-container">
|
|
<div class="control-container">
|
|
- <el-input class="control-container-input" v-model="filterText" placeholder="请输入文本"></el-input>
|
|
|
|
- <el-tooltip effect="light" :content="isLeftLock ? '解锁面板' : '锁定面板'" placement="bottom-end">
|
|
|
|
- <div :class="{ 'lock-style': isLeftLock }" class="control-container-pin-btn" @click="leftPanelLock"></div>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ class="control-container-input"
|
|
|
|
+ v-model="filterText"
|
|
|
|
+ placeholder="请输入文本"
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-tooltip
|
|
|
|
+ effect="light"
|
|
|
|
+ :content="isLeftLock ? '解锁面板' : '锁定面板'"
|
|
|
|
+ placement="bottom-end"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ :class="{ 'lock-style': isLeftLock }"
|
|
|
|
+ class="control-container-pin-btn"
|
|
|
|
+ @click="leftPanelLock"
|
|
|
|
+ ></div>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
<div class="contant-container">
|
|
<div class="contant-container">
|
|
@@ -83,7 +100,13 @@
|
|
:filter-node-method="filterNode"
|
|
:filter-node-method="filterNode"
|
|
>
|
|
>
|
|
<span class="custom-tree-node" slot-scope="{ node }">
|
|
<span class="custom-tree-node" slot-scope="{ node }">
|
|
- <template v-if="node.level === 3 || node.parent.label === '所有图层' || node.parent.label === '我的模型'">
|
|
|
|
|
|
+ <template
|
|
|
|
+ v-if="
|
|
|
|
+ node.level === 3 ||
|
|
|
|
+ node.parent.label === '所有图层' ||
|
|
|
|
+ node.parent.label === '我的模型'
|
|
|
|
+ "
|
|
|
|
+ >
|
|
<el-checkbox v-model="node.checked" style="position: relative"
|
|
<el-checkbox v-model="node.checked" style="position: relative"
|
|
>{{ node.label
|
|
>{{ node.label
|
|
}}<span
|
|
}}<span
|
|
@@ -117,7 +140,7 @@
|
|
<div
|
|
<div
|
|
:class="{
|
|
:class="{
|
|
'tree-arrow': !node.expanded,
|
|
'tree-arrow': !node.expanded,
|
|
- 'tree-arrow-expanded': node.expanded
|
|
|
|
|
|
+ 'tree-arrow-expanded': node.expanded,
|
|
}"
|
|
}"
|
|
></div>
|
|
></div>
|
|
<span>{{ node.label }}</span>
|
|
<span>{{ node.label }}</span>
|
|
@@ -137,15 +160,27 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="control-container">
|
|
<div class="control-container">
|
|
- <el-tooltip effect="light" :content="isRightLock ? '解锁面板' : '锁定面板'" placement="bottom-start">
|
|
|
|
- <div :class="{ 'lock-style': isRightLock }" @click="rightPanelLock"></div>
|
|
|
|
|
|
+ <el-tooltip
|
|
|
|
+ effect="light"
|
|
|
|
+ :content="isRightLock ? '解锁面板' : '锁定面板'"
|
|
|
|
+ placement="bottom-start"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ :class="{ 'lock-style': isRightLock }"
|
|
|
|
+ @click="rightPanelLock"
|
|
|
|
+ ></div>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="contant-container">
|
|
<div class="contant-container">
|
|
<div class="contant-container-innerbox">
|
|
<div class="contant-container-innerbox">
|
|
<el-collapse v-model="activeNames">
|
|
<el-collapse v-model="activeNames">
|
|
- <el-collapse-item v-for="key in Object.keys(originalData)" :key="key" :title="key" :name="key">
|
|
|
|
|
|
+ <el-collapse-item
|
|
|
|
+ v-for="key in Object.keys(originalData)"
|
|
|
|
+ :key="key"
|
|
|
|
+ :title="key"
|
|
|
|
+ :name="key"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
class="panel-list-item"
|
|
class="panel-list-item"
|
|
v-for="i in originalData[key]"
|
|
v-for="i in originalData[key]"
|
|
@@ -157,22 +192,32 @@
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
|
|
|
|
<el-collapse-item title="我的标记" name="myLabel">
|
|
<el-collapse-item title="我的标记" name="myLabel">
|
|
- <div class="panel-list-item" v-for="item in rightLabelData" :key="item.id">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="panel-list-item"
|
|
|
|
+ v-for="item in rightLabelData"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ >
|
|
<div @click="listItemClick('new', item)">
|
|
<div @click="listItemClick('new', item)">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
|
|
+ <span class="operation-icon"
|
|
|
|
+ ><el-button
|
|
|
|
+ size="normal"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="updateLabel(item)"
|
|
|
|
+ ></el-button
|
|
|
|
+ ><el-button
|
|
|
|
+ size="normal"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="deleteLabel(item.id)"
|
|
|
|
+ ></el-button
|
|
|
|
+ ></span>
|
|
<span
|
|
<span
|
|
- style="
|
|
|
|
- position: absolute;
|
|
|
|
- right: 100px;
|
|
|
|
- top: 0;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: space-around;
|
|
|
|
- width: 75px;
|
|
|
|
- "
|
|
|
|
- ><el-button size="normal" type="text" icon="el-icon-edit" @click="updateLabel(item)"></el-button
|
|
|
|
- ><el-button size="normal" type="text" icon="el-icon-delete" @click="deleteLabel(item.id)"></el-button
|
|
|
|
|
|
+ class="visible-icon"
|
|
|
|
+ :class="{ click: item.geometryChecked }"
|
|
|
|
+ @click="controlLabel(item)"
|
|
></span>
|
|
></span>
|
|
</div>
|
|
</div>
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
@@ -201,22 +246,17 @@ export default {
|
|
Legend,
|
|
Legend,
|
|
AttributePopup,
|
|
AttributePopup,
|
|
LawPopup,
|
|
LawPopup,
|
|
- LabelCasePopup
|
|
|
|
|
|
+ LabelCasePopup,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
addressInput: "",
|
|
addressInput: "",
|
|
legendShow: false,
|
|
legendShow: false,
|
|
- // 修改标记弹窗
|
|
|
|
- updateCasePopupShow: false,
|
|
|
|
- // 属性信息弹窗
|
|
|
|
- attrTableShow: false,
|
|
|
|
tableType: "normal",
|
|
tableType: "normal",
|
|
tableData: [],
|
|
tableData: [],
|
|
legendHeight: "0",
|
|
legendHeight: "0",
|
|
boxWidth: "600",
|
|
boxWidth: "600",
|
|
boxHeight: "600",
|
|
boxHeight: "600",
|
|
-
|
|
|
|
activeNames: ["myLabel"],
|
|
activeNames: ["myLabel"],
|
|
rightPanelTitle: "",
|
|
rightPanelTitle: "",
|
|
rightPanelDataMap: new Map(),
|
|
rightPanelDataMap: new Map(),
|
|
@@ -229,7 +269,7 @@ export default {
|
|
modelData: [],
|
|
modelData: [],
|
|
defaultProps: {
|
|
defaultProps: {
|
|
children: "children",
|
|
children: "children",
|
|
- label: "label"
|
|
|
|
|
|
+ label: "label",
|
|
},
|
|
},
|
|
legendIcon: [],
|
|
legendIcon: [],
|
|
legendTitle: [],
|
|
legendTitle: [],
|
|
@@ -239,7 +279,7 @@ export default {
|
|
// 存放对应图层的坐标
|
|
// 存放对应图层的坐标
|
|
treeCoordMap: new Map(),
|
|
treeCoordMap: new Map(),
|
|
isLeftLock: true,
|
|
isLeftLock: true,
|
|
- isRightLock: true
|
|
|
|
|
|
+ isRightLock: true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -254,7 +294,23 @@ export default {
|
|
},
|
|
},
|
|
getMyPoints() {
|
|
getMyPoints() {
|
|
return map2DViewer.myLabels;
|
|
return map2DViewer.myLabels;
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ attrTableShow: {
|
|
|
|
+ get() {
|
|
|
|
+ return this.$store.state.attrTableShow;
|
|
|
|
+ },
|
|
|
|
+ set(val) {
|
|
|
|
+ this.$store.state.attrTableShow = val;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ updateCasePopupShow: {
|
|
|
|
+ get() {
|
|
|
|
+ return this.$store.state.updateCasePopupShow;
|
|
|
|
+ },
|
|
|
|
+ set(val) {
|
|
|
|
+ this.$store.state.updateCasePopupShow = val;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
getLeftMenuTitle: {
|
|
getLeftMenuTitle: {
|
|
@@ -267,7 +323,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- immediate: true
|
|
|
|
|
|
+ immediate: true,
|
|
},
|
|
},
|
|
legendTitle(val) {
|
|
legendTitle(val) {
|
|
// console.log(val, "监听当前图例item数量");
|
|
// console.log(val, "监听当前图例item数量");
|
|
@@ -291,19 +347,19 @@ export default {
|
|
console.log(val, "目前存在的自定义模型");
|
|
console.log(val, "目前存在的自定义模型");
|
|
let myModelRef = this.$refs.tree.data[2];
|
|
let myModelRef = this.$refs.tree.data[2];
|
|
if (myModelRef.label === "我的模型") {
|
|
if (myModelRef.label === "我的模型") {
|
|
- this.$refs.tree.data[2].children = val.map(ele => {
|
|
|
|
|
|
+ this.$refs.tree.data[2].children = val.map((ele) => {
|
|
let firstId = publicFun.buildGuid();
|
|
let firstId = publicFun.buildGuid();
|
|
treeIdMap.set(ele.name, firstId);
|
|
treeIdMap.set(ele.name, firstId);
|
|
return {
|
|
return {
|
|
id: firstId,
|
|
id: firstId,
|
|
label: ele.name,
|
|
label: ele.name,
|
|
- data: ele.data
|
|
|
|
|
|
+ data: ele.data,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
console.log(myModelRef.children, "最新的数据");
|
|
console.log(myModelRef.children, "最新的数据");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- deep: true
|
|
|
|
|
|
+ deep: true,
|
|
},
|
|
},
|
|
getMyLabelData: {
|
|
getMyLabelData: {
|
|
handler(val) {
|
|
handler(val) {
|
|
@@ -317,20 +373,21 @@ export default {
|
|
coord: data.geometry.coordinates[0][0],
|
|
coord: data.geometry.coordinates[0][0],
|
|
type: data.properties.title,
|
|
type: data.properties.title,
|
|
des: data.properties.desc,
|
|
des: data.properties.desc,
|
|
- geojson: v.geojson
|
|
|
|
|
|
+ geojson: v.geojson,
|
|
|
|
+ geometryChecked: false,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
console.log(this.rightLabelData, "rightLabelData");
|
|
console.log(this.rightLabelData, "rightLabelData");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- deep: true
|
|
|
|
|
|
+ deep: true,
|
|
// immediate: true,
|
|
// immediate: true,
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.modelData = [];
|
|
this.modelData = [];
|
|
// 分别对应1、2、3级节点
|
|
// 分别对应1、2、3级节点
|
|
- this.modelData = treeModel.map(item1 => {
|
|
|
|
|
|
+ this.modelData = treeModel.map((item1) => {
|
|
if (item1.type === "我的模型") {
|
|
if (item1.type === "我的模型") {
|
|
this.myModel = item1;
|
|
this.myModel = item1;
|
|
}
|
|
}
|
|
@@ -338,23 +395,23 @@ export default {
|
|
return {
|
|
return {
|
|
id: item1.id,
|
|
id: item1.id,
|
|
label: item1.type,
|
|
label: item1.type,
|
|
- children: item1.children.map(item2 => {
|
|
|
|
|
|
+ children: item1.children.map((item2) => {
|
|
treeIdMap.set(item2.type, item2.id);
|
|
treeIdMap.set(item2.type, item2.id);
|
|
return {
|
|
return {
|
|
id: item2.id,
|
|
id: item2.id,
|
|
label: item2.type,
|
|
label: item2.type,
|
|
- children: item2.children.map(item3 => {
|
|
|
|
|
|
+ children: item2.children.map((item3) => {
|
|
treeIdMap.set(item3.type, item3.id);
|
|
treeIdMap.set(item3.type, item3.id);
|
|
this.rightPanelDataMap.set(item3.type, item3.children);
|
|
this.rightPanelDataMap.set(item3.type, item3.children);
|
|
return {
|
|
return {
|
|
id: item3.id,
|
|
id: item3.id,
|
|
label: item3.type,
|
|
label: item3.type,
|
|
children: [],
|
|
children: [],
|
|
- checked: false
|
|
|
|
|
|
+ checked: false,
|
|
};
|
|
};
|
|
- })
|
|
|
|
|
|
+ }),
|
|
};
|
|
};
|
|
- })
|
|
|
|
|
|
+ }),
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
|
|
@@ -363,7 +420,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
- map2DViewer.map.on("move", e => {
|
|
|
|
|
|
+ map2DViewer.map.on("move", (e) => {
|
|
if (!this.isLeftLock) {
|
|
if (!this.isLeftLock) {
|
|
this.showLeftBox = false;
|
|
this.showLeftBox = false;
|
|
this.leftBoxBtn = true;
|
|
this.leftBoxBtn = true;
|
|
@@ -379,6 +436,12 @@ export default {
|
|
treeIdMap.clear();
|
|
treeIdMap.clear();
|
|
this.treeCoordMap.clear();
|
|
this.treeCoordMap.clear();
|
|
map2DViewer.map.off("move");
|
|
map2DViewer.map.off("move");
|
|
|
|
+ for (let layer in map2DViewer.polygons) {
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .deletePolygonLayer(layer);
|
|
|
|
+ }
|
|
|
|
+ map2DViewer.polygons = {};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 调用我的标记接口
|
|
// 调用我的标记接口
|
|
@@ -388,17 +451,17 @@ export default {
|
|
paramData = {
|
|
paramData = {
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
sourceId: 0,
|
|
sourceId: 0,
|
|
- pageSize: 10
|
|
|
|
|
|
+ pageSize: 10,
|
|
};
|
|
};
|
|
- this.$Post(this.urlsCollection.selectByUser, paramData).then(res => {
|
|
|
|
|
|
+ this.$Post(this.urlsCollection.selectByUser, paramData).then((res) => {
|
|
if (res.code === 200 && res.content.length >= 1) {
|
|
if (res.code === 200 && res.content.length >= 1) {
|
|
console.log(res);
|
|
console.log(res);
|
|
this.$store.state.myLabelPointsArr = [];
|
|
this.$store.state.myLabelPointsArr = [];
|
|
- this.$store.state.myLabelPointsArr = res.content.map(v => {
|
|
|
|
|
|
+ this.$store.state.myLabelPointsArr = res.content.map((v) => {
|
|
return {
|
|
return {
|
|
id: v.id,
|
|
id: v.id,
|
|
geojson: v.geojson,
|
|
geojson: v.geojson,
|
|
- type: v.type
|
|
|
|
|
|
+ type: v.type,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -412,10 +475,13 @@ export default {
|
|
},
|
|
},
|
|
// 回退事件
|
|
// 回退事件
|
|
backEvent() {
|
|
backEvent() {
|
|
- if (this.$store.state.backMenu.index && this.$store.state.backMenu.subIndex) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.$store.state.backMenu.index &&
|
|
|
|
+ this.$store.state.backMenu.subIndex
|
|
|
|
+ ) {
|
|
this.$store.commit("changeNavSelect", {
|
|
this.$store.commit("changeNavSelect", {
|
|
index: this.$store.state.backMenu.index,
|
|
index: this.$store.state.backMenu.index,
|
|
- subIndex: this.$store.state.backMenu.subIndex
|
|
|
|
|
|
+ subIndex: this.$store.state.backMenu.subIndex,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -457,7 +523,9 @@ export default {
|
|
locateEvent(node) {
|
|
locateEvent(node) {
|
|
// console.log(node, "目前的节点");
|
|
// console.log(node, "目前的节点");
|
|
if (this.treeCoordMap.has(node.data.label)) {
|
|
if (this.treeCoordMap.has(node.data.label)) {
|
|
- this.$store.state.mapMethodsCollection.get("RENDER").setView(this.treeCoordMap.get(node.data.label), 16);
|
|
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .setView(this.treeCoordMap.get(node.data.label), 16);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleUpdate(node) {
|
|
handleUpdate(node) {
|
|
@@ -487,19 +555,19 @@ export default {
|
|
|
|
|
|
let passData = {
|
|
let passData = {
|
|
name: data.label,
|
|
name: data.label,
|
|
- value: cid
|
|
|
|
|
|
+ value: cid,
|
|
};
|
|
};
|
|
|
|
|
|
// 存放当前选中的图层,方便关联自定义模型
|
|
// 存放当前选中的图层,方便关联自定义模型
|
|
this.$store.commit("changeTreeData", passData);
|
|
this.$store.commit("changeTreeData", passData);
|
|
- get(`./static/json/${cid}.json`).then(geoJson => {
|
|
|
|
|
|
+ get(`./static/json/${cid}.json`).then((geoJson) => {
|
|
map2DViewer.polygons[`${cid}_layer`] = [];
|
|
map2DViewer.polygons[`${cid}_layer`] = [];
|
|
this.originalData[data.label] = geoJson.map((v, index) => {
|
|
this.originalData[data.label] = geoJson.map((v, index) => {
|
|
return {
|
|
return {
|
|
id: publicFun.buildGuid("abnormal"),
|
|
id: publicFun.buildGuid("abnormal"),
|
|
name: v.properties["异常"] + "_" + index,
|
|
name: v.properties["异常"] + "_" + index,
|
|
geometry: v.geometry,
|
|
geometry: v.geometry,
|
|
- properties: v.properties
|
|
|
|
|
|
+ properties: v.properties,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
// console.log(this.originalData[data.label], "label");
|
|
// console.log(this.originalData[data.label], "label");
|
|
@@ -511,12 +579,14 @@ export default {
|
|
let coordinates = firstPolygon.geometry.coordinates[0][0][0];
|
|
let coordinates = firstPolygon.geometry.coordinates[0][0][0];
|
|
this.treeCoordMap.set(data.label, coordinates);
|
|
this.treeCoordMap.set(data.label, coordinates);
|
|
|
|
|
|
- this.$store.state.mapMethodsCollection.get("RENDER").addPolygonLayer(geoJson, cid, color);
|
|
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .addPolygonLayer(geoJson, cid, color);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
let passData = {
|
|
let passData = {
|
|
name: data.label,
|
|
name: data.label,
|
|
- value: data.label
|
|
|
|
|
|
+ value: data.label,
|
|
};
|
|
};
|
|
// 存放当前选中的图层,方便关联自定义模型
|
|
// 存放当前选中的图层,方便关联自定义模型
|
|
this.$store.commit("changeTreeData", passData);
|
|
this.$store.commit("changeTreeData", passData);
|
|
@@ -534,18 +604,20 @@ export default {
|
|
// 目前仅针对所有图层栏的默认图层
|
|
// 目前仅针对所有图层栏的默认图层
|
|
if (guid.indexOf("defaultLayer") > -1) {
|
|
if (guid.indexOf("defaultLayer") > -1) {
|
|
let layer = `${defaultLayers[data.label].cid}_layer`;
|
|
let layer = `${defaultLayers[data.label].cid}_layer`;
|
|
- this.$store.state.mapMethodsCollection.get("RENDER").deletePolygonLayer(layer);
|
|
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .deletePolygonLayer(layer);
|
|
delete map2DViewer.polygons[layer];
|
|
delete map2DViewer.polygons[layer];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.legendTitle = Object.keys(this.originalData).map(v => {
|
|
|
|
|
|
+ this.legendTitle = Object.keys(this.originalData).map((v) => {
|
|
return { name: v, info: v };
|
|
return { name: v, info: v };
|
|
});
|
|
});
|
|
- this.legendIcon = this.legendTitle.map(v => {
|
|
|
|
|
|
+ this.legendIcon = this.legendTitle.map((v) => {
|
|
let color = publicFun.getRandomColor();
|
|
let color = publicFun.getRandomColor();
|
|
return {
|
|
return {
|
|
background: "transparent",
|
|
background: "transparent",
|
|
- border: `1px solid ${color}`
|
|
|
|
|
|
+ border: `1px solid ${color}`,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -568,7 +640,7 @@ export default {
|
|
version: data.properties["版本"],
|
|
version: data.properties["版本"],
|
|
nature: data.properties["性质"],
|
|
nature: data.properties["性质"],
|
|
area: data.properties["面积"],
|
|
area: data.properties["面积"],
|
|
- long: data.properties["周长"] || "--"
|
|
|
|
|
|
+ long: data.properties["周长"] || "--",
|
|
});
|
|
});
|
|
console.log(this.tableData);
|
|
console.log(this.tableData);
|
|
}
|
|
}
|
|
@@ -587,7 +659,7 @@ export default {
|
|
this.tableData.push({
|
|
this.tableData.push({
|
|
name: data.name,
|
|
name: data.name,
|
|
type: data.type,
|
|
type: data.type,
|
|
- des: data.des
|
|
|
|
|
|
+ des: data.des,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -615,17 +687,17 @@ export default {
|
|
sourceId: 0,
|
|
sourceId: 0,
|
|
type: geometryType,
|
|
type: geometryType,
|
|
geojson: JSON.stringify(geojson),
|
|
geojson: JSON.stringify(geojson),
|
|
- id: id
|
|
|
|
|
|
+ id: id,
|
|
};
|
|
};
|
|
this.$Post(this.urlsCollection.updateConllection, params).then(
|
|
this.$Post(this.urlsCollection.updateConllection, params).then(
|
|
- res => {
|
|
|
|
|
|
+ (res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
console.log("修改成功", res);
|
|
console.log("修改成功", res);
|
|
this.updateCasePopupShow = false;
|
|
this.updateCasePopupShow = false;
|
|
this.getUserMarkers();
|
|
this.getUserMarkers();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- error => {
|
|
|
|
|
|
+ (error) => {
|
|
this.$message.error("保存失败");
|
|
this.$message.error("保存失败");
|
|
console.log(error);
|
|
console.log(error);
|
|
}
|
|
}
|
|
@@ -639,13 +711,15 @@ export default {
|
|
this.$store.state.bottomMenuIndexs.subIndex = -1;
|
|
this.$store.state.bottomMenuIndexs.subIndex = -1;
|
|
this.updateCasePopupShow = true;
|
|
this.updateCasePopupShow = true;
|
|
this.attrTableShow = false;
|
|
this.attrTableShow = false;
|
|
- this.$nextTick(() => {
|
|
|
|
- console.log(this.$refs.updateLabelRef, "updateLabelRef");
|
|
|
|
- this.$refs.updateLabelRef.selectVal = val.type;
|
|
|
|
- this.$refs.updateLabelRef.textContent = val.des;
|
|
|
|
- this.$refs.updateLabelRef.id = val.id;
|
|
|
|
- this.$refs.updateLabelRef.geojson = val.geojson;
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.updateCasePopupShow) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ console.log(this.$refs.updateLabelRef, "updateLabelRef");
|
|
|
|
+ this.$refs.updateLabelRef.selectVal = val.type;
|
|
|
|
+ this.$refs.updateLabelRef.textContent = val.des;
|
|
|
|
+ this.$refs.updateLabelRef.id = val.id;
|
|
|
|
+ this.$refs.updateLabelRef.geojson = val.geojson;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 删除标记
|
|
// 删除标记
|
|
deleteLabel(id) {
|
|
deleteLabel(id) {
|
|
@@ -660,22 +734,48 @@ export default {
|
|
params = {
|
|
params = {
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
sourceId: 0,
|
|
sourceId: 0,
|
|
- id: id
|
|
|
|
|
|
+ id: id,
|
|
};
|
|
};
|
|
- this.$Post(this.urlsCollection.deleteConllection, params).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- console.log("疑点删除成功");
|
|
|
|
- this.getUserMarkers();
|
|
|
|
- // this.rightLabelData.forEach((v, i) => {
|
|
|
|
- // if (v.id === id) {
|
|
|
|
- // this.rightLabelData.splice(i, 1);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
|
|
+ this.$Post(this.urlsCollection.deleteConllection, params).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ console.log("疑点删除成功");
|
|
|
|
+ this.getUserMarkers();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ );
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 控制标记的显示与隐藏
|
|
|
|
+ controlLabel(val) {
|
|
|
|
+ val.geometryChecked = !val.geometryChecked;
|
|
|
|
+ // 已经绘制了几何体
|
|
|
|
+ if (map2DViewer.myLabels[`label_${val.id}`]) {
|
|
|
|
+ if (val.geometryChecked) {
|
|
|
|
+ console.log("允许图层显示");
|
|
|
|
+ map2DViewer.myLabels[`label_${val.id}`].setStyle({
|
|
|
|
+ opacity: 1,
|
|
|
|
+ fillOpacity: 0.4,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ console.log("隐藏图层");
|
|
|
|
+ map2DViewer.myLabels[`label_${val.id}`].setStyle({
|
|
|
|
+ opacity: 0,
|
|
|
|
+ fillOpacity: 0,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 未绘制几何体
|
|
|
|
+ console.log(val, "未绘制几何体");
|
|
|
|
+ if (val.geometryChecked) {
|
|
|
|
+ let geoType = JSON.parse(val.geojson).properties.featureType;
|
|
|
|
+ this.$store.state.mapMethodsCollection
|
|
|
|
+ .get("RENDER")
|
|
|
|
+ .drawGeometry(geoType, val);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -1057,6 +1157,27 @@ export default {
|
|
border-right: 1px solid rgba(207, 222, 255, 0.2);
|
|
border-right: 1px solid rgba(207, 222, 255, 0.2);
|
|
border-bottom: 1px solid rgba(207, 222, 255, 0.2);
|
|
border-bottom: 1px solid rgba(207, 222, 255, 0.2);
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
|
+ .operation-icon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 100px;
|
|
|
|
+ top: 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ width: 75px;
|
|
|
|
+ // background: red;
|
|
|
|
+ }
|
|
|
|
+ .visible-icon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 60px;
|
|
|
|
+ top: 9.5px;
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ background: url("../assets/map/eye_invisible.png") no-repeat center;
|
|
|
|
+ &.click {
|
|
|
|
+ background: url("../assets/map/eye_visible.png") no-repeat center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|