|
@@ -18,6 +18,7 @@
|
18
|
18
|
<!-- filterable可搜索 multiple可多选 default-first-option回车可选-->
|
19
|
19
|
<el-select
|
20
|
20
|
v-model="form.rightAnswer"
|
|
21
|
+ style="width:100%"
|
21
|
22
|
multiple
|
22
|
23
|
filterable
|
23
|
24
|
default-first-option
|
|
@@ -172,19 +173,19 @@ export default {
|
172
|
173
|
},
|
173
|
174
|
onSubmit() {
|
174
|
175
|
if (this.form.title && this.form.optType) {
|
175
|
|
- this.form.gameId = this.gameId
|
|
176
|
+ const data = { ...this.form }
|
|
177
|
+ data.gameId = this.gameId
|
176
|
178
|
if (this.questionId) {
|
177
|
|
- if (this.form.rightAnswer) {
|
178
|
|
- this.form.rightAnswer = this.form.rightAnswer.toString()
|
|
179
|
+ if (data.rightAnswer) {
|
|
180
|
+ data.rightAnswer = data.rightAnswer.toString()
|
179
|
181
|
}
|
180
|
|
- UpdateQuestion(this.form, this.questionId).then((res) => {
|
|
182
|
+ UpdateQuestion(data, this.questionId).then((res) => {
|
181
|
183
|
this.$message('修改问题成功')
|
182
|
184
|
// 告诉父页面实例表需要刷新并且关闭当前组件
|
183
|
185
|
this.$emit('handleRefreshQuestion', true)
|
184
|
|
- this.form.rightAnswer = res.data.rightAnswer?.split(',')
|
185
|
186
|
})
|
186
|
187
|
} else {
|
187
|
|
- saveQuestion(this.form).then((res) => {
|
|
188
|
+ saveQuestion(data).then((res) => {
|
188
|
189
|
this.$message('添加问题成功')
|
189
|
190
|
// 告诉父页面实例表需要刷新并且关闭当前组件
|
190
|
191
|
this.$emit('handleRefreshQuestion', true)
|