瀏覽代碼

小小艺术家

liushengqiang 2 年之前
父節點
當前提交
04b5229878
共有 2 個文件被更改,包括 26 次插入16 次删除
  1. 17 14
      src/views/main/cloudDate/exerciseDuration.vue
  2. 9 2
      src/views/main/cloudDate/exerciseDurationDetail.vue

+ 17 - 14
src/views/main/cloudDate/exerciseDuration.vue

@@ -169,13 +169,9 @@ import dayjs from "dayjs";
 import histogram from "v-charts/lib/histogram.common";
 import { getNowDateAndMonday, getNowDateAndSunday } from "@/utils/utils";
 import { cloudTeacherNum } from "../api";
-let nowTime = new Date();
-nowTime =
-  nowTime.getFullYear() +
-  "-" +
-  (nowTime.getMonth() + 1) +
-  "-" +
-  nowTime.getDate();
+let nowTime = dayjs()
+            .subtract(1, "day")
+            .format("YYYY-MM-DD")
 export const getTimes = (times, keys = []) => {
   if (times && times.length) {
     return {
@@ -191,17 +187,24 @@ export default {
   data() {
     return {
       searchForm: {
-        dates: []
+        dates: [
+        dayjs()
+            .subtract(1, "day")
+            .format("YYYY-MM-DD"),
+          dayjs()
+            .subtract(1, "day")
+            .format("YYYY-MM-DD")
+        ]
       },
       tableList: [],
       activeName: "first"
     };
   },
   async mounted() {
-    if (this.searchForm.dates?.length <= 0) {
-      this.searchForm.dates.push(nowTime);
-      this.searchForm.dates.push(nowTime);
-    }
+    // if (this.searchForm.dates?.length <= 0) {
+    //   this.searchForm.dates.push(nowTime);
+    //   this.searchForm.dates.push(nowTime);
+    // }
 
     this.getList();
   },
@@ -247,8 +250,8 @@ export default {
         page: 1
       };
       this.$refs.searchForm.resetFields();
-      this.searchForm.dates.push(getNowDateAndMonday(nowTime));
-      this.searchForm.dates.push(getNowDateAndSunday(nowTime));
+      // this.searchForm.dates.push(getNowDateAndMonday(nowTime));
+      // this.searchForm.dates.push(getNowDateAndSunday(nowTime));
       this.getList();
     },
     getDefaultTime() {

+ 9 - 2
src/views/main/cloudDate/exerciseDurationDetail.vue

@@ -97,13 +97,20 @@
               <div>{{ scope.row.trainRate }}%</div>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="id" label="<60分钟">
+
+          <el-table-column align="center" label="≤10分钟">
+            <template slot-scope="scope">
+              <div>{{ scope.row.train0 }}人</div>
+            </template>
+          </el-table-column>
+
+          <el-table-column align="center" label="10~60分钟">
             <template slot-scope="scope">
               <div>{{ scope.row.train1 }}人</div>
             </template></el-table-column
           >
 
-          <el-table-column align="center" prop="id" label="60~120分钟">
+          <el-table-column align="center" label="60~120分钟">
             <template slot-scope="scope">
               <div>{{ scope.row.train2 }}人</div>
             </template>