grade.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="home-container">
  3. <!-- 头部区域 -->
  4. <top-box v-bind:timeStamp="timeStamp"></top-box>
  5. <!-- 缩略图区域 -->
  6. <view class="mini-chart-list">
  7. <view class="mini-chart-item" style="width: 100%;">
  8. <view class="chart-container">
  9. <view class="chart-name">
  10. <view class="t-icon t-icon-xtubiao-4"></view>
  11. <text class="chart-name-text">成绩走势</text>
  12. </view>
  13. <view class="charts-box">
  14. <qiun-data-charts class="chart" :canvas2d='true' canvasId='canvans5' type="mainline"
  15. :chartData="gradeData.mainLineChart" :loadingType="4" tooltipFormat='tooltipScore' />
  16. </view>
  17. </view>
  18. </view>
  19. <view class="mini-chart-item">
  20. <view class="chart-container" @click="navLineChart">
  21. <view class="chart-name">
  22. <view class="t-icon t-icon-xtubiao-4"></view>
  23. <text class="chart-name-text">学期走势</text>
  24. </view>
  25. <view class="charts-box">
  26. <qiun-data-charts type="mini-line" :chartData="gradeData.semesterLineChart.lineComparison"
  27. :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
  28. canvasId='canvans3' />
  29. </view>
  30. </view>
  31. </view>
  32. <view class="mini-chart-item">
  33. <view class="chart-container" @click="navAreaChart">
  34. <view class="chart-name">
  35. <view class="t-icon t-icon-xtubiao-4"></view>
  36. <text class="chart-name-text">单科走势</text>
  37. </view>
  38. <view class="charts-box">
  39. <qiun-data-charts type="mini-area" :chartData="gradeData.subjectAreaChart.areaComparison"
  40. :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
  41. canvasId='canvans1' />
  42. </view>
  43. </view>
  44. </view>
  45. <view class="mini-chart-item">
  46. <view class="chart-container" @click="navColumnChart">
  47. <view class="chart-name">
  48. <view class="t-icon t-icon-xtubiao-2"></view>
  49. <text class="chart-name-text">最近成绩</text>
  50. </view>
  51. <view class="charts-box">
  52. <qiun-data-charts type="mini-column" :chartData="gradeData.recentColumnChart.columnComparison"
  53. :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
  54. canvasId='canvans2' />
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 分析模块 -->
  59. <view class="mini-chart-item">
  60. <analysis-box></analysis-box>
  61. </view>
  62. <!-- 成绩表单 -->
  63. <view class="mini-chart-item" style="width: 100%; height: 650rpx;">
  64. <view class="chart-container" style="height: 100%">
  65. <view class="chart-name">
  66. <view class="t-icon t-icon-xtubiao-5"></view>
  67. <text class="chart-name-text">成绩概览</text>
  68. </view>
  69. <z-table class="table" :tableData="gradeData.tableData" :columns="gradeData.columns" showBottomSum="true">
  70. </z-table>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. mapState
  79. } from 'vuex'
  80. export default {
  81. computed: {
  82. ...mapState('m_children', ['childreninfo', 'semester']),
  83. ...mapState('m_chart', ['gradeData'])
  84. },
  85. data() {
  86. return {
  87. //时间戳
  88. timeStamp: '',
  89. }
  90. },
  91. onLoad() {
  92. this.$getTimeStamp()
  93. },
  94. //刷新页面
  95. onPullDownRefresh() {
  96. this.$getTimeStamp()
  97. console.log('refresh');
  98. setTimeout(function() {
  99. uni.stopPullDownRefresh();
  100. }, 1000);
  101. },
  102. methods: {
  103. //导航柱状图页面
  104. navColumnChart(e) {
  105. console.log(e);
  106. uni.navigateTo({
  107. url: "/gradepkg/column-chart/column-chart"
  108. })
  109. },
  110. //导航面积折线图页面
  111. navAreaChart(e) {
  112. console.log(e);
  113. uni.navigateTo({
  114. url: "/gradepkg/area-chart/area-chart"
  115. })
  116. },
  117. //导航折线图页面
  118. navLineChart(e) {
  119. console.log(e);
  120. uni.navigateTo({
  121. url: "/gradepkg/line-chart/line-chart"
  122. })
  123. },
  124. },
  125. }
  126. </script>
  127. <style lang="scss">
  128. .home-container {
  129. width: 100%;
  130. height: 100%;
  131. overflow-x: hidden; //隐藏多余的页面
  132. .home-topinfo {
  133. background: linear-gradient(#ff8caf, $page-background-color);
  134. }
  135. //缩略图列表
  136. .mini-chart-list {
  137. display: flex;
  138. align-items: center;
  139. flex-wrap: wrap;
  140. margin: -50rpx 20rpx 10rpx 20rpx;
  141. justify-content: space-between;
  142. .mini-chart-item {
  143. margin: 2% 0;
  144. width: 48%;
  145. display: flex;
  146. flex-direction: column;
  147. }
  148. }
  149. }
  150. //图表卡片
  151. .chart-container {
  152. border-radius: $card-border-radius;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. flex-direction: column;
  157. background-color: #FFFFFF;
  158. // box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  159. width: 100%;
  160. height: 345rpx;
  161. .chart-name {
  162. display: flex;
  163. align-items: center;
  164. justify-content: flex-start;
  165. width: 100%;
  166. margin: 20rpx 0 35rpx 40rpx;
  167. .chart-name-text {
  168. margin-left: 20rpx;
  169. font-size: 30rpx;
  170. font-weight: bold;
  171. color: #3B4144;
  172. }
  173. }
  174. .charts-box {
  175. width: 100%;
  176. height: 250rpx;
  177. }
  178. }
  179. .table {
  180. margin-bottom: 40rpx;
  181. width: 93%;
  182. height: 100%;
  183. }
  184. .t-icon {
  185. width: 40rpx;
  186. height: 40rpx;
  187. }
  188. </style>