subject-chart.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="page-box">
  3. <back text="优劣科目"></back>
  4. <view class="children-box">
  5. <image class="children-avatar" :src="childreninfo.avatar"></image>
  6. <view class="children-msg">
  7. <view class="children-name">{{childreninfo.name}}</view>
  8. <view class="children-class">{{childreninfo.class}}</view>
  9. </view>
  10. </view>
  11. <!-- 数据分析模块 -->
  12. <view class="data-box">
  13. <view class="data-box-item" v-for="(item,index) in analysisData" :key="index" :style="{background: item.color}">
  14. <view class="item-text">{{item.title}} {{item.data.name}}</view>
  15. <view style="display: flex;align-items: baseline;">
  16. <view class="item-text" style="font-size: 50rpx;">{{item.data.value}}%</view>
  17. <view class="item-text" style="margin-left: 0;">得分率</view>
  18. </view>
  19. <view class="module-item-box">
  20. <view :class="item.data.value>=40?(item.data.value>=70?'t-icon t-icon-a-bianzu6':'t-icon t-icon-a-bianzu7'): 't-icon t-icon-a-bianzu8'"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 图表列表 -->
  25. <!-- 单次考试 -->
  26. <view class="chart-container">
  27. <view class="chart-name">
  28. <view class="start-tag"></view>
  29. <text class="chart-name-text">最近考试科目得分率分析</text>
  30. </view>
  31. <view class="charts-box">
  32. <qiun-data-charts type="rose" :chartData="gradeData.advantageRoseChart.recentAdvantage" :loadingType="4"
  33. :tapLegend="true" tooltipFormat='tooltipScoreShort'/>
  34. </view>
  35. </view>
  36. <!-- 学期平均 -->
  37. <view class="chart-container">
  38. <view class="chart-name">
  39. <view class="start-tag"></view>
  40. <text class="chart-name-text">{{semester}} 科目得分率平均值分析</text>
  41. </view>
  42. <view class="charts-box">
  43. <qiun-data-charts type="rose" :chartData="gradeData.advantageRoseChart.semesterAdvantage" :loadingType="4"
  44. :tapLegend="true" tooltipFormat='tooltipScoreShort'/>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. mapState
  52. } from 'vuex'
  53. export default {
  54. computed: {
  55. ...mapState('m_children', ['childreninfo', 'semester']),
  56. ...mapState('m_chart', ['gradeData'])
  57. },
  58. data() {
  59. return {
  60. //分析模块数据
  61. analysisData:
  62. [{
  63. title: '学期优势科:',
  64. data: '',
  65. color: '#4169E1'
  66. },{
  67. title: '学期劣势科:',
  68. data: '',
  69. color: '#ff8caf',
  70. }]
  71. };
  72. },
  73. onLoad() {
  74. this.getGradeDetail()
  75. },
  76. methods: {
  77. getGradeDetail() {
  78. //获取成绩最好科目
  79. this.analysisData[0].data = this.gradeData.advantageRoseChart.semesterAdvantage.series[0].data.reduce((pre, cur) =>
  80. pre.value > cur.value ? pre :
  81. cur)
  82. //劣势科目
  83. this.analysisData[1].data = this.gradeData.advantageRoseChart.semesterAdvantage.series[0].data.reduce((pre, cur) =>
  84. pre.value < cur.value ? pre :
  85. cur)
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. @import '@/gradepkg/common/chartpage.scss';
  92. </style>