Commit c57cdded authored by 黄奎's avatar 黄奎

页面修改

parent 495da70e
...@@ -84,13 +84,13 @@ export function CreateQuestion(questionKey) { ...@@ -84,13 +84,13 @@ export function CreateQuestion(questionKey) {
Name: "A", Name: "A",
Content: "" Content: ""
}]; }];
var array2 = [{ var array3 = [{
Name: "1", Name: "1",
Content: "A" Content: "A"
}]; }];
AnswerList.push(array1); AnswerList.push(array1);
AnswerList.push(array2); AnswerList.push(array2);
AnswerList.push(array2); AnswerList.push(array3);
break; break;
//排序题 //排序题
case "sorting-problem": case "sorting-problem":
......
<!--连线题--> <!--连线题-->
<style> <style>
.matchingQuestion{ .matchingQuestion {
width:100%; width: 100%;
} }
.team_tit { .team_tit {
display:inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
color: #A8A8B3; color: #A8A8B3;
padding-bottom: 20px; padding-bottom: 20px;
margin-left:13px; margin-left: 13px;
} }
.line_center{
.line_center {
display: inline-block; display: inline-block;
width: 28px; width: 28px;
height: 10px; height: 10px;
border-top: 1px solid #E1E1E5; border-top: 1px solid #E1E1E5;
margin: 13px 12px 0 0; margin: 13px 12px 0 0;
} }
.selectBox2 { .selectBox2 {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
...@@ -33,6 +36,7 @@ ...@@ -33,6 +36,7 @@
color: #181E33; color: #181E33;
outline: none; outline: none;
} }
</style> </style>
<template> <template>
<div class="matchingQuestion"> <div class="matchingQuestion">
...@@ -48,7 +52,6 @@ ...@@ -48,7 +52,6 @@
</td> </td>
<td style="width:40px;text-align:center;"> <td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(0,index)"></i> <i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(0,index)"></i>
<!-- <a style="cursor:pointer;" @click="deleteOpion(0,index)">删除</a> -->
</td> </td>
</tr> </tr>
<tfoot> <tfoot>
...@@ -78,7 +81,7 @@ ...@@ -78,7 +81,7 @@
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<a class="addTiMuList" style="margin-left:13px;" @click="addOption(0)"> <a class="addTiMuList" style="margin-left:13px;" @click="addOption(1)">
<i class="iconfont icon-add"></i>添加更多 <i class="iconfont icon-add"></i>添加更多
</a> </a>
</td> </td>
...@@ -87,7 +90,7 @@ ...@@ -87,7 +90,7 @@
</table> </table>
<span class="team_tit">答案</span> <span class="team_tit">答案</span>
<table v-if="data&&data.length>2" style="padding-left:13px;"> <table v-if="data&&data.length>2" style="padding-left:13px;">
<tr v-for="(item,index) in data[2]"> <tr v-for="(item,index) in data[0]">
<td style="width:30px;"> <td style="width:30px;">
{{item.Name}} {{item.Name}}
</td> </td>
...@@ -95,7 +98,7 @@ ...@@ -95,7 +98,7 @@
<span class="line_center"></span> <span class="line_center"></span>
</td> </td>
<td> <td>
<select v-model="item.Content" class="selectBox2"> <select v-model="data[2][index].Content" class="selectBox2">
<template v-for="(cItem,cIndex) in data[1]"> <template v-for="(cItem,cIndex) in data[1]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name"> <option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option> </option>
...@@ -128,8 +131,8 @@ ...@@ -128,8 +131,8 @@
initialFrameHeight: 80, initialFrameHeight: 80,
}, },
optionTitleList: [], optionTitleList: [],
commonIndex:-1, commonIndex: -1,
commonIndex2:-1 commonIndex2: -1
}; };
}, },
computed: { computed: {
...@@ -144,6 +147,10 @@ ...@@ -144,6 +147,10 @@
}, },
//删除选项 //删除选项
deleteOpion(index, subIndex) { deleteOpion(index, subIndex) {
//删除第一组是,也删除答案里面的
if (index == 0) {
this.data[2].splice(subIndex, 1);
}
this.data[index].splice(subIndex, 1); this.data[index].splice(subIndex, 1);
this.calcOptionTitle(); this.calcOptionTitle();
}, },
...@@ -180,18 +187,18 @@ ...@@ -180,18 +187,18 @@
this.$emit('getChild', this.data); this.$emit('getChild', this.data);
}, },
//点击切换输入 //点击切换输入
changeEdit(index){ changeEdit(index) {
this.commonIndex=index; this.commonIndex = index;
this.commonIndex2=-1; this.commonIndex2 = -1;
}, },
changeEdit2(index){ changeEdit2(index) {
this.commonIndex2=index; this.commonIndex2 = index;
this.commonIndex=-1; this.commonIndex = -1;
} }
}, },
mounted() { mounted() {
console.log(this.data,'data'); console.log(this.data, 'data');
}, },
watch: { watch: {
data: { data: {
handler(newValue) { handler(newValue) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment