You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
2.9 KiB

1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="card card2">
  3. <view class="chartTab">
  4. <view class="h3">{{ tit }}</view>
  5. <view class="btn_row">
  6. <view class="btn" @click="changeChart(1)" :class="{bg: currentChart==1}">曲线</view>
  7. <view class="btn" @click="changeChart(2)" :class="{bg: currentChart==2}">明细</view>
  8. </view>
  9. </view>
  10. <view class="tip">近30次科目{{ subject==1? '一': '四'}}模拟考试成绩</view>
  11. <view class="" v-if="listData.length">
  12. <view class="con" v-if="currentChart==1">
  13. <columnChart :chartData="chartData" :key="tit"></columnChart>
  14. <view class="tips">按住可左右滑动查看更多成绩</view>
  15. </view>
  16. <view class="con" v-if="currentChart==2">
  17. <view class="tables">
  18. <view class="fristTab li">
  19. <view class="item">考试成绩</view>
  20. <view class="item">考试用时</view>
  21. <view class="item">考试时间</view>
  22. </view>
  23. <view class="li" v-for="(item,index) in listData" :key="index">
  24. <view class="item">{{item.score}}</view>
  25. <view class="item">{{item.useTime}}</view>
  26. <view class="item">{{item.startTime}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="" v-else>
  32. <nodata>暂无考试记录</nodata>
  33. <view class="btnE">
  34. <oneBtn text="去考试" @oneBtnClick="$goPage(url)"></oneBtn>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script setup>
  40. import { ref } from 'vue'
  41. defineProps({
  42. tit: {
  43. type: String,
  44. default: ''
  45. },
  46. chartData: {
  47. type: Object,
  48. default: {}
  49. },
  50. listData: {
  51. type: Array,
  52. default: []
  53. },
  54. subject: {
  55. type: Number,
  56. default: 1
  57. },
  58. url: {
  59. type: String,
  60. default: '/pages/exercises/examSubjiect1/examSubjiect1'
  61. }
  62. })
  63. const currentChart = ref(1)
  64. function changeChart(num) {
  65. currentChart.value = num
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .tip {
  70. font-size: 24rpx;
  71. color: #ccc;
  72. padding: 10rpx 0 30rpx;
  73. }
  74. .tips {
  75. width: 360rpx;
  76. height: 48rpx;
  77. background: #DCE7FF;
  78. border-radius: 24rpx;
  79. font-size: 24rpx;
  80. color: $themC;
  81. text-align: center;
  82. line-height: 48rpx;
  83. margin-top: 30rpx;
  84. }
  85. .chartTab {
  86. display: flex;
  87. justify-content: space-between;
  88. .btn_row {
  89. display: flex;
  90. width: 170rpx;
  91. height: 44rpx;
  92. border-radius: 8rpx;
  93. overflow: hidden;
  94. border: 1px solid $themC;
  95. .btn.bg {
  96. background: #3776FF;
  97. color: #fff;
  98. }
  99. .btn {
  100. color: $themC;
  101. text-align: center;
  102. font-size: 28rpx;
  103. flex: 1;
  104. }
  105. }
  106. }
  107. .tables {
  108. width: 100%;
  109. .fristTab.li {
  110. background: #F4F4F4;
  111. border-radius: 8rpx 8rpx 0 0;
  112. .item {
  113. color: $themC;
  114. }
  115. }
  116. .li {
  117. height: 76rpx;
  118. line-height: 76rpx;
  119. border-bottom: 1rpx solid #F4F4F4;
  120. display: flex;
  121. .item {
  122. text-align: center;
  123. flex: 1;
  124. font-size: 28rpx;
  125. }
  126. }
  127. }
  128. .btnE {
  129. width: 240rpx;
  130. margin: 30rpx auto 60rpx auto;
  131. }
  132. </style>