|
@@ -3,10 +3,11 @@
|
3
|
3
|
<q-title v-bind="qTitleContent"></q-title>
|
4
|
4
|
<div style="margin-top:3em;">
|
5
|
5
|
<div class="scroll">
|
6
|
|
- <div v-for="answer in question.answerList" :key="answer.answerId">
|
7
|
|
- <TextAreas v-if="answer.questionType=='textarea'" />
|
|
6
|
+ <div v-if="types=='textarea'">
|
|
7
|
+ <textarea @input="handleTextArea"></textarea>
|
|
8
|
+ </div>
|
|
9
|
+ <div v-else v-for="answer in question.answerList" :key="answer.answerId">
|
8
|
10
|
<answer
|
9
|
|
- v-else
|
10
|
11
|
:active="values.includes(answer.optCode)"
|
11
|
12
|
:option="answer.optCode"
|
12
|
13
|
:label="answer.content"
|
|
@@ -23,8 +24,8 @@ export default {
|
23
|
24
|
name: 'Question',
|
24
|
25
|
components: {
|
25
|
26
|
Answer: () => import('./Answer.vue'),
|
26
|
|
- QTitle: () => import('./Title.vue'),
|
27
|
|
- TextAreas: () => import('./TextAreas.vue')
|
|
27
|
+ QTitle: () => import('./Title.vue')
|
|
28
|
+ // TextAreas: () => import('./TextAreas.vue')
|
28
|
29
|
},
|
29
|
30
|
props: {
|
30
|
31
|
value: {
|
|
@@ -54,7 +55,7 @@ export default {
|
54
|
55
|
computed: {
|
55
|
56
|
qTitleContent() {
|
56
|
57
|
return {
|
57
|
|
- serialNo: this.question.sortNo + 1,
|
|
58
|
+ serialNo: this.question.sortNo,
|
58
|
59
|
title: this.question.content,
|
59
|
60
|
qType: this.question.questionType
|
60
|
61
|
}
|
|
@@ -67,12 +68,16 @@ export default {
|
67
|
68
|
},
|
68
|
69
|
|
69
|
70
|
methods: {
|
|
71
|
+ handleTextArea(e) {
|
|
72
|
+ // console.log(e.target.value)
|
|
73
|
+ this.handleAnswer(e.target.value)
|
|
74
|
+ },
|
70
|
75
|
handleAnswer(opt) {
|
71
|
76
|
console.log('🚀 ~ file: index.vue ~ line 68 ~ handleAnswer ~ opt', opt)
|
72
|
77
|
const isChecked = this.values.includes(opt)
|
73
|
78
|
|
74
|
79
|
// 如果是多选
|
75
|
|
- if (this.question.optType === 'checkBox') {
|
|
80
|
+ if (this.question.questionType === 'checkBox') {
|
76
|
81
|
if (isChecked) {
|
77
|
82
|
this.$emit(
|
78
|
83
|
'input',
|
|
@@ -106,6 +111,16 @@ export default {
|
106
|
111
|
width: 100%;
|
107
|
112
|
height: 46vh;
|
108
|
113
|
overflow: auto;
|
|
114
|
+ div {
|
|
115
|
+ width: 93%;
|
|
116
|
+ > textarea {
|
|
117
|
+ width: 100%;
|
|
118
|
+ height: 20vh;
|
|
119
|
+ border: 1px solid rgb(192, 191, 191);
|
|
120
|
+ padding: 5px 8px;
|
|
121
|
+ font-size: 14px;
|
|
122
|
+ }
|
|
123
|
+ }
|
109
|
124
|
}
|
110
|
125
|
}
|
111
|
126
|
</style>
|