base.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="base-container" v-if="dataList.length">
  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. },
  24. };
  25. </script>
  26. <style scoped lang="scss">
  27. .base-container {
  28. display: flex;
  29. flex-direction: column;
  30. align-items: center;
  31. width: calc(100% - 64rpx);
  32. padding: 16rpx 0;
  33. margin: 0 32rpx;
  34. justify-content: space-between;
  35. border-radius: 16rpx;
  36. background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
  37. margin-bottom: 30rpx;
  38. .base-list {
  39. width: 100%;
  40. display: grid;
  41. grid-template-columns: repeat(4, 1fr);
  42. .base-item {
  43. text-align: center;
  44. .base-item-value {
  45. width: 150rpx;
  46. color: #042118;
  47. font-family: 'Source Han Sans CN VF';
  48. font-size: 32rpx;
  49. font-weight: 500;
  50. text-align: center;
  51. // 超出隐藏
  52. overflow: hidden;
  53. text-overflow: ellipsis;
  54. white-space: nowrap;
  55. }
  56. .base-item-label {
  57. width: 150rpx;
  58. color: #687a74;
  59. font-family: 'Source Han Sans CN VF';
  60. text-align: center;
  61. font-size: 28rpx;
  62. font-weight: 400;
  63. // 超出隐藏
  64. overflow: hidden;
  65. text-overflow: ellipsis;
  66. white-space: nowrap;
  67. }
  68. }
  69. }
  70. }
  71. </style>