workStats.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!-- 作业统计页面 -->
  2. <template>
  3. <view class="page-view">
  4. <top-return color="#FFF" text="作业统计"></top-return>
  5. <!-- 背景 -->
  6. <view class="bg-box1"></view>
  7. <!-- 页面标题内容 -->
  8. <view class="top-box">
  9. <view class="flex-baseline">
  10. <view class="info-title" style="margin-left: 0;">{{dayTime.split('月')[0]}}</view>
  11. <view class="info-subtitle">月</view>
  12. <view class="info-title">{{dayTime.split('月')[1]}}
  13. </view>
  14. <view class="info-subtitle">日</view>
  15. <view class="info-title" style="margin-left: 20rpx;">{{weekTime}}</view>
  16. </view>
  17. <view class="flex-baseline">
  18. <view class="data-subtitle" style="margin-left: 0;">孩子今日共</view>
  19. <view class="data-title">{{workData.length}}</view>
  20. <view class="data-subtitle">份作业</view>
  21. </view>
  22. </view>
  23. <!-- 统计列表 -->
  24. <view class="card-view">
  25. <view class="card-item" style="width: 100%;">
  26. <view class="card-title">
  27. <view class="front-tag"></view>
  28. <view class="title">近期作业完成率</view>
  29. </view>
  30. <view class="chart-box">
  31. <qiun-data-charts type="column" ontouch="true" :chartData="workChartData[0]"
  32. tooltipFormat='HomeworkPercent' :canvas2d="true" canvasId="work_chart1" />
  33. </view>
  34. </view>
  35. <view class="card-item" style="width: 100%;">
  36. <view class="card-title">
  37. <view class="front-tag"></view>
  38. <view class="title">近期作业得分率</view>
  39. </view>
  40. <view class="chart-box">
  41. <qiun-data-charts type="area" ontouch="true" :chartData="workChartData[1]"
  42. tooltipFormat='HomeworkPercent' :canvas2d="true" canvasId="work_chart2" />
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapState
  51. } from 'vuex'
  52. export default {
  53. computed: {
  54. ...mapState('m_children', ['workData']),
  55. ...mapState('m_chart', ['workChartData']),
  56. },
  57. data() {
  58. return {
  59. dayTime: '',
  60. weekTime: ''
  61. };
  62. },
  63. onLoad() {
  64. this.getToday()
  65. },
  66. methods: {
  67. getToday() {
  68. this.dayTime = (new Date()).format('M-d').replace('-', '月')
  69. this.weekTime = "星期" + "日一二三四五六".charAt(new Date().getDay());
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. @import '@/subpkg/datalist/top_info.scss';
  76. .chart-box {
  77. width: 100%;
  78. height: 500rpx;
  79. }
  80. </style>