index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!-- 刷题练习 -->
  2. <template>
  3. <div class="app-container practiceSolvingProblems">
  4. <div class="page-container practiceSolvingProblemsPage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <el-form-item label="" prop="deptId">
  9. <el-cascader
  10. style="width: 180px"
  11. v-model="queryParams.deptId"
  12. :options="optionListB"
  13. :props="{
  14. emitPath:false,
  15. checkStrictly: true,
  16. value: 'deptId',
  17. label: 'deptName',
  18. children: 'child',
  19. }"
  20. :show-all-levels="false"
  21. filterable
  22. placeholder="学院单位"
  23. ></el-cascader>
  24. </el-form-item>
  25. <el-form-item label="" prop="knowledgePointId">
  26. <el-cascader
  27. v-model="queryParams.knowledgePointId"
  28. :options="optionListC"
  29. :props="{
  30. emitPath:false,
  31. checkStrictly: true,
  32. value: 'id',
  33. label: 'knowledgePointName',
  34. children: 'children',
  35. }"
  36. style="width: 180px"
  37. :show-all-levels="false"
  38. filterable
  39. placeholder="知识点"
  40. ></el-cascader>
  41. </el-form-item>
  42. <el-form-item label="" prop="state">
  43. <el-date-picker
  44. :clearable="false"
  45. v-model="dateRange"
  46. size="small"
  47. style="width: 240px"
  48. value-format="yyyy-MM-dd"
  49. type="daterange"
  50. range-separator="-"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. ></el-date-picker>
  54. </el-form-item>
  55. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  56. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  57. </el-form>
  58. </div>
  59. <div class="page-content-box">
  60. <el-table class="table-box" border :data="dataList">
  61. <el-table-column label="知识点" prop="knowledgePointName" show-overflow-tooltip/>
  62. <el-table-column label="试题总数" prop="totalQuestionCount" width="200" show-overflow-tooltip/>
  63. <el-table-column label="练习人数" prop="practiceUserCount" width="200" show-overflow-tooltip/>
  64. <el-table-column label="答题总数" prop="totalAnswerCount" width="200" show-overflow-tooltip/>
  65. <el-table-column label="答对题数" prop="correctAnswerCount" width="200" show-overflow-tooltip/>
  66. <el-table-column label="整体正确率%" prop="correctRate" width="200" show-overflow-tooltip/>
  67. <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
  68. <template slot-scope="scope">
  69. <div class="table-button-box">
  70. <p class="table-button-null"></p>
  71. <p class="table-button-p"
  72. @click="tableButton(2,scope.row)"
  73. v-hasPermiRouter="['exam:elPracticeStat:detail']"
  74. >练习统计</p>
  75. <p class="table-button-null"></p>
  76. </div>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <pagination :page-sizes="[20, 30, 40, 50]"
  81. v-show="total>0"
  82. :total="total"
  83. :page.sync="queryParams.page"
  84. :limit.sync="queryParams.pageSize"
  85. @pagination="getList"
  86. />
  87. </div>
  88. </div>
  89. <practiceStatistics :propsData="propsData" v-if="pageType === 2"></practiceStatistics>
  90. </div>
  91. </template>
  92. <script>
  93. //import { getDicts } from "@/api/commonality/noPermission";
  94. //import { systemUserSelect } from "@/api/commonality/permission";
  95. //import { getInfo } from "@/api/basicsModules/index";
  96. import practiceStatistics from "./practiceStatistics.vue";
  97. import {
  98. examElPracticeStatPage,
  99. examElKnowledgePointTreeList,systemDeptCurrentDept,
  100. } from "@/api/safetyEducationExaminationNew/index";
  101. export default {
  102. name: 'index',
  103. components: {
  104. practiceStatistics
  105. },
  106. data () {
  107. return {
  108. tableButtonType:this.hasPermiDom(['exam:elPracticeStat:detail',]),
  109. //页面状态
  110. pageType:1,
  111. //下拉列表数据
  112. optionListB:[],
  113. optionListC:[],
  114. //查询条件
  115. queryParams:{
  116. page:1,
  117. pageSize:20,
  118. queryParamsData1:"",
  119. deptId :null,
  120. },
  121. //时间数据
  122. dateRange:[],
  123. //列表数据
  124. dataList:[],
  125. //数据数量
  126. total:0,
  127. //组件传参
  128. propsData:{},
  129. }
  130. },
  131. created () {
  132. },
  133. mounted () {
  134. this.systemDeptCurrentDept();
  135. this.examElKnowledgePointTreeList();
  136. this.getList();
  137. },
  138. methods: {
  139. //查询按钮
  140. handleQuery(){
  141. this.$set(this.queryParams,'page',1);
  142. this.getList();
  143. },
  144. //重置按钮
  145. resetQuery(){
  146. this.$set(this,'dateRange',[])
  147. this.$set(this,'queryParams',{
  148. page:1,
  149. pageSize:20,
  150. queryParamsData1:"",
  151. deptId :null,
  152. });
  153. this.getList();
  154. },
  155. //获取数据列表
  156. getList(){
  157. let obj = JSON.parse(JSON.stringify(this.queryParams))
  158. if(this.dateRange[0]){
  159. obj.startTime = this.dateRange[0]+'T00:00:00'
  160. obj.endTime = this.dateRange[1]+'T23:59:59'
  161. }else{
  162. obj.startTime = "";
  163. obj.endTime = "";
  164. }
  165. examElPracticeStatPage(obj).then(response => {
  166. this.$set(this,'dataList',response.data.records);
  167. this.$set(this,'total',response.data.total);
  168. });
  169. },
  170. //操作按钮
  171. tableButton(type,row){
  172. let self = this;
  173. if(type == 2){
  174. //详情
  175. this.$set(this,'pageType',2);
  176. let obj = JSON.parse(JSON.stringify(row))
  177. this.$set(this,'propsData',obj);
  178. }else if(type == 6){
  179. //返回并刷新
  180. this.$set(this,'pageType',1);
  181. this.getList();
  182. }
  183. },
  184. //学院列表
  185. systemDeptCurrentDept(){
  186. systemDeptCurrentDept({}).then(response => {
  187. const list = response.data || [];
  188. this.formatTreeData(list);
  189. this.$set(this,'optionListB',list);
  190. });
  191. },
  192. //知识点
  193. examElKnowledgePointTreeList(){
  194. examElKnowledgePointTreeList({ dataScope:2 }).then(response => {
  195. const list = response.data || [];
  196. this.formatTreeData(list);
  197. this.$set(this, 'optionListC', list);
  198. });
  199. },
  200. },
  201. }
  202. </script>
  203. <style scoped lang="scss">
  204. .practiceSolvingProblems{
  205. .practiceSolvingProblemsPage{
  206. }
  207. }
  208. </style>