提交 d1750965 authored 作者: Yroc's avatar Yroc

学生端功能

上级 e229ada9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-22 11:31:31 * @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-11 15:51:01 * @Last Modified time: 2023-03-13 10:11:24
*/ */
import request from '@/utils/request' import request from '@/utils/request'
...@@ -83,6 +83,14 @@ export function uploadTestResults(id,data) { ...@@ -83,6 +83,14 @@ export function uploadTestResults(id,data) {
}) })
} }
//考试结果查看
export function viewExamResults(id) {
return request({
url: `/student/test_results/getResults/${id}`,
method: 'get',
})
}
export function logout() { export function logout() {
return request({ return request({
url: '/vue-element-admin/user/logout', url: '/vue-element-admin/user/logout',
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-01 15:29:44 * @Date: 2023-03-01 15:29:44
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-11 16:59:11 * @Last Modified time: 2023-03-13 16:33:45
*/ */
</script><template> </script><template>
<div class="header_container"> <div class="header_container">
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
>{{ e.label }}</el-tag >{{ e.label }}</el-tag
> >
<el-tag <el-tag
v-if="time"
type="warning" type="warning"
style="margin-left: 30px; backgound-color: #fcf6ec" style="margin-left: 30px; backgound-color: #fcf6ec"
>{{ time }}</el-tag >{{ time }}</el-tag
...@@ -44,9 +45,14 @@ ...@@ -44,9 +45,14 @@
}}</span></span }}</span></span
> >
<span class="test_info" <span class="test_info"
>证件号<span class="test_info_show">{{ >证件号<span class="test_info_show">
user_info.idcard.replace(/(\w{4})\w*(\w{4})/,'$1********$2') <!-- {{
}}</span></span user_info.idcard.replace(/(\w{4})\w*(\w{4})/, '$1********$2') ||
'暂无'
}} -->
{{ id_card(user_info.idcard) }}</span
></span
> >
<span class="test_info" <span class="test_info"
>考试时间<span class="test_info_show">{{ >考试时间<span class="test_info_show">{{
...@@ -64,13 +70,30 @@ ...@@ -64,13 +70,30 @@
<div <div
v-for="(item, index) in data_keys" v-for="(item, index) in data_keys"
:key="index" :key="index"
class="info_unit" v-if="item.key" class="info_unit"
v-if="item.key"
v-show="examination_questions_info[item.key]" v-show="examination_questions_info[item.key]"
> >
<!-- examination_questions_info[item.key].replace(
/(\w{4})\w*(\w{4})/,
'$1********$2'
) -->
<span class="test_info">{{ item.label }}</span> <span class="test_info">{{ item.label }}</span>
<span class="test_info_show">{{ <span class="test_info_show">
item.key=='idcard'?examination_questions_info[item.key].replace(/(\w{4})\w*(\w{4})/,'$1********$2') :(examination_questions_info[item.key] || '暂无') <!-- {{
}}</span> item.key == 'idcard'
? id_card(examination_questions_info[item.key])
: examination_questions_info[item.key] || '暂无'
}} -->
<span v-if="item.key == 'idcard'">{{
id_card(examination_questions_info['idcard'])
}}</span>
<span v-else-if="item.key == 'duration'">
{{ change_time(examination_questions_info['duration']) }}
</span>
<span v-else>{{ examination_questions_info[item.key] }}</span>
</span>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -79,7 +102,7 @@ ...@@ -79,7 +102,7 @@
<script> <script>
import { secondsToMinutes } from '@/utils/tool'; import { secondsToMinutes } from '@/utils/tool';
export default { export default {
name: '', name: 'TestInfo',
props: ['testdata'], props: ['testdata'],
data() { data() {
return { return {
...@@ -119,15 +142,42 @@ export default { ...@@ -119,15 +142,42 @@ export default {
}, },
countDownTimer() { countDownTimer() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.testdata.const_down>0) { if (this.testdata.const_down > 0) {
this.time = secondsToMinutes(this.testdata.const_down--); this.time = secondsToMinutes(this.testdata.const_down--);
if(parseInt(this.testdata.const_down/10)==this.testdata.const_down/10){this.$emit('sub', false,false);} if (
parseInt(this.testdata.const_down / 10) ==
this.testdata.const_down / 10
) {
this.$emit('sub', false, false);
}
} else { } else {
clearTimeout(this.timer); clearTimeout(this.timer);
this.$emit('sub', true,true); this.$emit('sub', true, true);
} }
}, 1000); }, 1000);
}, },
//
id_card(str) {
if (str) {
return str.replace(/(\w{4})\w*(\w{4})/, '$1********$2');
} else {
return '暂无';
}
},
// id_card_next(str) {
// if (str) {
// return str.replace(/(\w{4})\w*(\w{4})/, '$1********$2');
// } else {
// return '暂无';
// }
// },
change_time(str) {
if (str) {
return secondsToMinutes(str);
} else {
return '暂无';
}
},
}, },
}; };
</script> </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-22 11:31:31 * @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-07 10:40:29 * @Last Modified time: 2023-03-13 16:35:08
*/ */
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
...@@ -153,6 +153,11 @@ export const asyncRoutes = [ ...@@ -153,6 +153,11 @@ export const asyncRoutes = [
name:'analysis', name:'analysis',
component: () => import('@/views/analysis/index.vue'), component: () => import('@/views/analysis/index.vue'),
}, },
{
path:'test',
name:'test',
component: () => import('@/views/test/index.vue'),
},
] ]
}, },
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-11 11:04:16 * @Date: 2023-03-11 11:04:16
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-11 12:09:07 * @Last Modified time: 2023-03-13 14:26:44
*/ */
export function secondsToMinutes(sec){ export function secondsToMinutes(sec){
if (!sec) return false
const totalSeconds = sec; const totalSeconds = sec;
/* 获取完整分钟数 */ /* 获取完整分钟数 */
const minutes = Math.floor(totalSeconds / 60); const minutes = Math.floor(totalSeconds / 60);
...@@ -19,3 +20,19 @@ const padTo2Digits = (num)=> { ...@@ -19,3 +20,19 @@ const padTo2Digits = (num)=> {
const result = `${padTo2Digits(minutes)}分${padTo2Digits(seconds)}秒`; const result = `${padTo2Digits(minutes)}分${padTo2Digits(seconds)}秒`;
return result; return result;
} }
//一维转换二维数组
export function array_conversion(arr, nums) {
const length = arr.length;
const n = nums // 假设每段显示n个
const Num = length % n === 0 ? length / n : Math.floor((length / n) + 1)  //得出多少份
const res = [] //定义数组接受最终的数据
for (let i = 0; i < Num; i++) {
// slice() 方法返回一个从开始到结束(不包括结束)的数组。且原始数组不会被修改。
const newArr = arr.slice(i * n, i * n + n) //得到每份的数据
res.push(JSON.parse(JSON.stringify(newArr))) //往res数组里加数据
}
return res;
}
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-03 17:24:48
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-04 17:01:03
*/
</script><template>
<div class="hover_card">
<el-row>
<el-col :span="12">
<h3 class="card_header_title">错误点分析</h3>
</el-col>
<el-col :span="12" style="text-align: right">
<el-button class="card_header_button" icon="el-icon-close"
>关闭</el-button
>
</el-col>
</el-row>
<div class="table_box">
<div v-for="(e, i) in 6" :key="i" class="table_line">
<div class="left">1</div>
<div class="right">2</div>
</div>
</div>
<!-- <el-table :data="gridData" class="hover_card">
<el-table-column width="150" prop="date" label="日期"></el-table-column>
<el-table-column width="100" prop="name" label="姓名"></el-table-column>
<el-table-column
width="300"
prop="address"
label="地址"
></el-table-column>
</el-table> -->
<!-- <div>
</div>
<div>
<div class="row_box" v-for="e in 4" :key="e">
<div class="row_line row_header">
<div class="left">序号</div>
<div class="right">结果</div>
</div>
</div>
</div> -->
</div>
</template>
<script>
export default {
props: ['gridData'],
name: '',
data() {
return {
info_data: {
result: 'C3F',
area: '南方',
conclusion: 'C2F',
breed: '中烟',
detail: '1111',
image: '',
},
};
},
mounted() {
// console.log(this.gridData);
},
};
</script>
<style lang="scss" scoped>
.hover_card {
width: 100%;
height: 400px;
}
.card_header_title {
margin: 8px 0;
color: #000;
}
.card_header_button {
background-color: #ebedf0;
padding: 5px 16px;
margin: 8px 0;
color: #000;
}
/* .row_box {
width: 100%;
display: inline-block;
.row_line .left {
width: 60px;
display: inline-block;
background-color: #f5f7fa;
}
.row_line .right {
width: calc(100% - 60px);
display: inline-block;
padding: 8px 25px;
}
}
*/
.table_box {
border: 1px solid #e5e7ed;
border-radius: 4px;
overflow: hidden;
.table_line {
border-bottom: 1px solid #e5e7ed;
.left {
width: 130px;
padding: 10px 15px;
box-sizing: border-box;
float: left;
background: #f5f7fa;
border-right: 1px solid #e5e7ed;
}
.right {
width: calc(100% - 130px);
padding: 10px 15px;
box-sizing: border-box;
float: left;
}
}
.table_line::after {
content: '';
display: block;
clear: both;
}
}
.table_box:last-child {
border-bottom: none;
}
</style>
<script> <script>
/** /**
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-02 14:19:33 * @Date: 2023-03-13 09:56:01
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-10 11:39:26 * @Last Modified time: 2023-03-13 19:01:05
*/ */
</script><template> </script>
<div class="content_container"> <template>
<test-info v-if=""></test-info> <div class="module_container">
<div class="body_container"> <div class="card_container">
<el-card class="box-card card_first"> <!-- <examination-header
<div class="list_container"> v-if="student_brief_introduction"
<div class="row_box" v-for="e in 4" :key="e"> :examination_questions="student_brief_introduction"
<div class="row_line row_header"> :key="new Date().getTime()"
></examination-header> -->
<!-- <test-info></test-info> -->
<test-info v-if="test_card_info" :testdata="test_card_info"></test-info>
<el-card class="box-card" v-if="questions_list.length > 0">
<div class="table_container">
<div class="header_box">
<div class="row_box" v-for="(item, index) in 5" :key="index">
<div class="left">序号</div> <div class="left">序号</div>
<div class="right">结果</div> <div class="right">结果</div>
</div> </div>
<div class="row_line" v-for="obj in 10" :key="obj"> </div>
<div class="left">zuo</div> <div
<div class="right"> class="lin_box"
<span v-if="obj % 2">you</span> v-for="(items, index) in questions_list"
<el-popover :key="index"
v-else >
placement="right" <div class="row_box" v-for="(e, i) in items" :key="i">
width="560" <div class="left">{{ e.index_number + 1 }}</div>
trigger="click" <div
> class="right"
<div> :class="
<popover-view e.grades_code &&
:gridData="gridData" detailed_information.test_results[e.id] != e.grades_code
width="300" ? 'wrong_answer'
></popover-view> : ''
"
>
<el-popover placement="right" trigger="click">
<div class="table_box">
<!-- <div><h3>错误点分析</h3></div> -->
<table border="1" cellspacing="0">
<tr>
<td class="title_box">
<div class="left_box">我的结果</div>
</td>
<td>
<div
class="right_box"
:class="
e.grades_code &&
detailed_information.test_results[e.id] !=
e.grades_code
? 'wrong_answer'
: ''
"
>
{{
detailed_information.test_results[e.id] || '暂无'
}}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">烟草区域</div>
</td>
<td>
<div class="right_box">
{{ e.place_of_production || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">试题结论</div>
</td>
<td>
<div class="right_box">
{{ e.grades_code || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">烟草品种</div>
</td>
<td>
<div class="right_box">
{{ e.breed_name || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">试题详解</div>
</td>
<td>
<div class="right_box">
{{ e.explain_in_detail || '暂无' }}
</div>
</td>
</tr>
<tr>
<td class="title_box">
<div class="left_box">烟草实物</div>
</td>
<td>
<div class="right_box">
<div
v-if="e.image && e.image != '/'"
class="image_box"
>
<img :src="IP + e.image" alt="" />
</div>
<div v-else>暂无</div>
</div>
</td>
</tr>
</table>
</div> </div>
<span slot="reference">you</span> <!-- <span slot="reference"> {{ e.grades_code || '暂无' }}</span> -->
<span slot="reference">
{{
detailed_information.test_results[e.id] || '暂无'
}}</span
>
</el-popover> </el-popover>
</div> </div>
</div> </div>
...@@ -40,286 +137,239 @@ ...@@ -40,286 +137,239 @@
</div> </div>
</el-card> </el-card>
</div> </div>
<div class="foot_container">
<el-card class="box-card card_next">
<div>
<el-radio-group>
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="2"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
</el-radio-group>
</div>
<div></div>
<!-- <div>
<card-view :card_style="card_style" :table_data="list"> </card-view>
</div> -->
<!-- 1 -->
<div>
<el-row>
<el-col :span="8">
<div class="card_father">
<card-view :card_style="card_style" :table_data="list">
</card-view>
</div>
</el-col>
<el-col :span="8">
<div class="card_father">
<card-view :card_style="card_style1" :table_data="list">
</card-view>
</div>
</el-col>
<el-col :span="8">
<div class="card_father">
<card-view
:card_style="card_style2"
:table_data="list"
></card-view>
</div>
</el-col>
</el-row>
</div>
<div>
<el-row>
<el-col :span="8">
<div class="card_father">
<card-view :card_style="card_style3" :table_data="list">
</card-view>
</div>
</el-col>
<el-col :span="16">
<div class="card_father">
<card-view :card_style="card_style4" :chart_data="chart_data">
</card-view>
</div>
</el-col>
</el-row>
</div>
<!-- 2 -->
<div>
<el-row>
<el-col :span="12">
<div class="card_father">
<card-view :card_style="card_style3" :table_data="list">
</card-view>
</div>
</el-col>
<el-col :span="12">
<div class="card_father">
<card-view :card_style="card_style4" :table_data="list">
</card-view>
</div>
</el-col>
</el-row>
</div>
<!-- 3 -->
<el-row>
<el-col :span="12">
<div class="card_father">
<card-view :card_style="card_style3" :table_data="list">
</card-view>
</div>
</el-col>
</el-row>
<!-- 4 --> <el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%">
<div> <div class="table_box">
<el-row> <!-- -->
<el-col :span="8"> </div>
<div class="card_father"> <span slot="footer" class="dialog-footer">
<card-view :card_style="card_style3" :table_data="list"> <el-button>取 消</el-button>
</card-view> <el-button type="primary">确 定</el-button>
</div> </span>
</el-col> </el-dialog>
<el-col :span="16">
<div class="card_father">
<card-view :card_style="card_style5" :chart_data="chart_data1">
</card-view>
</div>
</el-col>
</el-row>
</div>
</el-card>
</div>
</div> </div>
</template> </template>
<script> <script>
import TestInfo from '@/components/TestInfo/index'; import TestInfo from '@/components/TestInfo/index.vue';
import CardView from '@/components/CardView/index'; import { viewExamResults } from '@/api/user';
import PopoverView from './components/popover-view'; import { array_conversion } from '@/utils/tool';
export default { export default {
name: '', name: '',
components: { TestInfo, CardView, PopoverView }, components: { TestInfo },
data() { data() {
return { return {
card_style: { IP: process.env.VUE_APP_BASE_API,
tltle: '成绩分值段',
color: '#038d6e', //初始化请求参数
}, request_params: {
card_style1: { val: '',
tltle: '南方烟北方烟得分情况', page: 1,
color: '#e6a23c', limit: 10,
}, total: null,
card_style2: {
tltle: '省级产区得分情况',
color: '#505f79',
},
card_style3: {
tltle: '品种得分情况',
color: '#038d6e',
},
card_style4: {
tltle: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
color: '#99a9bf',
},
card_style5: {
tltle: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
color: '#99a9bf',
}, },
list: [ is_loading: false,
{ tableData: [],
type: 1, is_dialogVisible: false,
num: 2, is_updata_type: 'add',
person: 3, //头部信息
proportion: 4, student_brief_introduction: null,
}, //详细信息
{ detailed_information: {},
type: 1, //考试结果id
num: 2, test_results_id: null,
person: 3,
proportion: 4, //试题结果
}, questions_list: [],
{ test_card_info: null,
type: 1,
num: 2,
person: 3,
proportion: 4,
},
{
type: 1,
num: 2,
person: 3,
proportion: 4,
},
],
chart_data: [
[150, 230, 224, 218, 135, 147, 260, 184, 348, 376, 222, 333],
[110, 290, 334, 288, 735, 647, 230, 184, 638, 176, 222, 111],
],
chart_data1: [
[850, 230, 124, 618, 35, 147, 160, 184, 398, 476, 222, 333],
[410, 190, 134, 588, 235, 647, 230, 484, 238, 176, 222, 111],
],
tableData: [
{
date: '2016',
name: '王小虎',
},
{
date: '2016',
name: '王小虎',
},
{
date: '2016',
name: '王小虎',
},
{
date: '2016',
name: '王小虎',
},
{
date: '2016',
name: '王小虎',
},
],
gridData: [
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
],
}; };
}, },
computed: {},
created() {
let id = this.$route.query.id;
if (id) this.test_results_id = id;
},
mounted() {
this.init();
},
methods: {
init() {
this.getTestResultsDetail();
},
//考试结果详情
getTestResultsDetail() {
viewExamResults(this.test_results_id).then((res) => {
console.log('考试结果详情');
console.log(res);
this.test_card_info = {
title: res.examination_questions_title,
status: res.status,
name: res.name,
begin_answer_time: res.begin_answer_time,
duration: res.answer_duration,
score: res.score,
};
// this.student_brief_introduction = {
// title: res.examination_questions_title || '',
// user_name: res.name || '',
// score: res.score || '',
// duration: res.answer_duration || '',
// status: res.status,
// examination_status: [
// { id: 1, label: '预约完成', type: 'success' },
// { id: 2, label: '考试完成', type: 'success' },
// { id: 3, label: '已发布', type: 'success' },
// { id: 4, label: '取消', type: 'info' },
// { id: 5, label: '失效', type: 'danger' },
// ],
// };
this.questions_list = [];
// if (res.examination_questions) this.questions_list = || [];
res.examination_questions.examination_question_detail.forEach(
(element, index) => {
let obj = JSON.parse(JSON.stringify(element));
element['index_number'] = index; //用来记录在原始数据中的索引
}
);
console.log('表格数据源');
console.log(res.examination_questions.examination_question_detail);
let new_arr = array_conversion(
res.examination_questions.examination_question_detail,
5
);
console.log('二维数据@@@');
console.log(new_arr);
// console.log(JSON.stringify(new_arr));
this.questions_list = new_arr;
this.detailed_information = res;
});
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box-card { @import '@/styles/element-variables';
width: 1280px;
.table_container {
width: 80%;
margin: 0 auto; margin: 0 auto;
border-radius: 10px; border: 1px solid #ebeef5;
border-radius: 8px;
overflow: hidden;
.header_box {
background-color: $--color-primary;
.table_info { .row_box {
background-color: forestgreen; .left,
.right {
color: #fff !important;
}
}
} }
}
.list_container { .lin_box {
border: 1px solid #ababad; border-bottom: 1px solid #ebeef5;
border-radius: 4px; }
overflow: hidden;
} .row_box {
.row_box { width: 20%;
width: 25%; float: left;
display: inline-block; display: flex;
box-sizing: border-box; font-size: 14px;
.row_header { color: #303133;
background: #038d6e; justify-content: space-between;
align-items: center;
box-sizing: border-box;
border-right: 1px solid #ebeef5;
.left {
width: 60px;
text-align: center;
padding: 15px 0;
}
.right {
width: calc(100% - 60px);
text-align: center;
padding: 15px 0;
border-right: 1px solid #ebeef5;
}
} }
} }
.row_line {
border-top: 1px solid #dcdfe6; .header_box::after,
} .lin_box::after {
.row_box .row_line:nth-child(1) { display: block;
border-top: none; content: '';
} clear: both;
.row_line .left {
width: 60px;
text-align: center;
display: inline-block;
border-left: 2px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
} }
.list_container .row_box:nth-child(1) .row_line .left {
border-left: none; .lin_box .row_box .left {
border-right: 1px solid #ebeef5;
} }
.row_header .left {
border-right: none; .table_container .lin_box:last-child,
.lin_box .row_box:last-child,
.header_box .row_box:last-child {
border: none;
} }
.row_line .left {
padding: 10px; .table_box {
width: 100%;
table {
width: 100%;
border-top: 1px solid #e4e7ed;
border-left: 1px solid #e4e7ed;
border-collapse: collapse;
td {
margin: 0;
padding: 0;
border-bottom: 1px solid #e4e7ed;
border-right: 1px solid #e4e7ed;
}
.title_box {
width: 100px;
}
}
} }
.row_line .right {
width: calc(100% - 60px); .left_box {
display: inline-block; padding: 10px 10px;
color: #606266;
text-align: center; text-align: center;
padding: 10px;
} }
.body_container { .right_box {
.card_first { width: 400px;
padding: 0 135px; padding: 10px 10px;
} color: #303133;
} }
.card_father { .image_box {
width: 100%; width: 100%;
box-sizing: border-box; height: 400px;
padding: 0 10px 20px;
img {
max-width: 100%;
max-height: 100%;
}
}
.wrong_answer {
background-color: #fdf0f0;
}
.box-card {
width: 1280px;
margin: 0px auto;
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-07 19:34:46 * @Date: 2023-03-07 19:34:46
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-10 20:07:00 * @Last Modified time: 2023-03-13 16:44:07
*/ */
</script> </script>
<template> <template>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div> <div>
<el-button <el-button
v-if=" v-if="
test_node.examination_questions.status == 2 && test_node.examination_questions.status == 3 &&
test_node.status == 1 test_node.status == 1
" "
type="primary" type="primary"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-23 15:52:52 * @Date: 2023-02-23 15:52:52
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-11 09:57:16 * @Last Modified time: 2023-03-13 18:55:27
*/ */
</script><template> </script><template>
<div class="person_container"> <div class="person_container">
...@@ -145,11 +145,7 @@ ...@@ -145,11 +145,7 @@
<h3 style="margin-top: 0px"> <h3 style="margin-top: 0px">
{{ item.examination_questions_title }} {{ item.examination_questions_title }}
</h3> </h3>
<span <span>考试时间:{{ item.answer_time }}</span>
>考试时间:{{
item.answer_time
}}</span
>
</div> </div>
<div class="tab_box_tight"> <div class="tab_box_tight">
<div class="score_box"> <div class="score_box">
...@@ -161,8 +157,10 @@ ...@@ -161,8 +157,10 @@
<div style="border-left: 1px solid #f4d6a9"> <div style="border-left: 1px solid #f4d6a9">
<el-button <el-button
v-if=" v-if="
item.examination_questions.status == 4 && (item.examination_questions.status == 4 &&
item.status == 3 item.status == 3) ||
(item.examination_questions.status == 5 &&
item.status == 3)
" "
@click="route(item)" @click="route(item)"
type="warning" type="warning"
...@@ -260,13 +258,13 @@ export default { ...@@ -260,13 +258,13 @@ export default {
// ); // );
}, },
methods: { methods: {
route(row){ route(row) {
this.$router.push({ this.$router.push({
path: '/analysis', path: '/analysis',
query: {id: row.id,}, query: { id: row.id },
}); });
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw); this.imageUrl = URL.createObjectURL(file.raw);
}, },
......
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-13 16:34:30
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-13 18:15:25
*/
</script>
<template>
<div class="person_container">
<div class="table_box">
<div class="left"></div>
<div class="right"><el-input></el-input></div>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
// test_arr: [
// { as },
// { bs },
// { cs },
// { ds },
// { es },
// { fs },
// { gs },
// { hs },
// { is },
// { gs },
// { as },
// { bs },
// { cs },
// { ds },
// { es },
// { fs },
// { gs },
// { hs },
// { is },
// { gs },
// ],
};
},
};
</script>
<style lang="scss" scoped>
.table_box {
width: 1000px;
height: 100px;
border: 1px solid #000;
margin: 0px auto;
}
</style>
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-01 16:25:21 * @Date: 2023-03-01 16:25:21
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-11 17:07:10 * @Last Modified time: 2023-03-13 14:22:51
*/ */
</script> </script>
<template> <template>
<div> <div>
<test-info v-if="test_card_info.title" :testdata="test_card_info" @sub="sub"></test-info> <test-info
v-if="test_card_info.title"
:testdata="test_card_info"
@sub="sub"
></test-info>
<el-card class="box-card"> <el-card class="box-card">
<el-row v-if="false"> <el-row v-if="false">
<el-col :span="15"> <el-col :span="15">
...@@ -30,8 +34,12 @@ ...@@ -30,8 +34,12 @@
<el-col :span="14"> <el-col :span="14">
<div class="grid-content"> <div class="grid-content">
<div> <div>
<h3 class="photo_header_title" style="display: inline-block;">考试结果</h3> <h3 class="photo_header_title" style="display: inline-block">
<el-button type="primary" @click="sub(false)" style="float:right;">保存</el-button> 考试结果
</h3>
<el-button type="primary" @click="sub(false)" style="float: right"
>保存</el-button
>
</div> </div>
<div class="list_container"> <div class="list_container">
<el-row> <el-row>
...@@ -114,7 +122,9 @@ ...@@ -114,7 +122,9 @@
:headers="headers" :headers="headers"
:show-file-list="false" :show-file-list="false"
> >
<el-button type="primary" style="margin-left: 159px">重新上传</el-button> <el-button type="primary" style="margin-left: 159px"
>重新上传</el-button
>
</el-upload> </el-upload>
<!-- <el-upload <!-- <el-upload
...@@ -161,7 +171,9 @@ ...@@ -161,7 +171,9 @@
</el-col> </el-col>
</el-row> </el-row>
<div class="btn_upload_result"> <div class="btn_upload_result">
<el-button type="primary" style="width: 100%" @click="sub()">提交</el-button> <el-button type="primary" style="width: 100%" @click="sub()"
>提交</el-button
>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -171,7 +183,6 @@ ...@@ -171,7 +183,6 @@
import TestInfo from '@/components/TestInfo/index'; import TestInfo from '@/components/TestInfo/index';
import { getResultsData, uploadTestResults } from '@/api/user'; import { getResultsData, uploadTestResults } from '@/api/user';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { secondsToMinutes } from '@/utils/tool';
export default { export default {
name: '', name: '',
components: { TestInfo }, components: { TestInfo },
...@@ -186,7 +197,7 @@ export default { ...@@ -186,7 +197,7 @@ export default {
result_id: null, result_id: null,
imgrul: null, imgrul: null,
test_card_info: {}, test_card_info: {},
is_force:false, is_force: false,
}; };
}, },
created() { created() {
...@@ -197,31 +208,34 @@ export default { ...@@ -197,31 +208,34 @@ export default {
this.getTestData(); this.getTestData();
}, },
methods: { methods: {
sub(is_submit=true,is_force=false) { sub(is_submit = true, is_force = false) {
var data = {}; var data = {};
let is_tip=false let is_tip = false;
for (let i of this.test_result_sub_data) { for (let i of this.test_result_sub_data) {
data[i.id] = i.value; data[i.id] = i.value;
if(!i.value){ if (!i.value) {
is_tip=true is_tip = true;
} }
} }
if(is_submit && is_tip && !is_force){ if (is_submit && is_tip && !is_force) {
this.$confirm('您还有题目未答完成,是否强制提交?', '提示', { this.$confirm('您还有题目未答完成,是否强制提交?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then( () => { }).then(() => {
this.sub(is_submit,true) this.sub(is_submit, true);
}) });
return return;
} }
uploadTestResults(this.result_id, {is_submit: is_submit,test_results: data,}).then((res) => { uploadTestResults(this.result_id, {
is_submit: is_submit,
test_results: data,
}).then((res) => {
if (res.code == 200 && is_submit) { if (res.code == 200 && is_submit) {
this.$message.success(res.message); this.$message.success(res.message);
this.$router.push({ this.$router.push({
path: '/test-result', path: '/test-result',
query: {id: this.result_id,}, query: { id: this.result_id },
}); });
} }
}); });
...@@ -238,7 +252,8 @@ export default { ...@@ -238,7 +252,8 @@ export default {
begin_answer_time: res.begin_answer_time, begin_answer_time: res.begin_answer_time,
duration: res.examination_questions.duration, duration: res.examination_questions.duration,
const_down: const_down:
res.examination_questions.duration * 60 - (res.begin_answer_duration?res.begin_answer_duration:0), res.examination_questions.duration * 60 -
(res.begin_answer_duration ? res.begin_answer_duration : 0),
status: res.status, status: res.status,
title: res.examination_questions_title, title: res.examination_questions_title,
}; };
...@@ -249,10 +264,13 @@ export default { ...@@ -249,10 +264,13 @@ export default {
this.test_result_sub_data.push({ this.test_result_sub_data.push({
id: this.test_results.examination_questions id: this.test_results.examination_questions
.examination_question_detail[i].id, .examination_question_detail[i].id,
value: this.test_results.test_results[this.test_results.examination_questions value: this.test_results.test_results[
.examination_question_detail[i].id] this.test_results.examination_questions
.examination_question_detail[i].id
]
? this.test_results.test_results[ ? this.test_results.test_results[
this.test_results.examination_questions.examination_question_detail[i].id this.test_results.examination_questions
.examination_question_detail[i].id
] ]
: '', : '',
}); });
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论