提交 d664b55d authored 作者: matian's avatar matian

bug修改

上级 e8b2a703
<template>
<div>
<!-- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> -->
<el-form :disabled="!!($route.query.type === 'view')" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" >
<el-form
:disabled="!!($route.query.type === 'view')"
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="题库范围" prop="permission">
<el-radio v-model="ruleForm.permission" label="1">我的题库</el-radio>
<el-radio v-model="ruleForm.permission" label="2">公共题库</el-radio>
</el-form-item>
<el-form-item label="题目类型" prop="question_type">
<el-select :disabled="!!($route.query.id)" @change="questionTypeChange" v-model="ruleForm.question_type" placeholder="请选择活题目类型">
<el-select
:disabled="!!$route.query.id"
@change="questionTypeChange"
v-model="ruleForm.question_type"
placeholder="请选择活题目类型"
>
<el-option v-for="(item, index) in qType" :label="item.label" :value="item.value" :key="index"></el-option>
</el-select>
</el-form-item>
......@@ -55,7 +67,9 @@
</el-form-item>
<el-form-item>
<template v-if="$route.query.id">
<el-button v-if="$route.query.type == 'edit'" type="primary" @click="submitForm('ruleForm')">确认修改</el-button>
<el-button v-if="$route.query.type == 'edit'" type="primary" @click="submitForm('ruleForm')"
>确认修改</el-button
>
</template>
<template v-else>
<el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
......@@ -112,7 +126,7 @@ export default {
question_difficulty: [{ required: true, message: '请选择难度等级', trigger: 'change' }],
question_title: [{ required: true, message: '请填写题目标题', trigger: 'blur' }],
question_content: [{ required: true, message: '请填写题干内容', trigger: 'blur' }],
question_analysis: [{ required: true, message: '请填写题干内容', trigger: 'blur' }],
question_analysis: [{ required: false, message: '请填写题目解析', trigger: 'blur' }],
question_category: [{ required: true, message: '请选择试题分类', trigger: 'change' }],
knowledge_point: [{ required: true, message: '请输入题目知识点内容', trigger: 'blur' }],
question_options: [{ required: true, message: ' ', trigger: 'blur' }]
......@@ -150,7 +164,7 @@ export default {
})
}
} else {
console.log('error submit!!')
// console.log('error submit!!')
return false
}
})
......
......@@ -2,18 +2,31 @@
<app-card>
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template v-slot:radio-filter="{ params }">
<el-radio @change="refetchList" v-model="params.permission" :label=1>我的题库</el-radio>
<el-radio @change="refetchList" v-model="params.permission" :label=2>公共题库</el-radio>
<el-radio @change="refetchList" v-model="params.permission" :label="1">我的题库</el-radio>
<el-radio @change="refetchList" v-model="params.permission" :label="2">公共题库</el-radio>
</template>
<template v-slot:filter-category="{ params }">
<question-type-cascader v-model="params.question_category" @change="refetchList"></question-type-cascader>
</template>
<template v-slot:category_name="{ row }">
<p class="category_name">{{ row.question_category.name }}</p>
</template>
<template v-slot:question_title="{ row }">
<p class="category_name">{{ row.question_title }}</p>
</template>
<div class="operate-btn">
<el-button type="primary" icon="el-icon-plus" @click="$router.push({ path: '/question/create' })"
>新建试题</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="importDialogVisible = true">批量导入试题</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleDelete()">批量删除</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleDelete()"
:disabled="this.deleteQuestions.length === 0"
>批量删除</el-button
>
</div>
<template v-slot:table-x="{ row }">
<el-button type="text" @click="handleSettings(row)">编辑</el-button>
......@@ -34,7 +47,7 @@ export default {
data() {
return {
importDialogVisible: false, // 模板导入弹窗
deleteQuestions: [], // 批量删除
deleteQuestions: [], // 批量删除
treeDialogVisible: false, // tree弹窗
filterRadio: 1, // 题库筛选
filterInput: '', // tree回显内容
......@@ -133,21 +146,25 @@ export default {
},
columns: [
{ type: 'selection', minWidth: '50px', fixed: 'left' },
{ label: '序号', prop: 'order' },
{ label: '题目类型', prop: 'question_type' },
{ label: '试题分类', prop: 'question_category.category_name' },
{ label: '题目标题', prop: 'question_title' },
{ label: '序号', prop: 'order', width: 50 },
{ label: '题目类型', prop: 'question_type', width: 80 },
{
label: '试题分类',
prop: 'question_category.category_name',
slots: 'category_name',
width: 200
},
{ label: '题目标题', prop: 'question_title', width: 200, slots: 'question_title' },
// { label: '知识点', prop: 'knowledge_point.title' },
{ label: '等级难度', prop: 'question_difficulty' },
{ label: '等级难度', prop: 'question_difficulty', width: 80 },
{ label: '更新人', prop: 'operator.nickname' },
{ label: '更新时间', prop: 'updated_at' },
{ label: '操作', slots: 'table-x', align: 'right' }
{ label: '更新时间', prop: 'updated_at', width: 180 },
{ label: '操作', slots: 'table-x', align: 'right', width: 200 }
]
}
}
},
mounted() {
},
mounted() {},
methods: {
// 列表选择
handleSelectionChange(data) {
......@@ -204,4 +221,11 @@ export default {
height: 100%;
}
}
.category_name {
width: 200px;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论