| | |
| | | <template> |
| | | <div> |
| | | <div class="tabHandover"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane v-for="(item,index) in topicList" :key="index" :label="item.name" :name="item.name"></el-tab-pane> |
| | | </el-tabs> |
| | | <div> |
| | | <component :is="gcComp"></component> |
| | | <component :is="gcComp" :searchNameToPosition="searchNameToPosition"></component> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import EnvironmentalRisk from '@components/table/components/EnvironmentalRisk' |
| | | import Pipeline from '@components/table/components/Pipeline' |
| | | import CorporateEmergency from '@components/table/components/CorporateEmergency' |
| | | |
| | | import { TopicList } from '../../../conf/Topic' |
| | | import { topicList } from '../../../conf/Topic' |
| | | export default { |
| | | name: 'tabHandover', |
| | | components: { |
| | |
| | | return { |
| | | titleProp: '', |
| | | activeName: '污染源', |
| | | topicList: TopicList, // tab项 |
| | | gcComp: PollutionSource // 默认显示污染源内容 |
| | | topicList: topicList, // tab项 |
| | | gcComp: PollutionSource |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.gcComp = CorporateEmergency |
| | | break |
| | | } |
| | | }, |
| | | searchNameToPosition (e) { |
| | | if (e.target.innerHTML === '集团公司') { |
| | | return window.map.setView({ lat: 34.828558921813965, lng: 117.41676807403564 }, 5) |
| | | } |
| | | if (this.$store.state.companyPoints.filter(obj => obj.name === e.target.innerHTML).length > 0) { |
| | | const newList = this.$store.state.companyPoints.filter(obj => obj.name === e.target.innerHTML)[0] |
| | | window.map.setView({ lat: newList.Latitude, lng: newList.Longitude }, 15) |
| | | } else { |
| | | this.$message({ |
| | | message: '没有查询到该企业!', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style> |
| | | .tabHandover .el-tabs__item{ |
| | | font-size: .1rem; |
| | | } |
| | | </style> |