<template>
<div class="com-btn dis_flex">
<el-button type="primary" :disabled="disabled" @click="submitForm('visualForm')">{{btnContent[tabid]}}
</el-button>
</div>
</template>
<script>
var isDBOpen = false;
export default {
data() {
return {
disabled: false,
tabid: 0,
btnContent: ['方案展示', '方案对比']
}
},
created() {
if (this.$route.query.tabid) {
this.tabid = +this.$route.query.tabid;
}
if (this.$store.state.common.projectAbbreviation == '1#地块基本信息') {
if (this.$store.state.common.flow == 2) {
if (this.tabid == 0) {
this.disabled = false;
}
else {
this.disabled = true;
}
}
}
},
methods: {
submitForm(formName) {
console.log(this.$store.state.common.projectAbbreviation);
if (this.$store.state.common.projectAbbreviation == '1#地块基本信息') {
if (this.$store.state.common.flow == 2) {
if (this.tabid == 0) {
window[this.$mapClick['项目规划']]();
planA.setVisibleInViewport(1, false);
}
}
else if (this.$store.state.common.flow == 3) {
if (this.tabid == 0) {
window[this.$mapClick['项目设计']]();
planA.setVisibleInViewport(1, false);
}
}
}
else if (this.$store.state.common.projectAbbreviation == '进料系统结构') {
console.log(this.$store.state.common.projectAbbreviation);
if (this.$store.state.common.flow == 2) {
if (this.tabid == 0) {
window[this.$mapClick['马钢方案展示']]();
planA.setVisibleInViewport(1, false);
}
// else {
// window[this.$mapClick['马钢对比']]();
// }
}
}
var planB_1 = viewer.scene.layers.find('放样道路3');
var planB_2 = viewer.scene.layers.find('放样道路1');
var planB_3 = viewer.scene.layers.find('停车场1');
var planB_4 = viewer.scene.layers.find('停车场2');
var planB_5 = viewer.scene.layers.find('放样道路2');
var planB_6 = viewer.scene.layers.find('人行天桥');
var planB_7 = viewer.scene.layers.find('放样道路4');
var planA = viewer.scene.layers.find('宝山1号地块');
viewer.entities.removeById("baseLine&0");
viewer.entities.removeById("baseLine&1");
viewer.entities.removeById("baseLine&2");
viewer.entities.removeById("trialLine&0");
viewer.entities.removeById("trialLine&1");
viewer.entities.removeById("trialLine&2");
viewer.entities.removeById("XM_2");
viewer.entities.removeById("parking");
viewer.entities.removeById("kzll");
viewer.entities.removeById("gjtq");
viewer.entities.removeById("poi&长滩");
viewer.entities.removeById("poi&宝山宾馆");
viewer.entities.removeById("poi&宝钢商场");
viewer.entities.removeById("poi&宝乐汇");
viewer.entities.removeById("poi&宝龙广场");
viewer.entities.removeById("FQ&1");
viewer.entities.removeById("FQ&2");
viewer.entities.removeById("FQ&3");
viewer.entities.removeById("FQ&4");
viewer.entities.removeById("FQlabel&1");
viewer.entities.removeById("FQlabel&2");
viewer.entities.removeById("FQlabel&3");
viewer.entities.removeById("FQlabel&4");
if (!isDBOpen) {
$("#split_up").css("display", "block");
$("#split_bottom").css("display", "block");
$("#split_left").css("display", "none");
$("#split_right").css("display", "none");
$("#split_vertical_trisection_left").css("display", "none");
$("#split_vertical_trisection_right").css("display", "none");
viewer.scene.multiViewportMode = Cesium.MultiViewportMode["HORIZONTAL"];
planA.visible = true;
planB_1.visible = true;
planB_2.visible = true;
planB_3.visible = true;
planB_4.visible = true;
planB_5.visible = true;
planB_6.visible = true;
planB_7.visible = true;
planB_1.visibleDistanceMax = 500000;
planB_2.visibleDistanceMax = 500000;
planB_3.visibleDistanceMax = 500000;
planB_4.visibleDistanceMax = 500000;
planB_5.visibleDistanceMax = 500000;
planB_6.visibleDistanceMax = 500000;
planB_7.visibleDistanceMax = 500000;
planB_1.setVisibleInViewport(1, true);
planB_2.setVisibleInViewport(1, true);
planB_3.setVisibleInViewport(1, true);
planB_4.setVisibleInViewport(1, true);
planB_5.setVisibleInViewport(1, true);
planB_6.setVisibleInViewport(1, true);
planB_7.setVisibleInViewport(1, true);
planB_1.setVisibleInViewport(0, false);
planB_2.setVisibleInViewport(0, false);
planB_3.setVisibleInViewport(0, false);
planB_4.setVisibleInViewport(0, false);
planB_5.setVisibleInViewport(0, false);
planB_6.setVisibleInViewport(0, false);
planB_7.setVisibleInViewport(0, false);
isDBOpen = true;
}
else {
$("#split_up").css("display", "none");
$("#split_bottom").css("display", "none");
$("#split_left").css("display", "none");
$("#split_right").css("display", "none");
$("#split_vertical_trisection_left").css("display", "none");
$("#split_vertical_trisection_right").css("display", "none");
viewer.scene.multiViewportMode = Cesium.MultiViewportMode["NONE"];
window[this.$mapClick['项目规划']]();
window[this.$mapClick['项目设计']]();
window[this.$mapClick['马钢对比']]();
isDBOpen = false;
planB_1.visible = true;
planB_2.visible = true;
planB_3.visible = true;
planB_4.visible = true;
planB_5.visible = true;
planB_6.visible = true;
planB_7.visible = true;
planA.visible = false;
// planB.setVisibleInViewport(1, true);
}
}
}
}
</script>