workstats.vue 2.3 KB

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