|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>题目类型:</label> |
|
|
|
|
<el-select v-model="typeId" clearable placeholder="请选择题目类型" size="small" @change="getData"> |
|
|
|
|
<el-select v-model="typeId" clearable placeholder="请选择题目类型" size="small" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -23,22 +23,20 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" ref="table" row-key="id" class="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column |
|
|
|
|
type="selection" |
|
|
|
|
width="80" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true" |
|
|
|
|
:selectable="disabledSelection" |
|
|
|
|
></el-table-column> |
|
|
|
|
<el-table-column type="selection" width="80" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
<template |
|
|
|
|
slot-scope="scope" |
|
|
|
|
>{{scope.$index + (page - 1) * pageSize + 1}}</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="questionStem" :show-overflow-tooltip="true" width="300" label="题干" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="ellipsis" v-html="scope.row.questionStem"></div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="typeName" label="所属题库" min-width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column> |
|
|
|
@ -47,7 +45,7 @@ |
|
|
|
|
{{scope.row.myShare ? '已共享' : '未共享'}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="230"> |
|
|
|
|
<el-table-column label="操作" width="230" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:我上传的题库:查看'">查看</el-button> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)" v-auth="'/quesBank/list:我上传的题库:修改'">修改</el-button> |
|
|
|
@ -86,6 +84,16 @@ |
|
|
|
|
<div v-html="topicForm.questionStem"></div> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="topicForm.typeId == 1 || topicForm.typeId == 2"> |
|
|
|
|
<span class="name">选项:</span> |
|
|
|
|
<div class="val"> |
|
|
|
|
<p class="m-b-5" v-for="(option,i) in topicForm.options" :key="i">{{i}}.{{topicForm.options[i]}}</p> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="topicForm.typeId != 4" :class="{'a-center': topicForm.typeId == 1 || topicForm.typeId == 2}"> |
|
|
|
|
<span class="name">正确答案:</span> |
|
|
|
|
<span class="val">{{topicForm.answer}}</span> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<span class="name">答案解析:</span> |
|
|
|
|
<span class="val">{{topicForm.answerAnalysis}}</span> |
|
|
|
@ -104,8 +112,8 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
|
<el-button size="small" @click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -155,7 +163,7 @@ export default { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.getData() |
|
|
|
|
this.initData() |
|
|
|
|
},500) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -169,11 +177,23 @@ export default { |
|
|
|
|
userId: this.userId |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
this.listData = util.removeHtmlTag(res.data.list.list,'questionStem') |
|
|
|
|
let list = util.removeHtmlTag(res.data.list.list,'questionStem') |
|
|
|
|
list.map(n => { |
|
|
|
|
n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`______`) |
|
|
|
|
}) |
|
|
|
|
this.listData = list |
|
|
|
|
this.total = res.data.list.totalCount |
|
|
|
|
if(!this.listData.length && this.total){ |
|
|
|
|
this.page-- |
|
|
|
|
this.getData() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
getType() { |
|
|
|
|
this.$get(this.api.typesList) |
|
|
|
|
.then(res => { |
|
|
|
@ -183,6 +203,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
dialogGetData(){ |
|
|
|
@ -208,7 +229,8 @@ export default { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 10000, |
|
|
|
|
schoolId: this.clientId, |
|
|
|
|
source: 1 |
|
|
|
|
source: 1, |
|
|
|
|
keyword: '' |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.listByPage,data).then(res => { |
|
|
|
|
let list = res.data.list.list |
|
|
|
@ -223,6 +245,29 @@ export default { |
|
|
|
|
getDetail(id) { |
|
|
|
|
this.$post(`${this.api.findById}?id=${id}`).then(res => { |
|
|
|
|
let list = res.data.list |
|
|
|
|
let typeName = res.data.typeName |
|
|
|
|
let options = {} |
|
|
|
|
|
|
|
|
|
if(typeName == '填空题'){ |
|
|
|
|
let answer = [] |
|
|
|
|
for(let i in list){ |
|
|
|
|
if(i.includes('option') && list[i]) answer.push(list[i]) |
|
|
|
|
} |
|
|
|
|
list.answer = answer.join(',') |
|
|
|
|
list.questionStem = list.questionStem.replace(/\(\)\(\)\(\)/g,`______`) |
|
|
|
|
}else if(typeName == '判断题'){ |
|
|
|
|
if(list.answer == 'A'){ |
|
|
|
|
list.answer = '正确' |
|
|
|
|
}else{ |
|
|
|
|
list.answer = '错误' |
|
|
|
|
} |
|
|
|
|
}else if(typeName != '简答题'){ |
|
|
|
|
for(let i in list){ |
|
|
|
|
if(i.includes('option') && list[i]){ |
|
|
|
|
options[i.replace('option','')] = list[i] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.topicForm = { |
|
|
|
|
id: list.id, |
|
|
|
|
userId: list.userId, |
|
|
|
@ -232,7 +277,7 @@ export default { |
|
|
|
|
courses: list.courses, |
|
|
|
|
knowledgePoints: list.knowledgePoints, |
|
|
|
|
answer: list.answer, |
|
|
|
|
questionType: '', |
|
|
|
|
questionType: typeName, |
|
|
|
|
questionStem: list.questionStem, |
|
|
|
|
optionA: list.optionA, |
|
|
|
|
optionB: list.optionB, |
|
|
|
@ -240,6 +285,7 @@ export default { |
|
|
|
|
optionD: list.optionD, |
|
|
|
|
optionE: list.optionE, |
|
|
|
|
optionF: list.optionF, |
|
|
|
|
options, |
|
|
|
|
aisTrue: false, |
|
|
|
|
bisTrue: false, |
|
|
|
|
cisTrue: false, |
|
|
|
@ -251,7 +297,6 @@ export default { |
|
|
|
|
answerAnalysis: list.answerAnalysis, |
|
|
|
|
videoAudio: list.videoAudio |
|
|
|
|
} |
|
|
|
|
console.log(this.topicForm,this.quesBankList) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
show(row) { |
|
|
|
@ -277,7 +322,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
share(row) { |
|
|
|
|
this.$confirm('该题将共享至公共题库,是否确认共享?', '提示', { |
|
|
|
|
type: 'info' |
|
|
|
|
type: 'info', |
|
|
|
|
customClass: 'normal' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
let data = { |
|
|
|
@ -319,16 +365,15 @@ export default { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.$confirm(`是否确认共享${util.ellipsisStr(newArr[0].questionStem)}等${newArr.length}个选中的题目?`, '提示', { |
|
|
|
|
type: 'info' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
type: 'info', |
|
|
|
|
customClass: 'normal' |
|
|
|
|
}).then(() => { |
|
|
|
|
let data = { |
|
|
|
|
userId: this.userId, |
|
|
|
|
ids: shareList, |
|
|
|
|
source: 1 |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.batchSave,data).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
util.successMsg('此题已成功共享至校企公共题库') |
|
|
|
|
this.getData() |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
@ -336,7 +381,7 @@ export default { |
|
|
|
|
this.getData() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
.catch(() => {}) |
|
|
|
|
}else{ |
|
|
|
|
util.errorMsg('请先选择数据') |
|
|
|
|
} |
|
|
|
@ -353,7 +398,6 @@ export default { |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.$post(`${this.api.deleteByMeSubject}?ids=${delList.join()}`).then(res => { |
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
util.successMsg('删除成功'); |
|
|
|
|
this.getData() |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
@ -439,6 +483,9 @@ export default { |
|
|
|
|
max-width: calc(100% - 80px); |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
|
/deep/img{ |
|
|
|
|
max-width: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|