ソースを参照

修改

网管课暂停
mo 3 年 前
コミット
d53a972502

+ 67 - 67
src/views/smallStudentManager/components/index.vue

@@ -1,67 +1,67 @@
-<template>
-  <div class="Statistics">
-    <el-row class="rows" :gutter="20">
-      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
-        <sleep :data="statistic" />
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
-        <studyStudent :data="statistic" />
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
-        <remainder :data="statistic" />
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
-        <studentChange :groupType="groupType" />
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import sleep from './sleep';
-import studyStudent from './studyStudent';
-import remainder from './remainder';
-import studentChange from './studentChange';
-import { studentSmallClassStatisticsSum } from '../api'
-export default {
-  name: 'Statistics',
-  props: ['groupType'],
-  components: {
-    sleep,
-    studyStudent,
-    remainder,
-    studentChange
-  },
-  data() {
-    return {
-      statistic: {}
-    }
-  },
-  async mounted() {
-    try {
-      let res = await studentSmallClassStatisticsSum({ groupType: this.groupType })
-      this.statistic = res.data || {}
-    } catch {}
-  },
-}
-</script>
-
-<style lang="scss" scoped>
-.rows {
-    > div {
-      margin-bottom: 20px;
-    }
-  }
-/deep/ .el-card__body .statistic {
-  margin-bottom: 15px;
-  padding: 0;
-}
-.statistic {
-  .statistic-content > span {
-    font-size: 22px !important;
-    &:first-child {
-      font-size: 14px !important;
-    }
-  }
-}
-</style>
+<template>
+  <div class="Statistics">
+    <el-row class="rows" :gutter="20">
+      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
+        <sleep :data="statistic" />
+      </el-col>
+      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
+        <studyStudent :data="statistic" :groupType="groupType"/>
+      </el-col>
+      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
+        <remainder :data="statistic" />
+      </el-col>
+      <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
+        <studentChange :groupType="groupType" />
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import sleep from './sleep';
+import studyStudent from './studyStudent';
+import remainder from './remainder';
+import studentChange from './studentChange';
+import { studentSmallClassStatisticsSum } from '../api'
+export default {
+  name: 'Statistics',
+  props: ['groupType'],
+  components: {
+    sleep,
+    studyStudent,
+    remainder,
+    studentChange
+  },
+  data() {
+    return {
+      statistic: {}
+    }
+  },
+  async mounted() {
+    try {
+      let res = await studentSmallClassStatisticsSum({ groupType: this.groupType })
+      this.statistic = res.data || {}
+    } catch {}
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.rows {
+    > div {
+      margin-bottom: 20px;
+    }
+  }
+/deep/ .el-card__body .statistic {
+  margin-bottom: 15px;
+  padding: 0;
+}
+.statistic {
+  .statistic-content > span {
+    font-size: 22px !important;
+    &:first-child {
+      font-size: 14px !important;
+    }
+  }
+}
+</style>

+ 124 - 100
src/views/smallStudentManager/components/studyStudent.vue

@@ -1,100 +1,124 @@
-<template>
-  <div>
-    <el-card>
-      <div slot="header" class="clearfix">
-        <div class="box">
-          <span class="shape"></span>
-          <span>在读学员</span>
-        </div>
-      </div>
-      <!-- <div
-        class="wall"
-        style="height: 68px"
-        v-if="JSON.stringify(items) == '{}'&&!data['CHARGE_STUDENT_CHANGE_RATE']&&!data['ACTIVATION_RATE']"
-      >
-        暂无数据
-      </div> -->
-      <statistic :col="5" class="statistic" :cols="0">
-        <statistic-item
-          v-for="(item, key) in items"
-          :key="key"
-          :class="{ active: active === key }"
-          @click="active = key"
-        >
-          <span>
-            {{ item.text }}
-          </span>
-          <span> <count-to :endVal="item.value" /> </span>
-        </statistic-item>
-      </statistic>
-    </el-card>
-  </div>
-</template>
-<script>
-import countTo from "vue-count-to";
-export default {
-  props: ["data"],
-  components: {
-    "count-to": countTo,
-  },
-  data() {
-    return {
-      active: "",
-    };
-  },
-  computed: {
-    dataEmpty() {
-      return !this.chartData.rows.length;
-    },
-    items() {
-      let tempArr = [{
-        text: '在读学员总数',
-        value: 0,
-        id: 'normalStudentNum'
-      }, {
-        text: '进行中',
-        value: 0,
-        id: 'normalStudentHasNormalGroupNum'
-      }, {
-        text: '暂停',
-        value: 0,
-        id: 'hasCourseBalanceAndNotSubCourseNum'
-      }, {
-        text: '未排课',
-        value: 0,
-        id: 'normalStudentHasNoScheduleNum'
-      }]
-      tempArr.forEach(item => {
-        if(this.data[item.id]) {
-          item.value = this.data[item.id]
-        }
-      })
-      return tempArr
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-/deep/ .el-card__body .statistic {
-    margin-bottom: 15px;
-    padding: 0;
-  }
-/deep/.el-card__header {
-    padding: 0 20px!important;
-}
-.box {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  height: 55px;
-  line-height: 55px;
-  .shape {
-    margin-right: 10px;
-    height: 18px;
-    width: 4px;
-    background-color: var(--color-primary);
-  }
-}
-</style>
-
+<template>
+  <div>
+    <el-card>
+      <div slot="header" class="clearfix">
+        <div class="box">
+          <span class="shape"></span>
+          <span>在读学员</span>
+        </div>
+      </div>
+      <!-- <div
+        class="wall"
+        style="height: 68px"
+        v-if="JSON.stringify(items) == '{}'&&!data['CHARGE_STUDENT_CHANGE_RATE']&&!data['ACTIVATION_RATE']"
+      >
+        暂无数据
+      </div> -->
+      <statistic :col="5" class="statistic" :cols="0">
+        <statistic-item
+          v-for="(item, key) in items"
+          :key="key"
+          :class="{ active: active === key }"
+          @click="active = key"
+        >
+          <span>
+            {{ item.text }}
+          </span>
+          <span> <count-to :endVal="item.value" /> </span>
+        </statistic-item>
+      </statistic>
+    </el-card>
+  </div>
+</template>
+<script>
+import countTo from "vue-count-to";
+export default {
+  props: ["data","groupType"],
+  components: {
+    "count-to": countTo,
+  },
+  data() {
+    return {
+      active: "",
+    };
+  },
+  computed: {
+    dataEmpty() {
+      return !this.chartData.rows.length;
+    },
+    items() {
+      if(this.groupType == 'PRACTICE'){
+            let tempArr = [{
+        text: '在读学员总数',
+        value: 0,
+        id: 'normalStudentNum'
+      }, {
+        text: '进行中',
+        value: 0,
+        id: 'normalStudentHasNormalGroupNum'
+      }, {
+        text: '未排课',
+        value: 0,
+        id: 'normalStudentHasNoScheduleNum'
+      }]
+
+      tempArr.forEach(item => {
+        if(this.data[item.id]) {
+          item.value = this.data[item.id]
+        }
+      })
+      return tempArr
+      }else {
+            let tempArr = [{
+        text: '在读学员总数',
+        value: 0,
+        id: 'normalStudentNum'
+      }, {
+        text: '进行中',
+        value: 0,
+        id: 'normalStudentHasNormalGroupNum'
+      }, {
+        text: '暂停',
+        value: 0,
+        id: 'hasCourseBalanceAndNotSubCourseNum'
+      }, {
+        text: '未排课',
+        value: 0,
+        id: 'normalStudentHasNoScheduleNum'
+      }]
+      tempArr.forEach(item => {
+        if(this.data[item.id]) {
+          item.value = this.data[item.id]
+        }
+      })
+      return tempArr
+      }
+
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+/deep/ .el-card__body .statistic {
+    margin-bottom: 15px;
+    padding: 0;
+  }
+/deep/.el-card__header {
+    padding: 0 20px!important;
+}
+.box {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  height: 55px;
+  line-height: 55px;
+  .shape {
+    margin-right: 10px;
+    height: 18px;
+    width: 4px;
+    background-color: var(--color-primary);
+  }
+}
+</style>
+