提交 42b0dc8d authored 作者: Yroc's avatar Yroc

'后台部分功能优化'

上级 a8a78a0c
...@@ -147,6 +147,16 @@ export function get_examination_questions_detail(id, params) { ...@@ -147,6 +147,16 @@ export function get_examination_questions_detail(id, params) {
method: 'get', method: 'get',
}) })
} }
//试题得分设置
export function get_examination_questions_select(id, data) {
return request({
url: `/api/examination_question_detail/set_fraction/${id}`,
method: 'post',
data
})
}
//试题信息管理详情-图片上传 //试题信息管理详情-图片上传
export function upload_examination_question_image(data) { export function upload_examination_question_image(data) {
return request({ return request({
......
...@@ -8,22 +8,37 @@ ...@@ -8,22 +8,37 @@
<template> <template>
<div> <div>
<div> <div>
<el-button type="text" icon="el-icon-arrow-left" size="mini" class="back_btn" @click="back">返回</el-button> <el-button
type="text"
icon="el-icon-arrow-left"
size="mini"
class="back_btn"
@click="back"
>返回</el-button
>
<h2 class="title_box">{{ info_data.title }}</h2> <h2 class="title_box">{{ info_data.title }}</h2>
<span v-for="(item, index) in info_data.examination_status" :key="index"> <span v-for="(item, index) in info_data.examination_status" :key="index">
<el-tag :type="item.type" v-if="info_data.status == item.id">{{ item.label }}</el-tag> <el-tag :type="item.type" v-if="info_data.status == item.id">{{
item.label
}}</el-tag>
</span> </span>
</div> </div>
<div style="margin-top: 15px;"> <div style="margin-top: 15px">
<div class="person_attribute_box" v-for="(item, index) in data_keys" :key="index" <div
v-show="info_data[item.key] != undefined"> class="person_attribute_box"
v-for="(item, index) in data_keys"
:key="index"
v-show="info_data[item.key] != undefined"
>
<span v-if="item.key == 'duration'"> <span v-if="item.key == 'duration'">
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
<span>{{ info_data[item.key] }}分钟</span> <span>{{ info_data[item.key] }}分钟</span>
</span> </span>
<span v-else-if="item.key == 'answer_duration'"> <span v-else-if="item.key == 'answer_duration'">
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
<span class="label">{{ seconds_to_minutes(info_data[item.key]) }}</span> <span class="label">{{
seconds_to_minutes(info_data[item.key])
}}</span>
</span> </span>
<span v-else> <span v-else>
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
...@@ -48,7 +63,7 @@ export default { ...@@ -48,7 +63,7 @@ export default {
{ label: '成绩', key: 'score' }, { label: '成绩', key: 'score' },
{ label: '考试时长', key: 'duration' }, { label: '考试时长', key: 'duration' },
{ label: '考试时长', key: 'answer_duration' }, { label: '考试时长', key: 'answer_duration' },
{ label: '本套题满分', key: 'full_marks' },
], ],
strong_keys: ['user_name', 'score'], strong_keys: ['user_name', 'score'],
}; };
...@@ -60,7 +75,7 @@ export default { ...@@ -60,7 +75,7 @@ export default {
created() { created() {
this.info_data = { ...this.examination_questions }; this.info_data = { ...this.examination_questions };
}, },
mounted() { }, mounted() {},
methods: { methods: {
back() { back() {
...@@ -68,21 +83,20 @@ export default { ...@@ -68,21 +83,20 @@ export default {
}, },
seconds_to_minutes(str) { seconds_to_minutes(str) {
if (str) { if (str) {
return secondsToMinutes(str) return secondsToMinutes(str);
} else { } else {
return '暂无' return '暂无';
} }
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.back_btn { .back_btn {
/* font-size: 16px; */ /* font-size: 16px; */
color: #303133; color: #303133;
border-right: 1px solid #DCDFE6; border-right: 1px solid #dcdfe6;
padding: 3px 10px 3px 0; padding: 3px 10px 3px 0;
border-radius: none; border-radius: none;
} }
......
...@@ -34,15 +34,85 @@ ...@@ -34,15 +34,85 @@
<span <span
v-for="(item, index) in head_data.right_buttons" v-for="(item, index) in head_data.right_buttons"
:key="index" :key="index"
style="margin: 0 8px" style="margin: 0 5px"
> >
<el-button <el-button
v-if="upload_btns.indexOf(item.event) == -1" v-if="
upload_btns.indexOf(item.event) == -1 &&
item.event !== 'template_download' &&
item.event !== 'select_score'
"
type="primary" type="primary"
:icon="item.icon" :icon="item.icon"
@click="btnClick(item.event)" @click="btnClick(item.event)"
>{{ item.text }}</el-button >{{ item.text }}</el-button
> >
<el-popover
v-else-if="item.event == 'template_download'"
placement="bottom"
width="400"
trigger="hover"
>
<el-table :data="examination_questions_data">
<el-table-column prop="name" label="题目数量"> </el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button
type="primary"
@click="btnClick('template_download', scope.row.data)"
>下载</el-button
>
</template>
</el-table-column>
</el-table>
<el-button type="primary" slot="reference" :icon="item.icon">{{
item.text
}}</el-button>
</el-popover>
<el-popover
v-else-if="item.event == 'select_score'"
placement="bottom"
width="300"
trigger="hover"
>
<!-- <el-table height="400" :data="examination_questions_select_data">
<el-table-column
align="center"
prop="name"
label="每道题得分选择"
>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
>
</template>
</el-table-column>
</el-table> -->
<el-row>
<el-col :span="16">
<el-input
v-model="examination_questions_select_data"
placeholder="请输每道题新的得分"
></el-input
></el-col>
<el-col :span="8"></el-col
><el-button
style="margin-left: 20px"
type="primary"
@click="
btnClick('select_score', examination_questions_select_data)
"
>确认</el-button
>
</el-row>
<el-button type="primary" slot="reference" :icon="item.icon">{{
item.text
}}</el-button>
</el-popover>
<el-upload <el-upload
v-else v-else
id="upload_moudel" id="upload_moudel"
...@@ -61,6 +131,7 @@ ...@@ -61,6 +131,7 @@
</el-upload> </el-upload>
</span> </span>
</el-col> </el-col>
<!-- <el-col :span="2" <!-- <el-col :span="2"
><span v-if="head_data.ensembel_btn" ><span v-if="head_data.ensembel_btn"
><el-badge :value="head_data.number_value"> ><el-badge :value="head_data.number_value">
...@@ -88,6 +159,13 @@ export default { ...@@ -88,6 +159,13 @@ export default {
'examination_questions_upload', 'examination_questions_upload',
'batch_reservation', 'batch_reservation',
], ],
examination_questions_data: [
{ name: '100道题', data: 'setThemeCard100.docx' },
{ name: '50道题', data: 'setThemeCard50.docx' },
{ name: '25道题', data: 'setThemeCard25.docx' },
{ name: '20道题', data: 'setThemeCard20.docx' },
],
examination_questions_select_data: null,
btn_code: '', btn_code: '',
}; };
}, },
...@@ -123,8 +201,10 @@ export default { ...@@ -123,8 +201,10 @@ export default {
}, },
//右侧按钮事件 //右侧按钮事件
btnClick(val) { btnClick(val, data) {
this.$emit('btnClick', val); // console.log(val);
// console.log(data);
this.$emit('btnClick', { val, data });
}, },
uploadCode(val) { uploadCode(val) {
this.btn_code = val; this.btn_code = val;
......
差异被折叠。
...@@ -707,7 +707,7 @@ export default { ...@@ -707,7 +707,7 @@ export default {
}, },
}; };
}, },
//错误等级 //错误上下一级
changeErrorLevel(datas) { changeErrorLevel(datas) {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-28 10:34:24 * @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-11 19:40:37 * @Last Modified time: 2023-04-20 15:34:11
*/ */
</script> </script>
<template> <template>
...@@ -72,6 +72,8 @@ ...@@ -72,6 +72,8 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="fraction" align="center" label="每题得分">
</el-table-column>
<el-table-column prop="quote" label="是否引用" align="center"> <el-table-column prop="quote" label="是否引用" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.examination_question_detail_id ? '是' : '否' }} {{ scope.row.examination_question_detail_id ? '是' : '否' }}
...@@ -178,6 +180,7 @@ import { ...@@ -178,6 +180,7 @@ import {
get_image_path, get_image_path,
get_examination_questions_all, get_examination_questions_all,
create_answer_card, create_answer_card,
get_examination_questions_select,
} from '@/api/student'; } from '@/api/student';
import { exportText } from '@/utils/tool'; import { exportText } from '@/utils/tool';
const standard_template = { const standard_template = {
...@@ -201,6 +204,11 @@ export default { ...@@ -201,6 +204,11 @@ export default {
is_search_show: false, is_search_show: false,
search_placeholder: '学员姓名/手机号', search_placeholder: '学员姓名/手机号',
right_buttons: [ right_buttons: [
{
text: '每题得分',
icon: 'el-icon-magic-stick',
event: 'select_score',
},
{ {
text: '模板下载', text: '模板下载',
icon: 'el-icon-download', icon: 'el-icon-download',
...@@ -212,7 +220,7 @@ export default { ...@@ -212,7 +220,7 @@ export default {
event: 'examination_questions_upload', event: 'examination_questions_upload',
}, },
{ {
text: '试题下载', text: '答案下载',
icon: 'el-icon-download', icon: 'el-icon-download',
event: 'examination_download', event: 'examination_download',
}, },
...@@ -295,13 +303,14 @@ export default { ...@@ -295,13 +303,14 @@ export default {
this.getExaminationQuestionsDetail(); this.getExaminationQuestionsDetail();
}, },
btnClick(val) { btnClick(val) {
console.log('右侧按钮'); // console.log('右侧按钮');
console.log(val); // console.log(val);
if (val == 'add') this.addInformation(); if (val == 'add') this.addInformation();
if (val == 'template_download') this.templateDownload(); if (val.val == 'template_download') this.templateDownload(val.data);
/* pictureBatchUpload */ /* pictureBatchUpload */
if (val == 'batch_upload') this.pictureBatchUpload(); if (val == 'batch_upload') this.pictureBatchUpload();
if (val == 'examination_download') this.createAnswerCard(); if (val == 'examination_download') this.createAnswerCard();
if (val.val == 'select_score') this.selectScoreData(val.data);
}, },
init() { init() {
...@@ -381,9 +390,14 @@ export default { ...@@ -381,9 +390,14 @@ export default {
this.student_brief_introduction.begin_date = res.begin_date; this.student_brief_introduction.begin_date = res.begin_date;
this.student_brief_introduction.test_number = this.student_brief_introduction.test_number =
res.examination_question_detail.length; res.examination_question_detail.length;
this.student_brief_introduction.full_marks =
res.examination_question_detail.length *
res.examination_question_detail[0].fraction;
// console.log(this.student_brief_introduction.full_marks);
this.is_loading = false; this.is_loading = false;
}); });
}, },
//获取方位 //获取方位
getTobaccoProvince() { getTobaccoProvince() {
get_tobacco_province().then((res) => { get_tobacco_province().then((res) => {
...@@ -532,16 +546,17 @@ export default { ...@@ -532,16 +546,17 @@ export default {
}); });
}, },
//试题模版下载 //试题模版下载
templateDownload() { templateDownload(path) {
let url = `${this.IP}/php_sours/tmpDoc/setThemeCard.docx`; // let url = `${this.IP}/php_sours/tmpDoc/setThemeCard.docx`;
let url = `${this.IP}/php_sours/tmpDoc/${path}`;
exportText(url, '模板.docx'); exportText(url, '模板.docx');
}, },
//试题下载 //试题下载
createAnswerCard() { createAnswerCard() {
let id = this.examination_questions_id; let id = this.examination_questions_id;
create_answer_card(id).then((res) => { create_answer_card(id).then((res) => {
console.log('下载答题卡回调'); // console.log('下载答题卡回调');
console.log(res); // console.log(res);
if (res.code == 200) { if (res.code == 200) {
let s = res.message.split('='); let s = res.message.split('=');
let name = s[s.length - 1]; let name = s[s.length - 1];
...@@ -550,19 +565,32 @@ export default { ...@@ -550,19 +565,32 @@ export default {
} }
}); });
}, },
//得分选择
selectScoreData(val) {
let amendData = this.$handleParams({ fraction: val });
let id = this.examination_questions_id;
console.log(amendData);
console.log(id);
get_examination_questions_select(id, amendData).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.getExaminationQuestionsDetail();
}
});
},
//试题上传 //试题上传
uploadTestQuestions(val) { uploadTestQuestions(val) {
this.is_loading = true; this.is_loading = true;
console.log('试题上传'); // console.log('试题上传');
console.log(val); // console.log(val);
const formData = new FormData(); const formData = new FormData();
formData.append('file', val.file); formData.append('file', val.file);
let id = this.examination_questions_id; let id = this.examination_questions_id;
examination_question_detail_upload(id, formData) examination_question_detail_upload(id, formData)
.then((res) => { .then((res) => {
console.log('试题上传'); // console.log('试题上传');
console.log(res); // console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.is_loading = false; this.is_loading = false;
this.$message.success(res.message); this.$message.success(res.message);
...@@ -584,8 +612,8 @@ export default { ...@@ -584,8 +612,8 @@ export default {
}, },
//图片提交 //图片提交
subMitPictureList() { subMitPictureList() {
console.log('当前文件列表'); // console.log('当前文件列表');
console.log(this.picture_file_list); // console.log(this.picture_file_list);
let formData = new FormData(); let formData = new FormData();
this.picture_file_list.forEach((element) => { this.picture_file_list.forEach((element) => {
formData.append('image[]', element.raw); formData.append('image[]', element.raw);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-04-10 18:06:52 * @Date: 2023-04-10 18:06:52
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-18 11:45:11 * @Last Modified time: 2023-04-19 15:24:58
*/ */
</script> </script>
<template> <template>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<el-table-column prop="id" label="编号" width="50"> <el-table-column prop="id" label="编号" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="title" label="考试标题"> <el-table-column prop="title" label="考试标题" width="220">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover trigger="hover" placement="top"> <el-popover trigger="hover" placement="top">
<p>{{ scope.row.title }}</p> <p>{{ scope.row.title }}</p>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260"> <el-table-column label="操作" width="210">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-29 17:06:03 * @Date: 2023-03-29 17:06:03
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-17 10:39:36 * @Last Modified time: 2023-04-19 10:34:19
*/ */
</script> </script>
<template> <template>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<el-row> <el-row>
<!-- 错误方位/区域 --> <!-- 南北方正确/错误率 -->
<el-col :span="8" style="margin-bottom: 15px" v-if="area_score_list"> <el-col :span="8" style="margin-bottom: 15px" v-if="area_score_list">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="area_score_list"> </AnalyseModule> <AnalyseModule :module_data="area_score_list"> </AnalyseModule>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<AnalyseModule :module_data="wrong_group_list"> </AnalyseModule> <AnalyseModule :module_data="wrong_group_list"> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误等组 --> <!-- 错误正副组 -->
<el-col <el-col
:span="8" :span="8"
style="margin-bottom: 15px" style="margin-bottom: 15px"
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
test_text: test_text:
'针对你在本次烟草知识考试中的表现,我认为你已经做得非常出色。你的答案准确地回答了考试中的问题,而且展现出了对烟草知识的全面了解。', '针对你在本次烟草知识考试中的表现,我认为你已经做得非常出色。你的答案准确地回答了考试中的问题,而且展现出了对烟草知识的全面了解。',
//区域区域数据 //南北方正确/错误率
area_score_list: null, area_score_list: null,
//错误部位 //错误部位
wrong_position_list: null, wrong_position_list: null,
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
error_level_list: null, error_level_list: null,
//错误组别 //错误组别
wrong_group_list: null, wrong_group_list: null,
//错误等组 //错误正副组
wrong_iso_groups_list: null, wrong_iso_groups_list: null,
///眼光稳定性 ///眼光稳定性
eye_stability_list: null, eye_stability_list: null,
...@@ -214,7 +214,7 @@ export default { ...@@ -214,7 +214,7 @@ export default {
//表格列表 //表格列表
this.questions_list = new_arr; this.questions_list = new_arr;
//烟草区域 //南北方正确/错误率
this.area_score_list = this.changeAreaScore( this.area_score_list = this.changeAreaScore(
res.statistical_results.AreaScore res.statistical_results.AreaScore
); );
...@@ -234,7 +234,7 @@ export default { ...@@ -234,7 +234,7 @@ export default {
this.wrong_group_list = this.changeWrongGroup( this.wrong_group_list = this.changeWrongGroup(
res.statistical_results.WrongGroup res.statistical_results.WrongGroup
); );
//错误等组 //错误正副组
this.wrong_iso_groups_list = this.changeWrongIsoGroup( this.wrong_iso_groups_list = this.changeWrongIsoGroup(
res.statistical_results.WrongIsogroup res.statistical_results.WrongIsogroup
); );
...@@ -247,7 +247,7 @@ export default { ...@@ -247,7 +247,7 @@ export default {
console.log(this.eye_stability_list); console.log(this.eye_stability_list);
}); });
}, },
//区域得分 //南北方正确/错误率
changeAreaScore(datas) { changeAreaScore(datas) {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
type: 'bar', type: 'bar',
chart_id: 'bar_chart1', chart_id: 'bar_chart1',
color: '#E6A23C', color: '#E6A23C',
title: '突出区域的烟草识别', title: '南北方正确/错误率',
labers, labers,
keys, keys,
raw_data: datas, raw_data: datas,
...@@ -380,7 +380,7 @@ export default { ...@@ -380,7 +380,7 @@ export default {
list, list,
}; };
}, },
//错误等组 //错误正副组
changeWrongIsoGroup(datas) { changeWrongIsoGroup(datas) {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
...@@ -403,7 +403,7 @@ export default { ...@@ -403,7 +403,7 @@ export default {
type: 'table', type: 'table',
chart_id: 'wrong_group', chart_id: 'wrong_group',
color: '#529B2E', color: '#529B2E',
title: '错误等组', title: '错误正副组',
labers, labers,
list, list,
}; };
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论