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

'学生登录上传修改'

上级 507e4672
...@@ -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-17 18:38:05 * @Last Modified time: 2023-03-21 18:18:47
*/ */
import request from '@/utils/request' import request from '@/utils/request'
...@@ -119,7 +119,13 @@ export function getCityIntfo(data) { ...@@ -119,7 +119,13 @@ export function getCityIntfo(data) {
}) })
} }
//获取烟草等级列表
export function getTobaccoList() {
return request({
url: '/student/tobacco_grades/all',
method: 'get',
})
}
export function logout() { export function logout() {
return request({ return request({
......
...@@ -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-13 16:33:45 * @Last Modified time: 2023-03-21 20:19:14
*/ */
</script><template> </script><template>
<div class="header_container"> <div class="header_container">
......
...@@ -3,18 +3,20 @@ ...@@ -3,18 +3,20 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-23 16:03:00 * @Date: 2023-02-23 16:03:00
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-10 16:41:42 * @Last Modified time: 2023-03-21 17:03:56
*/ */
</script><template> </script><template>
<div class="header_container"> <div class="header_container">
<div class="logo" @click="goPersonalCenter()" style="cursor: pointer"> <div class="logo" @click="goPersonalCenter()" style="cursor: pointer">
<img src="/image/logo.svg" alt="" /> <img src="/image/logo.svg" alt="" />
</div> </div>
<div> <div class="header_box">
<h3>国家烟草识别培训系统</h3> <h3>国家烟草识别培训系统</h3>
</div> </div>
<div> <div>
<el-button type="primary" class="btn" @click="logOut">退出登录</el-button> <el-button type="primary" class="btn_box" @click="logOut"
>退出登录</el-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -56,4 +58,19 @@ export default { ...@@ -56,4 +58,19 @@ export default {
} }
} }
} }
// 移动端样式
@media screen and (max-width: 600px) {
.header_container {
.logo {
display: none;
}
.btn_box {
display: none;
}
.header_box {
margin: auto;
}
}
}
</style> </style>
...@@ -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-10 15:31:52 * @Last Modified time: 2023-03-21 15:42:57
*/ */
@import './variables.scss'; @import './variables.scss';
@import './mixin.scss'; @import './mixin.scss';
...@@ -226,4 +226,12 @@ aside { ...@@ -226,4 +226,12 @@ aside {
} }
/* 输入框样式调整 */ /* 移动端样式 */
@media screen and (max-width: 600px) {
.right_box {
.el-timeline {
padding: 0;
}
}
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-27 12:03:06 * @Date: 2023-02-27 12:03:06
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-10 20:06:52 * @Last Modified time: 2023-03-21 17:20:32
*/ */
</script><template> </script><template>
<el-card class="box-card"> <el-card class="box-card">
...@@ -69,12 +69,12 @@ export default { ...@@ -69,12 +69,12 @@ export default {
} }
.bgd_container { .bgd_container {
position: absolute;
top: 35%; top: 35%;
left: 0; left: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
z-index: 0; z-index: 0;
position: absolute;
img { img {
width: 180px; width: 180px;
...@@ -85,9 +85,18 @@ export default { ...@@ -85,9 +85,18 @@ export default {
.affirm_btn_box { .affirm_btn_box {
width: 220px; width: 220px;
height: 40px; height: 40px;
position: absolute; margin: 60% auto 0;
bottom: 15%; }
left: 34%; }
// 移动端样式
@media screen and (max-width: 600px) {
.box-card {
width: 100%;
margin: 24px 0 0 0;
.affirm_btn_box {
margin: 110% auto 0;
}
} }
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-13 09:56:01 * @Date: 2023-03-13 09:56:01
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-13 19:01:05 * @Last Modified time: 2023-03-21 18:54:08
*/ */
</script> </script>
<template> <template>
......
差异被折叠。
...@@ -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-13 16:44:07 * @Last Modified time: 2023-03-21 17:00:02
*/ */
</script> </script>
<template> <template>
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<p class="value_box"> <p class="value_box">
{{ test_node.examination_questions.created_at }} {{ test_node.examination_questions.created_at }}
</p> </p>
<div class="Wait_test"> <div class="wait_test">
<div class="tab_box"> <div class="tab_box">
<div> <div>
<h3 style="margin-top: 0px"> <h3 style="margin-top: 0px">
{{ test_node.examination_questions_title }} {{ test_node.examination_questions_title }}
</h3> </h3>
<div> <div>
<span style="font-size" <span style="font-size" class="begin_time_box"
>开考时间:{{ >开考时间:{{
test_node.examination_questions.begin_date test_node.examination_questions.begin_date
}}</span }}</span
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
test_node.status == 1 test_node.status == 1
" "
type="primary" type="primary"
style="float: right; margin: 10px" style="float: right; margin: 10px 0px 10px 10px"
@click="nextStep()" @click="nextStep()"
>开始考试 >开始考试
</el-button> </el-button>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
test_node.status == 1 test_node.status == 1
" "
type="primary" type="primary"
style="float: right; margin: 10px" style="float: right; margin: 10px 0px 10px 10px"
disabled disabled
>待开始 >待开始
</el-button> </el-button>
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
width: calc(100% - 20px); width: calc(100% - 20px);
} }
.Wait_test { .wait_test {
background-color: #ddf2ed; background-color: #ddf2ed;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
...@@ -169,4 +169,17 @@ export default { ...@@ -169,4 +169,17 @@ export default {
.el-input__icon { .el-input__icon {
cursor: pointer; cursor: pointer;
} }
// 移动端样式
@media screen and (max-width: 600px) {
.wait_test {
position: relative;
height: 120px;
.begin_time_box {
position: absolute;
margin-top: 15px;
}
}
}
</style> </style>
...@@ -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-21 11:43:10 * @Last Modified time: 2023-03-21 20:19:17
*/ */
</script><template> </script><template>
<div class="person_container"> <div class="person_container">
...@@ -74,7 +74,11 @@ ...@@ -74,7 +74,11 @@
<div class="node_box_top"> <div class="node_box_top">
<h2>已考完场次</h2> <h2>已考完场次</h2>
</div> </div>
<el-timeline :reverse="reverse" v-if="test_results.length > 0"> <el-timeline
:reverse="reverse"
v-if="test_results.length > 0"
class="timeLine_box"
>
<el-timeline-item <el-timeline-item
v-for="(item, index) in test_results" v-for="(item, index) in test_results"
:key="index" :key="index"
...@@ -100,7 +104,9 @@ ...@@ -100,7 +104,9 @@
</div> </div>
<div class="tab_box_tight"> <div class="tab_box_tight">
<div class="score_box"> <div class="score_box">
<span style="margin-left: 30px">成绩:</span> <span style="margin-left: 30px" class="score_box_left"
>成绩:</span
>
<span <span
style="font-size: 48px; font-weight: bold" style="font-size: 48px; font-weight: bold"
v-if=" v-if="
...@@ -122,7 +128,10 @@ ...@@ -122,7 +128,10 @@
>{{ item.score }}</span >{{ item.score }}</span
> >
</div> </div>
<div style="border-left: 1px solid #f4d6a9"> <div
style="border-left: 1px solid #f4d6a9"
class="score_btn_box"
>
<el-button <el-button
v-if=" v-if="
(item.examination_questions.status == 4 && (item.examination_questions.status == 4 &&
...@@ -155,6 +164,95 @@ ...@@ -155,6 +164,95 @@
</div> </div>
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
<!-- 移动端 -->
<div
:reverse="reverse"
v-if="test_results.length > 0"
class="mobile_box"
>
<div
v-for="(item, index) in test_results"
:key="index"
color="#eebe77"
v-show="
(item.examination_questions.status == 3 && item.status == 2) ||
(item.examination_questions.status == 5 && item.status == 3) ||
(item.examination_questions.status == 4 && item.status == 3)
"
>
<div class="node_box_bottom">
<div slot="header" class="clearfix">
<p class="value_box">
{{ item.examination_questions.created_at }}
</p>
<div class="Wait_test">
<div class="tab_box">
<div>
<h3 class="title_card_box">
{{ item.examination_questions_title }}
</h3>
</div>
<div class="tab_box_tight">
<div class="score_box">
<span>成绩:</span>
<span
style="font-size: 48px; font-weight: bold"
v-if="
(item.examination_questions.status == 4 &&
item.status == 2) ||
(item.examination_questions.status == 3 &&
item.status == 2)
"
>***</span
>
<span
v-else-if="
(item.examination_questions.status == 4 &&
item.status == 3) ||
(item.examination_questions.status == 5 &&
item.status == 3)
"
style="font-size: 48px; font-weight: bold"
>{{ item.score }}</span
>
<div style="border-left: 1px solid #f4d6a9">
<el-button
v-if="
(item.examination_questions.status == 4 &&
item.status == 3) ||
(item.examination_questions.status == 5 &&
item.status == 3)
"
@click="route(item)"
type="warning"
class="finish_btn"
>查看
</el-button>
<el-button
v-else-if="
(item.examination_questions.status == 4 &&
item.status == 2) ||
(item.examination_questions.status == 3 &&
item.status == 2)
"
type="warning"
class="finish_btn"
disabled
>未发布
</el-button>
</div>
</div>
</div>
<span>考试时间:{{ item.answer_time }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
<img v-else src="/image/empty.png" class="none_img" /> <img v-else src="/image/empty.png" class="none_img" />
</el-card> </el-card>
</el-col> </el-col>
...@@ -182,6 +280,7 @@ export default { ...@@ -182,6 +280,7 @@ export default {
this.user_info = this.$store.state.user.user; this.user_info = this.$store.state.user.user;
console.log(this.user_info); console.log(this.user_info);
this.getListData(); this.getListData();
console.log(window.offsetw);
//加密 //加密
// const test = this.$handleParams(this.info_test); // const test = this.$handleParams(this.info_test);
...@@ -256,11 +355,11 @@ export default { ...@@ -256,11 +355,11 @@ export default {
margin: 0 auto; margin: 0 auto;
padding: 20px; padding: 20px;
} }
.test_list { // .test_list {
width: 1280px; // width: 1280px;
height: 266px; // height: 266px;
background-color: #fff; // background-color: #fff;
} // }
.box-card { .box-card {
width: calc(100% - 20px); width: calc(100% - 20px);
...@@ -336,22 +435,30 @@ export default { ...@@ -336,22 +435,30 @@ export default {
} }
} }
.phonto_name { .phonto_name {
position: absolute; text-align: center;
margin-top: 15px;
font-size: 50px; font-size: 50px;
font-weight: bolder; font-weight: bolder;
right: 35%;
top: 15%;
} }
} }
.score_box_left {
margin-left: 30px;
}
.score_btn_box {
width: 120px;
}
.el-input__icon { .el-input__icon {
cursor: pointer; cursor: pointer;
} }
.title_card_box {
margin-top: 0;
}
.finish_btn { .finish_btn {
float: right; float: right;
margin: 10px; margin: 10px;
margin-left: 30px; // margin-left: 30px;
// background-color: #eebe77; // background-color: #eebe77;
} }
...@@ -393,16 +500,59 @@ export default { ...@@ -393,16 +500,59 @@ export default {
align-content: center; align-content: center;
} }
@media screen and (min-width: 600px) {
.mobile_box {
display: none;
}
}
// 移动端样式 // 移动端样式
@media screen and (max-width: 390px) { @media screen and (max-width: 600px) {
.left_card { .left_card {
display: none; display: none;
} }
.box-card {
width: 100%;
}
.person_container { .person_container {
width: 100%; width: 100%;
.box-card { padding: 0;
.right_box {
width: 100%; width: 100%;
} }
.node_box_top {
padding: 0;
}
.node_box_bottom {
padding: 0;
}
.timeLine_box {
display: none;
}
.tab_box {
display: block;
.score_box {
position: relative;
margin: 0 0 5px 0;
border-left: 1px solid #faecd8;
.score_box_left {
margin-left: 0;
margin-bottom: 0;
}
.finish_btn {
margin: 0;
position: absolute;
right: 45px;
top: 10px;
}
}
}
.tab_box_tight {
display: block;
}
}
.title_card_box {
margin-bottom: 10px;
} }
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-28 10:03:17 * @Date: 2023-02-28 10:03:17
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-14 16:19:46 * @Last Modified time: 2023-03-21 17:39:58
*/ */
</script><template> </script><template>
<div class="content_container"> <div class="content_container">
...@@ -129,4 +129,16 @@ export default { ...@@ -129,4 +129,16 @@ export default {
margin: 0px; margin: 0px;
} }
} }
@media screen and (max-width: 600px) {
.picture_container {
width: 50%;
}
.result_container {
width: 100%;
.tag_warning {
width: 100%;
}
}
}
</style> </style>
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-21 18:22:06
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-21 18:26:57
*/
</script><template>
<div class="answer_box">
<el-popover placement="right" width="400" trigger="click">
<el-table> </el-table>
</el-popover>
</div>
</template>
<script>
export default {
name: '',
data() {
return {};
},
};
</script>
<style lang="" scoped>
</style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @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-21 12:23:35 * @Last Modified time: 2023-03-21 20:05:50
*/ */
</script> </script>
...@@ -61,14 +61,55 @@ ...@@ -61,14 +61,55 @@
}} }}
</div> </div>
<div class="right_data"> <div class="right_data">
<el-input <!-- <el-input
v-if="test_result_sub_data[e + (i - 1) * 5 - 1]" v-if="test_result_sub_data[e + (i - 1) * 5 - 1]"
v-model=" v-model="
test_result_sub_data[e + (i - 1) * 5 - 1].value test_result_sub_data[e + (i - 1) * 5 - 1].value
" "
style="width: 100%" style="width: 100%"
class="input_box" class="input_box"
></el-input> >
</el-input> -->
<el-popover
style="display: block; width: 100%; height: 100%"
v-if="test_result_sub_data[e + (i - 1) * 5 - 1]"
placement="bottom"
width="300"
v-model="
test_result_sub_data[e + (i - 1) * 5 - 1].visible
"
trigger="click"
>
<div>
<el-row>
<el-radio-group
v-model="
test_result_sub_data[e + (i - 1) * 5 - 1]
.value
"
>
<el-col
:span="6"
v-for="(i, index) in tobacco_grades_data"
:key="index"
>
<el-radio :label="i.grade_code">{{
i.grade_code
}}</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<el-button
type="text"
style="color: #303133; width: 70px"
slot="reference"
>
{{
test_result_sub_data[e + (i - 1) * 5 - 1].value
}}
</el-button>
</el-popover>
</div> </div>
</div> </div>
</div> </div>
...@@ -111,8 +152,6 @@ ...@@ -111,8 +152,6 @@
<h3 class="photo_header_title">上传纸质考试照片</h3> <h3 class="photo_header_title">上传纸质考试照片</h3>
</el-col> </el-col>
<el-col :span="12" style="text-align: right"> <el-col :span="12" style="text-align: right">
<!-- :on-success="handleAvatarSuccess" -->
<!-- :http-request="uploadSubmit" -->
<el-upload <el-upload
name="image" name="image"
:accept="'image/*'" :accept="'image/*'"
...@@ -130,19 +169,9 @@ ...@@ -130,19 +169,9 @@
>重新上传</el-button >重新上传</el-button
> >
</el-upload> </el-upload>
<!-- <el-upload
v-else
action="https://jsonplaceholder.typicode.com/posts/"
style="display: inline-block; margin-right: 15px"
>
<el-button class="photo_header_button"
>上传考试结果</el-button
>
</el-upload> -->
</el-col> </el-col>
</el-row> </el-row>
<div class="grid-content_upload" v-loading="is_loading" > <div class="grid-content_upload" v-loading="is_loading">
<div class="upload_btn"> <div class="upload_btn">
<div <div
class="img_box" class="img_box"
...@@ -168,7 +197,7 @@ ...@@ -168,7 +197,7 @@
将文件拖到此处,或<em>点击上传</em> 将文件拖到此处,或<em>点击上传</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
只能上传jpg/png文件,且不超过20MB 只能上传jpg/png文件,且不超过20MB
</div> </div>
</el-upload> </el-upload>
</div> </div>
...@@ -187,11 +216,12 @@ ...@@ -187,11 +216,12 @@
<script> <script>
import TestInfo from '@/components/TestInfo/index'; import TestInfo from '@/components/TestInfo/index';
import { getResultsData, uploadTestResults } from '@/api/user'; import { getResultsData, uploadTestResults, getTobaccoList } from '@/api/user';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import AnswerView from './components/answer-view.vue';
export default { export default {
name: '', name: '',
components: { TestInfo }, components: { TestInfo, AnswerView },
data() { data() {
return { return {
headers: { Authorization: ' Bearer ' + getToken() }, headers: { Authorization: ' Bearer ' + getToken() },
...@@ -205,6 +235,7 @@ export default { ...@@ -205,6 +235,7 @@ export default {
test_card_info: {}, test_card_info: {},
is_force: false, is_force: false,
is_loading: false, is_loading: false,
tobacco_grades_data: [],
}; };
}, },
created() { created() {
...@@ -213,6 +244,7 @@ export default { ...@@ -213,6 +244,7 @@ export default {
mounted() { mounted() {
this.user_info = this.$store.state.user.user; this.user_info = this.$store.state.user.user;
this.getTestData(); this.getTestData();
this.getTobaccoInfo();
}, },
methods: { methods: {
sub(is_submit = true, is_force = false) { sub(is_submit = true, is_force = false) {
...@@ -260,8 +292,8 @@ export default { ...@@ -260,8 +292,8 @@ export default {
begin_answer_time: res.begin_answer_time, begin_answer_time: res.begin_answer_time,
duration: res.examination_questions.duration * 60, duration: res.examination_questions.duration * 60,
const_down: const_down:
res.examination_questions.duration * 60 - res.examination_questions.duration *
(res.begin_answer_duration ? res.begin_answer_duration : 0), -(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,
}; };
...@@ -270,6 +302,7 @@ export default { ...@@ -270,6 +302,7 @@ export default {
for (let i in this.test_results.examination_questions for (let i in this.test_results.examination_questions
.examination_question_detail) { .examination_question_detail) {
this.test_result_sub_data.push({ this.test_result_sub_data.push({
visible: false,
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[ value: this.test_results.test_results[
...@@ -317,14 +350,19 @@ export default { ...@@ -317,14 +350,19 @@ export default {
} }
}, },
uploadSubmit(file, fileList) { uploadSubmit(file, fileList) {
console.log(file.status) console.log(file.status);
// uploading ready error // uploading ready error
if(file && (file.status=="success" || file.status=="error")){ if (file && (file.status == 'success' || file.status == 'error')) {
this.is_loading = false; this.is_loading = false;
}else{ } else {
this.is_loading = true; this.is_loading = true;
} }
}, },
getTobaccoInfo() {
getTobaccoList().then((res) => {
this.tobacco_grades_data = res;
});
},
}, },
}; };
</script> </script>
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论