|
@@ -1,11 +1,12 @@
|
|
|
<template>
|
|
|
<div v-show="smashingComb">
|
|
|
- <div class="sm-function-module-content">
|
|
|
+ <div>
|
|
|
<!-- <div class="sm-point media-hidden"></div>
|
|
|
<label class="sm-function-module-sub-section-setting media-hidden">{{
|
|
|
Resource.ObserverInformation
|
|
|
}}</label> -->
|
|
|
|
|
|
+
|
|
|
<div class="boxchild">
|
|
|
<el-button type="primary" size="mini" @click="createSmashing"
|
|
|
>倾斜压平</el-button
|
|
@@ -14,11 +15,21 @@
|
|
|
Resource.clear
|
|
|
}}</el-button>
|
|
|
</div>
|
|
|
+ <el-select v-model="value" placeholder="请选择对象">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in options"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item"
|
|
|
+ @click.native="test(item)"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
- <script>
|
|
|
+
|
|
|
+<script>
|
|
|
let cutFillAnalysis = null;
|
|
|
|
|
|
export default {
|
|
@@ -34,6 +45,12 @@ export default {
|
|
|
),
|
|
|
//存储压平数据名称
|
|
|
flattenNames: [],
|
|
|
+ handlerTemp: new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas),
|
|
|
+ options: [],
|
|
|
+ value: "",
|
|
|
+ // primitive:undefined
|
|
|
+ testLay: undefined,
|
|
|
+ nameStr: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -45,13 +62,51 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
beforeDestroy() {},
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ store.state.S3MList.forEach((s) => {
|
|
|
+ s.forEach((i) => {
|
|
|
+ this.options.push(i);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // console.log(this.options, "this.options");
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ test(val) {
|
|
|
+ // console.log("woshi", val);
|
|
|
+ this.testLay = val;
|
|
|
+ this.value = val.name;
|
|
|
+ viewer.flyTo(val);
|
|
|
+ },
|
|
|
createSmashing() {
|
|
|
+ // console.log(
|
|
|
+ // store.state.modellayerlist,
|
|
|
+ // "////",
|
|
|
+ // store.state.S3MList,
|
|
|
+ // "---",
|
|
|
+ // store.state.tempLatData
|
|
|
+ // );
|
|
|
//绘制多边形
|
|
|
const that = this;
|
|
|
- that.handler_Cut_fill.clear();
|
|
|
- viewer.scene.globe.removeAllExcavationRegion();
|
|
|
+
|
|
|
+ that.clear();
|
|
|
+ // let handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
|
|
|
+ // handler.setInputAction((event) => {
|
|
|
+ // var pickObj = viewer.scene.pick(event.position);
|
|
|
+ // var position = viewer.scene.pickPosition(event.position);
|
|
|
+ // var cartographic = Cesium.Cartographic.fromCartesian(position);
|
|
|
+ // console.log(event, "event", pickObj,position);
|
|
|
+ // if (!position) {
|
|
|
+ // position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
|
|
|
+ // }
|
|
|
+ // }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
|
+
|
|
|
+ if (that.handler_Cut_fill == null) {
|
|
|
+ that.handler_Cut_fill = new Cesium.DrawHandler(
|
|
|
+ viewer,
|
|
|
+ Cesium.DrawMode.Polygon,
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
that.handler_Cut_fill.activeEvt.addEventListener(function (isActive) {
|
|
|
if (isActive == true) {
|
|
@@ -107,15 +162,48 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
viewer.scene.globe.removeAllExcavationRegion();
|
|
|
+ // //调用压平api进行压平
|
|
|
+ // store.state.tempLatData[0].forEach((el) => {
|
|
|
+ // //获取时间戳
|
|
|
+ // var date = new Date().getTime();
|
|
|
+ // // that.flattenNames.push(date);
|
|
|
+ // store.state.flattenNames.push(date);
|
|
|
+ // //调用压平api进行压平
|
|
|
+ // el.addFlattenRegion({
|
|
|
+ // position: positions,
|
|
|
+ // // name: "flatten" + Math.random(),
|
|
|
+ // name: "flatten" + date,
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ // store.state.S3MList.forEach((s) => {
|
|
|
+ // //调用压平api进行压平
|
|
|
+ // s.forEach((el) => {
|
|
|
+ // //获取时间戳
|
|
|
+ // var date = new Date().getTime();
|
|
|
+ // // that.flattenNames.push(date);
|
|
|
+ // store.state.flattenNames.push(date);
|
|
|
+ // //调用压平api进行压平
|
|
|
+ // el.addFlattenRegion({
|
|
|
+ // position: positions,
|
|
|
+ // // name: "flatten" + Math.random(),
|
|
|
+ // name: "flatten" + date,
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
//获取时间戳
|
|
|
var date = new Date().getTime();
|
|
|
// that.flattenNames.push(date);
|
|
|
+ that.nameStr = date;
|
|
|
store.state.flattenNames.push(date);
|
|
|
//调用压平api进行压平
|
|
|
- store.state.tempLatData.addFlattenRegion({
|
|
|
+ // store.state.tempLatData.addFlattenRegion({
|
|
|
+ // console.log(that.testLay, "this.testLay222");
|
|
|
+ that.testLay.addFlattenRegion({
|
|
|
position: positions,
|
|
|
// name: "flatten" + Math.random(),
|
|
|
- name: "flatten" + date,
|
|
|
+ name: "flatten" + that.nameStr,
|
|
|
});
|
|
|
that.handler_Cut_fill.polygon.show = false;
|
|
|
that.handler_Cut_fill.polyline.show = false;
|
|
@@ -124,17 +212,28 @@ export default {
|
|
|
that.handler_Cut_fill.activate();
|
|
|
},
|
|
|
clear() {
|
|
|
- if (store.state.flattenNames.length) {
|
|
|
- store.state.flattenNames.forEach((el) => {
|
|
|
- store.state.tempLatData.removeFlattenRegion("flatten" + el);
|
|
|
- });
|
|
|
+ const that = this;
|
|
|
+ if (that.handler_Cut_fill != null) {
|
|
|
+ that.handler_Cut_fill.clear();
|
|
|
+ viewer.scene.globe.removeAllExcavationRegion();
|
|
|
+ that.handler_Cut_fill.deactivate();
|
|
|
+ that.handler_Cut_fill = null;
|
|
|
+ that.value = "";
|
|
|
}
|
|
|
+ if (that.nameStr != "") {
|
|
|
+ that.testLay.removeFlattenRegion("flatten" + that.nameStr);
|
|
|
+ store.state.flattenNames = [];
|
|
|
+ }
|
|
|
+ // if (store.state.flattenNames.length) {
|
|
|
+ // store.state.flattenNames.forEach((el) => {
|
|
|
+ // that.testLay.removeFlattenRegion("flatten" + el);
|
|
|
+ // });
|
|
|
+ // store.state.flattenNames = [];
|
|
|
+ // }
|
|
|
},
|
|
|
},
|
|
|
watch: {},
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
- <style lang="scss" scoped>
|
|
|
-</style>
|
|
|
-
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|