新增问卷
This commit is contained in:
parent
1733738a9f
commit
c10d9d2f0e
@ -4,7 +4,7 @@
|
||||
<div class="topheader">
|
||||
<el-button size="medium">返回</el-button>
|
||||
<el-button size="medium" type="primary" plain>预览问卷</el-button>
|
||||
<el-button size="medium" type="primary">保存</el-button>
|
||||
<el-button size="medium" type="primary" @click="upload">保存</el-button>
|
||||
<el-button size="medium" type="primary">保存并发布</el-button>
|
||||
</div>
|
||||
<div class="bottomheader">
|
||||
@ -51,16 +51,17 @@
|
||||
<draggable v-model="questionlist">
|
||||
<transition-group>
|
||||
<div class="questionitem" v-for="(item, index) in questionlist" :key="item.id">
|
||||
<div v-if="item.questionname == '单选题'" class="item">
|
||||
<div v-if="item.questionname == '单选题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click="delquestion(item, index)">
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入内容" v-model="item.title" clearable>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
@ -72,25 +73,26 @@
|
||||
</el-input>
|
||||
<el-button icon="el-icon-close" type="text"
|
||||
style="color:red;margin-left:10px"
|
||||
@click="deloption(item, uitem, index, uindex)"></el-button>
|
||||
@click.stop="deloption(item, uitem, index, uindex)"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-button size="medium" icon="el-icon-plus" type="text"
|
||||
@click="addoption(item)">添加选项</el-button>
|
||||
@click.stop="addoption(item)">添加选项</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '多选题'" class="item">
|
||||
<div v-if="item.questionname == '多选题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click="delquestion(item, index)">
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入内容" v-model="item.title" clearable>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
@ -102,25 +104,26 @@
|
||||
</el-input>
|
||||
<el-button icon="el-icon-close" type="text"
|
||||
style="color:red;margin-left:10px"
|
||||
@click="deloption(item, uitem, index, uindex)"></el-button>
|
||||
@click.stop="deloption(item, uitem, index, uindex)"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-button size="medium" icon="el-icon-plus" type="text"
|
||||
@click="addoption(item)">添加选项</el-button>
|
||||
@click.stop="addoption(item)">添加选项</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '填空题'" class="item">
|
||||
<div v-if="item.questionname == '填空题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click="delquestion(item, index)">
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入内容" v-model="item.title" clearable>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options" style="align-items:center">
|
||||
@ -131,6 +134,241 @@
|
||||
<div class="more">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '打分题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<el-select v-model="item.optionNumber" placeholder="请选择"
|
||||
@change="selectchange($event, item)" style="padding-left:10px">
|
||||
<el-option v-for="item in optionlist" :key="item.value"
|
||||
:label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-radio-group>
|
||||
<el-radio :label="1" disabled v-if="optionNumber > 0">1</el-radio>
|
||||
<el-radio :label="2" disabled v-if="optionNumber > 1">2</el-radio>
|
||||
<el-radio :label="3" disabled v-if="optionNumber > 2">3</el-radio>
|
||||
<el-radio :label="4" disabled v-if="optionNumber > 3">4</el-radio>
|
||||
<el-radio :label="5" disabled v-if="optionNumber > 4">5</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '组合单选题'" class="item">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title" style="width:85%">
|
||||
<span>标题: </span>
|
||||
<el-input placeholder="请输入标题" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
|
||||
@click.stop="selectquestion(aitem, index, item, aindex)">
|
||||
<div class="questionname" style="padding-top:0">
|
||||
{{ aindex + 1 }}. {{ aitem.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<div v-for="(uitem, uindex) in aitem.options" :key="uindex"
|
||||
style="display:flex">
|
||||
<el-input placeholder="请输入内容" v-model="uitem.optionname" clearable>
|
||||
</el-input>
|
||||
<el-button icon="el-icon-close" type="text"
|
||||
style="color:red;margin-left:10px"
|
||||
@click.stop="deloption(aitem, uitem, aindex, uindex)"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-button size="medium" icon="el-icon-plus" type="text"
|
||||
@click.stop="addoption(aitem)">添加选项</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '组合多选题'" class="item">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title" style="width:85%">
|
||||
<span>标题: </span>
|
||||
<el-input placeholder="请输入标题" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
|
||||
@click.stop="selectquestion(aitem, index, item, aindex)">
|
||||
<div class="questionname" style="padding-top:0">
|
||||
{{ aindex + 1 }}. {{ aitem.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<div v-for="(uitem, uindex) in aitem.options" :key="uindex"
|
||||
style="display:flex">
|
||||
<el-input placeholder="请输入内容" v-model="uitem.optionname" clearable>
|
||||
</el-input>
|
||||
<el-button icon="el-icon-close" type="text"
|
||||
style="color:red;margin-left:10px"
|
||||
@click.stop="deloption(aitem, uitem, aindex, uindex)"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-button size="medium" icon="el-icon-plus" type="text"
|
||||
@click.stop="addoption(aitem)">添加选项</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '组合填空题'" class="item">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title" style="width:85%">
|
||||
<span>标题: </span>
|
||||
<el-input placeholder="请输入标题" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
|
||||
@click.stop="selectquestion(aitem, index, item, aindex)">
|
||||
<div class="questionname" style="padding-top:0">
|
||||
{{ aindex + 1 }}. {{ aitem.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options" style="align-items:center">
|
||||
<span>回答: </span>
|
||||
<el-input style="margin:0;width:300px" v-model="aitem.option" disabled
|
||||
placeholder="填写问卷时,用户需要在此输入答案" />
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-button size="medium" icon="el-icon-plus" type="text"
|
||||
@click.stop="addoption(aitem)">添加选项</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '组合打分题'" class="item">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title" style="width:85%">
|
||||
<span>标题: </span>
|
||||
<el-input placeholder="请输入标题" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-for="(aitem, aindex) in item.list" :key="aitem.id" class="combination"
|
||||
@click.stop="selectquestion(aitem, index, item, aindex)">
|
||||
<div class="questionname" style="padding-top:0">
|
||||
{{ aindex + 1 }}. {{ aitem.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="aitem.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<el-select v-model="aitem.optionNumber" placeholder="请选择"
|
||||
@change="selectchange($event, aitem)" style="padding-left:10px">
|
||||
<el-option v-for="yitem in optionlist" :key="yitem.value"
|
||||
:label="yitem.label" :value="yitem.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-radio-group>
|
||||
<el-radio :label="1" disabled v-if="aitem.optionNumber > 0">1</el-radio>
|
||||
<el-radio :label="2" disabled v-if="aitem.optionNumber > 1">2</el-radio>
|
||||
<el-radio :label="3" disabled v-if="aitem.optionNumber > 2">3</el-radio>
|
||||
<el-radio :label="4" disabled v-if="aitem.optionNumber > 3">4</el-radio>
|
||||
<el-radio :label="5" disabled v-if="aitem.optionNumber > 4">5</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '日期填空题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options" style="align-items:center">
|
||||
<span>回答: </span>
|
||||
<el-input style="" v-model="item.option" disabled prefix-icon="el-icon-date"
|
||||
placeholder="填写问卷时,用户在此选择日期" />
|
||||
</div>
|
||||
<div class="more">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.questionname == '时间填空题'" class="item"
|
||||
@click.stop="selectquestion(item, index)">
|
||||
<img src="@/assets/system/yidong.png" alt="" class="delicon yidong">
|
||||
<img src="@/assets/system/gb.png" alt="" class="delicon"
|
||||
@click.stop="delquestion(item, index)">
|
||||
<div class="questionname">
|
||||
{{ index + 1 }}. {{ item.questionname }}
|
||||
</div>
|
||||
<div class="title">
|
||||
<span>题目: </span>
|
||||
<el-input placeholder="请输入题目" v-model="item.title" clearable>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="options" style="align-items:center">
|
||||
<span>回答: </span>
|
||||
<el-input style="" v-model="item.option" disabled prefix-icon="el-icon-time"
|
||||
placeholder="填写问卷时,用户在此选择时间" />
|
||||
</div>
|
||||
<div class="more">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
@ -140,23 +378,71 @@
|
||||
<div class="totalscore-title">
|
||||
总分:0分
|
||||
</div>
|
||||
<div class="text">计分方式</div>
|
||||
<div class="introduce">根据多少道题平均分数</div>
|
||||
<div class="totalscore-title" style="font-size:14px">
|
||||
Q{{ questionitem.index + 1 }}
|
||||
<span
|
||||
v-if="questionitem.type == 'danxuans' || questionitem.type == 'duoxuans' || questionitem.type == 'tiankongs' || questionitem.type == 'duoxuans' || questionitem.type == 'dafens'">
|
||||
- {{ questionitem.aindex + 1 }}
|
||||
</span>: 整题分值设置
|
||||
</div>
|
||||
<div class="text">是否计分
|
||||
<el-switch v-model="questionitem.whetherScore" :disabled="questionitem.disabled"
|
||||
@change="changeswitch">
|
||||
</el-switch>
|
||||
</div>
|
||||
<div class="text" style="border:none">计分方式</div>
|
||||
<div class="introduce">
|
||||
<el-select v-model="questionitem.scoringMethod" placeholder="请选择计分方式" clearable style="width:200px"
|
||||
disabled>
|
||||
<el-option v-for="dict in dict.type.scoring_method" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div v-if="questionitem.scoringMethod == 'NOT_UNIQUE_ANSWER' && questionitem.whetherScore">
|
||||
<div class="text" style="border:none">各选项分值
|
||||
</div>
|
||||
<div v-for="item in questionitem.options" :key="item.optionid" class="optionitem">
|
||||
<div class="optionname">
|
||||
{{ item.optionname }}
|
||||
</div>
|
||||
<el-input-number v-model="item.optionScore" :min="0" :max="100"
|
||||
:controls="false"></el-input-number>
|
||||
<span style="padding-left:10px">
|
||||
分
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="questionitem.scoringMethod == 'UNIQUE_ANSWER' && questionitem.whetherScore">
|
||||
<div class="text" style="border:none">本题答案及答案分值
|
||||
</div>
|
||||
<div v-for="item in questionitem.options" :key="item.optionid" class="optionitem">
|
||||
<div class="optionname">
|
||||
<el-checkbox v-model="item.checked" :label="item.optionname"></el-checkbox>
|
||||
</div>
|
||||
<el-input-number v-model="item.optionScore" :min="0" :max="100" :controls="false"
|
||||
:disabled="!item.checked"></el-input-number>
|
||||
<span style="padding-left:10px">
|
||||
分
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import draggable from 'vuedraggable'
|
||||
export default {
|
||||
name: "addQuestionnaire",
|
||||
dicts: ['scoring_method'],
|
||||
components: {
|
||||
draggable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 99999999999,
|
||||
optionid: 99,
|
||||
otherQuestiontypes: [
|
||||
{
|
||||
id: 'riqi',
|
||||
@ -213,8 +499,29 @@ export default {
|
||||
src: require('@/assets/system/dafen.png')
|
||||
},
|
||||
],
|
||||
//题目arr
|
||||
questionlist: [],
|
||||
id: 99999999999,
|
||||
//打分题选项
|
||||
optionlist: [{
|
||||
value: 2,
|
||||
label: '2'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '3'
|
||||
}, {
|
||||
value: 4,
|
||||
label: '4'
|
||||
}, {
|
||||
value: 5,
|
||||
label: '5'
|
||||
}],
|
||||
//选择的题目list
|
||||
questionitem: {
|
||||
scoringMethod: '',
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
index: -1,
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -223,12 +530,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
addquestion(item) {
|
||||
this.id++
|
||||
if (this.questionlist.length > 0) {
|
||||
if (this.questionlist[this.questionlist.length - 1].title == '') {
|
||||
return this.$message.error('请填写完在继续添加');
|
||||
}
|
||||
}
|
||||
this.id++
|
||||
if (item.id == 'danxuan') {
|
||||
this.questionlist.push({
|
||||
type: 'danxuan',
|
||||
@ -236,10 +543,19 @@ export default {
|
||||
questionname: '单选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
}]
|
||||
optionScore: 0,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
})
|
||||
} else if (item.id == 'duoxuan') {
|
||||
this.questionlist.push({
|
||||
@ -248,10 +564,21 @@ export default {
|
||||
questionname: '多选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
checked: false,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionScore: 0,
|
||||
optionname: '',
|
||||
}]
|
||||
checked: false,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
})
|
||||
} else if (item.id == 'tiankong') {
|
||||
this.questionlist.push({
|
||||
@ -260,17 +587,258 @@ export default {
|
||||
questionname: '填空题',
|
||||
title: '',
|
||||
option: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
})
|
||||
} else if (item.id == 'dafen') {
|
||||
this.questionlist.push({
|
||||
type: 'dafen',
|
||||
optionNumber: undefined,
|
||||
id: this.id,
|
||||
questionname: '打分题',
|
||||
title: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
options: [],
|
||||
})
|
||||
} else if (item.id == 'danxuans') {
|
||||
this.questionlist.push({
|
||||
title: '',
|
||||
questionname: '组合单选题',
|
||||
type: 'danxuans',
|
||||
id: this.id++,
|
||||
list: [
|
||||
{
|
||||
type: 'danxuans',
|
||||
id: this.id++,
|
||||
questionname: '单选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
}, {
|
||||
type: 'danxuans',
|
||||
id: this.id++,
|
||||
questionname: '单选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
},
|
||||
],
|
||||
})
|
||||
} else if (item.id == 'duoxuans') {
|
||||
this.questionlist.push({
|
||||
title: '',
|
||||
questionname: '组合多选题',
|
||||
type: 'duoxuans',
|
||||
id: this.id++,
|
||||
list: [
|
||||
{
|
||||
type: 'duoxuans',
|
||||
id: this.id++,
|
||||
questionname: '多选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
checked: false,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionScore: 0,
|
||||
optionname: '',
|
||||
checked: false,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
}, {
|
||||
type: 'duoxuans',
|
||||
id: this.id++,
|
||||
questionname: '多选题',
|
||||
title: '',
|
||||
options: [{
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
checked: false,
|
||||
}, {
|
||||
optionid: ++this.optionid,
|
||||
optionScore: 0,
|
||||
optionname: '',
|
||||
checked: false,
|
||||
}],
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
},
|
||||
],
|
||||
})
|
||||
} else if (item.id == 'tiankongs') {
|
||||
this.questionlist.push({
|
||||
title: '',
|
||||
questionname: '组合填空题',
|
||||
type: 'tiankongs',
|
||||
id: this.id++,
|
||||
list: [
|
||||
{
|
||||
type: 'tiankongs',
|
||||
id: this.id++,
|
||||
questionname: '填空题',
|
||||
title: '',
|
||||
option: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
}, {
|
||||
type: 'tiankongs',
|
||||
id: this.id++,
|
||||
questionname: '填空题',
|
||||
title: '',
|
||||
option: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
} else if (item.id == 'dafens') {
|
||||
this.questionlist.push({
|
||||
title: '',
|
||||
questionname: '组合打分题',
|
||||
type: 'dafens',
|
||||
id: this.id++,
|
||||
list: [
|
||||
{
|
||||
type: 'dafens',
|
||||
id: this.id++,
|
||||
questionname: '打分题',
|
||||
optionNumber: undefined,
|
||||
title: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
options: [],
|
||||
}, {
|
||||
type: 'dafens',
|
||||
id: this.id++,
|
||||
optionNumber: undefined,
|
||||
questionname: '打分题',
|
||||
title: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
options: [],
|
||||
},
|
||||
],
|
||||
})
|
||||
} else if (item.id == 'riqi') {
|
||||
this.questionlist.push({
|
||||
type: 'riqi',
|
||||
id: this.id++,
|
||||
questionname: '日期填空题',
|
||||
title: '',
|
||||
option: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
})
|
||||
} else if (item.id == 'shijian') {
|
||||
this.questionlist.push({
|
||||
type: 'shijian',
|
||||
id: this.id++,
|
||||
questionname: '时间填空题',
|
||||
title: '',
|
||||
option: '',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
})
|
||||
}
|
||||
if (this.questionlist.length == 1) {
|
||||
this.questionitem = this.questionlist[0]
|
||||
this.questionitem.index = 0
|
||||
if (item.id == 'danxuans' || item.id == 'duoxuans' || item.id == 'tiankongs' || item.id == 'dafens') {
|
||||
this.questionitem = this.questionlist[0].list[0]
|
||||
this.questionitem.index = 0
|
||||
this.questionitem.aindex = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
selectquestion(item, index, topitem, aindex) {
|
||||
this.questionitem = item
|
||||
this.questionitem.index = index
|
||||
if (this.questionitem.type == 'danxuans' || this.questionitem.type == 'duoxuans' || this.questionitem.type == 'tiankongs' || this.questionitem.type == 'dafens') {
|
||||
this.questionitem.aindex = aindex
|
||||
}
|
||||
},
|
||||
delquestion(item, index) {
|
||||
if (this.questionlist.length == 1) {
|
||||
this.$message.error('请保留一条题目!');
|
||||
return
|
||||
}
|
||||
if (this.questionitem.id == this.questionlist[index].id) {
|
||||
this.questionlist.splice(index, 1)
|
||||
let index = 0
|
||||
this.questionlist.forEach(e => {
|
||||
e.index = index++
|
||||
})
|
||||
this.questionitem = this.questionlist[0]
|
||||
this.questionitem.index = 0
|
||||
} else {
|
||||
this.questionlist.splice(index, 1)
|
||||
let index = 0
|
||||
this.questionlist.forEach(e => {
|
||||
e.index = index++
|
||||
})
|
||||
}
|
||||
},
|
||||
addoption(item) {
|
||||
if (item.options.length == 6) {
|
||||
return this.$message.error('多选最多为六个选项!');
|
||||
}
|
||||
item.options.push({
|
||||
optionid: ++this.optionid,
|
||||
optionname: '',
|
||||
optionScore: 0,
|
||||
checked: false,
|
||||
})
|
||||
},
|
||||
delquestion(item, index) {
|
||||
this.questionlist.splice(index, 1)
|
||||
},
|
||||
deloption(item, uitem, index, uindex) {
|
||||
if (item.options.length > 2) {
|
||||
item.options.splice(uindex, 1)
|
||||
@ -278,6 +846,32 @@ export default {
|
||||
this.$message.error('最少保留两条选项!');
|
||||
}
|
||||
},
|
||||
changeswitch(e) {
|
||||
if (e) {
|
||||
if (this.questionitem.type == 'danxuan' || this.questionitem.type == 'dafen' || this.questionitem.type == 'dafens' || this.questionitem.type == 'danxuans') {
|
||||
this.questionitem.scoringMethod = 'NOT_UNIQUE_ANSWER'
|
||||
} else if (this.questionitem.type == 'duoxuan' || this.questionitem.type == 'duoxuans') {
|
||||
this.questionitem.scoringMethod = 'UNIQUE_ANSWER'
|
||||
}
|
||||
} else {
|
||||
this.questionitem.scoringMethod = ''
|
||||
}
|
||||
},
|
||||
selectchange(e, item) {
|
||||
item.options = []
|
||||
for (var i = 0; i < e; i++) {
|
||||
item.options.push({
|
||||
optionid: ++this.optionid,
|
||||
optionname: i + 1,
|
||||
optionScore: 0,
|
||||
checked: false,
|
||||
})
|
||||
}
|
||||
},
|
||||
//保存
|
||||
upload() {
|
||||
console.log(this.questionlist)
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -321,6 +915,7 @@ export default {
|
||||
}
|
||||
|
||||
.questionitem {
|
||||
padding-bottom: 1px;
|
||||
border-radius: 5px;
|
||||
margin: 40px auto;
|
||||
background-color: #fff;
|
||||
@ -328,6 +923,14 @@ export default {
|
||||
width: 100%;
|
||||
margin: 20px auto;
|
||||
|
||||
.combination {
|
||||
border-radius: 5px;
|
||||
padding-top: 25px;
|
||||
width: 90%;
|
||||
margin: 30px auto;
|
||||
box-shadow: 0 0px 6px 3px rgba(162, 162, 162, 0.5);
|
||||
}
|
||||
|
||||
.more {
|
||||
display: flex;
|
||||
border-radius: 5px;
|
||||
@ -348,17 +951,19 @@ export default {
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
line-height: 35px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
padding-left: 10px;
|
||||
margin-left: 10px !important;
|
||||
display: block;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
width: 400px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-bottom: 14px;
|
||||
margin: 0;
|
||||
width: 300px
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,10 +993,33 @@ export default {
|
||||
}
|
||||
|
||||
.totalScore {
|
||||
width: calc(20% - 30px);
|
||||
margin-left: 30px;
|
||||
width: 20%;
|
||||
margin-left: 20px;
|
||||
height: 790px;
|
||||
background: #FFFFFF;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden !important;
|
||||
|
||||
.optionitem {
|
||||
width: 80%;
|
||||
height: 36px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
|
||||
.optionname {
|
||||
width: 50%;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
::v-deep .el-input-number {
|
||||
width: 56px;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 16px;
|
||||
@ -399,6 +1027,8 @@ export default {
|
||||
line-height: 30px;
|
||||
width: calc(100% - 60px);
|
||||
margin: 20px auto 0;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #E2E2E2;
|
||||
}
|
||||
|
||||
.introduce {
|
||||
@ -407,6 +1037,7 @@ export default {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 30px;
|
||||
padding-bottom: 10px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #E2E2E2;
|
||||
}
|
||||
@ -421,7 +1052,7 @@ export default {
|
||||
}
|
||||
|
||||
.questionnairedetails {
|
||||
padding-left: 60px;
|
||||
padding-left: 30px;
|
||||
width: calc(60% - 30px);
|
||||
overflow: scroll;
|
||||
overflow-x: hidden !important;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user