paper-record.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div>
  3. <el-card>
  4. <mx-condition :query-params="queryParams" @query="handleQuery" use-alias-mapping></mx-condition>
  5. </el-card>
  6. <el-container style="background: #fff; min-height: 500px; display: block">
  7. <el-table :data="examRecord" style="width: 100%" v-loading="tableLoading">
  8. <el-table-column type="index" label="序号" width="50px">
  9. </el-table-column>
  10. <el-table-column prop="subjectName" label="科目"></el-table-column>
  11. <el-table-column prop="name" label="试卷标题">
  12. <template slot-scope="scope">
  13. <el-link @click="clickEditPaperName(scope.row)"><i class="el-icon-edit"></i>{{ scope.row.name }}</el-link>
  14. </template>
  15. </el-table-column>
  16. <el-table-column prop="remark" label="试卷概要"></el-table-column>
  17. <el-table-column prop="status" label="状态"></el-table-column>
  18. <el-table-column prop="createdTime" label="组卷时间"></el-table-column>
  19. <el-table-column label="操作">
  20. <template slot-scope="scope">
  21. <div>
  22. <span style="color: #47c6a2; margin-right: 16px; cursor: pointer"
  23. @click="clickEditPaper(scope.row)">编辑</span>
  24. <span style="color: #ff4e00; margin-right: 16px; cursor: pointer"
  25. @click="clickDownloadPaper(scope.row.paperId)">下载</span>
  26. <i class="el-icon-delete table-delete-icon" @click="clickDeletePopup(scope.row.paperId)"></i>
  27. </div>
  28. <div v-hasPermi="['front:generatingPaperCenter:saveToPersonResources']"
  29. style="color: #608edf; margin-right: 16px; cursor: pointer"
  30. @click="clickSendToResource(scope.row.paperId)">
  31. 发送至个人资源库
  32. </div>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <pagination v-if="examRecordTotal > 0" :total="examRecordTotal" :page.sync="pageNum" :limit.sync="pageSize"
  37. @pagination="getPaperRecords"/>
  38. </el-container>
  39. <el-dialog title="修改试卷标题" :visible.sync="dialogPaperNameVisible" width="400px">
  40. <el-input v-model="dialogPaperName" placeholder="请输入试卷标题"></el-input>
  41. <span slot="footer" class="dialog-footer">
  42. <el-button type="primary" @click="savePaperName">确 定</el-button>
  43. </span>
  44. </el-dialog>
  45. </div>
  46. </template>
  47. <script>
  48. import PaperWorkIdentifierMixin from './paper-work-identifier-mixin'
  49. import MxCondition from '@/components/MxCondition/mx-condition'
  50. import { deletePaper, download, listCustomerPaperQeustions, paperRecords } from '@/api/webApi/webQue'
  51. import consts from '@/common/mx-const'
  52. import { mapGetters } from 'vuex'
  53. export default {
  54. mixins: [PaperWorkIdentifierMixin],
  55. name: 'paper-record',
  56. components: { MxCondition },
  57. data() {
  58. return {
  59. queryParams: {
  60. exeSubject: ''
  61. },
  62. queryOutput: null,
  63. tableLoading: false,
  64. pageNum: 1,
  65. pageSize: 20,
  66. examRecord: [],
  67. examRecordTotal: 0,
  68. //
  69. dialogPaperNameVisible: false,
  70. dialogPager: null,
  71. dialogPaperName: ''
  72. }
  73. },
  74. computed: {
  75. ...mapGetters(['period'])
  76. },
  77. methods: {
  78. handleQuery(model) {
  79. this.queryOutput = model
  80. this.pageNum = 1
  81. this.getPaperRecords()
  82. },
  83. getPaperRecords() {
  84. paperRecords({
  85. pageNum: this.pageNum,
  86. pageSize: this.pageSize,
  87. ...this.queryOutput,
  88. ...this.extraData
  89. }).then((res) => {
  90. this.examRecordTotal = res.total
  91. this.examRecord = res.rows
  92. })
  93. },
  94. clickEditPaperName(paper) {
  95. this.dialogPager = paper
  96. this.dialogPaperName = paper.name
  97. this.dialogPaperNameVisible = true
  98. },
  99. clickEditPaper(paper) {
  100. listCustomerPaperQeustions(paper.paperId).then((res) => {
  101. localStorage.setItem(
  102. 'paperData',
  103. JSON.stringify({
  104. paperId: paper.paperId,
  105. paperTitle: paper.name,
  106. subjectId: paper.subjectid
  107. })
  108. )
  109. localStorage.setItem('questionList', JSON.stringify(res.rows))
  110. this.$router.push({
  111. path: '/question-center/generatingPaperCenter/paper',
  112. query: this.extraData
  113. })
  114. })
  115. },
  116. clickDownloadPaper(paperId) {
  117. download(paperId, this.period)
  118. },
  119. async clickDeletePopup(paperId) {
  120. await this.$confirm('是否删除该试卷?', '提示', {
  121. confirmButtonText: '确定',
  122. cancelButtonText: '取消',
  123. type: 'warning'
  124. })
  125. await deletePaper({ paperId })
  126. this.msgSuccess('删除成功!')
  127. this.getPaperRecords()
  128. },
  129. clickSendToResource(paperId) {
  130. },
  131. savePaperName() {
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped>
  137. </style>