This commit is contained in:
“zouyf” 2024-12-26 14:23:43 +08:00
parent be78520410
commit 48cd120eed
3 changed files with 31 additions and 5 deletions

View File

@ -1,4 +1,4 @@
<template> div<template>
<div class="book-wrap"> <div class="book-wrap">
<el-scrollbar height="100%"> <el-scrollbar height="100%">
<div class="book-name flex" v-if="isStadium() === true"> {{userStore.user.deptName}}</div> <div class="book-name flex" v-if="isStadium() === true"> {{userStore.user.deptName}}</div>
@ -7,11 +7,29 @@
<i class="iconfont icon-xiangyou"></i> <i class="iconfont icon-xiangyou"></i>
</div> </div>
<div class="book-list" v-loading="treeLoading"> <div class="book-list" v-loading="treeLoading">
<el-tree :data="treeData" accordion :props="defaultProps" node-key="id" :render-content="renderContent" <el-tree :data="treeData" accordion :props="defaultProps" node-key="id"
:default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current :default-expanded-keys="defaultExpandedKeys" :current-node-key="curNode.data.id" highlight-current
@node-click="handleNodeClick"> @node-click="handleNodeClick">
<template #default="{ node }"> <template #default="{ node }">
<span :title="node.label" class="tree-label">{{ node.label }}</span> <span :title="node.label" class="tree-label" >
{{ node.label }}
</span>
<!-- <div v-if="node.bookId == '' || node.bookId == '0'">
<el-tooltip effect="light" placement="top" content="当前单元章节无试题">
<span :title="node.label" class="tree-label" style="color: #A5B3CA">
{{ node }}
</span>
</el-tooltip>
</div>
<div v-else>
<span :title="node.label" class="tree-label">{{ node.label }}</span>
</div> -->
<!-- <div v-if="props.isClassTask == true">
</div>
<div v-else>
<span :title="node.label" class="tree-label">{{ node.label }}</span>
</div> -->
</template> </template>
</el-tree> </el-tree>
</div> </div>
@ -51,6 +69,13 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
const props = defineProps({
// []使()
isClassTask: {
default: true
},
})
const isStadium = () => { const isStadium = () => {
let roles = userStore.user.roles let roles = userStore.user.roles
return roles.some(item => item.roleKey === 'stadium') return roles.some(item => item.roleKey === 'stadium')
@ -184,7 +209,7 @@ const renderContent = (h, { node, data, store }) => {
'span', 'span',
{ {
style: { style: {
color: data.bookId==''||data.bookId=='0' ? '#A5B3CA' : 'black', color: props.isClassTask ? data.bookId==''||data.bookId=='0'?'#A5B3CA':'black' : 'black',
}, },
}, },
node.label node.label

View File

@ -815,6 +815,7 @@ const editWork = async (cform) =>{
let res = await updateClasswork(cform); let res = await updateClasswork(cform);
if (res.code == 200) { if (res.code == 200) {
ElMessage.success('更新成功'); ElMessage.success('更新成功');
taskList.value = [];
// //
if(isShow.value){ if(isShow.value){
currentRow.value.id = 1; currentRow.value.id = 1;

View File

@ -1,7 +1,7 @@
<template> <template>
<el-row class="model-wrap"> <el-row class="model-wrap">
<!-- 左侧 选择教材 目录 --> <!-- 左侧 选择教材 目录 -->
<ChooseTextbook @change-book="changeBook" @node-click="changeBook" /> <ChooseTextbook :isClassTask="true" @change-book="changeBook" @node-click="changeBook" />
<!-- 右侧 展示内容 --> <!-- 右侧 展示内容 -->
<div class="right-content"> <div class="right-content">
<div class="content-header-wrap"> <div class="content-header-wrap">