base.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="base-container">
  3. <view class="base-list">
  4. <view class="base-item" v-for="(item, index) in dataList" :key="index">
  5. <view class="base-item-value">{{ item.value }}</view>
  6. <view class="base-item-label">{{
  7. item.sfDisplayname || item.sfName
  8. }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. dataList: {
  17. type: Array,
  18. default: () => [],
  19. },
  20. },
  21. data() {
  22. return {
  23. list: [
  24. {
  25. label: 'PH值',
  26. value: '0.00',
  27. },
  28. {
  29. label: 'EC值',
  30. value: '987 us',
  31. },
  32. {
  33. label: '水温',
  34. value: '20 ℃',
  35. },
  36. {
  37. label: '管道压力',
  38. value: '20 Pa',
  39. },
  40. ],
  41. };
  42. },
  43. };
  44. </script>
  45. <style scoped lang="scss">
  46. .base-container {
  47. display: flex;
  48. flex-direction: column;
  49. align-items: center;
  50. width: calc(100% - 64rpx);
  51. padding: 16rpx 0;
  52. margin: 0 32rpx;
  53. justify-content: space-between;
  54. border-radius: 16rpx;
  55. background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
  56. margin-bottom: 30rpx;
  57. .base-list {
  58. width: 100%;
  59. display: grid;
  60. grid-template-columns: repeat(4, 1fr);
  61. .base-item {
  62. text-align: center;
  63. .base-item-value {
  64. width: 150rpx;
  65. color: #042118;
  66. font-family: 'Source Han Sans CN VF';
  67. font-size: 32rpx;
  68. font-weight: 500;
  69. text-align: center;
  70. }
  71. .base-item-label {
  72. width: 150rpx;
  73. color: #687a74;
  74. font-family: 'Source Han Sans CN VF';
  75. text-align: center;
  76. font-size: 28rpx;
  77. font-weight: 400;
  78. // 超出隐藏
  79. overflow: hidden;
  80. text-overflow: ellipsis;
  81. white-space: nowrap;
  82. }
  83. }
  84. }
  85. }
  86. </style>