yujialong 3 months ago
parent 9945e373c3
commit 081c4613bf
  1. 27
      src/pages/testPaper/detail/index.vue
  2. 3
      src/pages/testPaper/list/index.vue
  3. 41
      src/pages/testPaper/preview/index.vue
  4. 3
      src/styles/common.scss

@ -123,13 +123,15 @@
<el-button type="primary" @click="allocation(item)">一键分配分值</el-button> <el-button type="primary" @click="allocation(item)">一键分配分值</el-button>
<el-button type="primary" @click="showManualDia(item)">批量添加</el-button> <el-button type="primary" @click="showManualDia(item)">批量添加</el-button>
<el-button type="danger" @click="batchDelQues(item)">批量删除试题</el-button> <el-button type="danger" @click="batchDelQues(item)">批量删除试题</el-button>
<i class="arrow el-icon-arrow-down" @click="item.shrink = !item.shrink"></i> <img :class="['shrink', { active: item.shrink }]" src="@/assets/images/shrink.svg" alt=""
@click="item.shrink = !item.shrink">
</div> </div>
</div> </div>
<p class="sum">本大题共{{ item.questionNum }}小题{{ item.targetScore }}</p> <p class="sum">本大题共{{ item.questionNum }}小题{{ item.targetScore }}</p>
<div :class="['ques-wrap', { hide: item.shrink }]"> <div :class="['ques-wrap', { hide: item.shrink }]">
<draggable v-model="item.examQuestions" :group="dragGroup" @update="e => updateSort(e, item)"> <draggable v-model="item.examQuestions" :group="dragGroup" chosenClass="chosen" animation="1000"
@update="e => updateSort(e, item)">
<div v-for="(ques, j) in item.examQuestions" :key="j" class="ques-item"> <div v-for="(ques, j) in item.examQuestions" :key="j" class="ques-item">
<el-checkbox v-model="ques.check"></el-checkbox> <el-checkbox v-model="ques.check"></el-checkbox>
<div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.isRepeat }]"> <div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.isRepeat }]">
@ -894,7 +896,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.ques { .ques {
li { li {
padding: 15px;
margin: 20px 0 10px; margin: 20px 0 10px;
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
} }
@ -903,6 +904,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 15px;
} }
.serial { .serial {
@ -910,15 +912,18 @@ export default {
font-size: 13px; font-size: 13px;
} }
.arrow { .shrink {
margin-left: 10px; margin-left: 10px;
font-size: 16px;
color: #a9a9a9;
cursor: pointer; cursor: pointer;
transition: .5s;
&.active {
transform: rotate(180deg);
}
} }
.sum { .sum {
margin: 15px 0; margin: 0 15px 15px;
font-size: 13px; font-size: 13px;
color: $main-color; color: $main-color;
} }
@ -933,11 +938,15 @@ export default {
} }
} }
.chosen {
box-shadow: 0 0 7px rgba(239, 239, 239, .8);
// border: solid 2px #3089dc !important;
}
.ques-item { .ques-item {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
padding: 15px;
margin-bottom: 20px;
} }
.ques-info { .ques-info {

@ -120,7 +120,8 @@
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column> <el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column> <el-table-column prop="score" label="总分" align="center" width="60"></el-table-column>
<el-table-column prop="medianScore" label="中分位数" align="center" width="70"></el-table-column> <el-table-column prop="medianScore" label="中分位数" align="center" width="70"></el-table-column>
<el-table-column prop="questionType" label="题型" align="center" min-width="90"></el-table-column> <el-table-column prop="questionType" label="题型" align="center" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom"> <el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom">
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e => <template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e =>
e.id === scope.row.difficult).name : '' }}</template> e.id === scope.row.difficult).name : '' }}</template>

@ -30,7 +30,8 @@
<template v-for="(ques, j) in item.examQuestions"> <template v-for="(ques, j) in item.examQuestions">
<li <li
v-if="!sheetStatus || (sheetStatus === 1 && !ques.answered) || (sheetStatus === 2 && ques.answered) || (sheetStatus === 3 && ques.partAnswer) || (sheetStatus === 4 && ques.sign)" v-if="!sheetStatus || (sheetStatus === 1 && !ques.answered) || (sheetStatus === 2 && ques.answered) || (sheetStatus === 3 && ques.partAnswer) || (sheetStatus === 4 && ques.sign)"
:key="j" :class="{ answered: ques.answered, partAnswer: ques.partAnswer }"> :key="j" :class="{ answered: ques.answered, partAnswer: ques.partAnswer }"
@click="scrollToQues(ques)">
<img v-if="ques.sign" class="tag" src="@/assets/images/tag-active.svg" alt=""> <img v-if="ques.sign" class="tag" src="@/assets/images/tag-active.svg" alt="">
{{ j + 1 }} {{ j + 1 }}
</li> </li>
@ -47,7 +48,7 @@
</ul> </ul>
</div> </div>
<ul v-if="form.paperOutline" class="ques-wrap"> <ul v-if="form.paperOutline" class="ques-wrap" id="quesWrap">
<li v-for="(item, i) in form.paperOutline" :key="i"> <li v-for="(item, i) in form.paperOutline" :key="i">
<div class="outline"> <div class="outline">
{{ arabicToChinese(i + 1) }}{{ item.questionTypeName }}本题共{{ item.questionNum }}小题{{ {{ arabicToChinese(i + 1) }}{{ item.questionTypeName }}本题共{{ item.questionNum }}小题{{
@ -56,11 +57,11 @@
@click="item.shrink = !item.shrink"> @click="item.shrink = !item.shrink">
</div> </div>
<div :class="['ques', { hide: item.shrink }]"> <div :class="['ques', { hide: item.shrink }]">
<div v-for="(ques, j) in item.examQuestions" :key="j" class="item"> <div v-for="(ques, j) in item.examQuestions" :key="j" class="item" :id="'ques' + ques.id">
<div class="stem-wrap"> <div class="stem-wrap">
<span class="label">{{ j + 1 }} / {{ item.questionNum }}</span> <span class="label">{{ j + 1 }} / {{ item.questionNum }}</span>
<span class="label">{{ item.questionTypeName }}</span> <span class="label">{{ item.questionTypeName }}</span>
<div :id="'stem' + ques.id" v-html="getQuesStem(ques)"></div> <div class="stem" :id="'stem' + ques.id" v-html="getQuesStem(ques)"></div>
<p v-if="item.questionType !== 'fill_blank'">{{ ques.score }}</p> <p v-if="item.questionType !== 'fill_blank'">{{ ques.score }}</p>
<img class="tag" :src="require('@/assets/images/' + (ques.sign ? 'tag-active' : 'tag') + '.svg')" alt="" <img class="tag" :src="require('@/assets/images/' + (ques.sign ? 'tag-active' : 'tag') + '.svg')" alt=""
@click="ques.sign = ques.sign ? 0 : 1"> @click="ques.sign = ques.sign ? 0 : 1">
@ -259,6 +260,26 @@ export default {
progressFormat (e) { progressFormat (e) {
return this.totalAnswered + '/' + this.form.questionCount return this.totalAnswered + '/' + this.form.questionCount
}, },
scrollToSmooth (position, duration) {
let startTime = Date.now()
function scroll () {
let now = Date.now()
let progress = Math.min(1, (now - startTime) / duration)
document.querySelector('#quesWrap').scrollTo(0, position * progress)
if (progress < 1) {
window.requestAnimationFrame(scroll)
}
}
window.requestAnimationFrame(scroll)
},
//
scrollToQues (e) {
const el = document.querySelector('#ques' + e.id)
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop, 200)
},
// //
filterStatus (e) { filterStatus (e) {
this.sheetStatus = this.sheetStatus === e ? '' : e this.sheetStatus = this.sheetStatus === e ? '' : e
@ -418,6 +439,11 @@ export default {
line-height: 35px; line-height: 35px;
color: #505050; color: #505050;
border: 1px solid #d3d3d3; border: 1px solid #d3d3d3;
cursor: pointer;
&:hover {
opacity: .9;
}
&.answered { &.answered {
color: #fff; color: #fff;
@ -533,7 +559,7 @@ export default {
.stem-wrap { .stem-wrap {
display: flex; display: flex;
align-items: center; align-items: baseline;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -552,10 +578,15 @@ export default {
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
color: $main-color; color: $main-color;
white-space: nowrap;
border: 1px solid; border: 1px solid;
border-radius: 2px; border-radius: 2px;
} }
.stem {
max-width: calc(100% - 191px);
}
.fill-input { .fill-input {
width: 100px; width: 100px;
height: 28px; height: 28px;

@ -368,9 +368,6 @@
padding-bottom: 50px; padding-bottom: 50px;
} }
} }
.el-tooltip__popper {
width: 300px;
}
@media(max-width: 1600px) { @media(max-width: 1600px) {
.el-table { .el-table {
.el-switch__label--right.is-active { .el-switch__label--right.is-active {

Loading…
Cancel
Save