xiangpei
2024-12-03 8c3eaeddeff2c9c5a92352e6bf830e5000ff5882
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
  <div class="app-container">
    <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
      <el-table-column prop="questionTitle" label="反馈题目" />
      <el-table-column prop="describe" label="反馈描述" />
      <el-table-column prop="userName" label="反馈用户" />
      <el-table-column prop="fix" label="是否处理" width="100px" align="center">
        <template slot-scope="{row}">
          <el-tag :type="row.fix ? 'success' : 'warning'">{{ row.fix ? '已处理' : '未处理' }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="fixTime" label="处理时间" width="160px"/>
      <el-table-column label="操作" align="center" width="300px">
        <template slot-scope="{row}">
          <el-button size="mini" @click="showQuestion(row)" class="link-left">题目预览</el-button>
          <el-popconfirm title="确认处理" @confirm="hanldSettleFeedback(row)">
            <el-button slot="reference" v-if="!row.fix" size="mini" type="primary" class="link-left">确认处理</el-button>
          </el-popconfirm>
          <el-popconfirm title="确认删除" @confirm="hanldDeleteFeedback(row)">
            <el-button slot="reference" size="mini" type="danger" class="link-left">删除</el-button>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
      @pagination="search" />
 
    <!-- 预览框 -->
    <el-dialog :visible.sync="questionShow.dialog" style="width: 100%;height: 100%">
      <QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading"/>
    </el-dialog>
  </div>
</template>
 
<script>
import Pagination from '@/components/Pagination'
import feedbackApi from '@/api/feedback'
import QuestionShow from '../exam/question/components/Show'
import questionApi from '@/api/question'
 
export default {
  components: { Pagination, QuestionShow },
  data() {
    return {
      queryParam: {
        pageIndex: 1,
        pageSize: 10
      },
      subjectFilter: null,
      listLoading: true,
      tableData: [],
      total: 0,
      questionShow: {
        qType: 0,
        dialog: false,
        question: null,
        loading: false
      },
    }
  },
  created() {
    this.search()
  },
  methods: {
    search() {
      this.listLoading = true
      feedbackApi.getFeedbackPageList(this.queryParam).then(data => {
        const re = data.response
        this.tableData = re.list
        this.total = re.total
        this.queryParam.pageIndex = re.pageNum
        this.listLoading = false
      })
    },
    showQuestion (row) {
      let _this = this
      this.questionShow.dialog = true
      this.questionShow.loading = true
      questionApi.select(row.questionId).then(re => {
        _this.questionShow.qType = re.response.questionType
        _this.questionShow.question = re.response
        _this.questionShow.loading = false
      })
    },
    hanldSettleFeedback(row) {
      feedbackApi.settleFeedback(row.id).then(res => {
        this.$message({
          message: '操作成功',
          type: 'success'
        })
        this.search()
      })
    },
    hanldDeleteFeedback(row) {
      feedbackApi.deleteFeedback(row.id).then(res => {
        this.$message({
          message: '操作成功',
          type: 'success'
        })
        this.search()
      })
    }
  }
}
</script>