SoilacidificationStatistics.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="layout-container">
  3. <!-- 第一列:酸化缓解数据组件 -->
  4. <div class="column column-1">
  5. <div class="component-container">
  6. <ReducedataStatistics />
  7. </div>
  8. </div>
  9. <!-- 第二列:酸化加剧数据组件 -->
  10. <div class="column column-2">
  11. <div class="component-container">
  12. <refluxcedataStatictics />
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import ReducedataStatistics from '@/components/soilStatictics/reducedataStatistics.vue';
  19. import refluxcedataStatictics from '@/components/soilStatictics/refluxcedataStatictics.vue'
  20. export default {
  21. components: {
  22. ReducedataStatistics,
  23. refluxcedataStatictics
  24. }
  25. }
  26. </script>
  27. <style scoped>
  28. /* 核心:网格布局统一控制尺寸
  29. .layout-container {
  30. display: grid;
  31. grid-template-columns: 1fr 1fr; /* 两列等宽
  32. height: 400px;
  33. gap: 16px; /* 列/行间距
  34. padding: 16px; /* 内边距
  35. box-sizing: border-box;
  36. width: 100%;
  37. min-height: 100vh;
  38. }*/
  39. /* 统一子组件外层容器:确保填充网格单元格 */
  40. .component-container {
  41. width: 1000px;
  42. height: 500px;
  43. padding: 16px;
  44. margin: 20px;
  45. border: 1px solid #e5e7eb;
  46. border-radius: 8px;
  47. overflow: hidden;
  48. box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  49. box-sizing: border-box;
  50. }
  51. /* 区分两列背景色(保留原有视觉差异) */
  52. .column-1 .component-container {
  53. background: #f9fafc;
  54. }
  55. .column-2 .component-container {
  56. background: #f3f4f6;
  57. }
  58. /* 响应式设计 */
  59. @media (max-width: 768px) {
  60. .layout-container {
  61. grid-template-columns: 1fr; /* 小屏幕下单列布局 */
  62. }
  63. }
  64. </style>