index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="base-container">
  3. <fnHeader></fnHeader>
  4. <div class="content">
  5. <!-- <div class="top"></div> -->
  6. <div class="left">
  7. <tool-list direction="left" :list="leftToolList" @handleActive="handleActiveLeft"></tool-list>
  8. <component :is="components[currentComponent]" />
  9. </div>
  10. <div class="home-bottom">
  11. <div class="log-box">
  12. <chart-box name="果园日志"></chart-box>
  13. </div>
  14. <div class="file-box">
  15. <chart-box name="果园档案"></chart-box>
  16. </div>
  17. </div>
  18. <div class="right">
  19. <div class="list">
  20. <chart-box name="农事列表" arrow="arrow-left"></chart-box>
  21. </div>
  22. <tool-list direction="right" :list="rightToolList"></tool-list>
  23. </div>
  24. </div>
  25. </div>
  26. <div ref="mapRef" class="bottom-map"></div>
  27. </template>
  28. <script setup>
  29. import { onMounted, ref } from "vue";
  30. import fnHeader from "@/components/fnHeader.vue";
  31. import chartBox from "@/components/chartBox.vue";
  32. import toolList from "@/components/toolList.vue";
  33. import HomeMap from "./homeMap";
  34. import homePage from "./components/homePage.vue"
  35. import weatherPage from "./components/weatherPage.vue"
  36. import phenologyPage from "./components/phenologyPage.vue"
  37. const components = {
  38. homePage,
  39. weatherPage,
  40. phenologyPage
  41. };
  42. let homeMap = new HomeMap();
  43. const mapRef = ref();
  44. onMounted(() => {
  45. let location = "POINT (113.78049350268851 23.419886891845312)"
  46. homeMap.initMap(location, mapRef.value);
  47. })
  48. const currentComponent = ref('homePage');
  49. const handleActiveLeft = (e) =>{
  50. currentComponent.value = e.componentName
  51. }
  52. const leftToolList = [
  53. {
  54. title:'首页',
  55. name:'home',
  56. componentName:'homePage'
  57. },
  58. {
  59. title:'气象预警',
  60. componentName:'weatherPage'
  61. },
  62. {
  63. title:'物候调节',
  64. componentName:'phenologyPage'
  65. },
  66. {
  67. title:'病虫测报'
  68. },
  69. {
  70. title:'营养评估'
  71. }
  72. ]
  73. const rightToolList = [
  74. {
  75. title:'农事列表'
  76. },
  77. {
  78. title:'新增农事'
  79. },
  80. {
  81. title:'复核对比'
  82. }
  83. ]
  84. </script>
  85. <style lang="scss" scoped>
  86. .base-container {
  87. width: 100%;
  88. height: 100vh;
  89. color: #fff;
  90. position: absolute;
  91. box-sizing: border-box;
  92. z-index: 1;
  93. pointer-events: none;
  94. .content {
  95. width: 100%;
  96. height: calc(100% - 74px - 48px);
  97. display: flex;
  98. justify-content: space-between;
  99. box-sizing: border-box;
  100. .left,
  101. .right {
  102. pointer-events: all;
  103. width: calc(376px + 54px);
  104. height: 100%;
  105. padding-top: 10px;
  106. box-sizing: border-box;
  107. display: flex;
  108. }
  109. .right {
  110. .list {
  111. width: 100%;
  112. height: 100%;
  113. }
  114. }
  115. .home-bottom {
  116. display: flex;
  117. align-items: flex-end;
  118. width: calc(100% - 430px - 430px - 72px);
  119. height: 100%;
  120. align-self: flex-end;
  121. .log-box {
  122. pointer-events: all;
  123. height: 30%;
  124. width: calc(100% - 340px - 28px);
  125. margin-right: 28px;
  126. }
  127. .file-box {
  128. pointer-events: all;
  129. height: 25%;
  130. width: 340px;
  131. }
  132. }
  133. }
  134. }
  135. .bottom-map {
  136. width: 100%;
  137. height: 100vh;
  138. position: absolute;
  139. z-index: 0;
  140. }
  141. </style>