Blame view

src/views/AnswerResult/detail.vue 1.93 KB
78156aa6   yangzhi   级联菜单
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
  <template>
    <div class="container">
      <h3>{{ info.TestPaperName }}</h3>
      <div class="header-opts">
          <el-button type="text">查看回放</el-button>
      </div>
      <div class="questions">
        <el-card class="box-card" v-for="item in list" :key="item.id">
          <h4>
            <el-tag size="mini" type="success" effect="dark">{{
              item.QuestionClassName
            }}</el-tag>
            【{{ item.subjectName }}】{{ item.subject }}
          </h4>
          <ul v-if="item.subjectType == 1">
            <li v-for="i in item.subjectContentObj" :key="i.option">
              <el-tag size="mini" type="primary" effect="dark">{{
                i.option
              }}</el-tag>
              {{ i.optionContent }}
            </li>
          </ul>
          <p v-if="item.subjectType == 1">Ta的答案:{{ item.answer }}</p>
          <p v-if="item.subjectType == 1">正确答案:B</p>
        </el-card>
      </div>
    </div>
  </template>
  <style lang="scss" scoped>
  .container {
    width: 80%;
    max-width: 1200px;
    min-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    .header-opts{
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }
    .questions {
      width: 100%;
    }
    li {
      list-style: none;
      margin-bottom: 10px;
    }
  }
  </style>
  <script>
  import { SelectQuestionBankListForHistoryId } from "@/api/HistoryAnswer";
  export default {
    data() {
      return {
        info: {},
        list: [],
      };
    },
    created() {
      let id = this.$route.query.id;
      this.getDetail(id);
    },
    methods: {
      getDetail(id) {
        SelectQuestionBankListForHistoryId(id).then((res) => {
          let { info, list } = res.data.data;
          this.info = info;
          this.list = list.map((t) => {
            t.subjectContentObj = JSON.parse(t.subjectContent);
            return t;
          });
        });
      },
      getList() {},
    },
  };
  </script>
  <style lang="scss" scoped>
  </style>