提交 17c5daeb authored 作者: matian's avatar matian

bug fixes:修改考试单选

上级 043e7687
......@@ -4,7 +4,8 @@ import { useQuestionList } from '@/composables/useQuestionList'
const appList = ref()
let { list: selectTree } = useQuestionList()
const tabValue = ref('1')
const multipleSelection: any = ref([])
const selectionRow: any = ref([])
const tableData = ref([])
const emit = defineEmits<Emits>()
const props = defineProps({
isShowExamDialog: {
......@@ -42,6 +43,7 @@ const listOptions = {
return params
},
callback(data: any) {
tableData.value = data.data
return { list: data.data, total: data.total }
},
params: {
......@@ -76,7 +78,8 @@ const listOptions = {
{ label: '总分', prop: 'paper_total_score' },
{ label: '及格分数', prop: 'pass_score' },
{ label: '更新时间', prop: 'updated_at' }
]
],
data: tableData.value
}
// 资源出处 tab触发
......@@ -87,10 +90,22 @@ const tabChange = () => {
const handleCancel = () => {
emit('update:isShowExamDialog', false)
}
const handleSelection = (selection: any) => {
// table组件选中事件
if (selection.length > 1) {
let del_row = selection.shift()
appList.value?.tableRef.toggleRowSelection(del_row, false)
console.log(selection, 'selection')
selectionRow.value = selection
} else {
selectionRow.value = selection
}
}
// 保存
const handleSave = () => {
const name = multipleSelection.value.map((item: any) => item.paper_title)[0]
const resource_id = multipleSelection.value.map((item: any) => item.id)[0]
console.log(selectionRow.value)
const name = selectionRow.value[0]?.paper_title
const resource_id = selectionRow.value[0]?.id
const params: any = {
name: name,
course_id: props.course_id,
......@@ -114,9 +129,6 @@ const defaultProps = {
const typeFilter = () => {
appList.value.refetch()
}
const handleSelectionChange = (val: any) => {
multipleSelection.value = val
}
</script>
<template>
......@@ -133,7 +145,7 @@ const handleSelectionChange = (val: any) => {
<el-tab-pane label="公开资源" name="2"></el-tab-pane>
</el-tabs>
</div>
<AppList v-bind="listOptions" ref="appList" @selection-change="handleSelectionChange">
<AppList v-bind="listOptions" ref="appList" @select="handleSelection">
<template #filter-type="{ params }">
<el-tree-select
@change="typeFilter"
......@@ -152,3 +164,8 @@ const handleSelectionChange = (val: any) => {
</div>
</el-drawer>
</template>
<style lang="scss" scoped>
:deep(.el-table__header-wrapper .el-checkbox) {
display: none;
}
</style>
......@@ -150,7 +150,7 @@ if (props.btnInfo.resource_type === '2') {
<el-radio
v-model="item.check_status"
:label="item"
style="position: absolute; right: 40px; bottom: 22px"
style="position: absolute; right: 15px; bottom: 22px"
>
{{ '' }}</el-radio
>
......
......@@ -264,8 +264,7 @@ const nodeType = (node: any) => {
:allow-drop="allowDrop"
@node-drop="handleDrop"
style="min-width: 100%"
accordion
default-expand-all
:expand-on-click-node="false"
>
<!-- -->
<template #default="{ node, data }">
......@@ -284,7 +283,13 @@ const nodeType = (node: any) => {
>
<el-link
class="btn_edit"
v-if="data.depth === '3' && node.data.resource_type !== '2' && node.data.resource_type !== '6'"
v-if="
data.depth === '3' &&
node.data.resource_type !== '2' &&
node.data.resource_type !== '6' &&
node.data.resource_type !== '3' &&
node.data.resource_type !== '9'
"
@click="handleDownload(node)"
:disabled="node.data.resource.can_view !== true"
style="margin-left: 35px"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论