提交 013a3654 authored 作者: lihuihui's avatar lihuihui
......@@ -8,18 +8,22 @@
@remove-tag="handleRemoveTag"
ref="select"
>
<el-tree
node-key="id"
show-checkbox
:data="options"
:defaultExpandedKeys="defaultExpandedKeys"
:props="defaultProps"
:check-strictly="checkStrictly"
@check-change="handleChange"
v-bind="$attrs"
v-on="$listeners"
ref="tree"
></el-tree>
<div style="margin: 10px 14px">
<el-input placeholder="搜索" v-model="filterText" clearable style="margin-bottom: 10px"></el-input>
<el-tree
node-key="id"
show-checkbox
:data="options"
:defaultExpandedKeys="defaultExpandedKeys"
:props="defaultProps"
:check-strictly="checkStrictly"
:filter-node-method="filterNode"
@check-change="handleChange"
v-bind="$attrs"
v-on="$listeners"
ref="tree"
></el-tree>
</div>
</el-select>
</template>
......@@ -33,6 +37,7 @@ export default {
},
data() {
return {
filterText: '',
selectValue: [],
options: [],
defaultExpandedKeys: []
......@@ -44,6 +49,9 @@ export default {
handler() {
this.setChecked()
}
},
filterText(val) {
this.$refs.tree.filter(val)
}
},
computed: {
......@@ -83,6 +91,10 @@ export default {
}
this.selectValue = this.multiple ? nodes : nodes.map(item => item.category_name)
},
filterNode(value, data) {
if (!value) return true
return data.category_name.indexOf(value) !== -1
},
handleChange(data, checked) {
const RefTree = this.$refs.tree
if (!this.multiple && checked) {
......
......@@ -128,6 +128,13 @@ export default {
this.$message.warning('请选择考试时间')
return
}
const startTime = new Date(params.start_time)
const endTime = new Date(params.end_time)
if ((endTime - startTime) / 86400000 > 40) {
this.$message.warning('考试时间不能超过40天')
return
}
this.$emit('getBaseInfo', params)
this.$parent.$parent.nextStep()
},
......
......@@ -72,15 +72,17 @@ export default {
return
}
this.$parent.$parent.nextStep()
const listArray = []
for (let i = 0; i < this.q.length; i++) {
const listArray = []
for (let j = 0; j < this.ExamParerList.length; j++) {
if (this.q[i] === this.ExamParerList[j].key) {
listArray.push(this.ExamParerList[j])
}
}
this.checkedArrs = listArray
}
this.checkedArrs = listArray
console.log(this.checkedArrs)
const qs = this.q.toString()
this.$emit('getCheckPaper', qs)
this.$emit('getCheckPaperList', this.checkedArrs)
......
......@@ -8,6 +8,16 @@
<el-button type="primary" v-show="configs.enabled_promise === true">考试承诺书</el-button>
<el-button type="success" v-show="configs.enabled_lock === true">锁定考试</el-button>
<el-button type="info" v-show="configs.enabled_watermark === true">答题水印</el-button>
<span
v-if="
configs.enabled_ip_limit === false &&
configs.enabled_promise === false &&
configs.enabled_lock === false &&
configs.enabled_watermark === false
"
>
暂无
</span>
</div>
<el-row class="btn_next">
<el-button type="primary" @click="lastStep">上一步</el-button>
......
......@@ -2,38 +2,53 @@
<div class="question-item">
<div class="question-item-title" v-html="questionData.content"></div>
<template v-if="questionType === 1 || questionType === 6">
<el-radio-group v-model="questionData.answer[0]" :disabled="true" class="question-item-content" >
<el-radio-group v-model="questionData.answer[0]" :disabled="true" class="question-item-content">
<div class="question-item-option" v-for="subItem in questionData.options" :key="subItem.id">
<el-radio :label="subItem.id">{{ subItem.option }}</el-radio>
</div>
</el-radio-group>
</template>
<template v-if="questionType === 2">
<el-checkbox-group v-model="questionData.answer" :disabled="true" class="question-item-content" >
<el-checkbox-group v-model="questionData.answer" :disabled="true" class="question-item-content">
<div class="question-item-option" v-for="subItem in questionData.options" :key="subItem.id">
<el-checkbox :label="subItem.id"> {{ subItem.option }} </el-checkbox>
</div>
</el-checkbox-group>
</template>
<template v-if="questionType === 3">
<div class="SAQ">{{questionData.answer || ''}}</div>
<div style="text-align:right;">
<div class="SAQ">{{ questionData.answer || '' }}</div>
<div style="text-align: right">
<el-button type="primary" size="mini" plain @click="showComment = !showComment">点击评分</el-button>
</div>
<div class="comment" v-show="showComment">
<div class="comment-top">
<p>本题{{questionData.score}}</p>
<p>本题{{ questionData.score }}</p>
<div class="get-score">
学生得分:<el-input-number :disabled="questionData.checked_flag" v-model="questionData.get_score" controls-position="right" :min="0" :max="questionData.score" size="mini"></el-input-number>
学生得分:<el-input-number
:disabled="questionData.checked_flag"
v-model="questionData.get_score"
controls-position="right"
:min="0"
:max="questionData.score"
size="mini"
></el-input-number>
</div>
</div>
<el-input type="textarea" placeholder="请输入评语" v-model="questionData.comment" rows="3" :disabled="questionData.checked_flag" />
<div style="text-align:center;padding-top:10px;">
<el-button type="primary" size="mini" @click="fetchComment" :disabled="questionData.checked_flag" >提交点评</el-button>
<el-input
type="textarea"
placeholder="请输入评语"
v-model="questionData.comment"
rows="3"
:disabled="questionData.checked_flag"
/>
<div style="text-align: center; padding-top: 10px">
<el-button type="primary" size="mini" @click="fetchComment" :disabled="questionData.checked_flag"
>提交点评</el-button
>
</div>
</div>
</template>
<div class="question-item-score">得分:{{questionData.get_score}}分</div>
<div class="question-item-score">得分:{{ questionData.get_score }}分</div>
</div>
</template>
<script>
......@@ -77,11 +92,6 @@ export default {
// if (this.questionType === 3) console.log(this.questionData)
},
methods: {
handleComment() {
// console.log(this.question_item_id)
// console.log(this.questionData)
this.fetchComment()
},
fetchComment() {
const params = {
sheet_id: this.sheet_id,
......@@ -102,44 +112,44 @@ export default {
}
</script>
<style lang="scss" scoped>
.question-item{
font-size:14px;
color:#454545;
border-bottom:1px solid #f3f3f3;
margin-bottom:10px;
.question-item-content{
padding-left:10px;
.question-item-option{
padding-top:10px ;
.question-item {
font-size: 14px;
color: #454545;
border-bottom: 1px solid #f3f3f3;
margin-bottom: 10px;
.question-item-content {
padding-left: 10px;
.question-item-option {
padding-top: 10px;
}
}
.SAQ{
min-height:60px;
font-size:14px;
line-height:24px;
color:#888;
border:1px solid #eee;
background:#f3f3f3;
margin:10px 0;
border-radius:6px;
.SAQ {
min-height: 60px;
font-size: 14px;
line-height: 24px;
color: #888;
border: 1px solid #eee;
background: #f3f3f3;
margin: 10px 0;
border-radius: 6px;
}
.comment{
border:1px solid rgba(192,28,64, .3);
border-radius:4px;
padding:10px;
margin-top:15px;
background:#f9f9f9;
.comment-top{
.comment {
border: 1px solid rgba(192, 28, 64, 0.3);
border-radius: 4px;
padding: 10px;
margin-top: 15px;
background: #f9f9f9;
.comment-top {
display: flex;
margin-bottom:10px;
p{
flex:1;
margin-bottom: 10px;
p {
flex: 1;
}
}
}
.question-item-score{
color:#777;
padding:10px 0;
.question-item-score {
color: #777;
padding: 10px 0;
}
}
</style>
......@@ -15,11 +15,17 @@
<el-button type="primary" @click="showSelectQuestion">自动组卷</el-button>
</template>
</template>
<question-list :list="questions" :disableScore="data.paper_type === 2" style="margin-top: 20px">
<question-list
:list="questions"
:disableScore="data.paper_type === 2"
style="margin-top: 20px"
v-if="questions.length"
>
<template v-slot:selection="item" v-if="data.paper_type === 1">
<el-checkbox @change="handleSelectionChange(arguments[0], item)"></el-checkbox>
</template>
</question-list>
<el-empty description="该试卷无试题,去添加试题吧" v-else></el-empty>
</app-card>
</el-col>
<!-- 试题序号 -->
......
......@@ -7,18 +7,18 @@
</el-radio-group>
</template>
<template v-slot:filter-category="{ params }">
<question-type-cascader v-model="params.question_category" @change="refetchList"></question-type-cascader>
<question-type-treeselect v-model="params.question_category" @change="refetchList"></question-type-treeselect>
</template>
</app-list>
</template>
<script>
import { getQuestionList } from '../api.js'
import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue'
import QuestionTypeTreeselect from '@/components/base/QuestionTypeTreeselect.vue'
export default {
props: { data: { type: Object, default: () => ({}) } },
components: { QuestionTypeCascader },
components: { QuestionTypeTreeselect },
data() {
return {}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论