transportationSafetyCenter.vue 3.0 KB

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