HomeView.vue 8.0 KB

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