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

updates

上级 9fe2e086
...@@ -4,6 +4,7 @@ module.exports = { ...@@ -4,6 +4,7 @@ module.exports = {
}, },
extends: ['plugin:vue/essential', 'standard'], extends: ['plugin:vue/essential', 'standard'],
rules: { rules: {
'vue/no-mutating-props': 'off', // 暂时关闭
'vue/comment-directive': 'off', 'vue/comment-directive': 'off',
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'space-before-function-paren': 'off' 'space-before-function-paren': 'off'
......
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
} }
.app-card-hd { .app-card-hd {
display: flex; display: flex;
align-items: flex-start;
} }
.app-card-hd__title { .app-card-hd__title {
flex: 1; flex: 1;
......
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
// 翻页参数设置 // 翻页参数设置
if (this.hasPagination) { if (this.hasPagination) {
params.page = this.page.currentPage.toString() params.page = this.page.currentPage.toString()
params.page_size = this.page.size.toString() params.limit = this.page.size.toString()
} }
// 接口请求之前 // 接口请求之前
if (beforeRequest) { if (beforeRequest) {
......
import httpRequest from '@/utils/axios' import httpRequest from '@/utils/axios'
/**
* 获取知识点/标签
*/
export function getKnowledge(params) {
return httpRequest.get('/admin/v1/knowledge-point/search/x1', { params })
}
/** /**
* 获取试卷列表 * 获取试卷列表
*/ */
...@@ -34,9 +28,45 @@ export function getPaper(params) { ...@@ -34,9 +28,45 @@ export function getPaper(params) {
return httpRequest.get(`/api/qbs/admin/v1/question-paper/${params.id}`, { params }) return httpRequest.get(`/api/qbs/admin/v1/question-paper/${params.id}`, { params })
} }
/**
* 删除试卷
*/
export function batchDeletePaper(data) {
return httpRequest.post('/api/qbs/admin/v1/question-paper/batch-delete', data)
}
/**
* 获取试题列表
*/
export function getQuestionList(params) {
return httpRequest.get('/api/qbs/admin/v1/questions', { params })
}
/**
* 批量获取试题列表
*/
export function batchGetQuestionList(data) {
return httpRequest.post('/api/qbs/admin/v1/questions/batch', data)
}
/**
* 设置组题规则
* 添加试题和设置试题分数
*/
export function updatePaperRules(data) {
return httpRequest.post(`/api/qbs/admin/v1/question-paper/rules/${data.id}`, data)
}
/** /**
* 获取试卷分类 * 获取试卷分类
*/ */
export function getPaperCategory(params) { export function getPaperCategory(params) {
return httpRequest.get(`/api/qbs/admin/v1/question-category/tree/${params.project_prefix}`, { params }) return httpRequest.get(`/api/qbs/admin/v1/question-category/tree/${params.project_prefix}`, { params })
} }
/**
* 获取知识点/标签
*/
export function getKnowledge(params) {
return httpRequest.get('/admin/v1/knowledge-point/search/x1', { params })
}
<template> <template>
<el-dialog v-bind="$attrs" v-on="$listeners" :modal="false" width="20%"> <el-dialog title="批量设置分数" v-bind="$attrs" v-on="$listeners" append-to-body width="400px">
<el-form> <el-form>
<el-form-item>单选题</el-form-item> <el-form-item>单选题</el-form-item>
<el-form-item>数量:8</el-form-item> <el-form-item>数量:8</el-form-item>
......
<template>
<div>
<el-row :gutter="20" style="margin-top: 20px">
<!-- 试题列表 -->
<el-col :span="18">
<app-card title="试题列表">
<template #header-aside>
<el-button type="primary" @click="handleAdd">添加试题</el-button>
<el-button type="primary" @click="handleRemove">删除选中试题</el-button>
</template>
<question-list :list="questions">
<template v-slot:selection="item">
<el-checkbox @change="handleSelectionChange(arguments[0], item)"></el-checkbox>
</template>
</question-list>
</app-card>
</el-col>
<!-- 试题序号 -->
<el-col :span="6">
<question-num :list="questions">
<template #footer>
<el-button type="primary" @click="handleSubmit">保存试卷</el-button>
</template>
</question-num>
</el-col>
</el-row>
<!-- 选题组卷 -->
<template v-if="data.paper_type === 1">
<addPaper :visible.sync="visible" :data="data" @update="handelUpdate" v-if="visible" />
</template>
<!-- 自动组卷 -->
<template v-if="data.paper_type === 2">
<AutomaticPaper :visible.sync="visible" :data="data" @update="handelUpdate" v-if="visible" />
</template>
</div>
</template>
<script>
import QuestionList from './QuestionList.vue'
import QuestionNum from './QuestionNum.vue'
import AddPaper from './AddPaper.vue'
import AutomaticPaper from './AutomaticPaper.vue'
import { updatePaperRules } from '../api.js'
export default {
props: {
data: { type: Object, default: () => ({}) }
},
components: { QuestionList, QuestionNum, AddPaper, AutomaticPaper },
data() {
return {
visible: false,
questions: [],
multipleSelection: [] // 选择项
}
},
watch: {
data: {
immediate: true,
handler(data) {
this.questions = data.questions || []
}
}
},
computed: {},
methods: {
// 增加试题
handleAdd() {
this.visible = true
},
handleSelectionChange(checked, data) {
if (checked) {
this.multipleSelection.push(data.id)
} else {
this.multipleSelection = this.multipleSelection.filter(id => id !== data.id)
}
},
// 删除选中试题
handleRemove() {
this.questions = this.questions.filter(item => !this.multipleSelection.includes(item.id))
},
// 保存试卷
handleSubmit() {
const rules = []
this.questions.forEach(question => {
rules.push({ id: question.id, score: question.score || 0 })
if (question.children && question.children.length) {
question.children.forEach(question => {
rules.push({ id: question.id, score: question.score || 0 })
})
}
})
const parmas = { id: this.data.id, rules }
updatePaperRules(parmas).then(res => {
this.$message.success('保存成功')
})
},
// 更新详情数据
handelUpdate() {
this.$emit('update')
}
}
}
</script>
<template>
<el-card style="margin-bottom: 20px" shadow="hover">
<div class="question-item">
<div class="question-item-hd">
<div class="question-item-hd-top">
<slot name="selection"></slot>
<div class="question-index">{{ index }}</div>
<div class="question-type">{{ questionTypeText }}</div>
<div class="question-score">
<p>分数:</p>
<el-input v-model="data.score" style="width: 100px"></el-input>
</div>
</div>
<!-- 题干 -->
<div class="question-title" v-html="data.question_content"></div>
</div>
<slot>
<div class="question-item-bd">
<!-- 单选题 -->
<template v-if="questionType === 1">
<el-radio-group :disabled="disabled" :value="data.question_answer[0]">
<div class="question-item-option" v-for="item in data.question_options" :key="item.id">
<el-radio :label="item.id">{{ item.option }}</el-radio>
</div>
</el-radio-group>
</template>
<!-- 多选题 -->
<template v-if="questionType === 2">
<el-checkbox-group :disabled="disabled" :value="data.question_answer">
<div class="question-item-option" v-for="item in data.question_options" :key="item.id">
<el-checkbox :label="item.id"> {{ item.option }} </el-checkbox>
</div>
</el-checkbox-group>
</template>
<!-- 问答题 -->
<template v-if="questionType === 3">
<v-editor></v-editor>
</template>
<!-- 判断题 -->
<template v-if="questionType === 6">
<el-radio-group :disabled="disabled" :value="data.question_answer">
<div class="question-item-option" v-for="item in data.question_options" :key="item.id">
<el-radio :label="item.id">{{ item.option }}</el-radio>
</div>
</el-radio-group>
</template>
</div>
</slot>
<div class="question-item-ft"></div>
</div>
</el-card>
</template>
<script>
import VEditor from '@/components/tinymce/Index.vue'
export default {
props: {
index: { type: Number, default: 1 },
disabled: { type: Boolean, default: false },
data: { type: Object, default: () => ({}) }
},
components: { VEditor },
data() {
return {
question: {}
}
},
watch: {
data: {
immediate: true,
handler(data) {
this.question = this.genQuestion(data)
}
}
},
computed: {
// 试题类型
questionType() {
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
return this.data.child_question_type || this.data.question_type
},
// 26个英文字母
A_Z() {
const result = []
for (let i = 0; i < 26; i++) {
result.push(String.fromCharCode(65 + i))
}
return result
},
// 选项类型
questionTypeText() {
const map = { 1: '单选题', 2: '多选题', 3: '问答题', 5: '案例题', 6: '判断题', 7: '实操题', 8: '情景题' }
return map[this.questionType]
}
},
methods: {
genQuestion(data) {}
}
}
</script>
<style lang="scss" scoped>
.question-item-hd-top {
display: flex;
.question-index {
margin-left: 10px;
color: #c01c40;
}
.question-type {
flex: 1;
color: #c01c40;
}
.question-score {
display: flex;
align-items: center;
p {
white-space: nowrap;
}
}
}
.question-title {
padding: 10px 0;
}
.question-item-option {
margin: 10px 0;
}
</style>
<template>
<div>
<div v-for="(item, index) in questionList" :key="index">
<!-- 简单题类型 [1,2,3,6] :根据判断题的类型渲染 -->
<el-card class="boxCard" v-if="signQuestionTypes.includes(item.question_type)" :id="`page${index}`">
<div class="boxHeader">
<div class="headerLeft">
<div class="check">
<input
type="checkbox"
class="checkInpt"
v-model="selectSubjects"
:value="item"
@change="slectSubItem(item)"
/>
</div>
<div class="title">
<div class="titleType">{{ index + 1 }}{{ item.question_title }}</div>
<div class="titleDec" v-html="item.question_content"></div>
</div>
</div>
<div class="pmty"></div>
<div class="headerRight">
<div class="scoreValue">
<span class="lableScore">分数:</span>
<el-input v-model="item.score"></el-input>
</div>
</div>
</div>
<div class="boxMain">
<el-radio-group class="options">
<el-radio v-for="(v, index) in item.question_options" :key="index" :label="v.options" class="option">{{
v.options
}}</el-radio>
</el-radio-group>
</div>
<div class="boxFooter">
<div>正确答案:</div>
<div class="boxAnswer">{{ item.question_answer }}</div>
</div>
</el-card>
<!-- 复杂题类型 [5,7,8] :根据判断题的类型渲染 复杂利用上面的头部,内部重新写个页面渲染复杂题中的小题-->
<el-card class="boxCard" v-if="intricacyQuestionTypes.includes(item.question_type)" :id="`page${index}`">
<div class="boxHeader">
<div class="headerLeft">
<div class="check">
<input
type="checkbox"
class="checkInpt"
v-model="selectSubjects"
:value="item"
@change="slectSubItem(item)"
/>
</div>
<div class="title">
<div class="titleType">{{ index + 1 }}{{ item.question_title }}</div>
<div class="titleDec" v-html="item.question_content"></div>
</div>
</div>
<div class="headerRight">
<div class="scoreValue">
<span class="lableScore">分数:</span>
<el-input :value="getSubScore(item)"></el-input>
</div>
</div>
</div>
<div class="intricacyBoxMain" v-for="(v, index) in item.list" :key="index" style="margin-top: 20px">
<div class="intricacyHeader">
<div class="intricacyDsc">
<div class="intricacyTitle">{{ index + 1 }}{{ v.question_title }}</div>
<div class="titleDec" v-html="v.question_content"></div>
</div>
<div class="intricacyScoreValue">
<span class="lableScore">分数:</span>
<el-input v-model="v.score"></el-input>
</div>
<div class="empty"></div>
</div>
<div class="intricacyMain">
<el-radio-group class="options">
<el-radio v-for="(o, index) in v.question_options" :key="index" :label="o.options" class="option">{{
o.options
}}</el-radio>
</el-radio-group>
</div>
<div class="intricacyFooter">
<div>正确答案:</div>
<div class="intricacyAnswer">{{ v.question_answer }}</div>
</div>
</div>
</el-card>
</div>
</div>
</template>
<script>
export default {
// 问答、情景、案例
props: {
questionList: {
// 试题数据
type: Array
}
},
data() {
return {
selectSubjects: [], // 选中的题
signQuestionTypes: [1, 2, 3, 6], // 简单题类型
intricacyQuestionTypes: [5, 7, 8] // 复杂题类型
}
},
methods: {
// 根据小题的分数计算大题的分数,以至于监听分数变化 s.score*1 是为了下次修改,返回的是字符串变成number类型才可以计算
getSubScore(item) {
return item?.list?.map(s => parseInt(s.score) * 1).reduce((pre, em) => pre + em, 0)
},
// 返回点击题号的offsettop
handleScroll(key) {
const PageId = document.querySelector('#page' + key)
this.$emit('handlePosition', PageId.offsetTop)
},
// 选中的数据回传
slectSubItem(item) {
console.log(item)
this.$emit('selectSubjectsChange', this.selectSubjects)
}
}
}
</script>
<style lang="scss">
.boxCard {
margin-bottom: 10px;
.boxHeader {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
.headerLeft {
flex: 0.75;
display: flex;
.check {
margin-right: 20px;
}
.title {
justify-content: space-around;
.titleType {
width: 200px;
color: #1890ff;
}
}
.checkInpt .title {
display: inline-block;
}
}
.pmty {
flex: 0.05;
}
.headerRight {
flex: 0.2;
display: flex;
position: relative;
.scoreValue {
position: absolute;
top: 0px;
display: flex;
align-items: center;
.lableScore {
width: 100px;
}
}
}
}
.boxMain {
padding-left: 70px;
.options {
display: flex;
flex-direction: column;
.option {
margin-bottom: 5px;
}
}
}
.boxFooter {
margin-top: 30px;
padding-left: 40px;
display: flex;
align-items: center;
.boxAnswer {
color: #1890ff;
font-size: 14px;
}
}
.intricacyBoxMain {
padding-left: 70px;
padding-top: 20px;
.options {
display: flex;
flex-direction: column;
.option {
margin-bottom: 5px;
}
}
.intricacyHeader {
display: flex;
align-items: center;
.intricacyDsc {
flex: 0.8;
.intricacyTitle {
width: 200px;
color: #949091;
}
}
.intricacyScoreValue {
flex: 0.2;
margin-left: 50px;
display: flex;
align-items: center;
.lableScore {
width: 80px;
}
}
}
.intricacyMain {
padding-left: 30px;
}
.intricacyFooter {
margin-top: 10px;
display: flex;
align-items: center;
.intricacyAnswer {
color: #1890ff;
font-size: 14px;
}
}
}
}
</style>
<template> <template>
<el-card> <app-card class="fixed">
<div class="titleIndex"> <div class="question-num">
<ul> <div class="question-num-bd">
<li <ul>
:class="currentIndex === index ? `dotItem` : ''" <li :class="className" v-for="(item, index) in list" :key="index" @click="handleClick(index)">
v-for="(item, index) in list" {{ index + 1 }}
:key="index" </li>
@click="TitleClick(index)" </ul>
> </div>
{{ index + 1 }} <div class="question-num-ft">
</li> <slot name="footer"></slot>
</ul>
<div style="margin-top: 10px; display: flex; justify-content: center; align-items: center">
<el-button type="primary">保存试卷</el-button>
</div> </div>
</div> </div>
</el-card> </app-card>
</template> </template>
<script> <script>
...@@ -31,8 +28,13 @@ export default { ...@@ -31,8 +28,13 @@ export default {
currentIndex: 0 // 当前点击题号 currentIndex: 0 // 当前点击题号
} }
}, },
computed: {
className() {
return {}
}
},
methods: { methods: {
TitleClick(index) { handleClick(index) {
this.currentIndex = index this.currentIndex = index
this.$emit('indexClick', `${index + 1}`) this.$emit('indexClick', `${index + 1}`)
} }
...@@ -40,12 +42,15 @@ export default { ...@@ -40,12 +42,15 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.titleIndex { .fixed {
position: sticky;
top: 0;
}
.question-num {
ul { ul {
display: flex; display: flex;
justify-content: space-around; flex-wrap: wrap;
align-items: center;
li { li {
border-radius: 50px; border-radius: 50px;
width: 24px; width: 24px;
...@@ -56,10 +61,15 @@ export default { ...@@ -56,10 +61,15 @@ export default {
border: 2px solid #ccc; border: 2px solid #ccc;
color: #666; color: #666;
cursor: pointer; cursor: pointer;
margin: 10px 5px;
} }
.dotItem { .dotItem {
background-color: rgb(243, 190, 190); background-color: rgb(243, 190, 190);
} }
} }
} }
.question-num-ft {
margin-top: 20px;
text-align: center;
}
</style> </style>
<template> <template>
<el-dialog title="添加试卷试题" v-bind="$attrs" v-on="$listeners"></el-dialog> <app-list v-bind="tableOptions" ref="list" style="padding-left: 30px"> </app-list>
</template> </template>
<script> <script>
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange"> <app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<div class="btn_operate"> <div class="btn_operate">
<el-button type="primary" icon="el-icon-plus" @click="handleCreate">新建试卷</el-button> <el-button type="primary" icon="el-icon-plus" @click="handleCreate">新建试卷</el-button>
<el-button type="primary" icon="el-icon-delete" @click="batchDelete">批量删除</el-button> <el-button type="primary" icon="el-icon-delete" :disabled="!multipleSelection.length" @click="handleBatchDelete"
>批量删除</el-button
>
</div> </div>
<template v-slot:filter-category="{ params }"> <template v-slot:filter-category="{ params }">
<question-type-cascader v-model="params.paper_category"></question-type-cascader> <question-type-cascader v-model="params.paper_category"></question-type-cascader>
...@@ -18,7 +20,7 @@ ...@@ -18,7 +20,7 @@
</template> </template>
<script> <script>
import { getPaperList } from '../api' import { getPaperList, batchDeletePaper } from '../api'
import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue' import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue'
const paperType = [ const paperType = [
...@@ -30,9 +32,7 @@ export default { ...@@ -30,9 +32,7 @@ export default {
components: { QuestionTypeCascader }, components: { QuestionTypeCascader },
data() { data() {
return { return {
visible: false, multipleSelection: [] // 选择项
multipleSelection: [], // 选择项
paperCategoryList: []
} }
}, },
computed: { computed: {
...@@ -85,8 +85,15 @@ export default { ...@@ -85,8 +85,15 @@ export default {
columns: [ columns: [
{ type: 'selection', width: '50px', fixed: 'left' }, { type: 'selection', width: '50px', fixed: 'left' },
{ type: 'index', label: '序号', minWidth: '50px', fixed: 'left' }, { type: 'index', label: '序号', minWidth: '50px', fixed: 'left' },
{ label: '组卷模式', prop: 'paper_type' }, {
{ label: '试卷分类', prop: 'paper_category' }, label: '组卷模式',
prop: 'paper_type',
computed: ({ row }) => {
const map = { 1: '选题组卷', 2: '自动组卷' }
return map[row.paper_type] || row.paper_type
}
},
{ label: '试卷分类', prop: 'paper_category.category_name' },
{ label: '试卷名称', prop: 'paper_title' }, { label: '试卷名称', prop: 'paper_title' },
{ label: '总分', prop: 'paper_total_score' }, { label: '总分', prop: 'paper_total_score' },
{ label: '及格分数', prop: 'pass_score' }, { label: '及格分数', prop: 'pass_score' },
...@@ -113,13 +120,34 @@ export default { ...@@ -113,13 +120,34 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
// 批量删除
batchDelete() {
console.log('111')
},
// 单个删除 // 单个删除
handleDelete(row) { handleDelete(row) {
// this.$refs.list.refetch() this.$confirm('确定删除该试卷吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = [row.id]
this.batchDeletePaper(ids)
})
},
// 批量删除
handleBatchDelete() {
this.$confirm('确定删除所选试卷吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = this.multipleSelection.map(item => item.id)
this.batchDeletePaper(ids)
})
},
// 批量删除
batchDeletePaper(ids) {
batchDeletePaper({ ids }).then(res => {
// 刷新列表
this.$refs.list.refetch()
})
} }
} }
} }
......
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
<el-button type="primary" @click="handleSubmitSelect" v-if="hasSelectQuestionButton">保存并选择试题</el-button> <el-button type="primary" @click="handleSubmitSelect" v-if="hasSelectQuestionButton">保存并选择试题</el-button>
</div> </div>
</el-form> </el-form>
<question-select :visible.sync="questionSelectVisible"></question-select>
</app-card> </app-card>
</template> </template>
...@@ -141,7 +140,7 @@ import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue' ...@@ -141,7 +140,7 @@ import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue'
export default { export default {
props: { id: { type: String } }, props: { id: { type: String } },
components: { QuestionTypeCascader, QuestionSelect: () => import('../components/QuestionSelect.vue') }, components: { QuestionTypeCascader },
data() { data() {
return { return {
form: { form: {
......
...@@ -53,13 +53,9 @@ ...@@ -53,13 +53,9 @@
remote remote
reserve-keyword reserve-keyword
placeholder="请输入关键词" placeholder="请输入关键词"
:remote-method="remoteMethod"> :remote-method="remoteMethod"
<el-option >
v-for="item in pointOptions" <el-option v-for="item in pointOptions" :key="item.id" :label="item.title" :value="item.id"> </el-option>
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -67,13 +63,13 @@ ...@@ -67,13 +63,13 @@
<!-- <el-button @click="resetForm('ruleForm')">重置</el-button> --> <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-dialog <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
title="提示" <el-tree
:visible.sync="dialogVisible" :data="treeList"
width="30%" :props="defaultProps"
:before-close="handleClose" @node-click="handleNodeClick"
> :expand-on-click-node="false"
<el-tree :data="treeList" :props="defaultProps" @node-click="handleNodeClick" :expand-on-click-node="false"></el-tree> ></el-tree>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button> <el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="dialogConfirm">确 定</el-button> <el-button type="primary" @click="dialogConfirm">确 定</el-button>
...@@ -115,7 +111,7 @@ export default { ...@@ -115,7 +111,7 @@ export default {
qType: [ qType: [
{ label: '单选题', value: 1 }, { label: '单选题', value: 1 },
{ label: '多选题', value: 2 }, { label: '多选题', value: 2 },
{ label: '答题', value: 3 }, { label: '答题', value: 3 },
{ label: '案例题', value: 5 }, { label: '案例题', value: 5 },
{ label: '判断题', value: 6 }, { label: '判断题', value: 6 },
{ label: '实操题', value: 7 }, { label: '实操题', value: 7 },
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
<el-button type="text" @click="handleSettings(row)">查看详情</el-button> <el-button type="text" @click="handleSettings(row)">查看详情</el-button>
<el-button type="text" @click="handleSettings(row)">删除</el-button> <el-button type="text" @click="handleSettings(row)">删除</el-button>
</template> </template>
<el-dialog <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
title="提示" <el-tree
:visible.sync="dialogVisible" :data="treeList"
width="30%" :props="defaultProps"
:before-close="handleClose" @node-click="handleNodeClick"
> :expand-on-click-node="false"
<el-tree :data="treeList" :props="defaultProps" @node-click="handleNodeClick" :expand-on-click-node="false"></el-tree> ></el-tree>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button> <el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="dialogConfirm">确 定</el-button> <el-button type="primary" @click="dialogConfirm">确 定</el-button>
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
options: [ options: [
{ label: '单选题', value: 1 }, { label: '单选题', value: 1 },
{ label: '多选题', value: 2 }, { label: '多选题', value: 2 },
{ label: '答题', value: 3 }, { label: '答题', value: 3 },
{ label: '案例题', value: 5 }, { label: '案例题', value: 5 },
{ label: '判断题', value: 6 }, { label: '判断题', value: 6 },
{ label: '实操题', value: 7 }, { label: '实操题', value: 7 },
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
const questionType = { const questionType = {
1: '单选题', 1: '单选题',
2: '多选题', 2: '多选题',
3: '答题', 3: '答题',
5: '案例题', 5: '案例题',
6: '判断题', 6: '判断题',
7: '实操题', 7: '实操题',
......
...@@ -49,7 +49,6 @@ httpRequest.interceptors.request.use( ...@@ -49,7 +49,6 @@ httpRequest.interceptors.request.use(
httpRequest.interceptors.response.use( httpRequest.interceptors.response.use(
function (response) { function (response) {
const { data } = response const { data } = response
console.log(response)
// 正常返回 // 正常返回
if (data.code === 0 || data.type === 'application/vnd.ms-excel') { if (data.code === 0 || data.type === 'application/vnd.ms-excel') {
return data return data
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论