<template>
|
<div class="analysis" id="analysis">
|
<div v-if="clipBox" class="funcBox">
|
<span class="closeLeftMenu" @click="closeClipBox()">×</span>
|
<div>
|
<button class="btn" @click="clippingModel('x')">X方向</button>
|
<button class="btn" @click="clippingModel('y')">Y方向</button>
|
<button class="btn" @click="clippingModel('z')">Z方向</button>
|
</div>
|
</div>
|
<div class="analysisTools">
|
<div class="analysisTool" @click="ymfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="淹没分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/ymfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
<div class="analysisTool" @click="tsfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="通视分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/tsfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
<div class="analysisTool" @click="syfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="视域分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/syfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
|
<div class="analysisTool" @click="tjxfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="天际线分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/tjxfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
|
<!-- <div class="analysisTool" @click="hcqfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="缓冲区分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/hcqfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div> -->
|
<div class="analysisTool" @click="pqfx('x')">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="剖切分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/yyfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
|
<!-- <div class="analysisTool" @click="rzfx">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="日照分析"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/kjfx/rzfx.png" />
|
</el-button>
|
</el-tooltip>
|
</div> -->
|
<div class="analysisTool" @click="clearAnalysis">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="清除"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button> <img src="@/assets/img/right/ls/qc-s.png" /> </el-button
|
></el-tooltip>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<style scoped>
|
hr {
|
margin: 10px 0;
|
width: 111%;
|
margin-left: -15px;
|
}
|
/* .el-button {
|
width: 200px;
|
} */
|
|
.el-button:focus,
|
.el-button:hover {
|
background: transparent;
|
}
|
.analysis {
|
position: absolute;
|
left: 65px;
|
bottom: 6px;
|
height: 50px;
|
/* border-radius: 30px; */
|
box-shadow: 0px 0px 10px rgba(101, 180, 253, 0.8) inset;
|
background-color: rgba(5, 39, 126, 0.7);
|
width: 350px;
|
/* border-image-source: radial-gradient(
|
52% 120%,
|
transparent 0px,
|
transparent 100%,
|
cyan 100%
|
);
|
border-image-slice: 1;
|
border-width: 1px;
|
border-style: solid;
|
border-image-outset: 0; */
|
}
|
.analysisList {
|
background: transparent;
|
padding-top: 10px;
|
}
|
.analysisTools {
|
margin-left: 20px;
|
}
|
.analysisTool {
|
border: 1px solid #999;
|
border-radius: 5px;
|
float: left;
|
width: 40px;
|
height: 40px;
|
margin: 5px;
|
}
|
.analysisTool img {
|
margin: 4px;
|
}
|
.analysisTool1 {
|
padding: 5px 0;
|
}
|
|
.analysisTool:hover {
|
background: rgba(0, 168, 255, 0.16);
|
}
|
.analysisTool1:hover {
|
background: rgba(0, 168, 255, 0.16);
|
}
|
|
.tool-title {
|
margin: 1px 10px;
|
}
|
.tool-title label {
|
vertical-align: top;
|
}
|
.analysis label {
|
margin-left: 10px;
|
font-size: 17px;
|
font-family: Microsoft YaHei;
|
font-weight: 400;
|
/* color: #3d3d3d; */
|
color: white;
|
}
|
.el-button {
|
padding: 0 !important;
|
font-size: 24px;
|
border: unset;
|
float: unset;
|
display: block;
|
background: transparent;
|
/* background: rgba(0, 0, 0, .8); */
|
}
|
.el-button label {
|
font-size: 14px;
|
}
|
.closeTool {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
}
|
.selected,
|
.active {
|
background: rgba(0, 168, 255, 0.16);
|
/* background: skyblue; */
|
/* border-radius: 5px; */
|
}
|
.funcBox {
|
position: absolute;
|
top: -100px;
|
padding: 10px;
|
background-color: rgba(0, 0, 0, 0.4);
|
border-radius: 4px;
|
left: 230px;
|
width: 220px;
|
height: 60px;
|
}
|
.closeLeftMenu {
|
position: absolute;
|
right: 10px;
|
top: 10px;
|
color: #fff;
|
}
|
.funcBox .btn {
|
margin-top: 25px;
|
width: 70px;
|
height: 30px;
|
background-color: rgba(0, 0, 0, 0.4);
|
color: #fff;
|
font-size: 14px;
|
}
|
</style>
|
<script>
|
import { mapState } from "vuex";
|
import Bus from "../../tools/Bus"; //空间分析
|
let model;
|
|
export default {
|
name: "analysis",
|
data() {
|
return {
|
skyline: false,
|
clipBox: false,
|
isOpen: {
|
ymfx: false,
|
tsfx: false,
|
syfx: false,
|
tjxfx: false,
|
hcqfx: false,
|
rzfx: false,
|
},
|
};
|
},
|
|
methods: {
|
clearAnalysis() {
|
window.clearAnalyse();
|
},
|
//淹没分析
|
ymfx() {
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
//结束之前操作
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
|
if (this.isOpen.ymfx) {
|
this.isOpen.ymfx = false;
|
sgworld.drawObj && sgworld.drawObj.end && sgworld.drawObj.end("cancel");
|
return;
|
}
|
|
// 清除选中,选中当前
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
this.isOpen.ymfx = true;
|
|
layerOpen("淹没分析", {
|
width: 370,
|
height: 120,
|
offset: ["25%", Viewer.container.offsetWidth - 360 - 200 + "px"],
|
// offset: ["60%", "10px"],
|
url: "./static/html/AnalysisFloodSubmergence.html",
|
fn: {
|
success: (layero, index) => {
|
SmartEarthPopupData.layerContainer = layero;
|
},
|
end: () => {
|
this.isOpen.ymfx = false;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
},
|
});
|
},
|
// 通视分析
|
tsfx() {
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
if (this.isOpen.tsfx) {
|
this.isOpen.tsfx = false;
|
sgworld.drawObj && sgworld.drawObj.end && sgworld.drawObj.end("cancel");
|
return;
|
}
|
|
//结束之前操作
|
// 清除选中,选中当前
|
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
|
this.isOpen.tsfx = true;
|
layerOpen("通视分析", {
|
width: 350,
|
height: 250,
|
offset: ["25%", Viewer.container.offsetWidth - 360 - 200 + "px"],
|
// offset: ["60%", "10px"],
|
url: "./static/html/AnalysisIntervisibility.html",
|
fn: {
|
success: (layero, index) => {
|
SmartEarthPopupData.layerContainer = layero;
|
},
|
end: () => {
|
this.isOpen.syfx = false;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
},
|
});
|
// window.CreateLineOfSight &&window.CreateLineOfSight(() => {this.isOpen.tsfx = false;});
|
},
|
// 视域分析
|
syfx() {
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
//结束之前操作
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
|
if (this.isOpen.syfx) {
|
this.isOpen.syfx = false;
|
sgworld.drawObj && sgworld.drawObj.end && sgworld.drawObj.end("cancel");
|
return;
|
}
|
|
// 清除选中,选中当前
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
|
this.isOpen.syfx = true;
|
layerOpen("视域分析", {
|
width: 350,
|
height: 300,
|
offset: ["25%", Viewer.container.offsetWidth - 360 - 200 + "px"],
|
// offset: ["60%", "10px"],
|
url: "./static/html/AnalysisViewshed.html",
|
fn: {
|
success: (layero, index) => {
|
SmartEarthPopupData.layerContainer = layero;
|
},
|
end: () => {
|
this.isOpen.syfx = false;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
},
|
});
|
},
|
// 天际线分析
|
tjxfx() {
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
//结束之前操作
|
// 清除选中,选中当前
|
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
|
this.skyline = !this.skyline;
|
this.isOpen.tjxfx = this.skyline;
|
// if (this.skyline) {
|
if (!sgworld.Analysis.skyline) {
|
sgworld.Analysis.createSkylineAnalysis("rgba(237, 7, 7, 0.9)");
|
this.$message({
|
showClose: true,
|
message: "开启天际线",
|
});
|
sgworld.Analysis.skyline = true;
|
} else {
|
sgworld.Analysis.clearSkylineAnalysis();
|
this.$message({
|
showClose: true,
|
message: "关闭天际线",
|
});
|
sgworld.Analysis.skyline = false;
|
}
|
},
|
//缓冲区分析
|
hcqfx() {
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
//结束之前操作
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
|
if (this.isOpen.hcqfx) {
|
this.isOpen.hcqfx = false;
|
sgworld.drawObj && sgworld.drawObj.end && sgworld.drawObj.end("cancel");
|
return;
|
}
|
// 清除选中,选中当前
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
this.isOpen.hcqfx = true;
|
|
layerOpen("缓冲区分析", {
|
width: 370,
|
height: 180,
|
offset: ["25%", Viewer.container.offsetWidth - 360 - 200 + "px"],
|
// offset: ["60%", "10px"],
|
url: "./static/html/AnalysisBuffer.html",
|
fn: {
|
success: (layero, index) => {
|
SmartEarthPopupData.layerContainer = layero;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
end: () => {
|
this.isOpen.hcqfx = false;
|
},
|
},
|
});
|
},
|
// 日照分析
|
rzfx() {
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
// this.$parent.closeAllHighLight("kjfx");
|
//收缩面板
|
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
//结束之前操作
|
if (this.isOpen.rzfx) {
|
this.isOpen.rzfx = false;
|
sgworld.drawObj && sgworld.drawObj.end && sgworld.drawObj.end("cancel");
|
return;
|
}
|
|
//结束之前操作
|
// 清除选中,选中当前
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler && sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
this.isOpen.rzfx = true;
|
|
layerOpen("日照分析", {
|
width: 350,
|
height: 400,
|
// offset: ["60%", "10px"],
|
offset: ["25%", Viewer.container.offsetWidth - 360 - 200 + "px"],
|
url: "./static/html/AnalysisSunshine.html",
|
fn: {
|
success(layero, index) {
|
SmartEarthPopupData.layerContainer = layero;
|
layero.find("iframe").height(520);
|
},
|
end: () => {
|
this.isOpen.rzfx = false;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
},
|
});
|
},
|
//剖面分析
|
pqfx() {
|
if (model) {
|
sgworld.Creator.DeleteObject(model);
|
}
|
this.clipBox = true;
|
var url =
|
"http://10.10.4.121:8070/gisserver/c3dserver/YHYQ1/tileset.json";
|
model = sgworld.Creator.create3DTilesets(
|
"",
|
url,
|
{},
|
{
|
// groundCenter: [116.44257, 39.74873, 25.49], // 修改模型位置
|
},
|
"0",
|
true,
|
(data) => {
|
sgworld.Navigate.flyToObj(data);
|
}
|
);
|
},
|
clippingModel(direction) {
|
model.clippingModel({
|
direction: direction,
|
});
|
},
|
closeClipBox() {
|
this.clipBox = false;
|
if (model) {
|
sgworld.Creator.DeleteObject(model);
|
}
|
},
|
},
|
};
|
</script>
|