组卷->新增试题/编辑试题等

master
yujialong 3 months ago
parent 0165016dd7
commit 0a07ceed91
  1. 239
      src/pages/ques/detail/index.vue
  2. 17
      src/pages/ques/list/index.vue
  3. 2
      src/pages/quesBankType/index.vue
  4. 35
      src/pages/testPaper/detail/index.vue
  5. 76
      src/pages/testPaper/detail/manual.vue
  6. 3
      src/pages/testPaper/detail/template.vue
  7. 6
      src/pages/testPaper/list/index.vue

@ -1,22 +1,37 @@
<template>
<div class="page">
<Breadcrumb :data="crumbs" />
<div class="page h-full">
<Breadcrumb v-if="!paperType" :data="crumbs" />
<p class="page-name mb">试题</p>
<el-form :model="form" :rules="rules" class="input-form model" ref="form" label-width="110px"
:disabled="detailType === 2">
<el-form :model="form" :rules="rules" :class="['input-form model', { paper: paperType }]" ref="form"
label-width="110px" :disabled="detailType === 2">
<div class="item-line">
<el-form-item label="题库分类">
<el-input v-model="questionBankCategory" disabled />
</el-form-item>
<el-form-item label="题库">
<el-input v-model="questionBankName" disabled />
</el-form-item>
<template v-if="paperType === 1">
<el-form-item prop="questionBankTypeId" label="题库分类">
<el-cascader placeholder="请选择题库分类" v-model="form.questionBankTypeId" :options="questionBankTypes"
:props="{ value: 'id', label: 'name', checkStrictly: true }" clearable
@change="getQuesBank"></el-cascader>
</el-form-item>
<el-form-item prop="questionBankId" label="题库">
<el-select v-model="form.questionBankId" filterable placeholder="请选择题库" @change="getKnowledge">
<el-option v-for="(item, i) in questionBanks" :key="i" :label="item.questionBankName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template v-else>
<el-form-item label="题库分类">
<el-input v-model="questionBankCategory" disabled />
</el-form-item>
<el-form-item label="题库">
<el-input v-model="questionBankName" disabled />
</el-form-item>
</template>
</div>
<div class="item-line">
<el-form-item prop="specialtyIds" label="所属专业">
<el-select v-model="form.specialtyIds" clearable multiple filterable placeholder="请选择所属专业">
<el-option v-for="(item, i) in professionals" :key="i" :label="item.professionalName"
:value="item.professionalId" filter></el-option>
:value="item.professionalId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="knowledgePointIds" label="所属知识点">
@ -57,7 +72,8 @@
</el-form-item>
<!-- 单选多选判断特有 -->
<el-form-item v-if="form.questionType !== 'fill_blank' && form.questionType !== 'essay'" label="正确答案" required>
<el-form-item v-if="form.questionType !== 'fill_blank' && form.questionType !== 'essay'"
prop="questionAnswerVersions" label="正确答案">
<div class="opts">
<div v-for="(item, i) in form.questionAnswerVersions" :key="i" class="opt">
<el-checkbox v-if="form.questionType === 'multiple_choice'" class="correct-check"
@ -72,8 +88,9 @@
<UeditorPlus v-else class="opt-editor" :ref="'opt' + item.optionNumber" :config="editorConfig"
v-model="item.optionText" @ready="editor => optReady(editor, item)" />
<template v-if="form.questionType !== 'judgement'">
<i class="icon el-icon-circle-plus-outline" @click="addOpt(i)"></i>
<i class="icon el-icon-remove-outline" @click="delOpt(i)"></i>
<i class="icon el-icon-circle-plus-outline m-t-8" @click="addOpt(i)"></i>
<i v-if="form.questionAnswerVersions.length > 2" class="icon el-icon-remove-outline m-t-8"
@click="delOpt(i)"></i>
</template>
</div>
</div>
@ -89,8 +106,8 @@
<div v-if="item.fills" class="fill-items">
<div v-for="(fill, j) in item.fills" :key="j" class="fill-item">
<el-input type="textarea" autosize resize="none" placeholder="请输入" v-model="fill.val" />
<span v-if="j !== item.fills.length - 1" class="m-r-8"></span>
<i v-if="j" class="action-icon el-icon-remove-outline" @click="item.fills.splice(j, 1)"></i>
<span v-if="j !== item.fills.length - 1"></span>
</div>
</div>
@ -187,15 +204,6 @@
<el-button type="primary" @click="saveQues">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="richEditor.dialogVisible" width="1000px" :show-close="false" center
:close-on-click-modal="false">
<!-- <UeditorPlus ref="title2" @ready="editorReady" /> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="editorSubmit">确定</el-button>
<el-button @click="richEditor.dialogVisible = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -209,6 +217,7 @@ import dayjs from 'dayjs'
import _ from 'lodash'
import Const from '@/const/ques'
export default {
props: ['paperType', 'curQues'], //
components: { Breadcrumb, UeditorPlus, Upload },
data () {
return {
@ -218,26 +227,17 @@ export default {
questionBankId: this.$route.query.questionBankId, // id
questionBankName: this.$route.query.questionBankName,
questionBankCategory: this.$route.query.questionBankCategory,
detailType: this.$route.query.detailType,
detailType: +this.$route.query.detailType,
numToLetter: Util.numToLetter,
detailTypes: ['', '复制', '查看', '编辑', '编辑'],
types: [],
cascaderValue: [],
cascaderProps: {
checkStrictly: true,
label: "classificationName",
value: "classificationId"
},
questionBankTypes: [],
questionBanks: [],
professionals: [],
difficults: Const.difficults,
questionTypes: Const.questionTypes,
knowledges: [],
editorConfig: {},
richEditor: {
object: null,
parameterName: '',
instance: null
editorConfig: {
zIndex: 2500,
},
originForm: {},
originOpt: {
@ -252,6 +252,7 @@ export default {
fillBlanks: [],
uploadList: [],
form: {
questionBankTypeId: '',
difficulty: '',
givenYear: new Date(),
knowledgePointIds: [],
@ -265,6 +266,9 @@ export default {
uploadInstructions: '',
},
rules: {
questionBankId: [
{ required: true, message: '请选择题库', trigger: 'change' }
],
knowledgePointIds: [
{ required: true, message: '请选择知识点', trigger: 'change' }
],
@ -274,6 +278,9 @@ export default {
questionType: [
{ required: true, message: '请选择题型', trigger: 'change' }
],
questionAnswerVersions: [
{ required: true, message: '请选择正确答案', trigger: 'change' }
],
},
templateVisible: false,
submiting: false,
@ -302,20 +309,30 @@ export default {
},
mounted () {
const { query } = this.$route
this.crumbs = [
{
name: '试题管理',
route: 'list',
query: {
questionBankId: query.questionBankId,
questionBankName: query.questionBankName,
questionBankCategory: query.questionBankCategory,
}
},
{
name: this.diaTitle
},
]
if (!this.paperType) {
this.crumbs = [
{
name: '试题管理',
route: 'list',
query: {
questionBankId: query.questionBankId,
questionBankName: query.questionBankName,
questionBankCategory: query.questionBankCategory,
}
},
{
name: this.diaTitle
},
]
this.form.questionBankId = query.questionBankId
} else if (this.curQues) {
this.questionId = this.curQues.questionId
this.version = this.curQues.version
}
this.editorConfig = this.paperType ? {
zIndex: 2500
} : {}
this.originForm = _.cloneDeep(this.form)
// this.originFillBlank = _.cloneDeep(this.fillBlanks[0])
@ -328,13 +345,15 @@ export default {
this.form = _.cloneDeep(this.originForm)
const type = this.detailType
//
if (!type) {
if (this.paperType === 1) {
this.getQuesBankType()
this.getQuesBank()
} else if (!type) {
//
const { path } = this.$route.query
if (path) this.form.knowledgePointIds = [path.split('/').map(e => +e)]
} else if (type === 4) {
// this.questionBankId = this.row.questionBankId
}
const { stem, answerAnalysis, referenceAnswer, uploadInstructions } = this.$refs
stem && stem.instance && stem.setText('')
answerAnalysis && answerAnalysis.instance && answerAnalysis.setText('')
@ -363,17 +382,12 @@ export default {
//
async getDetail () {
try {
const { questionId, version } = this
let { questionId, version } = this
if (questionId) {
const res = await this.$post(`${this.api.findQuestion}?questionId=${questionId}&version=${version}`)
const r = res.message
const opts = r.questionAnswerVersionsList
if (this.detailType === 4) {
this.questionBankName = r.questionBankName
// this.questionBankCategory = r.questionBankCategory
}
opts.map(e => e.focus = 0)
this.form = {
questionId: r.questionId,
@ -391,9 +405,10 @@ export default {
stemAttachment: r.stemAttachment,
uploadInstructions: r.uploadInstructions,
questionAnswerVersions: opts,
questionBankId: r.questionBankId,
}
this.answerAnalysis = opts[0].answerAnalysis
this.fillBlanks = JSON.parse(opts[0].answerData)
this.fillBlanks = opts[0].answerData ? JSON.parse(opts[0].answerData) : []
//
const file = r.allowAttachment
@ -403,19 +418,29 @@ export default {
url: file
}]
}
//
if (this.paperType === 2) {
this.questionBankName = r.questionBankName
console.log("🚀 ~ getKnowledge ~ id:", this.form)
// this.questionBankCategory = r.questionBankCategory
this.$nextTick(() => {
this.getKnowledge()
})
}
}
} catch (e) { }
},
//
async getKnowledge () {
if (this.questionBankId) {
const { questionBankId: id } = this.form
if (id) {
try {
const { data } = await this.$post(this.api.TreeStructure, {
createSource: 1,
questionBankId: this.questionBankId,
questionBankId: id,
keyword: '',
})
this.handleType(data)
this.handleType(data, 1)
this.knowledges = data
} catch (e) { }
}
@ -432,16 +457,42 @@ export default {
} catch (e) { }
},
//
handleType (list) {
handleType (list, disable) {
list.map(e => {
if (!e.type) e.disabled = true
if (disable && !e.type) e.disabled = true
if (e.children && e.children.length) {
this.handleType(e.children)
this.handleType(e.children, disable)
} else {
delete e.children
}
})
},
//
async getQuesBankType () {
try {
const { data } = await this.$post(this.api.getAllQuestionBankCategories, {
createSource: 1,
status: 1,
})
this.handleType(data)
this.questionBankTypes = data
} catch (e) { }
},
//
async getQuesBank () {
try {
let type
const val = this.form.questionBankTypeId
if (val.length) type = val[val.length - 1]
const res = await this.$post(this.api.questionBankList, {
status: 1,
pageNum: 1,
pageSize: 1000,
questionCategoryId: type || '',
})
this.questionBanks = res.message.records
} catch (e) { }
},
//
handleSingleMultiple () {
//
@ -537,31 +588,6 @@ export default {
editor.focus()
},
editorReady (instance) {
console.log("🚀 ~ editorReady ~ instance:", instance)
// this.richEditor.instance = instance
// let currentContent = this.richEditor.object[this.richEditor.parameterName]
// this.richEditor.instance.setContent(currentContent)
// // Ueditor
// this.richEditor.instance.focus(true)
},
inputClick (object, parameterName) {
this.richEditor.object = object
this.richEditor.parameterName = parameterName
this.richEditor.dialogVisible = true
},
editorSubmit () {
let content = this.richEditor.instance.getContent()
if (this.richEditor.parameterName === 'title') { //
// if (this.questionItemReset(content)) {
// this.richEditor.object[this.richEditor.parameterName] = content
// this.richEditor.dialogVisible = false
// }
} else {
this.richEditor.object[this.richEditor.parameterName] = content
this.richEditor.dialogVisible = false
}
},
// 线
questionItemReset (content) {
let spanRegex = new RegExp('<span class="gapfilling-span" (.*?)>(.*?)______(.*?)<\\/span>', 'g')
@ -637,7 +663,7 @@ export default {
try {
this.beforeSubmitForm = _.cloneDeep(form)
form.stem = stem
form.questionBankId = this.questionBankId
if (!this.paperType) form.questionBankId = this.questionBankId
form.knowledgePointIds = form.knowledgePointIds.map(e => {
return e[e.length - 1]
})
@ -669,7 +695,7 @@ export default {
}
if (form.questionId) {
try {
await this.$confirm(`<p style="margin-bottom: 10px;">您确定要保存对本题所做的更改吗?</p>${this.detailType === 4 ? '' : '<p style="margin-bottom: 10px;">保存后,所有关联的试卷将会自动更新</p>'}${keep ? '<p>系统未识别到与本题相似的题目</p>' : ''}`, '提示', {
await this.$confirm(`<p style="margin-bottom: 10px;">您确定要保存对本题所做的更改吗?</p>${this.detailType === 4 ? '' : `<p style="margin-bottom: 10px;">保存后,所有关联的试卷将会自动更新。${keep ? '系统未识别到与本题相似的题目' : ''}</p>`}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -697,9 +723,10 @@ export default {
try {
const form = this.tempForm
const type = this.detailType
const paperEdit = this.curQues //
// type: 1()234createNewVersion
const res = await this.$post(this.api[type === 4 ? 'createNewVersion' : type === 1 || !form.questionId ? 'addQuestion' : 'updateQuestion'], form)
type === 4 && this.$emit('updateQues', this.tempForm, res.questionVersionId)
const res = await this.$post(this.api[paperEdit ? 'createNewVersion' : type === 1 || !form.questionId ? 'addQuestion' : 'updateQuestion'], form)
paperEdit && this.$emit('updateQues', form, res.questionVersionId)
Util.successMsg('保存成功')
!form.questionId && this.keep ? this.init(form) : this.back()
@ -709,15 +736,21 @@ export default {
}
},
back () {
this.$router.back()
if (this.paperType) {
//
this.$emit('closeAdd')
} else {
this.$router.back()
}
},
}
};
</script>
<style lang="scss" scoped>
.action-icon {
margin-right: 10px;
.input-form.model.paper {
height: calc(100vh - 172px);
padding-bottom: 30px;
}
.ques {
@ -807,6 +840,10 @@ export default {
margin-right: 15px;
}
.el-radio {
margin-top: 8px;
}
.opt-input {
width: 100%;
min-height: 32px;

@ -409,14 +409,19 @@ export default {
this.page = 1
this.getList()
},
getSort (o) {
return o ? (o === 'ascending' ? 'asc' : 'desc') : ''
},
//
sortChange (column) {
if (column.prop === 'questionType') this.filter.questionTypeSort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
if (column.prop === 'givenYear') this.filter.givenYearSort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
if (column.prop === 'difficulty') this.filter.difficultySort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
if (column.prop === 'correctRate') this.filter.correctRateSort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
if (column.prop === 'updateTime') this.filter.updateTimeSort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
if (column.prop === 'referenceCount') this.filter.referenceCountSort = column.order ? column.order === 'ascending' ? 'asc' : 'desc' : ''
const { prop: p, order: o } = column
const { filter } = this
filter.questionTypeSort = p === 'questionType' ? this.getSort(o) : ''
filter.givenYearSort = p === 'givenYear' ? this.getSort(o) : ''
filter.difficultySort = p === 'difficulty' ? this.getSort(o) : ''
filter.correctRateSort = p === 'correctRate' ? this.getSort(o) : ''
filter.updateTimeSort = p === 'updateTime' ? this.getSort(o) : ''
filter.referenceCountSort = p === 'referenceCount' ? this.getSort(o) : ''
this.getList()
},

@ -25,7 +25,7 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="题库分类名称"></el-table-column>
<el-table-column prop="orderNum" label="已关联题库" align="center"></el-table-column>
<el-table-column prop="questionBankCount" label="已关联题库" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="createUserName" label="创建人" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="300">

@ -98,7 +98,8 @@
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<i class="el-icon-circle-plus-outline action-icon m-r-10" @click="addLine(scope.$index)"></i>
<i class="el-icon-remove-outline action-icon" @click="delLine(scope.$index)"></i>
<i v-if="form.paperOutline.length > 1" class="el-icon-remove-outline action-icon"
@click="delLine(scope.$index)"></i>
</template>
</el-table-column>
</el-table>
@ -181,8 +182,7 @@
查看每空分值<el-input class="l-input" placeholder="请输入分值" v-model="ques.score" readonly />
</div>
</el-popover>
<!-- <el-button type="text" @click="toQues(item, j, ques)">编辑试题</el-button> -->
<el-button type="text" @click="toQues(item, j, ques)">编辑试题</el-button>
<el-button type="text" @click="showManualDia(item, j, ques)">更换试题</el-button>
<el-button type="text" @click="showManualDia(item, j)">添加试题</el-button>
<el-button type="text" @click="delQues(item, j)">移除试题</el-button>
@ -210,6 +210,12 @@
<Manual :visible.sync="manualVisible" :questionType.sync="curType.questionType" />
<Auto :visible.sync="autoVisible" />
<RepeatQues :visible.sync="repeatVisible" :list.sync="repeatQues" />
<el-drawer title="编辑试题" :visible.sync="addQuesVisible" size="1200px" :close-on-click-modal="false"
custom-class="editques-dia">
<QuesDetail :paperType.sync="testPaperType" :curQues.sync="curRow" @closeAdd="closeAdd"
@updateQues="updateQues" />
</el-drawer>
</div>
</template>
<script>
@ -220,16 +226,17 @@ import Template from './template'
import Manual from './manual'
import Auto from './auto'
import RepeatQues from './repeatQues'
import QuesDetail from '@/pages/ques/detail'
import Setting from '@/setting'
import Util from '@/libs/util'
import dayjs from 'dayjs'
import QuesConst from '@/const/ques'
import TestPaperConst from '@/const/testPaper'
import Decimal from 'decimal.js'
import { template } from 'lodash'
import _ from 'lodash'
export default {
components: { UeditorPlus, Breadcrumb, Template, Manual, Auto, RepeatQues, Draggable },
components: { UeditorPlus, Breadcrumb, Template, Manual, Auto, RepeatQues, Draggable, QuesDetail },
data () {
return {
crumbs: [],
@ -348,10 +355,11 @@ export default {
quesVisible: false,
curRow: {},
detailType: '',
difficultSelected: false,
addQuesVisible: false,
testPaperType: 2,
repeatVisible: false,
repeatQues: [],
@ -633,13 +641,17 @@ export default {
})
ques.score = total
},
//
toQues (item, i, ques) {
this.curType = item
this.curQuesIndex = i
this.curRow = ques
this.quesVisible = true
this.detailType = 4
this.addQuesVisible = true
},
//
closeAdd () {
this.addQuesVisible = false
},
//
updateQues (ques, id) {
@ -649,6 +661,7 @@ export default {
this.curType.examQuestions[this.curQuesIndex] = Object.assign(this.curRow, ques)
this.calcDifficult()
},
//
showManualDia (item, i, ques) {
this.curType = item
@ -1144,4 +1157,10 @@ export default {
padding-left: 32px;
}
}
/deep/.editques-dia {
.el-drawer__header {
margin-bottom: 0;
}
}
</style>

@ -104,22 +104,24 @@
<span class="kl">知识点</span>
</div>
<template v-for="(item, i) in checked">
<div v-if="item.stemText.includes(checkedKeyword) || item.knowledgePointName.includes(checkedKeyword)"
:key="i" class="line j-between">
<div class="check-left">
<el-checkbox v-model="item.check"></el-checkbox>
<span class="serial">{{ i + 1 }}</span>
<el-tooltip effect="dark" :content="item.stemText" placement="top-start">
<p class="checked-stem">{{ item.stemText }}</p>
</el-tooltip>
<el-tooltip effect="dark" :content="item.knowledgePointName" placement="top-start">
<p class="kl checked-kl">{{ item.knowledgePointName }}</p>
</el-tooltip>
<div class="lines">
<template v-for="(item, i) in checked">
<div v-if="item.stemText.includes(checkedKeyword) || item.knowledgePointName.includes(checkedKeyword)"
:key="i" class="line">
<div class="check-left">
<el-checkbox v-model="item.check"></el-checkbox>
<span class="serial">{{ i + 1 }}</span>
<el-tooltip effect="dark" :content="item.stemText" placement="top-start">
<p class="checked-stem">{{ item.stemText }}</p>
</el-tooltip>
<el-tooltip effect="dark" :content="item.knowledgePointName" placement="top-start">
<p class="kl checked-kl">{{ item.knowledgePointName }}</p>
</el-tooltip>
</div>
<i class="el-icon-delete action-icon" @click="delChecked(item)"></i>
</div>
<i class="el-icon-delete action-icon" @click="delChecked(item)"></i>
</div>
</template>
</template>
</div>
</div>
</template>
<div v-else class="empty">
@ -131,7 +133,6 @@
<div class="flex j-between p-l-20 p-r-20">
<p>未找到试题<a class="link" @click="toAddQues">去新增</a></p>
<p>已选题数/目标题数{{ checkedLen }}/{{ $parent.curType.questionNum }}
<!-- &emsp;&emsp;<a class="link" @click="toEditQues">修改目标</a> -->
</p>
</div>
@ -140,6 +141,12 @@
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button>
</div>
</el-drawer>
<el-drawer title="新增试题" :visible.sync="addQuesVisible" size="1200px" :close-on-click-modal="false"
custom-class="add-dia">
<QuesDetail :paperType.sync="paperType" @closeAdd="closeAdd" />
</el-drawer>
</div>
</template>
<script>
@ -147,8 +154,10 @@ import Setting from '@/setting'
import Util from '@/libs/util'
import _ from 'lodash'
import QuesConst from '@/const/ques'
import QuesDetail from '@/pages/ques/detail'
export default {
props: ['visible', 'questionType'],
components: { QuesDetail },
data () {
return {
selectQuesVisible: false,
@ -176,7 +185,8 @@ export default {
quesVisible: false,
curRow: {},
detailType: '',
addQuesVisible: false,
paperType: 1,
};
},
computed: {
@ -410,12 +420,12 @@ export default {
},
//
toAddQues () {
this.quesVisible = true
this.detailType = 5
// this.$router.push('/ques/detail?detailType=5')
this.addQuesVisible = true
},
//
toEditQues () {
//
closeAdd () {
this.addQuesVisible = false
},
//
updateQues (ques, id) {
@ -502,6 +512,10 @@ export default {
width: 38%;
padding: 15px;
border-right: 1px solid #eee;
&:first-child {
width: 24%;
}
}
.total {
@ -511,9 +525,17 @@ export default {
.lines {
height: calc(100vh - 358px);
// padding-right: 10px;
overflow: auto;
}
.ques {
.lines {
height: calc(100vh - 328px);
overflow: auto;
}
}
.line {
display: flex;
padding: 5px 0;
@ -557,13 +579,13 @@ export default {
@include ellipsis;
&.checked-kl {
width: 90px;
width: 100px;
margin-right: 10px;
}
}
.checked-stem {
max-width: 165px;
width: 190px;
margin-right: 20px;
@include ellipsis;
}
@ -583,4 +605,10 @@ export default {
cursor: pointer;
}
}
/deep/.add-dia {
.el-drawer__header {
margin-bottom: 0;
}
}
</style>

@ -79,7 +79,8 @@
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<i class="el-icon-circle-plus-outline action-icon m-r-10" @click="addLine(scope.$index)"></i>
<i class="el-icon-remove-outline action-icon" @click="delLine(scope.$index)"></i>
<i v-if="form.paperOutline.length > 1" class="el-icon-remove-outline action-icon"
@click="delLine(scope.$index)"></i>
</template>
</el-table-column>
</el-table>

@ -141,7 +141,7 @@
e.id === scope.row.paperType).name : '' }}</template>
</el-table-column>
<el-table-column label="状态" align="center" width="60">
<template slot-scope="scope">{{ scope.row.status ? '草稿' : (scope.row.isDisable ? '禁用' : '启用') }}</template>
<template slot-scope="scope">{{ !scope.row.status ? '草稿' : (scope.row.isDisable ? '禁用' : '启用') }}</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center" width="160"
sortable="custom"></el-table-column>
@ -154,7 +154,7 @@
<el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button type="text" @click="toDetail(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch v-if="!scope.row.status" v-model="scope.row.isDisable" :active-value="false"
<el-switch v-if="scope.row.status" v-model="scope.row.isDisable" :active-value="false"
:inactive-value="true" style="margin: 0 10px 0 5px" :active-text="scope.row.isDisable ? '禁用' : '启用'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
@ -412,7 +412,7 @@ export default {
const res = await this.$post(this.api.examPaperList, {
...this.filter,
isDisable: this.status === 2 ? '' : this.status, //
status: this.status === 2 ? 1 : '', // 稿
status: this.status === 2 ? 0 : '', // 稿
particularYear: this.particularYear ? [this.particularYear] : [],
questionType: this.questionType.length ? this.questionType.join() : '',
type: this.isNotJoin,

Loading…
Cancel
Save