HomeView.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="dashboard">
  3. <div class="background-image"></div>
  4. <div class="bottom-bg" v-if="!showMap"></div>
  5. <div class="top-title" :class="{ 'title-alt': activeTab === '水文四预' || activeTab === '水资源调配' }"></div>
  6. <div class="system-title">数字孪生黑林小流域</div>
  7. <!-- 全局地图 -->
  8. <div class="map-container" v-if="showMap">
  9. <CesiumMap @toggleMap="toggleMap" />
  10. </div>
  11. <!-- 渐变装饰层(四周暗角) -->
  12. <GradientOverlay />
  13. <div
  14. class="sub-title left-1"
  15. :class="{ active: activeTab === '流域总览' }"
  16. @click="selectTab('流域总览')"
  17. >
  18. 流域总览
  19. </div>
  20. <div
  21. class="sub-title left-2"
  22. :class="{ active: activeTab === '水文四预' }"
  23. @click="selectTab('水文四预')"
  24. >
  25. 水文四预
  26. </div>
  27. <div
  28. class="sub-title right-1"
  29. :class="{ active: activeTab === '水资源调配' }"
  30. @click="selectTab('水资源调配')"
  31. >
  32. 水资源调配
  33. </div>
  34. <div
  35. class="sub-title right-2"
  36. :class="{ active: activeTab === '孪生水文站' }"
  37. @click="selectTab('孪生水文站')"
  38. >
  39. 孪生水文站
  40. </div>
  41. <div
  42. class="sub-title right-3"
  43. :class="{ active: activeTab === '水文化宣传' }"
  44. @click="selectTab('水文化宣传')"
  45. >
  46. 水文化宣传
  47. </div>
  48. <!-- 流域总览视图 -->
  49. <OverviewView v-if="activeTab === '流域总览'" @selectTab="selectTab" />
  50. <!-- 水文四预视图 -->
  51. <HydrologyForecastView
  52. v-if="activeTab === '水文四预'"
  53. :activeSecondaryTab="activeSecondaryTab"
  54. @selectSecondaryTab="selectSecondaryTab"
  55. />
  56. <!-- 水资源调配视图 -->
  57. <WaterResourceAllocationView
  58. v-if="activeTab === '水资源调配'"
  59. :activeSecondaryTab="activeSecondaryTab"
  60. @selectSecondaryTab="selectSecondaryTab"
  61. />
  62. </div>
  63. </template>
  64. <script>
  65. import OverviewView from './OverviewView.vue'
  66. import HydrologyForecastView from './HydrologyForecastView.vue'
  67. import WaterResourceAllocationView from './WaterResourceAllocationView.vue'
  68. import CesiumMap from '../components/CesiumMap.vue'
  69. import GradientOverlay from '../components/gradient-overlay.vue'
  70. export default {
  71. name: 'HomeView',
  72. components: {
  73. OverviewView,
  74. HydrologyForecastView,
  75. WaterResourceAllocationView,
  76. CesiumMap,
  77. GradientOverlay
  78. },
  79. data() {
  80. return {
  81. activeTab: '流域总览',
  82. activeSecondaryTab: '水文预报',
  83. showMap: true // 控制显示Cesium地图还是图片底图
  84. }
  85. },
  86. methods: {
  87. selectTab(tab) {
  88. this.activeTab = tab
  89. if (tab === '水文四预') {
  90. this.activeSecondaryTab = '水文预报'
  91. } else if (tab === '水资源调配') {
  92. this.activeSecondaryTab = '调配基础数据'
  93. }
  94. },
  95. selectSecondaryTab(tab) {
  96. this.activeSecondaryTab = tab
  97. },
  98. toggleMap(show) {
  99. this.showMap = show
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped>
  105. .dashboard {
  106. width: 100%;
  107. height: 100%;
  108. overflow: hidden;
  109. position: relative;
  110. }
  111. .background-image {
  112. position: absolute;
  113. top: 0;
  114. left: 0;
  115. width: 100%;
  116. height: 100%;
  117. background-image: url('/src/assets/images/背景.png');
  118. background-size: 100% 100%;
  119. background-position: center;
  120. background-repeat: no-repeat;
  121. pointer-events: none;
  122. z-index: 3;
  123. }
  124. .bottom-bg {
  125. position: absolute;
  126. bottom: 0;
  127. left: 0;
  128. width: 100%;
  129. height: 100%;
  130. background-image: url('/src/assets/images/Heilin/WPS图片(1).jpeg');
  131. background-size: 100% 100%;
  132. background-position: center;
  133. background-repeat: no-repeat;
  134. pointer-events: none;
  135. z-index: 3;
  136. }
  137. .top-title {
  138. position: absolute;
  139. top: 0;
  140. left: 0;
  141. width: 100%;
  142. height: 100%;
  143. background-image: url('/src/assets/images/顶部大标题.png');
  144. background-size: 100% 100%;
  145. background-position: center;
  146. background-repeat: no-repeat;
  147. pointer-events: none;
  148. z-index: 4;
  149. }
  150. .top-title.title-alt {
  151. background-image: url('/src/assets/images/顶部大标题1.png');
  152. }
  153. .system-title {
  154. position: absolute;
  155. top: 20px;
  156. left: 50%;
  157. transform: translateX(-50%);
  158. font-size: 36px;
  159. font-weight: bold;
  160. background: linear-gradient(to bottom, #ffffff 50%, #00d5ff 100%);
  161. -webkit-background-clip: text;
  162. background-clip: text;
  163. color: transparent;
  164. text-shadow: 0 0 1px rgba(2, 217, 255, 0.205);
  165. z-index: 4;
  166. pointer-events: none;
  167. }
  168. /* 地图容器样式 */
  169. .map-container {
  170. position: absolute;
  171. left: 0;
  172. right: 0;
  173. top: 0;
  174. bottom: 0;
  175. z-index: 1;
  176. overflow: hidden;
  177. pointer-events: auto;
  178. }
  179. .sub-title {
  180. position: absolute;
  181. top: 30px;
  182. width: 151px;
  183. height: 63px;
  184. background-image: url('/src/assets/images/顶部小标题.png');
  185. background-size: 100% 100%;
  186. background-position: center;
  187. background-repeat: no-repeat;
  188. display: flex;
  189. align-items: flex-start;
  190. padding-top: 10px;
  191. justify-content: center;
  192. font-size: 16px;
  193. font-weight: bold;
  194. color: #e0fcff;
  195. text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
  196. z-index: 4;
  197. cursor: pointer;
  198. transition: transform 0.3s ease;
  199. }
  200. .sub-title:hover {
  201. transform: scale(1.05);
  202. }
  203. .sub-title.left-1 {
  204. left: 300px;
  205. }
  206. .sub-title.left-2 {
  207. left: 450px;
  208. }
  209. .sub-title.right-1 {
  210. right: 450px;
  211. }
  212. .sub-title.right-2 {
  213. right: 300px;
  214. }
  215. .sub-title.right-3 {
  216. right: 150px;
  217. }
  218. .bottom-sub-title {
  219. position: absolute;
  220. bottom: 46px;
  221. width: 159px;
  222. height: 31px;
  223. background-image: url('/src/assets/images/未选中底部标题.png');
  224. background-size: 100% 100%;
  225. background-position: center;
  226. background-repeat: no-repeat;
  227. display: flex;
  228. align-items: center;
  229. justify-content: center;
  230. z-index: 2;
  231. cursor: pointer;
  232. transition: all 0.3s ease;
  233. }
  234. .bottom-sub-title:hover,
  235. .bottom-sub-title.active {
  236. background-image: url('/src/assets/images/选中底部标题.png');
  237. }
  238. .bottom-sub-title.bottom-left {
  239. left: 50%;
  240. transform: translateX(-169px);
  241. }
  242. .bottom-sub-title.bottom-right {
  243. right: 50%;
  244. transform: translateX(169px);
  245. }
  246. .bottom-text {
  247. font-size: 14px;
  248. font-weight: bold;
  249. background: linear-gradient(to bottom, #e2e8ff, #7bbef6);
  250. -webkit-background-clip: text;
  251. background-clip: text;
  252. color: transparent;
  253. text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
  254. }
  255. .bottom-sub-title.active .bottom-text {
  256. background: linear-gradient(to bottom, #e2e8ff, #62f6fb);
  257. -webkit-background-clip: text;
  258. background-clip: text;
  259. color: transparent;
  260. }
  261. /* 二级标题样式 */
  262. .secondary-title-container {
  263. position: absolute;
  264. bottom: 46px;
  265. left: 50%;
  266. transform: translateX(-50%);
  267. display: flex;
  268. gap: 20px;
  269. z-index: 4;
  270. }
  271. .secondary-title {
  272. width: 159px;
  273. height: 31px;
  274. background-image: url('/src/assets/images/未选中底部标题.png');
  275. background-size: 100% 100%;
  276. background-position: center;
  277. background-repeat: no-repeat;
  278. display: flex;
  279. align-items: center;
  280. justify-content: center;
  281. font-size: 14px;
  282. font-weight: bold;
  283. cursor: pointer;
  284. transition: all 0.3s ease;
  285. }
  286. .secondary-title span {
  287. background: linear-gradient(to bottom, #e2e8ff, #7bbef6);
  288. -webkit-background-clip: text;
  289. background-clip: text;
  290. color: transparent;
  291. text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
  292. }
  293. .secondary-title:hover,
  294. .secondary-title.active {
  295. background-image: url('/src/assets/images/选中底部标题.png');
  296. }
  297. .secondary-title:hover span,
  298. .secondary-title.active span {
  299. background: linear-gradient(to bottom, #e2e8ff, #62f6fb);
  300. -webkit-background-clip: text;
  301. background-clip: text;
  302. color: transparent;
  303. }
  304. /* 一级标题选中样式 */
  305. .sub-title.active {
  306. transform: scale(1.05);
  307. }
  308. </style>