Skip to content

Commit 4280dae

Browse files
committed
创建或更新题目时,题目类型从后端获取
1 parent 74193af commit 4280dae

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed

passjava-portal/src/views/modules/question/question-add-or-update.vue

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
</el-form-item>
3030
<el-form-item label="题目类型" prop="type">
3131
<el-select v-model="dataForm.type" placeholder="请选择" @change="chooseType">
32-
<el-option v-for="item in types" :key="item.id" :label="item.comments" :value="item.id">
32+
<el-option v-for="item in types"
33+
:key="item.id"
34+
:label="item.comments"
35+
:value="item.id*1">
3336
<span style="float: left">{{ item.comments }}</span>
3437
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.type }}</span>
3538
</el-option>
@@ -57,31 +60,31 @@ export default {
5760
data() {
5861
return {
5962
types: [
60-
{
61-
id: 1,
62-
type: "javaBasic",
63-
comments: "Java基础"
64-
},
65-
{
66-
id: 2,
67-
type: "jvm",
68-
comments: "jvm虚拟机"
69-
},
70-
{
71-
id: 3,
72-
type: "spring",
73-
comments: "Spring核心原理"
74-
},
75-
{
76-
id: 4,
77-
type: "bigData",
78-
comments: "大数据"
79-
},
80-
{
81-
id: 5,
82-
type: "thread",
83-
comments: "多线程"
84-
}
63+
// {
64+
// id: 1,
65+
// type: "javaBasic",
66+
// comments: "Java基础"
67+
// },
68+
// {
69+
// id: 2,
70+
// type: "jvm",
71+
// comments: "jvm虚拟机"
72+
// },
73+
// {
74+
// id: 3,
75+
// type: "spring",
76+
// comments: "Spring核心原理"
77+
// },
78+
// {
79+
// id: 4,
80+
// type: "bigData",
81+
// comments: "大数据"
82+
// },
83+
// {
84+
// id: 5,
85+
// type: "thread",
86+
// comments: "多线程"
87+
// }
8588
],
8689
value: "",
8790
key: "",
@@ -93,7 +96,7 @@ export default {
9396
level: "",
9497
displayOrder: "",
9598
subTitle: "",
96-
type: "",
99+
type: 0,
97100
key: 0,
98101
enable: "",
99102
createTime: "",
@@ -178,6 +181,18 @@ export default {
178181
this.dataForm.updateTime = data.question.updateTime;
179182
}
180183
});
184+
185+
this.$http({
186+
url: this.$http.adornUrl(
187+
`/question/type/list`
188+
),
189+
method: "get",
190+
params: this.$http.adornParams()
191+
}).then(({ data }) => {
192+
if (data && data.code === 0) {
193+
this.types = data.page.list;
194+
}
195+
});
181196
}
182197
});
183198
},

0 commit comments

Comments
 (0)