提交 5e9dcb6d authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 87c3707c
...@@ -180,20 +180,13 @@ const handleEdit = function (type: number) { ...@@ -180,20 +180,13 @@ const handleEdit = function (type: number) {
// 添加 // 添加
function handleAddExamRule() { function handleAddExamRule() {
form.exam_rules.push({ id: '', exam_id: '', percent: undefined, is_auto_scoring: 1 }) form.exam_rules.push({ id: '0', exam_id: '', percent: undefined, is_auto_scoring: 1 })
} }
// 删除 // 删除
function handleRemoveExamRule(index: number) { function handleRemoveExamRule(index: number) {
form.exam_rules.splice(index, 1) form.exam_rules.splice(index, 1)
} }
function handleExamChange(id: string, row: any) {
const exam = examList.value.find((item: any) => item.id === id)
if (!exam) return
row.id = exam.id
row.exam_id = exam.exam_id
}
</script> </script>
<template> <template>
...@@ -223,8 +216,8 @@ function handleExamChange(id: string, row: any) { ...@@ -223,8 +216,8 @@ function handleExamChange(id: string, row: any) {
<el-table :data="form.exam_rules" row-key="id"> <el-table :data="form.exam_rules" row-key="id">
<el-table-column prop="name" width="170"> <el-table-column prop="name" width="170">
<template #default="{ row }"> <template #default="{ row }">
<el-select :modelValue="row.id" style="width: 100%" @change="data => handleExamChange(data, row)"> <el-select v-model="row.exam_id" style="width: 100%">
<el-option v-for="item in examList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in examList" :key="item.id" :label="item.name" :value="item.exam_id"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论