index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <el-footer class="MainFooter">
  3. <el-switch
  4. style="display: block;margin-top: 5px;margin-left: 10px;"
  5. v-model="modeType"
  6. active-color="#3f96a5"
  7. inactive-color="#000000"
  8. active-text="态势显示"
  9. inactive-text="场景模拟"
  10. @change="modelTypeChange()">
  11. </el-switch>
  12. <div style="margin-left: 300px;line-height: 31px;color: #3f96a5;">
  13. <span style="margin: auto 30px;">经度: {{ mouseLocation.longitude }}</span>
  14. <span style="margin: auto 30px;">纬度:{{ mouseLocation.latitude }}</span>
  15. <span style="margin: auto 30px;">层级: {{ cameraHeightAndZoom.zoom }}</span>
  16. <span style="margin: auto 30px;">视高:{{ cameraHeightAndZoom.height }}</span>
  17. </div>
  18. </el-footer>
  19. </template>
  20. <script>
  21. import { mapGetters } from 'vuex'
  22. export default {
  23. data(){
  24. return{
  25. modeType: false,
  26. platformshow: this.platformShow,
  27. //经度
  28. longitude: 0,
  29. //维度
  30. latitude: 0,
  31. }
  32. },
  33. computed: {
  34. ...mapGetters([
  35. 'isCollapse',
  36. 'mouseLocation',
  37. 'cameraHeightAndZoom',
  38. 'mode'
  39. ]),
  40. },
  41. watch: {
  42. mouseLocation: function(val, oldVal){
  43. console.log(val)
  44. this.longitude = val.longitude
  45. this.latitude = val.latitude
  46. },
  47. mode: function(val, oldVal){
  48. this.modeType = val
  49. this.$notify({
  50. title: val==true?"已切换到态势显示":"已切换到场景模拟",
  51. type: 'success'
  52. });
  53. }
  54. },
  55. mounted(){
  56. },
  57. methods: {
  58. platformShowChange(){
  59. this.$store.commit('app/setPlatformShow',this.platformshow);
  60. },
  61. setCollapse(){
  62. this.$store.commit('app/setIsCollapse',!this.isCollapse);
  63. },
  64. modelTypeChange(val){
  65. this.$store.commit('app/setMode',this.modeType);
  66. }
  67. }
  68. }
  69. </script>
  70. <style scoped>
  71. .MainFooter {
  72. padding: 0px;
  73. height: 30px !important;
  74. display: flex;
  75. background-color: #071c44;
  76. }
  77. /deep/ .el-input--mini .el-input__inner {
  78. height: 24px;
  79. line-height: 24px;
  80. background-color: transparent;
  81. color: white;
  82. }
  83. .platformId /deep/ .el-input__inner{
  84. background-color: #282c34;
  85. color: white;
  86. }
  87. </style>