SAchooseexam.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <Row class="exam_box">
  3. <Col span="24">
  4. <li v-for="(item,index) in selectexam" class="list_box" @click="select_box(index)">
  5. <p class="box_title">{{item.title}}-{{item.type}}</p>
  6. <p class="box_time">{{item.time}}</p>
  7. <p class="box_type">诊断类型:{{item.typename}}</p>
  8. <p class="box_num">测试人数:{{item.num}}人</p>
  9. </li>
  10. <infinite-loading @infinite="onInfinite" ref="infiniteLoading"></infinite-loading>
  11. </Col>
  12. </Row>
  13. </template>
  14. <script>
  15. import InfiniteLoading from 'vue-infinite-loading';
  16. export default {
  17. components: {
  18. InfiniteLoading,
  19. },
  20. data() {
  21. return {
  22. list: [],
  23. now_url: this.$route.path,
  24. ops: {
  25. vuescroll: {},
  26. scrollPanel: {},
  27. rail: {
  28. keepShow: true
  29. },
  30. bar: {
  31. hoverStyle: true,
  32. onlyShowBarOnScroll: false, //是否只有滚动的时候才显示滚动条
  33. background: 'red',
  34. }
  35. },
  36. };
  37. },
  38. created() {
  39. this.init();
  40. },
  41. computed: {
  42. selectexam() {
  43. return this.$store.state.selectexam
  44. },
  45. },
  46. methods: {
  47. onInfinite() {
  48. //setTimeout(() => {
  49. // const temp = [];
  50. // // let suiji=Math.ceil(Math.random()*10);
  51. // for (let i = this.list.length + 1; i <= this.list.length + 3; i++) {
  52. // temp.push(i);
  53. // }
  54. // this.list = this.list.concat(temp);
  55. // this.$refs.infiniteLoading.$emit('$InfiniteLoading:loaded');
  56. //}, 300);
  57. },
  58. //点击考试获取详情
  59. select_box(value) {
  60. if (this.now_url == '/saindex') {
  61. this.$api.FindSelectExam({})
  62. .then((response) => {
  63. //console.log(response.result.data);
  64. this.$store.state.selectgrade = response.result.data.selectgrade
  65. //获取新的学年期
  66. this.$store.state.selectterm = response.result.data.term
  67. //获取新的考试次数情况
  68. this.$store.state.selectexam = response.result.data.exam[0].data;
  69. //获取新的基础信息
  70. this.$store.state.basicsdata = response.result.data.base;
  71. //获取新的各校成绩排名
  72. this.$store.state.zhuxhuang = response.result.data.barecharts;
  73. //获取新的各项科目表现
  74. this.$store.state.leida = response.result.data.leida;
  75. //获取新的科目表现对比
  76. this.$store.state.pie = response.result.data.pie
  77. //获取新的考试类型
  78. this.$store.state.examtype = response.result.data.examtype;
  79. //获取新的各校历次总分统计图
  80. this.$store.state.linechart = response.result.data.linechart;
  81. })
  82. } else if (this.now_url == '/teach') {
  83. this.$api.FindClickExam({})
  84. .then((response) => {
  85. //获取新的学年期
  86. this.$store.state.selectterm = response.result.data.term;
  87. //获取新的数据对比
  88. this.$store.state.selectcontrast = response.result.data.selectcontrast;
  89. //获取新的考试次数情况
  90. this.$store.state.selectexam = response.result.data.exam[0].data;
  91. //获取新的基础信息
  92. this.$store.state.basicsdata = response.result.data.base;
  93. //获取各班平均分数排名
  94. this.$store.state.barline = response.result.data.barecharts;
  95. //获取及格率比较
  96. this.$store.state.annulus = response.result.data.annulus;
  97. //获取PR百分等级
  98. this.$store.state.accuracyPR = response.result.data.accuracyPR;
  99. //获取历次总分统计图
  100. this.$store.state.linechart = response.result.data.linechart;
  101. })
  102. }
  103. },
  104. init() {
  105. if (this.now_url == '/saindex') {
  106. this.$api.FindExam({})
  107. .then((response) => {
  108. //console.log(response.result.data,11111);
  109. this.$store.state.selectexam = response.result.data[0].data;
  110. //console.log(this.list,333333)
  111. })
  112. } else if (this.now_url == '/teach') {
  113. this.$api.FindTeachExam({})
  114. .then((response) => {
  115. console.log(response.result.data, 45678999990000)
  116. this.$store.state.selectexam = response.result.data[0].data;
  117. })
  118. } else if (this.now_url == '/total') {
  119. this.$api.FindExam({})
  120. .then((response) => {
  121. this.$store.state.selectexam = response.result.data[0].data;
  122. })
  123. }
  124. }
  125. },
  126. };
  127. </script>