作业设计

This commit is contained in:
白了个白 2024-09-18 10:23:13 +08:00
parent 7ae8547d41
commit 980e4d66e8
3 changed files with 202 additions and 2 deletions

View File

@ -74,6 +74,12 @@ export const constantRoutes = [
name: 'classCorrect', name: 'classCorrect',
meta: {title: '作业批改'}, meta: {title: '作业批改'},
}, },
{
path: '/newClassTask',
component: () => import('@/views/classTask/newClassTask.vue'),
name: 'newClassCorrect',
meta: {title: '作业设计'},
},
{ {
path: '/examReport', path: '/examReport',
component: () => import('@/views/examReport/index.vue'), component: () => import('@/views/examReport/index.vue'),

View File

@ -0,0 +1,193 @@
<template>
<div class="page-resource flex">
<el-menu
default-active="1"
class="el-menu-vertical-demo"
:collapse="isCollapse"
:style="{ width: isCollapse ? '64px' : '300px'}"
@open="handleOpen"
@close="handleClose"
>
<!--左侧 教材 目录-->
<!-- <div v-show="!isCollapse">
<Third v-if="isThird" @node-click="getDataOther"></Third>
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
</div> -->
<div >
<el-menu-item index="1">
<el-icon><document /></el-icon>
<template #title>
<Third v-if="isThird" @node-click="getDataOther"></Third>
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
</template>
</el-menu-item>
</div>
</el-menu>
<div class="page-right">
<el-form ref="classWorkForm" :model="classWorkForm" label-width="120" style="height: calc(100% - 55px);display: flex;flex-direction: column;">
<!-- 标题 -->
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="作业范围">
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
<el-radio-button :value="false">打开</el-radio-button>
<el-radio-button :value="true">折叠</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="作业名称">
<el-input type="text" v-model="classWorkForm.uniquekey" placeholder="请输入作业名称"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 搜索 -->
<!-- <ResoureSearch #add>
<el-button
v-if="sourceStore.isCreate"
type="primary"
round
class="create-btn"
@click="openDialog"
>
<i class="iconfont icon-jiahao"></i>
新建资源</el-button
>
</ResoureSearch> -->
<!-- 列表 -->
<!-- 第三方列表-->
<ThirdList v-if="isThird" />
<ResoureList v-else />
</div>
</div>
<!-- 上传弹窗 -->
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
</template>
<script setup>
import { onMounted, ref, toRaw,watch } from 'vue'
// import useResoureStore from './store'
import ChooseTextbook from '@/components/choose-textbook/index.vue'
import Third from '@/components/choose-textbook/third.vue'
// import ResoureSearch from './container/resoure-search.vue'
// import ResoureList from './container/resoure-list.vue'
// import ThirdList from './container/third-list.vue'
import uploadDialog from '@/components/upload-dialog/index.vue'
import uploaderState from '@/store/modules/uploader'
import { createWindow } from '@/utils/tool'
import { useToolState } from '@/store/modules/tool'
// const sourceStore = useResoureStore()
const isDialogOpen = ref(false)
const toolStore = useToolState()
const openDialog = () => {
isDialogOpen.value = true
}
// ---------------------------------------------------
const classWorkForm = ref({})
const isCollapse = ref(false)
// ---------------------------------------------------
//
const isThird = ref(false)
//
const getData = (data) => {
const { textBook, node } = data
let textbookId = textBook.curBookId
let levelSecondId = node.id
let levelFirstId
if (node.parentNode) {
levelFirstId = node.parentNode.id
} else {
levelFirstId = node.id
levelSecondId = ''
}
// sourceStore.query.levelFirstId = levelFirstId
// sourceStore.query.levelSecondId = levelSecondId
// sourceStore.query.textbookId = textbookId
// sourceStore.nodeData = {
// textbookId,
// levelFirstId,
// levelSecondId
// }
// sourceStore.handleQuery()
// ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
}
const getDataOther = (data) => {
// sourceStore.thirdQuery.chapterId = data.chapterId
// sourceStore.thirdQuery.bookId = data.bookId
// sourceStore.thirdQuery.stage = data.stage
// sourceStore.thirdQuery.subjectId = data.subjectId
// sourceStore.handleQuery()
}
//
const submitFile = (data) => {
// let fileList = toRaw(data)
// const { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } = sourceStore.query
// //
// fileList.forEach((item) => {
// let fileData = { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot }
// fileData.fileShowName = item.fileData.fileShowName
// fileData.fileFlag = item.fileData.fileFlag
// item.fileData = fileData
// item.callback = fileCallBack
// })
// uploaderState().pushFile(fileList)
}
const fileCallBack = (res) => {
// if (res.code == 200) {
// sourceStore.handleQuery()
// }
}
onMounted(() => {
// sourceStore.getCreate()
})
// watch(() => sourceStore.query.fileSource,() => {
// sourceStore.query.fileSource === ''?isThird.value = true:isThird.value = false
// })
</script>
<style lang="scss" scoped>
.page-resource {
padding-top: 10px;
height: 100%;
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 300px;
min-height: 100%;
}
.page-right {
min-width: 0;
display: flex;
flex-direction: column;
flex: 1;
margin-left: 20px;
height: 100%;
background: #ffffff;
border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
}
.icon-jiahao {
font-size: 12px;
margin-right: 3px;
font-weight: bold;
}
}
</style>

View File

@ -104,8 +104,9 @@ const menuList = [{
{ {
name: '作业设计', name: '作业设计',
icon: 'icon-jiaoxuefansi', icon: 'icon-jiaoxuefansi',
isOuter: true, //isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask' //path: '/teaching/classtaskassign?titleName=&&openDialog=newClassTask'
path: '/newClassTask'
}, },
{ {
name: '作业布置', name: '作业布置',