answerList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="app-container calendar-list-container">
  3. <!-- 查询和其他操作 -->
  4. <div class="filter-container">
  5. <el-input clearable class="filter-item" style="width: 200px;" placeholder="员工姓名"
  6. v-model="listQuery.userName"></el-input>
  7. <el-date-picker
  8. class="filter-item"
  9. value-format="yyyy-MM-dd"
  10. v-model="listQuery.createTime"
  11. type="date"
  12. placeholder="创建日期">
  13. </el-date-picker>
  14. <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
  15. </div>
  16. <!-- 查询结果 -->
  17. <el-table size="small" :data="list" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit
  18. highlight-current-row>
  19. <el-table-column type="index" label="序号" header-align="center" align="center">
  20. </el-table-column>
  21. <el-table-column align="center" min-width="180px" label="部门" prop="deptName">
  22. </el-table-column>
  23. <el-table-column align="center" min-width="80px" label="员工" prop="userName">
  24. </el-table-column>
  25. <el-table-column align="center" min-width="80px" label="正确数" prop="rightQuantities">
  26. </el-table-column>
  27. <el-table-column align="center" min-width="80px" label="用时(毫秒)" prop="answerTime">
  28. </el-table-column>
  29. <el-table-column align="center" min-width="150px" label="答题时间" prop="answerDate">
  30. </el-table-column>
  31. <el-table-column align="center" min-width="150px" label="日期" prop="createTime">
  32. </el-table-column>
  33. <el-table-column align="center" min-width="80px" label="答题记录">
  34. <template slot-scope="scope">
  35. <el-button type="primary" size="small" @click="handleView(scope.row.answerLogs)">查看</el-button>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <!-- 分页 -->
  40. <div class="pagination-container">
  41. <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
  42. :current-page="listQuery.page" :page-sizes="[10, 20, 30, 50]" :page-size="listQuery.limit"
  43. layout="total, sizes, prev, pager, next, jumper" :total="total">
  44. </el-pagination>
  45. </div>
  46. <!-- 答题记录列表 -->
  47. <el-dialog :close-on-click-modal="false" title="答题记录" :visible.sync="dialogFormVisible" width="70%">
  48. <!-- 查询结果 -->
  49. <el-table size="small" :data="itemList" element-loading-text="正在查询中。。。" border fit
  50. highlight-current-row>
  51. <el-table-column align="center" min-width="150px" label="题目" prop="ask">
  52. </el-table-column>
  53. <el-table-column align="center" min-width="100px" label="员工答案" prop="userAnswer">
  54. </el-table-column>
  55. <el-table-column align="center" min-width="200px" label="正确答案" prop="answer">
  56. </el-table-column>
  57. </el-table>
  58. </el-dialog>
  59. </div>
  60. </template>
  61. <style>
  62. .demo-table-expand {
  63. font-size: 0;
  64. }
  65. .demo-table-expand label {
  66. width: 200px;
  67. color: #99a9bf;
  68. }
  69. .demo-table-expand .el-form-item {
  70. margin-right: 0;
  71. margin-bottom: 0;
  72. }
  73. </style>
  74. <script>
  75. import { answerList } from "@/api/answerGame";
  76. import waves from "@/directive/waves"; // 水波纹指令
  77. export default {
  78. directives: { waves },
  79. data() {
  80. return {
  81. list: [],
  82. itemList:[],
  83. total: 0,
  84. listLoading: false,
  85. listQuery: {
  86. page: 1,
  87. limit: 10,
  88. userName: '',
  89. createTime: '',
  90. },
  91. dialogFormVisible: false,
  92. }
  93. },
  94. created() {
  95. this.getList();
  96. },
  97. methods: {
  98. handleView(row) {
  99. this.itemList = row;
  100. this.dialogFormVisible = true
  101. },
  102. getList() {
  103. this.listLoading = true
  104. answerList(this.listQuery).then(response => {
  105. this.list = response.data.data.items
  106. this.total = response.data.data.total
  107. this.listLoading = false
  108. }).catch(() => {})
  109. },
  110. handleFilter() {
  111. this.listQuery.page = 1
  112. this.getList()
  113. },
  114. handleSizeChange(val) {
  115. this.listQuery.limit = val
  116. this.getList()
  117. },
  118. handleCurrentChange(val) {
  119. this.listQuery.page = val
  120. this.getList()
  121. },
  122. }
  123. }
  124. </script>
  125. <style>
  126. .ad-avatar-uploader .el-upload {
  127. border: 1px dashed #d9d9d9;
  128. border-radius: 6px;
  129. cursor: pointer;
  130. position: relative;
  131. overflow: hidden;
  132. }
  133. .ad-avatar-uploader .el-upload:hover {
  134. border-color: #409EFF;
  135. }
  136. .ad-avatar-uploader-icon {
  137. font-size: 28px;
  138. color: #8c939d;
  139. width: 178px;
  140. height: 178px;
  141. line-height: 178px;
  142. text-align: center;
  143. }
  144. .ad-avatar {
  145. display: block;
  146. }
  147. </style>