|
|
|
@ -104,7 +104,7 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<p class="m-t-10 m-b-20 text-right">目标总题数:{{ questionCount }};目标总分:{{ score }}</p> |
|
|
|
|
<p class="m-t-10 m-b-20 text-right">目标总题数:{{ overview.questionCount }};目标总分:{{ overview.totalScore }}</p> |
|
|
|
|
|
|
|
|
|
<div class="line"></div> |
|
|
|
|
|
|
|
|
@ -140,7 +140,6 @@ |
|
|
|
|
@update="e => updateSort(e, item)"> |
|
|
|
|
<div v-for="(ques, j) in item.examQuestions" :key="j" class="ques-item"> |
|
|
|
|
<el-checkbox v-model="ques.check"></el-checkbox> |
|
|
|
|
{{ ques.repeat }} |
|
|
|
|
<div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.repeat }]"> |
|
|
|
|
<div class="top-line"> |
|
|
|
|
<div class="stem-info"> |
|
|
|
@ -168,7 +167,7 @@ |
|
|
|
|
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly /> |
|
|
|
|
</div> |
|
|
|
|
</el-popover> |
|
|
|
|
<el-button type="text" @click="toQues(item, j, ques)">编辑试题</el-button> |
|
|
|
|
<el-button v-if="!ques.isDel" type="text" @click="toQues(item, j, ques)">编辑试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button> |
|
|
|
|
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button> |
|
|
|
|
<el-button type="text" @click="delQues(item, j)">移除试题</el-button> |
|
|
|
@ -216,6 +215,31 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-if="form.paperOutline && form.paperOutline.length" class="layer"> |
|
|
|
|
<table class="table"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th width="30%">大题</th> |
|
|
|
|
<th width="35%">已添加题数/目标题数</th> |
|
|
|
|
<th width="35%">已分配分值/目标分值</th> |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<tr v-for="(item, i) in form.paperOutline" :key="i"> |
|
|
|
|
<td>第{{ arabicToChinese(i + 1) }}大题</td> |
|
|
|
|
<td>{{ item.examQuestions.length }}/{{ item.questionNum }}</td> |
|
|
|
|
<td>{{ item.examQuestions.reduce((e, j) => (e += +j.score), 0) }}/{{ item.targetScore }}</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td>总计</td> |
|
|
|
|
<td>{{ overview.alreadyQuesCount }}/{{ overview.questionCount }}</td> |
|
|
|
|
<td>{{ overview.alreadyScore }}/{{ overview.totalScore }}</td> |
|
|
|
|
</tr> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<Template :visible.sync="templateVisible" /> |
|
|
|
|
<Manual :visible.sync="manualVisible" :questionType.sync="curType.questionType" /> |
|
|
|
|
<Auto :visible.sync="autoVisible" /> |
|
|
|
@ -386,7 +410,31 @@ export default { |
|
|
|
|
// 目标总分 |
|
|
|
|
score () { |
|
|
|
|
return this.form.paperOutline.reduce((e, j) => (e += +j.targetScore), 0) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 试题概览 |
|
|
|
|
overview () { |
|
|
|
|
const paper = this.form.paperOutline |
|
|
|
|
let questionCount = 0 |
|
|
|
|
let alreadyQuesCount = 0 |
|
|
|
|
let totalScore = 0 |
|
|
|
|
let alreadyScore = 0 |
|
|
|
|
paper.forEach(e => { |
|
|
|
|
questionCount += +e.questionNum // 试卷目标总题数 |
|
|
|
|
if (e.examQuestions) { |
|
|
|
|
alreadyQuesCount += e.examQuestions.length // 已添加总题数 |
|
|
|
|
totalScore = Decimal(totalScore).add(+e.targetScore || 0).toNumber() // 试卷目标总分 |
|
|
|
|
e.examQuestions.forEach(n => { |
|
|
|
|
alreadyScore = Decimal(alreadyScore).add(+n.score || 0).toNumber() // 已分配总分值 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
return { |
|
|
|
|
questionCount, |
|
|
|
|
alreadyQuesCount, |
|
|
|
|
totalScore, |
|
|
|
|
alreadyScore, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.crumbs = [ |
|
|
|
@ -674,7 +722,7 @@ export default { |
|
|
|
|
this.curRow = ques |
|
|
|
|
this.addQuesVisible = true |
|
|
|
|
}, |
|
|
|
|
// 关闭新增试题弹框 |
|
|
|
|
// 关闭试题弹框 |
|
|
|
|
closeAdd () { |
|
|
|
|
this.addQuesVisible = false |
|
|
|
|
}, |
|
|
|
@ -824,7 +872,7 @@ export default { |
|
|
|
|
// 提交验证及处理数据 |
|
|
|
|
async validForm (status) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
const { isCopy } = this // 复制 |
|
|
|
|
const { isCopy, overview } = this // 复制 |
|
|
|
|
const form = _.cloneDeep(this.form) |
|
|
|
|
const paper = form.paperOutline |
|
|
|
|
const allQues = [] |
|
|
|
@ -909,9 +957,9 @@ export default { |
|
|
|
|
form.professionalId = form.professionalId.join() |
|
|
|
|
form.particularYear = +(dayjs(form.particularYear).format('YYYY')) |
|
|
|
|
form.libraryId = this.libraryId |
|
|
|
|
form.questionCount = this.questionCount |
|
|
|
|
form.questionCount = overview.questionCount |
|
|
|
|
form.remarks = this.$refs.remarks.getUEContent() |
|
|
|
|
form.score = this.score |
|
|
|
|
form.score = overview.totalScore |
|
|
|
|
form.status = status |
|
|
|
|
|
|
|
|
|
paper.map(e => { |
|
|
|
@ -1059,6 +1107,7 @@ export default { |
|
|
|
|
color: #fff; |
|
|
|
|
background-color: #f00; |
|
|
|
|
transform: rotate(45deg); |
|
|
|
|
opacity: .6; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1181,6 +1230,40 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.layer { |
|
|
|
|
z-index: 2000; |
|
|
|
|
position: fixed; |
|
|
|
|
top: 40%; |
|
|
|
|
right: 10px; |
|
|
|
|
width: 265px; |
|
|
|
|
max-height: 300px; |
|
|
|
|
background-color: #fff; |
|
|
|
|
box-shadow: 0 0 7px rgba(235, 235, 235, .8); |
|
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
.table { |
|
|
|
|
text-align: center; |
|
|
|
|
border-collapse: collapse; |
|
|
|
|
|
|
|
|
|
th { |
|
|
|
|
padding: 10px 8px; |
|
|
|
|
font-size: 13px; |
|
|
|
|
color: #fff; |
|
|
|
|
background-color: #2bbb61; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
td { |
|
|
|
|
padding: 10px; |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
|
|
&:first-child { |
|
|
|
|
background-color: #f1f1f1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.editques-dia { |
|
|
|
|
.el-drawer__header { |
|
|
|
|
margin-bottom: 0; |
|
|
|
|