提交 566f885b authored 作者: lihuihui's avatar lihuihui
......@@ -128,16 +128,18 @@ export default {
this.$message.warning('请选择考试时间')
return
}
const startTime = new Date(params.start_time)
const endTime = new Date(params.end_time)
if ((endTime - startTime) / 86400000 > 40) {
this.$message.warning('考试时间不能超过40天')
return
}
// const startTime = new Date(params.start_time)
// const endTime = new Date(params.end_time)
// const day = (endTime - startTime) / 86400000
// console.log(day)
// if ((endTime - startTime) / 86400000 >= 40) {
// this.$message.warning('考试时间不能超过40天')
// return
// }
this.$emit('getBaseInfo', params)
this.$parent.$parent.nextStep()
},
// 保存/更新基本信息
saveExamInfo() {
const params = {
id: this.exam_id,
......
<template>
<el-card>
<div class="finished_title">{{ params.name }}</div>
<div class="login_time item">登录时间段:{{ params.start_time }} - {{ params.start_time }}</div>
<div class="login_time item">登录时间段:{{ params.start_time }} - {{ params.end_time }}</div>
<div class="check_exam item">选择考试:{{ checkedPapers.toString() }}</div>
<div class="exam_setting item">
考试配置:<el-button v-show="configs.enabled_ip_limit === true">限定登录位置</el-button>
......
......@@ -7,7 +7,9 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="dialogVisible = true">考生导入</el-dropdown-item>
<el-dropdown-item>
<a href="https://webapp-pub.ezijing.com/qbs/student.xlsx" download="student.xlsx"
<a
href="https://webapp-pub.ezijing.com/qbs/%E5%AD%A6%E5%91%98%E6%A8%A1%E6%9D%BF.xlsx"
download="学员模板.xlsx"
>模版下载</a
></el-dropdown-item
>
......
......@@ -7,17 +7,17 @@
<el-step title="考试配置"></el-step>
<el-step title="考试配置"></el-step>
</el-steps>
<base-info data="" v-if="stepsIndex === 1" @getBaseInfo="getBaseInfo" :isEdit="isEdit" />
<base-info data="" v-show="stepsIndex === 1" @getBaseInfo="getBaseInfo" :isEdit="isEdit" />
<check-paper
v-if="stepsIndex === 2"
v-show="stepsIndex === 2"
@getCheckPaper="getCheckPaper"
@getCheckPaperList="getCheckPaperList"
:isEdit="isEdit"
/>
<personal-info v-if="stepsIndex === 3" @getInfo="getInfo" :isEdit="isEdit" />
<exam-setting v-if="stepsIndex === 4" @getExamConfig="getExamConfig" :isEdit="isEdit" />
<personal-info v-show="stepsIndex === 3" @getInfo="getInfo" :isEdit="isEdit" />
<exam-setting v-show="stepsIndex === 4" @getExamConfig="getExamConfig" :isEdit="isEdit" />
<finished
v-if="stepsIndex === 5"
v-show="stepsIndex === 5"
:params="params"
:configs="configs"
:checkedPaper="checkedPaper"
......
<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
}
})
......
......@@ -17,6 +17,16 @@
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<div style="text-align: center">
<a
href="https://webapp-pub.ezijing.com/qbs/%E8%AF%95%E9%A2%98%E6%A8%A1%E6%9D%BF.xlsx"
download="试题模板.xlsx"
style="color: #c01c40"
>
<i class="el-icon-download"></i>试题模板.xlsx</a
>
<!-- <a href="https://webapp-pub.oss-cn-beijing.aliyuncs.com/qbs/question.xlsx" :download="试题模版"></a> -->
</div>
<div style="text-align: center; margin-top: 15px">
<el-button size="mini" @click="cancel">取消</el-button>
<el-button type="primary" size="mini" @click="submitUpload" style="margin-right: 5px"> 确认提交</el-button>
</div>
......
......@@ -24,6 +24,16 @@ const routes = [
path: 'classify',
component: () => import('./views/Classify.vue'),
meta: { title: '题库分类' }
},
{
path: 'questionDetail',
component: () => import('./views/Create.vue'),
meta: { title: '试题详情' }
},
{
path: 'editQuestion',
component: () => import('./views/Create.vue'),
meta: { title: '编辑试题' }
}
]
}
......
......@@ -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) {
......@@ -171,11 +188,11 @@ export default {
},
// 查看
handleView(row) {
this.$router.push({ path: '/question/create', query: { id: row.id, type: 'view' } })
this.$router.push({ path: '/question/questionDetail', query: { id: row.id, type: 'view' } })
},
// 编辑
handleSettings(row) {
this.$router.push({ path: '/question/create', query: { id: row.id, type: 'edit' } })
this.$router.push({ path: '/question/editQuestion', query: { id: row.id, type: 'edit' } })
},
radioChange() {
this.$refs.list.refetch()
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论