transportationSafetyCenter.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div style="position: relative">
  3. <div id="bmap"></div>
  4. <ShipSearch
  5. class="ship-search z20"
  6. style="position: absolute; top: 40px; right: 524px"
  7. ></ShipSearch>
  8. <NumberVue
  9. class="z20"
  10. v-if="this.$store.state.currentTabText != '环境中心'"
  11. :data="arr"
  12. style="position: absolute; top: 0; left: 0"
  13. ></NumberVue>
  14. <SafetyModule
  15. class="z20"
  16. v-if="this.$store.state.currentTabText == '运输安全管理中心'"
  17. style="position: absolute; top: 24px; right: 34px"
  18. ></SafetyModule>
  19. <IntelligentModule
  20. class="z20"
  21. v-if="this.$store.state.currentTabText == '智能交易中心'"
  22. style="position: absolute; top: 24px; right: 34px"
  23. ></IntelligentModule>
  24. <EnvironmentalModule
  25. class="z20"
  26. v-if="this.$store.state.currentTabText == '环境中心'"
  27. style="position: absolute; top: 24px; right: 34px"
  28. ></EnvironmentalModule>
  29. <Warning
  30. class="z20"
  31. v-if="this.$store.state.currentTabText == '环境中心'"
  32. style="position: absolute; top: 40px; left: 20px; right: 744px"
  33. ></Warning>
  34. <div class="mask"></div>
  35. </div>
  36. </template>
  37. <script>
  38. import ShipSearch from "comps/ShipSearch.vue";
  39. import router from "router/index";
  40. import store from "store/index";
  41. import { ref, onMounted, watch } from "vue";
  42. export default {
  43. components: {
  44. ShipSearch,
  45. },
  46. setup() {
  47. const bmap = ref({});
  48. function initMap() {
  49. bmap.value = new BMapGL.Map("bmap");
  50. bmap.value.setMapStyleV2({
  51. styleId: "fa3f2f79d64ac87e2683cfa762891cb5",
  52. });
  53. bmap.value.centerAndZoom(new BMapGL.Point(120.688612, 31.975529), 11);
  54. bmap.value.enableScrollWheelZoom(true);
  55. }
  56. watch(
  57. () => store.state.currentTabText,
  58. (a, b) => {
  59. getNumbers(a == "运输安全管理中心");
  60. }
  61. );
  62. let arr = ref([]);
  63. async function getNumbers(b) {
  64. store.dispatch("GetNumbers", b).then((e) => {
  65. arr.value = e;
  66. });
  67. }
  68. onMounted(() => {
  69. initMap();
  70. getNumbers(store.state.currentTabText == "运输安全管理中心");
  71. });
  72. return {
  73. initMap,
  74. arr,
  75. };
  76. },
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. #bmap {
  81. width: 100%;
  82. height: calc(100vh - 60px);
  83. box-sizing: border-box;
  84. background: #1d2c43;
  85. border-top: 1px solid grey;
  86. }
  87. :deep(.ship-search) {
  88. .el-input__inner {
  89. background: none;
  90. color: #fff;
  91. }
  92. }
  93. .mask {
  94. position: fixed;
  95. top: 60px;
  96. left: 0;
  97. right: 0;
  98. bottom: 0;
  99. z-index: 8;
  100. pointer-events: none;
  101. background-image: radial-gradient(ellipse, #213e5f, #0f1d2e);
  102. opacity: 0.35;
  103. }
  104. </style>