|
|
@ -89,9 +89,9 @@ |
|
|
|
<div style="margin-bottom: 15px;"> |
|
|
|
<div style="margin-bottom: 15px;"> |
|
|
|
<el-button type="primary" @click="add">新增试题</el-button> |
|
|
|
<el-button type="primary" @click="add">新增试题</el-button> |
|
|
|
<el-button type="primary" @click="batchImport">批量导入</el-button> |
|
|
|
<el-button type="primary" @click="batchImport">批量导入</el-button> |
|
|
|
<!-- <el-button type="primary" @click="add">批量转移</el-button> --> |
|
|
|
<!-- <el-button type="primary" @click="batchRemove">批量转移</el-button> --> |
|
|
|
<el-button type="primary" @click="add">批量移除 </el-button> |
|
|
|
<el-button type="primary" :disabled="!isKnowLedge" @click="batchRemove">批量移除 </el-button> |
|
|
|
<el-button type="primary" @click="delAllSelection">批量删除</el-button> |
|
|
|
<el-button type="primary" @click="batchDel">批量删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -124,7 +124,7 @@ |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 1)">复制</el-button> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 1)">复制</el-button> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 2)">查看</el-button> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 2)">查看</el-button> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 3)">编辑</el-button> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 3)">编辑</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">移除</el-button> |
|
|
|
<el-button type="text" :disabled="!isKnowLedge" @click="remove(scope.row)">移除</el-button> |
|
|
|
<el-button type="text" @click="del([scope.row])">删除</el-button> |
|
|
|
<el-button type="text" @click="del([scope.row])">删除</el-button> |
|
|
|
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" |
|
|
|
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" |
|
|
|
:active-text="scope.row.status ? '开' : '关'" |
|
|
|
:active-text="scope.row.status ? '开' : '关'" |
|
|
@ -204,12 +204,11 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Ueditor from '@/components/ueditor' |
|
|
|
|
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
import Detail from '../detail' |
|
|
|
import Detail from '../detail' |
|
|
|
import Const from '@/const/ques' |
|
|
|
import Const from '@/const/ques' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: { Ueditor, Breadcrumb, Detail }, |
|
|
|
components: { Breadcrumb, Detail }, |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
crumbs: [ |
|
|
|
crumbs: [ |
|
|
@ -285,18 +284,28 @@ export default { |
|
|
|
uploading: false, |
|
|
|
uploading: false, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
// 当前选择的是否是知识点 |
|
|
|
|
|
|
|
isKnowLedge () { |
|
|
|
|
|
|
|
if (this.isNotJoin === '') { |
|
|
|
|
|
|
|
let node = this.$refs.typeTree |
|
|
|
|
|
|
|
return node ? node.getCurrentNode().type === 1 : false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function (val) { |
|
|
|
keyword: function () { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(this.getType, 500); |
|
|
|
this.searchTimer = setTimeout(this.getType, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
'filter.keyword': function (val) { |
|
|
|
'filter.keyword': function () { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(this.initData, 500); |
|
|
|
this.searchTimer = setTimeout(this.initData, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
quesVisible () { |
|
|
|
quesVisible () { |
|
|
|
this.quesVisible || this.getList() |
|
|
|
this.quesVisible || this.getList() |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
this.getType() |
|
|
|
this.getType() |
|
|
@ -425,6 +434,23 @@ export default { |
|
|
|
this.curRow = row |
|
|
|
this.curRow = row |
|
|
|
this.detailType = type |
|
|
|
this.detailType = type |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 移除 |
|
|
|
|
|
|
|
async remove (row) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$confirm(`确认要移除吗?`, '提示', { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
await this.$post(this.api.removeQuestionKnowledge, { |
|
|
|
|
|
|
|
knowledgePointId: this.$refs.typeTree.getCurrentKey() || '', |
|
|
|
|
|
|
|
questionVersionIds: [row.questionVersionId] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
Util.successMsg('移除成功') |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
// 删除 |
|
|
|
async del (rows) { |
|
|
|
async del (rows) { |
|
|
|
const ids = rows.map(e => e.questionId) |
|
|
|
const ids = rows.map(e => e.questionId) |
|
|
@ -449,7 +475,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
async delAllSelection () { |
|
|
|
async batchDel () { |
|
|
|
const list = this.multipleSelection |
|
|
|
const list = this.multipleSelection |
|
|
|
list.length ? this.del(list) : Util.warningMsg('请选择数据') |
|
|
|
list.length ? this.del(list) : Util.warningMsg('请选择数据') |
|
|
|
}, |
|
|
|
}, |
|
|
@ -462,6 +488,30 @@ export default { |
|
|
|
this.delVisible = false |
|
|
|
this.delVisible = false |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量移除 |
|
|
|
|
|
|
|
async batchRemove () { |
|
|
|
|
|
|
|
const list = this.multipleSelection |
|
|
|
|
|
|
|
if (list.length) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$confirm(`确认要移除吗?`, '提示', { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
await this.$post(this.api.removeQuestionKnowledge, { |
|
|
|
|
|
|
|
knowledgePointId: this.$refs.typeTree.getCurrentKey() || '', |
|
|
|
|
|
|
|
questionVersionIds: list.map(e => e.questionVersionId) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
Util.successMsg('移除成功') |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
this.multipleSelection = [] |
|
|
|
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Util.warningMsg('请选择数据') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 禁启用 |
|
|
|
// 禁启用 |
|
|
|
async switchOff (val, row) { |
|
|
|
async switchOff (val, row) { |
|
|
|
try { |
|
|
|
try { |
|
|
|