|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
<template> |
|
|
|
|
<div :class="['page', { inQues }]"> |
|
|
|
|
<Breadcrumb v-if="!inQues" style="margin-bottom: 0;" :data="crumbs" /> |
|
|
|
|
<div class="wrap"> |
|
|
|
|
<el-drawer title="知识点设置" :visible.sync="kpVisible" size="1200px" :close-on-click-modal="false" append-to-body |
|
|
|
|
custom-class="kp-dia" @closed="closeDia"> |
|
|
|
|
<div class="page"> |
|
|
|
|
<div class="side"> |
|
|
|
|
<div class="m-b-20"> |
|
|
|
|
<el-radio-group v-model="isNotJoin" @change="changeType"> |
|
|
|
@ -22,7 +22,7 @@ |
|
|
|
|
|
|
|
|
|
<el-input class="m-b-10" placeholder="请输入知识点分类" prefix-icon="el-icon-search" size="small" clearable |
|
|
|
|
v-model="keyword"></el-input> |
|
|
|
|
<div style="overflow: auto"> |
|
|
|
|
<div class="type-wrap"> |
|
|
|
|
<el-tree v-loading="loading" :data="types" default-expand-all ref="typeTree" node-key="id" highlight-current |
|
|
|
|
:expand-on-click-node="false" @node-click="handleNodeClick" :props="{ label: 'name', isLeaf: 'leaf' }"> |
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
@ -117,7 +117,6 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="提示" :visible.sync="delVisible" width="400px" :close-on-click-modal="false" append-to-body |
|
|
|
|
custom-class="del-dia"> |
|
|
|
|
<div class="del-wrap"> |
|
|
|
@ -132,7 +131,7 @@ |
|
|
|
|
<el-button type="primary" @click="delTypeSubmit">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</el-drawer> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
@ -140,12 +139,12 @@ import Util from '@/libs/util' |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
|
export default { |
|
|
|
|
props: ['visible'], |
|
|
|
|
components: { Breadcrumb }, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
crumbs: [], |
|
|
|
|
kpVisible: false, |
|
|
|
|
questionBankId: this.$route.query.questionBankId, |
|
|
|
|
inQues: false, |
|
|
|
|
createSource: 1, |
|
|
|
|
loading: false, |
|
|
|
|
keyword: '', |
|
|
|
@ -209,26 +208,12 @@ export default { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(this.getList, 500) |
|
|
|
|
}, |
|
|
|
|
visible () { |
|
|
|
|
this.kpVisible = this.visible |
|
|
|
|
this.visible && this.getType() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
const { query } = this.$route |
|
|
|
|
const { referrer1, referrer2 } = this.$store.state.user |
|
|
|
|
this.crumbs = [ |
|
|
|
|
{ |
|
|
|
|
name: query.questionBankName || '题库管理', |
|
|
|
|
route: referrer1 || '/quesBank' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: '试题列表', |
|
|
|
|
route: referrer2 || '/ques', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: '知识点列表' |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
this.inQues = this.$route.path === '/ques/detail' // 当前页面是否在试题详情 |
|
|
|
|
this.getType() |
|
|
|
|
}, |
|
|
|
|
mounted () { }, |
|
|
|
|
methods: { |
|
|
|
|
// 获取分类 |
|
|
|
|
async getType () { |
|
|
|
@ -259,7 +244,7 @@ export default { |
|
|
|
|
name: '', |
|
|
|
|
} |
|
|
|
|
this.typeVisible = true |
|
|
|
|
this.cascaderValue = data.path.split('/').map(e => +e) |
|
|
|
|
this.cascaderValue = data ? data.path.split('/').map(e => +e) : [] |
|
|
|
|
}, |
|
|
|
|
// 编辑分类 |
|
|
|
|
editType (node, data) { |
|
|
|
@ -403,7 +388,6 @@ export default { |
|
|
|
|
name: row.name, |
|
|
|
|
parentId: path.slice(0, path.length - 1), |
|
|
|
|
} |
|
|
|
|
console.log(11, this.form) |
|
|
|
|
}, |
|
|
|
|
// 知识点提交 |
|
|
|
|
async knowledgeSubmit () { |
|
|
|
@ -446,29 +430,29 @@ export default { |
|
|
|
|
Util.warningMsg('请选择数据') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 弹框关闭回调 |
|
|
|
|
closeDia () { |
|
|
|
|
this.$emit('closed') |
|
|
|
|
this.$emit('update:visible', false) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.m-b-20 { |
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.org-name { |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.w-100 { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.inQues { |
|
|
|
|
padding: 0 25px; |
|
|
|
|
} |
|
|
|
|
/deep/.kp-dia { |
|
|
|
|
.el-drawer__header { |
|
|
|
|
margin-bottom: 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.wrap { |
|
|
|
|
.page { |
|
|
|
|
display: flex; |
|
|
|
|
padding: 0 24px; |
|
|
|
|
|
|
|
|
|
.side { |
|
|
|
|
width: 300px; |
|
|
|
@ -477,9 +461,17 @@ export default { |
|
|
|
|
border-right: 1px solid rgba(0, 0, 0, 0.06); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.type-wrap { |
|
|
|
|
max-height: calc(100vh - 265px); |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.right { |
|
|
|
|
width: calc(100% - 324px); |
|
|
|
|
max-height: calc(100vh - 53px); |
|
|
|
|
padding: 24px 0; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |