marking.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="app-container">
  3. <form-search
  4. :searchformShow="showForm"
  5. @handleQuery="handleQuery"
  6. @resetQuery="resetQuery"
  7. ></form-search>
  8. <evaluation-title
  9. title="阅卷试卷"
  10. :subTitle="`共有${total}个内容`"
  11. ></evaluation-title>
  12. <el-row :gutter="10">
  13. <el-col
  14. class="evaluation-card-wrapper"
  15. v-for="(item, idx) in dataList"
  16. :key="idx"
  17. :xs="12"
  18. :sm="8"
  19. :md="8"
  20. :lg="6"
  21. :xl="6"
  22. >
  23. <evaluation-card
  24. @click.native="detail(item)"
  25. :title="item.name"
  26. :sub-title="item.subjectName"
  27. :state-options="mxGlobal.MergeEvalInspectionStates(item.stateStr)"
  28. :state="item.stateStr"
  29. :pointer-enable="item.evaluationClassId>0"
  30. ></evaluation-card>
  31. </el-col>
  32. </el-row>
  33. <pagination
  34. v-show="total > 0"
  35. :total="total"
  36. :page.sync="queryParams.pageNum"
  37. :limit.sync="queryParams.pageSize"
  38. :page-size="20"
  39. @pagination="getList"
  40. />
  41. </div>
  42. </template>
  43. <script>
  44. import { getEvaluationForTest } from '@/api/webApi/studentEvaluating'
  45. import transferMixin from '@/components/mx-transfer-mixin'
  46. export default {
  47. mixins: [transferMixin],
  48. name: 'marking',
  49. data() {
  50. return {
  51. total: 0,
  52. // 遮罩层
  53. loading: true,
  54. // 显示状态数据字典
  55. visibleOptions: [],
  56. // 菜单状态数据字典
  57. statusOptions: [],
  58. // 查询参数
  59. showForm: {},
  60. queryParams: {
  61. classId: '',
  62. catalogId: '',
  63. pageNum: 1,
  64. pageSize: 20
  65. },
  66. dataList: [],
  67. viewName: ''
  68. }
  69. },
  70. created() {
  71. this.viewName = this.$route.name
  72. this.resolveCatalogId()
  73. this.setSearchConditions()
  74. this.handleQuery()
  75. },
  76. methods: {
  77. resolveCatalogId() {
  78. let catalogId = ''
  79. const subPaths = this.$route.path.split('/')
  80. const lastSubPath = subPaths[subPaths.length - 1]
  81. if (lastSubPath.toLowerCase().indexOf('marking_') == 0) {
  82. const cataPaths = lastSubPath.split('_')
  83. if (cataPaths.length == 2) catalogId = cataPaths[1]
  84. }
  85. this.queryParams.catalogId = catalogId
  86. },
  87. setSearchConditions() {
  88. switch (this.queryParams.catalogId) {
  89. case '1':
  90. this.showForm = { subjectid: '', gradeid: '', semester: '', exam: '', publish: '' }
  91. break
  92. case '3':
  93. this.showForm = { subjectid: '', gradeid: '', exam: '' }
  94. break
  95. default:
  96. this.showForm = { subjectid: '' }
  97. break
  98. }
  99. },
  100. detail(item) {
  101. if (item.state > 1) {
  102. this.transferTo('/evaluating/answer', { evaluationClassId: item.evaluationClassId })
  103. } else {
  104. this.$message.error(item.stateStr + '状态不能查看试卷!')
  105. }
  106. },
  107. /** 测评列表 */
  108. getList() {
  109. this.loading = true
  110. let Ajax = {
  111. catalogId: this.queryParams.catalogId,
  112. pageNum: this.queryParams.pageNum,
  113. pageSize: this.queryParams.pageSize,
  114. subjectId: this.queryParams.subjectid,
  115. gradeId: this.queryParams.gradeid,
  116. termId: this.queryParams.semester,
  117. typeId: this.queryParams.exam,
  118. publish: this.queryParams.publish,
  119. examineeType: '1' // 区分"测评"页
  120. }
  121. getEvaluationForTest(Ajax)
  122. .then((response) => {
  123. this.dataList = response.rows
  124. this.total = response.total
  125. this.loading = false
  126. })
  127. .catch((err) => {
  128. this.loading = false
  129. })
  130. },
  131. /** 搜索按钮操作 */
  132. handleQuery(data = {}) {
  133. this.queryParams.gradeid = data.gradeid
  134. this.queryParams.subjectid = data.subjectid
  135. this.queryParams.semester = data.semester
  136. this.queryParams.exam = data.exam
  137. this.queryParams.publish = data.publish
  138. this.getList()
  139. },
  140. handleSizeChange(val) {
  141. console.log(`每页 ${val} 条`)
  142. },
  143. handleCurrentChange(val) {
  144. console.log(`当前页: ${val}`)
  145. },
  146. /** 重置按钮操作 */
  147. resetQuery(data) {
  148. this.handleQuery()
  149. }
  150. }
  151. }
  152. </script>