Ver Fonte

首页数据bug修复完毕

1
mo há 3 anos atrás
pai
commit
ed351e6008

+ 17 - 7
src/views/main/baseinfo/curriculum.vue

@@ -8,6 +8,7 @@
         :title="'课程数据'"
         @changeValue="changeValue"
         :isShowQuert="true"
+        ref="searchHeader"
       />
     </div>
     <statistic class="statistic" :cols="0" :col="5">
@@ -18,7 +19,7 @@
         @click="active = key"
       >
         <span>
-          {{ item.title+"(节 )" }}
+          {{ item.title + "(节 )" }}
           <el-tooltip
             v-if="item.desc"
             :content="item.desc"
@@ -80,7 +81,7 @@ export default {
         "VIP_GROUP_COURSE",
         "VIP_GROUP_ONLINE_COURSE",
         "VIP_GROUP_OFFLINE_COURSE",
-        "PRACTICE_GROUP_COURSE"
+        "PRACTICE_GROUP_COURSE",
       ];
       arr.forEach((str) => {
         if (this.data[str]) {
@@ -96,7 +97,7 @@ export default {
         PRACTICE_GROUP_COURSE: this.data["PRACTICE_GROUP_COURSE"] || {},
       };
        */
-      return obj
+      return obj;
     },
     dataZoom() {
       return [
@@ -232,7 +233,16 @@ export default {
       loading: false,
     };
   },
-  watch: {},
+  watch: {
+    search: {
+      deep: true,
+      handler(val) {
+        this.mdate = val.dates;
+        this.timer= "day"
+         this.$refs.searchHeader.initStatue();
+      },
+    },
+  },
   methods: {
     changeValue(date) {
       // 请求更改数据
@@ -323,9 +333,9 @@ export default {
         this.items["VIP_GROUP_COURSE"]["indexMonthData"][item[0].dataIndex]
           ?.extendInfo
       ) {
-        str = this.items["VIP_GROUP_COURSE"]["indexMonthData"][
-          item[0].dataIndex
-        ]?.extendInfo;
+        str =
+          this.items["VIP_GROUP_COURSE"]["indexMonthData"][item[0].dataIndex]
+            ?.extendInfo;
         str.replace("/", "");
         try {
           let strObj = JSON.parse(str);

+ 7 - 7
src/views/main/baseinfo/index.vue

@@ -75,10 +75,10 @@
         />
       </el-col>
       <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-        <curriculum :data="dataInfo" :search="search" @resetDate="resetDate" />
+        <curriculum :data="dataInfo"   ref="curriculum" :search="search" @resetDate="resetDate" />
       </el-col>
       <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-        <student :data="dataInfo" :search="search" @resetDate="resetDate" />
+        <student :data="dataInfo" ref="student" :search="search" @resetDate="resetDate" />
       </el-col>
 
       <!-- <el-col :xs="24" :sm="24" :md="12">
@@ -196,6 +196,7 @@ export default {
       this.FetchDetail();
     },
     async FetchDetail() {
+      // 这里改变就通知子组件重置
       const data = {};
       try {
         const { dates, ...rest } = this.search;
@@ -213,6 +214,7 @@ export default {
         console.log(error);
       }
       this.dataInfo = data;
+
       if (this.$refs.business) {
         this.$refs["business"].init();
       }
@@ -225,7 +227,6 @@ export default {
       for (let item in data) {
         // console.log(item)
         if (item == "VIP_GROUP_COURSE") {
-          console.log(data[item]);
           arr = data[item].indexMonthData;
         }
         this.dataInfo[item] = data[item];
@@ -259,11 +260,10 @@ export default {
   .statistic {
     .statistic-content > span {
       font-size: 22px !important;
-     &:first-child{
-         font-size: 14px !important;
-     }
+      &:first-child {
+        font-size: 14px !important;
+      }
     }
-
   }
 }
 

+ 4 - 1
src/views/main/baseinfo/management.vue

@@ -7,6 +7,7 @@
         @changeValue="changeValue"
         :isShowQuert="true"
         :endDate="endDate"
+        ref='searchHeader'
       />
     </div>
     <div
@@ -286,13 +287,15 @@ export default {
       endDate: "",
     };
   },
-  created() {
+  mounted() {
     this.init();
   },
   methods: {
     init() {
+      this.$refs.searchHeader.initStatue()
       this.mdate = this.getInitDate();
       this.endDate = this.$helpers.dayjs(new Date()).format("YYYY-MM-DD");
+      // this.$refs.searchHeader.initStatue()
       this.changeValue(this.mdate);
     },
     changeValue(date) {

+ 13 - 6
src/views/main/baseinfo/modals/searchHeader.vue

@@ -52,16 +52,21 @@
 import { getNowDateAndSunday, getNowDateAndMonday } from "@/utils/date";
 export default {
   props: ["title", "dates", "isShowQuert", "endDate"],
+
   data() {
     return {
       timer: "",
-      date:this.dates
+      date: this.dates,
     };
   },
-  watch:{
-    dates(val){
-      this.date = val
-    }
+  mounted() {
+  },
+
+  watch: {
+    dates(val) {
+      this.date = val;
+    },
+
   },
 
   methods: {
@@ -75,7 +80,6 @@ export default {
       this.submitDate(this.date);
     },
     changeQuick(val) {
-
       let startDate;
       let endDate;
       if (val == "month") {
@@ -139,6 +143,9 @@ export default {
         },
       };
     },
+    initStatue() {
+      this.timer = "";
+    },
   },
 };
 </script>

+ 13 - 2
src/views/main/baseinfo/student.vue

@@ -9,6 +9,7 @@ v-loading="loading"
         :title="'学员变动'"
         @changeValue="changeValue"
         :isShowQuert="true"
+        ref="searchHeader"
       />
     </div>
     <statistic :col="6" class="statistic" :cols="0">
@@ -19,7 +20,7 @@ v-loading="loading"
         @click="active = key"
       >
         <span>
-          {{ item.title+"(人)" }}
+          {{ item.title + "(人)" }}
           <el-tooltip
             v-if="item.desc"
             :content="item.desc"
@@ -120,7 +121,7 @@ export default {
           },
         },
         series: {
-           type: 'line',
+          type: "line",
           smooth: false,
         },
         tooltip: {
@@ -274,6 +275,16 @@ export default {
       }
     },
   },
+  watch: {
+    search: {
+      deep: true,
+      handler(val) {
+        this.mdate = val.dates;
+        this.timer = "day";
+        this.$refs.searchHeader.initStatue();
+      },
+    },
+  },
 };
 </script>
 <style lang="less" scoped>