MiddleSection.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="middle-section">
  3. <div class="search-button">
  4. <el-button type="primary" @click="handleQuery1">备战防御</el-button>
  5. <el-button type="primary" @click="handleQuery2">指挥调度</el-button>
  6. </div>
  7. <company-map v-model:visible="mapDialogVisible" @change="handleMapChange" />
  8. <GlobalMap is-component width="3894" height="2140" />
  9. </div>
  10. </template>
  11. <script lang="ts" setup>
  12. import GlobalMap from '../globalMap/index.vue';
  13. import { ref } from 'vue';
  14. // import Dialog from "@/components/Dialog/index2.vue";
  15. import CompanyMap from './company-map.vue';
  16. const form = ref({
  17. eventId: '',
  18. address: '',
  19. lon: '',
  20. lat: ''
  21. });
  22. const mapDialogVisible = ref(false);
  23. const handleQuery1 = () => {
  24. console.log('备战防御被点击');
  25. };
  26. const handleQuery2 = () => {
  27. mapDialogVisible.value = true;
  28. };
  29. const handleMapChange = (data) => {
  30. form.value.address = data.address;
  31. form.value.lon = data.lnglat[0];
  32. form.value.lat = data.lat[1];
  33. mapDialogVisible.value = true;
  34. };
  35. </script>
  36. <style lang="scss" scoped>
  37. .middle-section {
  38. margin: 0 91px;
  39. flex: 1;
  40. height: 2140px;
  41. animation: slideAndFade 1.5s;
  42. position: relative;
  43. }
  44. .search-button {
  45. position: absolute;
  46. top: 60px;
  47. left: 900px;
  48. z-index: 10;
  49. }
  50. .el-button {
  51. width: 360px;
  52. height: 100px;
  53. padding: 20px 40px;
  54. font-size: 48px;
  55. }
  56. @keyframes slideAndFade {
  57. 0% {
  58. transform: translateY(218px);
  59. opacity: 0;
  60. }
  61. 100% {
  62. transform: translateX(0);
  63. opacity: 1;
  64. }
  65. }
  66. </style>