allDate.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div>
  3. <el-card>
  4. <headers title="数据总览" :hidenOrgan="true" />
  5. <div
  6. class="wall"
  7. style="height: 68px"
  8. v-if="JSON.stringify(items) == '{}'"
  9. >
  10. 暂无数据
  11. </div>
  12. <!--
  13. -->
  14. <statistic :col="6" class="statistic" :cols="0">
  15. <statistic-item v-for="(item, key) in items" :key="key" @click="active = key" :class="{ active: active === key }">
  16. <span>
  17. {{ item.title + "(人)" }}
  18. <el-tooltip
  19. v-if="item.desc"
  20. :content="item.desc"
  21. :open-delay="0.3"
  22. placement="top"
  23. >
  24. <i
  25. style="margin-left: 5px; cursor: pointer"
  26. class="el-icon-warning-outline"
  27. />
  28. </el-tooltip>
  29. </span>
  30. <span> <count-to :endVal="item.percent || 0" /> </span>
  31. </statistic-item>
  32. </statistic>
  33. </el-card>
  34. </div>
  35. </template>
  36. <script>
  37. import headers from "./modals/headers.vue";
  38. import countTo from "vue-count-to";
  39. import { descs, titles } from "../constant";
  40. import { getCloudStudyStudentOverView } from "../api";
  41. export default {
  42. props: ["data"],
  43. components: {
  44. headers,
  45. countTo
  46. },
  47. data() {
  48. return {
  49. dataList:{},
  50. active:''
  51. };
  52. },
  53. async mounted() {
  54. try {
  55. const res = await getCloudStudyStudentOverView();
  56. this.dataList = res.data;
  57. } catch (e) {
  58. console.log(e);
  59. }
  60. // 获取数据
  61. },
  62. computed: {
  63. items() {
  64. let obj = {};
  65. // "eVipStudentNum",
  66. let arr = [
  67. "totalStudentNum",
  68. "waitActivateVipStudentNum",
  69. "effectiveVipStudentNum",
  70. "vipStudentNum",
  71. "cloudStudyLivelyStudentNum",
  72. // "newCloudStudyStudentNum",
  73. // "cloudStudyTodayUseStudentNum",
  74. "cloudStudyUseStudentNum",
  75. ];
  76. arr.forEach((str) => {
  77. if (this.dataList[str]+'') {
  78. obj[str] ={title:titles[str],percent:this.dataList[str],desc:descs[str]};
  79. }
  80. });
  81. return obj;
  82. },
  83. },
  84. methods: {},
  85. };
  86. </script>
  87. <style lang="scss" scoped>
  88. /deep/.el-card__body {
  89. padding-top: 0 !important;
  90. }
  91. </style>