grade.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="home-container">
  3. <!-- 头部区域 -->
  4. <top-box v-bind:timeStamp="timeStamp"></top-box>
  5. <!-- 活动内容 -->
  6. <task-box :current="0">
  7. <!-- 记录模块 -->
  8. <template #center-slot>
  9. <!-- 缩略图区域 -->
  10. <view class="mini-chart-list">
  11. <!-- 成绩走势 -->
  12. <view class="mini-chart-item" style="width: 100%;">
  13. <view class="chart-container" @click="navGeneral">
  14. <view class="chart-name">
  15. <view :class="icon.General"></view>
  16. <text class="chart-name-text">成绩走势</text>
  17. </view>
  18. <view class="charts-box">
  19. <qiun-data-charts class="chart" :canvas2d='true' canvasId='canvans1' type="mainline"
  20. :chartData="gradeData.semesterLineChart.generalComparison" :loadingType="4"
  21. tooltipFormat='tooltipScore' />
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 单次考试 -->
  26. <view class="mini-chart-item">
  27. <view class="chart-container" @click="navSingle">
  28. <view class="chart-name">
  29. <view :class="icon.RecentTest"></view>
  30. <text class="chart-name-text">单次考试分析</text>
  31. </view>
  32. <view class="charts-box">
  33. <qiun-data-charts type="mini-column" :chartData="gradeData.recentTestChart.recentComparison"
  34. :loadingType="4" :tapLegend="false" :canvas2d='true' canvasId='canvans2' />
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 成绩占比 -->
  39. <view class="mini-chart-item">
  40. <view class="chart-container" @click="navRank">
  41. <view class="chart-name">
  42. <view :class="icon.Rank"></view>
  43. <text class="chart-name-text">排行占比分析</text>
  44. </view>
  45. <view class="charts-box">
  46. <qiun-data-charts type="mini-area" :chartData="gradeData.rankChart.semesterRank"
  47. :loadingType="4" :tapLegend="false" :canvas2d='true' canvasId='canvans3' />
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 优劣科目分析 -->
  52. <view class="mini-chart-item">
  53. <view class="chart-container" @click="navSubject">
  54. <view class="chart-name">
  55. <view :class="icon.Advantage"></view>
  56. <text class="chart-name-text">优劣科目分析</text>
  57. </view>
  58. <view class="charts-box">
  59. <qiun-data-charts type="mini-rose" :chartData="gradeData.advantageRoseChart.recentAdvantage"
  60. :loadingType="4" :tapLegend="false" :canvas2d='true' canvasId='canvans4' />
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 考试能力分析 -->
  65. <view class="mini-chart-item">
  66. <view class="chart-container" @click="navAbility">
  67. <view class="chart-name">
  68. <view :class="icon.Ability"></view>
  69. <text class="chart-name-text">考试能力分析</text>
  70. </view>
  71. <view class="charts-box">
  72. <qiun-data-charts type="mini-column" :chartData="gradeData.abilityChart.importantAnalyse"
  73. :loadingType="4" :tapLegend="false" :canvas2d='true' canvasId='canvans5' />
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. </task-box>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. mapState
  85. } from 'vuex'
  86. export default {
  87. computed: {
  88. ...mapState('m_children', ['childreninfo', 'semester']),
  89. ...mapState('m_chart', ['gradeData'])
  90. },
  91. data() {
  92. return {
  93. //图标
  94. icon: {
  95. General: 't-icon t-icon-pingjia',
  96. RecentTest: 't-icon t-icon-zhishi',
  97. Rank: 't-icon t-icon-fengxianpinggu',
  98. Advantage: 't-icon t-icon-gaishuai',
  99. Ability: 't-icon t-icon-tongji',
  100. },
  101. //时间戳
  102. timeStamp: '',
  103. }
  104. },
  105. onLoad() {
  106. this.init()
  107. },
  108. //刷新页面
  109. onPullDownRefresh() {
  110. setTimeout(function() {
  111. this.init()
  112. uni.stopPullDownRefresh();
  113. }, 1000);
  114. },
  115. methods: {
  116. init() {
  117. //获取当前时间
  118. this.timeStamp = (new Date()).format("hh:mm")
  119. //获取成绩数据
  120. this.$initGrade()
  121. },
  122. //导航成绩走势
  123. navGeneral(e) {
  124. uni.navigateTo({
  125. url: "/gradepkg/general-chart/general-chart"
  126. })
  127. },
  128. //导航单次考试
  129. navSingle(e) {
  130. uni.navigateTo({
  131. url: "/gradepkg/single-chart/single-chart"
  132. })
  133. },
  134. //导航排行占比
  135. navRank(e) {
  136. uni.navigateTo({
  137. url: "/gradepkg/rank-chart/rank-chart"
  138. })
  139. },
  140. //导航优劣科目
  141. navSubject(e) {
  142. uni.navigateTo({
  143. url: "/gradepkg/subject-chart/subject-chart"
  144. })
  145. },
  146. //导航考试能力
  147. navAbility(e) {
  148. uni.navigateTo({
  149. url: "/gradepkg/ability-chart/ability-chart"
  150. })
  151. },
  152. },
  153. }
  154. </script>
  155. <style lang="scss">
  156. .home-container {
  157. width: 100%;
  158. height: 100%;
  159. overflow-x: hidden; //隐藏多余的页面
  160. .home-topinfo {
  161. background: linear-gradient($color-pink, $page-background-color);
  162. }
  163. //缩略图列表
  164. .mini-chart-list {
  165. display: flex;
  166. align-items: center;
  167. flex-wrap: wrap;
  168. margin: -10rpx 20rpx -20rpx 20rpx;
  169. justify-content: space-between;
  170. .mini-chart-item {
  171. margin: 2% 0;
  172. width: 48%;
  173. display: flex;
  174. flex-direction: column;
  175. }
  176. }
  177. }
  178. //图表卡片
  179. .chart-container {
  180. border-radius: $card-border-radius;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. flex-direction: column;
  185. background-color: #FFFFFF;
  186. // box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  187. width: 100%;
  188. height: 345rpx;
  189. .chart-name {
  190. display: flex;
  191. align-items: center;
  192. justify-content: flex-start;
  193. width: 100%;
  194. margin: 20rpx 0 20rpx 40rpx;
  195. .chart-name-text {
  196. margin-left: 15rpx;
  197. font-size: 30rpx;
  198. font-weight: bold;
  199. color: $color-title;
  200. }
  201. }
  202. .charts-box {
  203. width: 100%;
  204. height: 265rpx;
  205. }
  206. }
  207. .table {
  208. margin-bottom: 20rpx;
  209. width: 93%;
  210. height: 100%;
  211. }
  212. .t-icon {
  213. width: 40rpx;
  214. height: 40rpx;
  215. }
  216. </style>