grade.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="chart-list-container">
  3. <!-- 头部区域 -->
  4. <top-box v-bind:timeStamp="timeStamp"></top-box>
  5. <!-- 缩略图区域 -->
  6. <view class="mini-chart-list">
  7. <view class="mini-chart-item">
  8. <view class="mainchart-container">
  9. <view class="mainchart-name">
  10. <view class="t-icon t-icon-xtubiao-4"></view>
  11. <text class="mainchart-text">学期成绩走势</text>
  12. </view>
  13. <view class="mainchart-box">
  14. <qiun-data-charts class="chart" :canvas2d='true' canvasId='canvans5' type="mainline"
  15. :chartData="gradeData.mainLineChart" :loadingType="4" />
  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. </view>
  63. <!-- 成绩表单 -->
  64. <view class="table-card">
  65. <view class="table-name">
  66. <view class="t-icon t-icon-xtubiao-5"></view>
  67. <text class="table-name-text">成绩概览</text>
  68. </view>
  69. <z-table class="table" :tableData="gradeData.tableData" :columns="gradeData.columns" stickSide="true">
  70. </z-table>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import {
  76. mapState
  77. } from 'vuex'
  78. export default {
  79. computed: {
  80. ...mapState('m_children', ['childreninfo', 'semester']),
  81. ...mapState('m_chart', ['gradeData'])
  82. },
  83. data() {
  84. return {
  85. //时间戳
  86. timeStamp: '',
  87. }
  88. },
  89. methods: {
  90. //导航柱状图页面
  91. navColumnChart(e) {
  92. console.log(e);
  93. uni.navigateTo({
  94. url: "/gradepkg/column-chart/column-chart"
  95. })
  96. },
  97. //导航面积折线图页面
  98. navAreaChart(e) {
  99. console.log(e);
  100. uni.navigateTo({
  101. url: "/gradepkg/area-chart/area-chart"
  102. })
  103. },
  104. //导航折线图页面
  105. navLineChart(e) {
  106. console.log(e);
  107. uni.navigateTo({
  108. url: "/gradepkg/line-chart/line-chart"
  109. })
  110. },
  111. //更新时间戳
  112. getTimeStamp() {
  113. var date = new Date(),
  114. hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
  115. minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  116. this.timeStamp = (hour + ':' + minute).toString();
  117. }
  118. },
  119. onLoad() {
  120. this.getTimeStamp()
  121. },
  122. //刷新页面
  123. onPullDownRefresh() {
  124. this.getTimeStamp()
  125. console.log('refresh');
  126. setTimeout(function() {
  127. uni.stopPullDownRefresh();
  128. }, 1000);
  129. }
  130. }
  131. </script>
  132. <style lang="scss">
  133. .chart-list-container {
  134. width: 100%;
  135. height: 100%;
  136. overflow-x:hidden; //隐藏多余的页面
  137. .home-topinfo {
  138. background: linear-gradient(#ff8caf, #f1f3f5);
  139. }
  140. //缩略图列表
  141. .mini-chart-list {
  142. display: flex;
  143. align-items: center;
  144. flex-wrap: wrap;
  145. margin: -50rpx 20rpx 0 20rpx;
  146. justify-content: space-between;
  147. .mini-chart-item {
  148. margin: 10rpx 0;
  149. display: flex;
  150. flex-direction: column;
  151. }
  152. }
  153. }
  154. //总成绩折线图
  155. .mainchart-container {
  156. border-radius: 16rpx;
  157. display: flex;
  158. align-items: center;
  159. flex-direction: column;
  160. background-color: #FFFFFF;
  161. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  162. width: 100%;
  163. .mainchart-name {
  164. display: flex;
  165. align-items: center;
  166. justify-content: flex-start;
  167. width: 100%;
  168. margin: 20rpx 0 20rpx 40rpx;
  169. .mainchart-text {
  170. margin-left: 20rpx;
  171. font-size: 30rpx;
  172. font-weight: bold;
  173. color: #3B4144;
  174. }
  175. }
  176. .mainchart-box {
  177. width: 710rpx;
  178. height: 300rpx;
  179. }
  180. }
  181. //缩略图
  182. .chart-container {
  183. border-radius: 16rpx;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. flex-direction: column;
  188. background-color: #FFFFFF;
  189. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  190. width: 347rpx;
  191. height: 345rpx;
  192. .chart-name {
  193. display: flex;
  194. align-items: center;
  195. justify-content: flex-start;
  196. width: 100%;
  197. margin: 20rpx 0 35rpx 40rpx;
  198. .chart-name-text {
  199. margin-left: 20rpx;
  200. font-size: 30rpx;
  201. font-weight: bold;
  202. color: #3B4144;
  203. }
  204. }
  205. .charts-box {
  206. width: 100%;
  207. height: 250rpx;
  208. }
  209. }
  210. //表格
  211. .table-card {
  212. margin: 10rpx 20rpx;
  213. border-radius: 16rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. flex-direction: column;
  218. background-color: #FFFFFF;
  219. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  220. .table-name {
  221. width: 100%;
  222. text-align: left;
  223. margin: 20rpx 0 0 50rpx;
  224. display: flex;
  225. align-items: center;
  226. font-weight: bold;
  227. color: #3B4144;
  228. .table-name-text {
  229. font-size: 30rpx;
  230. margin-left: 20rpx;
  231. }
  232. }
  233. .table {
  234. margin: 20rpx;
  235. width: 92%;
  236. }
  237. }
  238. //图标
  239. .t-icon {
  240. width: 40rpx;
  241. height: 40rpx;
  242. }
  243. </style>