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

bug fixes:修改考试单选

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