<template>
|
<div class="synthesis">
|
<el-tabs type="border-card">
|
<el-tab-pane v-if="menuStatus.menu1" :label="$t('synthesis.coverage')">
|
<coverage />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu2" :label="$t('synthesis.viewport')">
|
<viewport />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu3" :label="$t('synthesis.wander')">
|
<wander />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu4" :label="$t('synthesis.analyse')">
|
<analyse />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu5" :label="$t('synthesis.iqyery')">
|
<iqyery />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu6" :label="$t('synthesis.orientation')">
|
<orientation />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu7" :label="$t('synthesis.measurement')">
|
<measurement />
|
</el-tab-pane>
|
<el-tab-pane v-if="menuStatus.menu8" :label="$t('synthesis.plotting')">
|
<plotting />
|
</el-tab-pane>
|
</el-tabs>
|
<el-card class="box-card">
|
<map-div></map-div>
|
</el-card>
|
</div>
|
</template>
|
|
<script>
|
import coverage from './coverage.vue'; //图层
|
import viewport from './viewport.vue'; //视图
|
import wander from './wander.vue'; //漫游
|
import analyse from './analyse.vue'; //分析
|
import iqyery from './inquire.vue'; //查询
|
import orientation from './orientation.vue'; //定位
|
import measurement from './measurement.vue'; //测量
|
import plotting from './plotting.vue'; //标绘
|
import MapDiv from '../../components/MapDiv';
|
import { getPerms } from '../../api/api';
|
export default {
|
components: {
|
coverage,
|
viewport,
|
wander,
|
analyse,
|
iqyery,
|
orientation,
|
measurement,
|
plotting,
|
MapDiv,
|
},
|
data() {
|
return {
|
iframeSrc: null,
|
messageName: null,
|
permsId: null,
|
menuStatus: {
|
menu1: false,
|
menu2: false,
|
menu3: false,
|
menu4: false,
|
menu5: false,
|
menu6: false,
|
menu7: false,
|
menu8: false,
|
},
|
};
|
},
|
watch: {},
|
methods: {
|
tepostmessage(res) {
|
const msg = {
|
message: 'changeTool',
|
data: res,
|
};
|
document
|
.getElementById('sunIframe')
|
.contentWindow.postMessage(msg, this.iframeSrc);
|
},
|
showMenuChange(res, result) {
|
var permsId = res.id;
|
this.$store.state.syntiesis.menu = res.id;
|
for (var i = 0; i < result.length; i++) {
|
if (result[i].pid == permsId) {
|
this.showMenuStatus(result[i]);
|
}
|
}
|
},
|
showMenuStatus(res) {
|
switch (res.cnName) {
|
case '图层':
|
this.menuStatus.menu1 = true;
|
break;
|
case '视图':
|
this.menuStatus.menu2 = true;
|
break;
|
case '漫游':
|
this.menuStatus.menu3 = true;
|
break;
|
case '分析':
|
this.menuStatus.menu4 = true;
|
break;
|
case '查询':
|
this.menuStatus.menu5 = true;
|
break;
|
case '定位':
|
this.menuStatus.menu6 = true;
|
break;
|
case '测量':
|
this.menuStatus.menu7 = true;
|
break;
|
case '标绘':
|
this.menuStatus.menu8 = true;
|
break;
|
}
|
},
|
getPermsMenu() {
|
let val;
|
if (this.$store.state.currentPerms) {
|
val = this.$store.state.currentPerms;
|
} else {
|
val = '/comprehensive';
|
}
|
var permsEntity = this.$store.state.permsEntity;
|
if (permsEntity.length == 0) {
|
getPerms().then((res) => {
|
if (res.code == 200) permsEntity = res.result;
|
this.$store.state.permsEntity = permsEntity;
|
});
|
}
|
|
for (var i = 0; i < permsEntity.length; i++) {
|
if (permsEntity[i].perms == val) {
|
this.showMenuChange(permsEntity[i], permsEntity);
|
}
|
}
|
},
|
},
|
mounted() {
|
//this.messageName = this.$store.state.teNmme;
|
|
this.$bus.$on('changetool', (e) => {
|
this.tepostmessage(e);
|
});
|
},
|
created() {
|
this.getPermsMenu();
|
},
|
};
|
</script>
|
|
<style>
|
.el-card {
|
border: transparent !important;
|
}
|
.synthesis {
|
width: 100%;
|
height: 100%;
|
position: relative;
|
}
|
.synthesis .el-tabs__item {
|
color: white !important;
|
text-align: center;
|
|
background: rgb(55, 77, 110) !important;
|
}
|
.synthesis .is-active {
|
color: white !important;
|
background-color: #586884 !important;
|
border: #586884 !important;
|
}
|
.synthesis .el-tabs__nav-scroll {
|
background: rgb(55, 77, 110) !important;
|
}
|
.synthesis .el-tabs__content {
|
color: white !important;
|
background-color: #586884 !important;
|
padding: 0px !important;
|
}
|
.synthesis .box-card {
|
height: 88%;
|
|
border-radius: 0px;
|
}
|
.synthesis .el-card .el-card__body {
|
padding: 0px;
|
}
|
.cardbox {
|
width: 98%;
|
height: 86%;
|
position: absolute;
|
}
|
.synthesis .el-tabs--border-card {
|
border: transparent;
|
background: transparent;
|
}
|
</style>
|