Administrator
2021-08-27 bb0d6a910c2145f5936bb89dbd2fce41d3d1933b
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
 * @Author: Morpheus
 * @Date: 2021-08-02 09:31:54
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-08-02 09:31:54
 * menu-name 成绩管理
 */
<template>
  <div class="exam-end">
    <!-- <button class="logout" 
          onmouseover="this.style.backgroundColor='red';" 
          onmouseout="this.style.backgroundColor='';"
          @click="handleLogout">退出系统</button>
        <div class="end">
            <div class="title">
                <span>考试结束</span>
            </div>
            
            <div class="score">
                <span>本次考试得分:&nbsp;{{score}}&nbsp;分</span>
            </div>
        </div> -->
    <div class="startexam_heard">
      {{ examUserData.title }}
    </div>
    <div class="startexam_main">
      <div class="s_m_img">
        <img src="/img/exam/startbg.jpg" alt="" />
      </div>
      <div class="s_m_value" v-if="examUserData.list.length != 0">
        <div v-for="(item, index) in examUserData.list" :key="index">
          <span class="s_m_v_title">{{ item.title }}</span>
          <span>{{ item.value }}</span>
        </div>
        <div>
          <span class="s_m_v_title" style="font-size: 24px">成绩 :</span>
          <span style="font-size: 24px; color: red">
            <span style="font-size: 32px">{{ score }}</span> &nbsp;分</span
          >
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { getExamScore } from "@/api/exam/examscore";
import { mapState } from "vuex";
export default {
  data() {
    return {
      score: 0,
    };
  },
  created() {},
  computed: {
    ...mapState({
      examUserData: (state) => state.exam.examUserData,
    }),
  },
  mounted() {
    //获取考试成绩
    this.getExamScore();
  },
  methods: {
    //退出登录
    handleLogout() {
      this.$confirm("是否退出系统, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$store.dispatch("LogOut").then(() => {
          this.$router.push({ path: "/login" });
        });
      });
    },
    getExamScore() {
      var data = {
        userId: this.$route.query.userId,
        examId: this.$route.query.examId,
      };
      getExamScore(data).then((res) => {
        this.score = res.data.data.theoryGrade;
      });
    },
  },
};
</script>
 
<style lang="scss" scoped>
.exam-end {
  width: calc(100% - 100px);
  height: 89%;
  margin: 2.5% 50px;
  background-color: rgba($color: #fff, $alpha: 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  .startexam_heard {
    font-size: 34px;
    color: rgb(240, 114, 29);
    position: relative;
    top: -10%;
  }
  .startexam_main {
    width: 960px;
    height: 300px;
    // border: 1px solid red;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0px 0px 5px 3px rgba($color: #797979, $alpha: 0.2);
    .s_m_img {
      width: 50%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      img {
        width: 90%;
        height: 90%;
      }
    }
    .s_m_value {
      width: 50%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      div {
        width: 90%;
        height: 15%;
        font-size: 17px;
        .s_m_v_title {
          display: inline-block;
          width: 100px;
        }
      }
    }
  }
}
 
// .logout {
//   border: 0px;
//   margin-left: 92%;
//   margin-top: 30px;
//   border-radius: 5px;
//   font-size: 14px;
//   width: 80px;
//   height: 30px;
//   letter-spacing: 1px;
// }
 
// .end {
//   width: 20%;
//   height: 200px;
//   line-height: 200px;
//   text-align: center;
//   background-color: #fff;
//   border-radius: 5px;
//   margin-left: 40%;
//   margin-top: 10%;
 
//   .title {
//     width: 100%;
//     height: 40px;
 
//     span {
//       color: blueviolet;
//       letter-spacing: 2px;
//     }
//   }
 
//   .score {
//     font-size: 16px;
//     color: darkorchid;
//   }
// }
</style>