base.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. height: 100%;
  51. width: calc(100% - 64rpx);
  52. height: 88rpx;
  53. padding: 16rpx 0;
  54. margin: 0 32rpx;
  55. justify-content: space-between;
  56. border-radius: 16rpx;
  57. background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
  58. margin-bottom: 30rpx;
  59. .base-list {
  60. width: 100%;
  61. display: grid;
  62. grid-template-columns: repeat(4, 1fr);
  63. .base-item {
  64. text-align: center;
  65. .base-item-value {
  66. width: 150rpx;
  67. color: #042118;
  68. font-family: 'Source Han Sans CN VF';
  69. font-size: 32rpx;
  70. font-weight: 500;
  71. text-align: center;
  72. }
  73. .base-item-label {
  74. width: 150rpx;
  75. color: #687a74;
  76. font-family: 'Source Han Sans CN VF';
  77. text-align: center;
  78. font-size: 28rpx;
  79. font-weight: 400;
  80. // 超出隐藏
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. white-space: nowrap;
  84. }
  85. }
  86. }
  87. }
  88. </style>