inspectionClass.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="app-container">
  3. <evaluation-title
  4. :title="routeParams.evaluationName + '/选择班级'"
  5. :navBackButton="true"
  6. ></evaluation-title>
  7. <form-search
  8. :withoutSearchButton="true"
  9. :searchformShow="{ class: '', clbum: '' }"
  10. @change="handleQuery"
  11. @handleQuery="handleQuery"
  12. @resetQuery="resetQuery"
  13. ></form-search>
  14. <el-row :gutter="10">
  15. <el-col
  16. class="evaluation-card-wrapper"
  17. v-for="item in dataList"
  18. :key="item.evaluationClassId"
  19. :xs="12"
  20. :sm="8"
  21. :md="8"
  22. :lg="6"
  23. :xl="6"
  24. >
  25. <evaluation-card
  26. @click.native="detail(item)"
  27. :title="item.name"
  28. :subTitle="item.subjectName"
  29. :thirdTitle="item.className"
  30. :stateOptions="mxGlobal.MergeEvalInspectionStates(item.stateStr)"
  31. :state="item.stateStr"
  32. :proportion="`${item.valid}/${item.total}`"
  33. ></evaluation-card>
  34. </el-col>
  35. </el-row>
  36. <pagination
  37. v-show="total > queryParams.pageSize"
  38. :total="total"
  39. :page.sync="queryParams.pageNum"
  40. :limit.sync="queryParams.pageSize"
  41. :page-size="20"
  42. @pagination="getList"
  43. />
  44. <evaluation-empty v-if="total == 0" />
  45. </div>
  46. </template>
  47. <script>
  48. import { getEvaluationForTeacher } from "@/api/webApi/studentEvaluating";
  49. import Treeselect from "@riophae/vue-treeselect";
  50. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  51. import IconSelect from "@/components/IconSelect";
  52. export default {
  53. name: "Menu",
  54. components: { Treeselect, IconSelect },
  55. data() {
  56. return {
  57. total: 0,
  58. // 遮罩层
  59. loading: true,
  60. // 多级传递参数
  61. routeParams: {},
  62. // 查询参数
  63. queryParams: {
  64. classId: "",
  65. catalogId: "",
  66. evaluationId: "",
  67. pageNum: 1,
  68. pageSize: 20,
  69. },
  70. evaluationName: "",
  71. dataList: [],
  72. };
  73. },
  74. created() {
  75. this.routeParams = this.$route.query;
  76. this.queryParams = { ...this.queryParams, ...this.$route.query };
  77. delete this.queryParams.evaluationName;
  78. this.handleQuery({});
  79. },
  80. methods: {
  81. detail(item) {
  82. this.$router.push({
  83. path: "/accurateTeaching/evaluating/inspection/student",
  84. query: { ...this.routeParams, evaluationClassId: item.evaluationClassId, className: item.className },
  85. });
  86. },
  87. // 选择图标
  88. selected(name) {
  89. this.form.icon = name;
  90. },
  91. /** 测评列表 */
  92. getList() {
  93. this.loading = true;
  94. getEvaluationForTeacher(this.queryParams)
  95. .then((response) => {
  96. this.dataList = response.rows;
  97. this.total = response.total;
  98. this.loading = false;
  99. })
  100. .catch((err) => {
  101. this.loading = false;
  102. });
  103. },
  104. // 表单重置
  105. reset() {
  106. this.form = {};
  107. this.resetForm("form");
  108. },
  109. /** 搜索按钮操作 */
  110. handleQuery(data = {}) {
  111. this.queryParams.pageNum = 1;
  112. this.queryParams.classId = data.clbum;
  113. this.queryParams.gradeId = data.gradeid;
  114. this.queryParams.subjectId = data.userSubject;
  115. this.queryParams.termId = data.semester;
  116. this.queryParams.typeId = data.exam;
  117. this.getList();
  118. },
  119. handleSizeChange(val) {
  120. console.log(`每页 ${val} 条`);
  121. },
  122. handleCurrentChange(val) {
  123. console.log(`当前页: ${val}`);
  124. },
  125. /** 重置按钮操作 */
  126. resetQuery() {
  127. // this.resetForm("queryForm");
  128. // this.handleQuery();
  129. this.queryParams = {
  130. pageNum: 1,
  131. pageSize: 20,
  132. };
  133. this.handleQuery();
  134. },
  135. },
  136. };
  137. </script>