airSampleData.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <template>
  2. <div class="page-container">
  3. <!-- 系统标题区域 -->
  4. <div class="header-section">
  5. <div class="header-content">
  6. <h1 class="system-title">韶关市大气重金属污染采样</h1>
  7. <div class="calculation-selector">
  8. <span class="selector-title">采样方式:</span>
  9. <select
  10. v-model="calculationMethod"
  11. class="calculation-select"
  12. >
  13. <option value="weight">按重量采样</option>
  14. <option value="volume">按体积采样</option>
  15. </select>
  16. </div>
  17. </div>
  18. </div>
  19. <!-- 地图展示区域 -->
  20. <div class="dashboard-section ">
  21. <div class="section-header">
  22. <div class="section-icon">🗺️</div>
  23. <h2 class="section-title">采样点地理分布</h2>
  24. </div>
  25. <div class="dashboard-card map-card">
  26. <div class="map-holder">
  27. <atmsamplemap :calculation-method="calculationMethod" :map-type="mapType"/>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- 数据展示区域 - 上下排列 -->
  32. <div class="data-section">
  33. <!-- 数据列表 -->
  34. <div class="dashboard-section">
  35. <div class="section-header">
  36. <div class="section-icon">📋</div>
  37. <h2 class="section-title">采样点数据详情</h2>
  38. <div class="data-info">
  39. <span class="info-item">当前采样方式: {{ calculationMethod === 'weight' ? '按重量' : '按体积' }}</span>
  40. <span class="info-item">最后更新: 2025-08-16</span>
  41. </div>
  42. </div>
  43. <div class="dashboard-card data-card">
  44. <div class="table-container">
  45. <AirsampleLine :calculation-method="calculationMethod"/>
  46. </div>
  47. </div>
  48. </div>
  49. <!-- 图表分析 -->
  50. <div class="dashboard-section">
  51. <div class="section-header">
  52. <div class="section-icon">📊</div>
  53. <h2 class="section-title">区域污染分析</h2>
  54. </div>
  55. <div class="dashboard-card chart-card">
  56. <div class="chart-header">
  57. <h3>各区县平均大气重金属污染柱状图</h3>
  58. </div>
  59. <div class="chart-container">
  60. <AirsampleChart :calculation-method="calculationMethod"/>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </template>
  67. <script setup>
  68. import { ref } from 'vue'
  69. import AirsampleLine from '@/components/atmpollution/airsampleLine.vue';
  70. import atmsamplemap from '@/components/atmpollution/atmsamplemap.vue';
  71. import AirsampleChart from '@/components/atmpollution/airsampleChart.vue';
  72. const calculationMethod = ref('weight')
  73. const mapType = ref('standard') // standard/satellite
  74. const toggleMapType = () => {
  75. mapType.value = mapType.value === 'standard' ? 'satellite' : 'standard'
  76. }
  77. </script>
  78. <style scoped>
  79. /* 基础样式重置 */
  80. .page-container {
  81. display: flex;
  82. flex-direction: column;
  83. min-height: 100vh;
  84. background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
  85. padding: 25px;
  86. gap: 20px;
  87. position: relative;
  88. overflow-x: hidden;
  89. }
  90. /* 页眉区域 */
  91. .header-section {
  92. text-align: center;
  93. position: relative;
  94. }
  95. .header-content {
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. }
  100. .system-title {
  101. color: #1a365d;
  102. font-size: 2.8rem;
  103. margin-bottom: 12px;
  104. font-weight: 700;
  105. letter-spacing: 0.5px;
  106. text-shadow: 0 2px 4px rgba(0,0,0,0.05);
  107. }
  108. .system-subtitle {
  109. font-size: 1.3rem;
  110. color: #cbd5e0;
  111. margin: 0;
  112. }
  113. .calculation-selector {
  114. display: flex;
  115. align-items: center;
  116. gap: 15px;
  117. margin-top: 20px;
  118. }
  119. .selector-icon {
  120. font-size: 1.8rem;
  121. color: #4a9ef7;
  122. }
  123. .selector-title {
  124. font-size: 1.1rem;
  125. color: black;
  126. font-weight: 500;
  127. }
  128. .calculation-select {
  129. padding: 10px 20px;
  130. border: 1px solid rgba(255, 255, 255, 0.3);
  131. border-radius: 8px;
  132. background: rgba(255, 255, 255, 0.15);
  133. color: black;
  134. font-size: 1rem;
  135. cursor: pointer;
  136. transition: all 0.3s ease;
  137. }
  138. .calculation-select:hover {
  139. background: rgba(255, 255, 255, 0.25);
  140. }
  141. .calculation-select:focus {
  142. outline: none;
  143. border-color: #4a9ef7;
  144. box-shadow: 0 0 0 2px rgba(74, 158, 247, 0.5);
  145. }
  146. .header-stats {
  147. display: flex;
  148. gap: 20px;
  149. }
  150. .stat-card {
  151. flex: 1;
  152. display: flex;
  153. align-items: center;
  154. gap: 15px;
  155. background: rgba(255, 255, 255, 0.1);
  156. border-radius: 12px;
  157. padding: 15px;
  158. backdrop-filter: blur(5px);
  159. border: 1px solid rgba(255, 255, 255, 0.1);
  160. }
  161. .stat-icon {
  162. font-size: 2.2rem;
  163. color: #4a9ef7;
  164. }
  165. .stat-info {
  166. flex: 1;
  167. }
  168. .stat-value {
  169. font-size: 1.8rem;
  170. font-weight: 700;
  171. color: white;
  172. line-height: 1.2;
  173. }
  174. .stat-label {
  175. font-size: 1rem;
  176. color: #cbd5e0;
  177. font-weight: 500;
  178. }
  179. /* 地图区域 */
  180. .dashboard-section {
  181. margin-bottom: 20px;
  182. }
  183. .section-header {
  184. display: flex;
  185. align-items: center;
  186. gap: 15px;
  187. margin-bottom: 20px;
  188. }
  189. .section-icon {
  190. font-size: 2.2rem;
  191. color: #3a9fd3;
  192. }
  193. .section-title {
  194. font-size: 1.8rem;
  195. font-weight: 600;
  196. color: #1a365d;
  197. margin: 0;
  198. position: relative;
  199. padding-left: 10px;
  200. }
  201. .section-title::before {
  202. content: "";
  203. position: absolute;
  204. left: 0;
  205. top: 50%;
  206. transform: translateY(-50%);
  207. width: 4px;
  208. height: 80%;
  209. background: linear-gradient(to bottom, #4a9ef7, #3acfd5);
  210. border-radius: 2px;
  211. }
  212. .map-actions {
  213. margin-left: auto;
  214. display: flex;
  215. gap: 15px;
  216. }
  217. .map-action-btn {
  218. padding: 8px 16px;
  219. border: 1px solid #cbd5e0;
  220. border-radius: 6px;
  221. background: #f0f7ff;
  222. font-size: 0.9rem;
  223. cursor: pointer;
  224. transition: all 0.3s ease;
  225. }
  226. .map-action-btn:hover {
  227. background: #e1f0ff;
  228. transform: translateY(-2px);
  229. }
  230. /* 卡片设计 */
  231. .dashboard-card {
  232. border-radius: 16px;
  233. background: rgba(255, 255, 255, 0.92);
  234. box-shadow: 0 6px 20px rgba(0, 60, 120, 0.12);
  235. transition: all 0.4s ease;
  236. overflow: hidden;
  237. position: relative;
  238. }
  239. .dashboard-card:hover {
  240. transform: translateY(-5px);
  241. box-shadow: 0 12px 30px rgba(0, 60, 120, 0.18);
  242. }
  243. /* 地图容器 */
  244. .map-card {
  245. height: 550px;
  246. position: relative;
  247. }
  248. .map-holder {
  249. position: relative;
  250. height: 100%;
  251. z-index: 100;
  252. }
  253. .map-legend {
  254. position: absolute;
  255. bottom: 20px;
  256. left: 20px;
  257. z-index: 200;
  258. display: flex;
  259. gap: 15px;
  260. background: rgba(255, 255, 255, 0.9);
  261. border-radius: 8px;
  262. padding: 10px 15px;
  263. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  264. }
  265. .legend-item {
  266. display: flex;
  267. align-items: center;
  268. gap: 8px;
  269. }
  270. .legend-color {
  271. width: 20px;
  272. height: 20px;
  273. border-radius: 4px;
  274. }
  275. .high-pollution { background-color: #e53e3e; }
  276. .medium-pollution { background-color: #dd6b20; }
  277. .low-pollution { background-color: #38a169; }
  278. /* 数据展示区域 - 上下排列 */
  279. .data-section {
  280. display: flex;
  281. flex-direction: column;
  282. gap: 30px;
  283. }
  284. /* 数据卡片 - 固定高度滚动条 */
  285. .data-card {
  286. height: 450px;
  287. display: flex;
  288. flex-direction: column;
  289. }
  290. .table-container {
  291. flex: 1;
  292. overflow-y: auto;
  293. padding: 15px;
  294. }
  295. .table-footer {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. padding: 15px;
  300. border-top: 1px solid #e2e8f0;
  301. background: #f8fafc;
  302. }
  303. .pagination {
  304. display: flex;
  305. gap: 10px;
  306. }
  307. .page-btn {
  308. padding: 6px 12px;
  309. border: 1px solid #cbd5e0;
  310. border-radius: 4px;
  311. background: white;
  312. cursor: pointer;
  313. transition: all 0.3s ease;
  314. }
  315. .page-btn:hover {
  316. background: #edf2f7;
  317. }
  318. .page-btn.active {
  319. background: #4a9ef7;
  320. color: white;
  321. border-color: #4a9ef7;
  322. }
  323. /* 图表卡片 */
  324. .chart-card {
  325. height: 550px;
  326. padding: 20px;
  327. background: white;
  328. border-radius: 16px;
  329. box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  330. display: flex;
  331. flex-direction: column;
  332. }
  333. .chart-container {
  334. flex: 1;
  335. min-height: 0; /* 修复flex容器滚动问题 */
  336. }
  337. .data-info {
  338. display: flex;
  339. gap: 20px;
  340. margin-left: 30px;
  341. font-size: 0.9rem;
  342. color: #4a5568;
  343. }
  344. .chart-header {
  345. border-bottom: 1px solid #e2e8f0;
  346. }
  347. .chart-header h3 {
  348. font-size: 1.4rem;
  349. color: #1a365d;
  350. margin: 0 0 5px 0;
  351. font-weight: 600;
  352. }
  353. .chart-header p {
  354. font-size: 1rem;
  355. color: #718096;
  356. margin: 0;
  357. }
  358. .chart-actions {
  359. display: flex;
  360. align-items: center;
  361. gap: 10px;
  362. margin-left: auto;
  363. }
  364. .data-select {
  365. padding: 8px 12px;
  366. border: 1px solid #cbd5e0;
  367. border-radius: 6px;
  368. background: white;
  369. font-size: 0.9rem;
  370. }
  371. .chart-legend {
  372. display: flex;
  373. justify-content: center;
  374. gap: 25px;
  375. margin-top: 15px;
  376. padding-top: 10px;
  377. border-top: 1px solid #e2e8f0;
  378. }
  379. .legend-item {
  380. display: flex;
  381. align-items: center;
  382. gap: 8px;
  383. }
  384. .color-box {
  385. width: 20px;
  386. height: 20px;
  387. border-radius: 4px;
  388. }
  389. .cadmium { background-color: #ff6b6b; }
  390. .lead { background-color: #4ecdc4; }
  391. .chromium { background-color: #ffd166; }
  392. .arsenic { background-color: #6a0572; }
  393. /* 页脚区域 */
  394. .footer-section {
  395. margin-top: 30px;
  396. padding: 20px 0;
  397. text-align: center;
  398. color: #546e7a;
  399. font-size: 1rem;
  400. border-top: 1px solid #e2e8f0;
  401. }
  402. .footer-links {
  403. display: flex;
  404. justify-content: center;
  405. gap: 30px;
  406. margin-top: 10px;
  407. font-size: 0.9rem;
  408. color: #718096;
  409. }
  410. /* 响应式设计 */
  411. @media (max-width: 1200px) {
  412. .header-stats {
  413. flex-wrap: wrap;
  414. }
  415. .stat-card {
  416. flex: 0 0 calc(50% - 10px);
  417. margin-bottom: 10px;
  418. }
  419. }
  420. @media (max-width: 900px) {
  421. .header-content {
  422. flex-direction: column;
  423. align-items: flex-start;
  424. gap: 20px;
  425. }
  426. .system-title {
  427. font-size: 2rem;
  428. }
  429. .section-title {
  430. font-size: 1.6rem;
  431. }
  432. }
  433. @media (max-width: 768px) {
  434. .page-container {
  435. padding: 15px;
  436. gap: 20px;
  437. }
  438. .map-card {
  439. height: 450px;
  440. }
  441. .data-card, .chart-card {
  442. height: 350px;
  443. }
  444. .section-header {
  445. flex-wrap: wrap;
  446. }
  447. .map-actions {
  448. margin-top: 10px;
  449. width: 100%;
  450. }
  451. .data-info {
  452. margin-left: 0;
  453. margin-top: 10px;
  454. width: 100%;
  455. }
  456. }
  457. @media (max-width: 480px) {
  458. .system-title {
  459. font-size: 1.8rem;
  460. }
  461. .section-title {
  462. font-size: 1.4rem;
  463. }
  464. .map-card {
  465. height: 400px;
  466. }
  467. .data-card, .chart-card {
  468. height: 300px;
  469. }
  470. .footer-links {
  471. flex-direction: column;
  472. gap: 5px;
  473. }
  474. .header-stats {
  475. gap: 10px;
  476. }
  477. .stat-card {
  478. flex: 0 0 100%;
  479. }
  480. }
  481. </style>