|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
- <div class="ghzc BoxCommonVector" v-if="title">
|
|
|
- <div class="innerContainerVector leftPaneVector" v-drag>
|
|
|
+ <div class="ghzc BoxCommonVector">
|
|
|
+ <div class="innerContainerVector leftPaneVector" v-drag v-if="title">
|
|
|
<h2 class="PangetitleVector darg-div">
|
|
|
<span class="pange_textVector">{{ title }}</span>
|
|
|
<slot name="title"></slot>
|
|
@@ -98,13 +98,10 @@
|
|
|
</template>
|
|
|
<slot name="all"></slot>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="sm-panel sm-function-module-query"
|
|
|
- v-if="store.state.vectorData.length > 0"
|
|
|
- v-drag
|
|
|
- >
|
|
|
+ <div class="sm-panel sm-function-module-query" v-if="isShallow" v-drag>
|
|
|
<div class="sm-panel-header">
|
|
|
<span>详情</span>
|
|
|
+ <i class="el-icon-close" @click="isShallow = false"></i>
|
|
|
</div>
|
|
|
<el-tabs
|
|
|
type="border-card"
|
|
@@ -113,7 +110,7 @@
|
|
|
stretch
|
|
|
>
|
|
|
<el-tab-pane label="基本信息" name="base">
|
|
|
- <CockpitVector></CockpitVector>
|
|
|
+ <CockpitVector :baseData="store.state.vectorData"></CockpitVector>
|
|
|
</el-tab-pane>
|
|
|
<!-- -->
|
|
|
<el-tab-pane
|
|
@@ -133,7 +130,7 @@ import * as tdsy from "@/views/cockpit/js/tdsy";
|
|
|
|
|
|
import * as wellknown from "wellknown";
|
|
|
import * as turf from "@turf/turf";
|
|
|
-
|
|
|
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
|
|
|
import CockpitVector from "@/components/Query/clickQuery/CockpitVector.vue";
|
|
|
let BoxCommonVector_entity = null;
|
|
|
let layerSources = {};
|
|
@@ -160,6 +157,7 @@ export default {
|
|
|
searchs: [],
|
|
|
searchform: {},
|
|
|
xzqTreeData: [],
|
|
|
+ isShallow: false,
|
|
|
activeTabs: "base",
|
|
|
};
|
|
|
},
|
|
@@ -224,29 +222,30 @@ export default {
|
|
|
})
|
|
|
);
|
|
|
tdsy.layersObj[lid] = layer;
|
|
|
- this.loadGeoJSON(geom, lid);
|
|
|
- },
|
|
|
- loadGeoJSON(geojson, id, yanse, isfly = true) {
|
|
|
- let polygon = Cesium.GeoJsonDataSource.load(geojson, {
|
|
|
- clampToGround: true,
|
|
|
- stroke: yanse
|
|
|
- ? Cesium.Color.fromCssColorString(yanse)
|
|
|
- : Cesium.Color.RED.withAlpha(0),
|
|
|
- fill: yanse
|
|
|
- ? Cesium.Color.fromCssColorString(yanse).withAlpha(0.3)
|
|
|
- : Cesium.Color.WHITE.withAlpha(0),
|
|
|
- strokeWidth: isfly ? 5 : 2,
|
|
|
- zIndex: isfly ? 10 : 5,
|
|
|
- });
|
|
|
- polygon.then(function (dataSource) {
|
|
|
- viewer.dataSources.add(dataSource);
|
|
|
- layerSources[id] = dataSource;
|
|
|
- if (isfly)
|
|
|
- viewer.flyTo(dataSource, {
|
|
|
- offset: new Cesium.HeadingPitchRange(0, -45),
|
|
|
- });
|
|
|
+ loadGeoJSON(geom, null, { isfly: true }, (data) => {
|
|
|
+ layerSources[lid] = data;
|
|
|
});
|
|
|
},
|
|
|
+ // loadGeoJSON(geojson, id, yanse, isfly = true) {
|
|
|
+ // let polygon = Cesium.GeoJsonDataSource.load(geojson, {
|
|
|
+ // clampToGround: true,
|
|
|
+ // stroke: yanse
|
|
|
+ // ? Cesium.Color.fromCssColorString(yanse)
|
|
|
+ // : Cesium.Color.RED.withAlpha(0),
|
|
|
+ // fill: yanse
|
|
|
+ // ? Cesium.Color.fromCssColorString(yanse).withAlpha(0.3)
|
|
|
+ // : Cesium.Color.WHITE.withAlpha(0),
|
|
|
+ // strokeWidth: isfly ? 5 : 2,
|
|
|
+ // });
|
|
|
+ // polygon.then(function (dataSource) {
|
|
|
+ // viewer.dataSources.add(dataSource);
|
|
|
+ // layerSources[id] = dataSource;
|
|
|
+ // if (isfly)
|
|
|
+ // viewer.flyTo(dataSource, {
|
|
|
+ // offset: new Cesium.HeadingPitchRange(0, -45),
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // },
|
|
|
multiPolygonToPolygons(multiPolygon) {
|
|
|
const polygons = [];
|
|
|
multiPolygon.coordinates.forEach((polygonCoordinates) => {
|
|
@@ -408,7 +407,17 @@ export default {
|
|
|
offset: new Cesium.HeadingPitchRange(0, -45),
|
|
|
});
|
|
|
} else {
|
|
|
- this.loadGeoJSON(item.geom, "h_" + item.index, "#ff0000");
|
|
|
+ loadGeoJSON(
|
|
|
+ item.geom,
|
|
|
+ "#ff0000",
|
|
|
+ { isfly: true, sw: 5 },
|
|
|
+ (data) => {
|
|
|
+ layerSources["h_" + item.index] = data;
|
|
|
+ data.entities.values.forEach((entity) => {
|
|
|
+ entity.properties = item;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -424,6 +433,7 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
store.state.vectorData = arr;
|
|
|
+ this.isShallow = true;
|
|
|
// store.setActiveToolBar(9);
|
|
|
},
|
|
|
addpolygon(item) {
|
|
@@ -614,6 +624,7 @@ export default {
|
|
|
this.searchs = newVal.searchs;
|
|
|
this.searchform = newVal.searchform;
|
|
|
this.state = "";
|
|
|
+ this.isShallow = false;
|
|
|
if (newVal.goitem) {
|
|
|
this.draw_vector_server(newVal.mapType, newVal.goitem);
|
|
|
} else if (newVal.tableData && newVal.tableData.length > 0) {
|
|
@@ -631,8 +642,15 @@ export default {
|
|
|
// else this.draw_vector_tdgy_gy_jd(newVal);
|
|
|
else {
|
|
|
newVal.forEach((res, index) => {
|
|
|
+ res.type = "图斑上图";
|
|
|
res.index = index;
|
|
|
- if (res.geom) this.loadGeoJSON(res.geom, index, "#55A1E3", false);
|
|
|
+ if (res.geom)
|
|
|
+ loadGeoJSON(res.geom, "#55A1E3", {}, (data) => {
|
|
|
+ layerSources[index] = data;
|
|
|
+ data.entities.values.forEach((entity) => {
|
|
|
+ entity.properties = res;
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -643,7 +661,12 @@ export default {
|
|
|
// tdsy.layersObj[newVal].show = true;
|
|
|
}
|
|
|
if (oldVal && layerSources[oldVal]) {
|
|
|
- viewer.dataSources.remove(layerSources[oldVal]);
|
|
|
+ try {
|
|
|
+ viewer.dataSources.remove(layerSources[oldVal]);
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+
|
|
|
layerSources[oldVal] = null;
|
|
|
}
|
|
|
console.log(newVal, oldVal, "----");
|
|
@@ -886,5 +909,16 @@ div::-webkit-scrollbar {
|
|
|
/deep/ .el-table .warning-row {
|
|
|
background: rgb(102, 177, 255) !important;
|
|
|
}
|
|
|
+/deep/ .el-icon-close:before {
|
|
|
+ position: absolute;
|
|
|
+ // top: 10px;
|
|
|
+ // right: 10px;
|
|
|
+ font-size: larger;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: aqua;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|