新增习题:待完善

This commit is contained in:
白了个白 2024-11-19 09:50:47 +08:00
parent e322103089
commit f8d0e846cd
4 changed files with 172 additions and 2 deletions

View File

@ -135,7 +135,13 @@ const dynamicRoutes = [
path: 'newClassTaskAssign', path: 'newClassTaskAssign',
component: () => import('@/views/classTask/newClassTaskAssign/index.vue'), component: () => import('@/views/classTask/newClassTaskAssign/index.vue'),
name: 'newClassTaskAssign', name: 'newClassTaskAssign',
meta: { title: '新作业设计', showBread: true } meta: { title: '新作业管理', showBread: true }
},
{
path: 'questionUpload',
component: () => import('@/views/classTask/newClassTaskAssign/questionUpload/index.vue'),
name: 'questionUpload',
meta: { title: '新作业管理', showBread: true }
}, },
{ {
path: 'classTask', path: 'classTask',

View File

@ -16,7 +16,7 @@
<!-- <i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i> --> <!-- <i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i> -->
<span>作业设计</span> <span>作业设计</span>
<!-- <i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i> --> <!-- <i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i> -->
<!-- <el-button type="primary" @click="goToNewClassTaskAssign">新版作业管理</el-button> --> <el-button type="primary" @click="goToNewClassTaskAssign">新版作业管理</el-button>
</div> </div>
<div v-else class="unit-top-left"> <div v-else class="unit-top-left">
<i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i> <i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i>

View File

@ -39,6 +39,9 @@
<el-col :span="5"> <el-col :span="5">
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button> <el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
</el-col> </el-col>
<el-col :span="5">
<el-button type="primary" @click="goToQuestUpload()">添加习题</el-button>
</el-col>
</el-row> </el-row>
<!-- 习题表格 --> <!-- 习题表格 -->
<div class="page-table" > <div class="page-table" >
@ -92,6 +95,7 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { listEntpcoursework } from '@/api/education/entpCourseWork' import { listEntpcoursework } from '@/api/education/entpCourseWork'
import { listEvaluationclue } from '@/api/classTask' import { listEvaluationclue } from '@/api/classTask'
@ -105,6 +109,7 @@ import { sessionStore } from '@/utils/store'
import {throttle,debounce } from '@/utils/comm' import {throttle,debounce } from '@/utils/comm'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const router = useRouter()
// emit // emit
const emit = defineEmits(['addQuiz']) const emit = defineEmits(['addQuiz'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -190,6 +195,10 @@ onMounted(() => {
debounceQueryData(); // debounceQueryData(); //
}) })
const goToQuestUpload = () => {
router.push({ path: '/questionUpload', query: { courseObj: JSON.stringify(props.bookobj) } });
}
const initPageParams = () => { const initPageParams = () => {
// //
workResource.entpCourseWorkList = []; workResource.entpCourseWorkList = [];

View File

@ -0,0 +1,155 @@
<template>
<div class="pagqe-quiz-upload">
<div class="page-left">
<el-tabs v-model="activeAptTab" style="height: 100%;">
<el-tab-pane label="人工录入" name="人工录入" class="prepare-center-zglr">
<div>
<vue-cropper
class="import-manual-cropper"
ref="cropper"
:img="cropOption.img"
:outputSize="cropOption.outputSize"
:outputType="cropOption.outputType"
:info="cropOption.info"
:canScale="cropOption.canScale"
:autoCrop="cropOption.autoCrop"
:autoCropWidth="cropOption.autoCropWidth"
:autoCropHeight="cropOption.autoCropHeight"
:fixedNumber="cropOption.fixedNumber"
:fixedBox="cropOption.fixedBox"
:fixed="cropOption.fixed"
:canMove="cropOption.canMove"
:canMoveBox="cropOption.canMoveBox"
:original="cropOption.original"
:centerBox="cropOption.centerBox"
:infoTrue="cropOption.infoTrue"
:maxImgSize="cropOption.maxImgSize"
:full="cropOption.full"
:enlarge="cropOption.enlarge"
:mode="cropOption.mode"
>
</vue-cropper>
<div class="import-manual-crop-menu">
<el-upload
action=""
:auto-upload="false"
:show-file-list="false"
:on-change="handleImportImg"
>
<el-button type="primary" size="small" class="manual-crop-menu-browse">本地浏览</el-button>
</el-upload>
<el-button type="primary" size="small" class="manual-crop-menu-browse" @click="getClipboardImg">获取剪贴板图片</el-button>
<el-button type="primary" size="small" class="manual-crop-menu-whole" @click="identifyOverallImg">整题识别</el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div class="page-right">
</div>
</div>
</template>
<script setup>
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash'
import { processList } from '@/hooks/useProcessList'
import { editListItem } from '@/hooks/useClassTask'
import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store'
import { useRouter, useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const route = useRoute();
const { proxy } = getCurrentInstance()
const props = defineProps({
})
const propsQueryCourseObj = route.query.courseObj;//
const courseObj = reactive({
// : id,id,id,
textbookId: '',
levelFirstId: '',
levelSecondId: '',
coursetitle:'',
node: null, //
//
})
const activeAptTab = ref("自主搜题");
const taskList = ref([]); //
const tasklist_loading = ref(false); //
onMounted(() => {
console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId //
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId //
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (/)
courseObj.node = JSON.parse(propsQueryCourseObj).node; //
}
initHomeWork();
})
/**
* 获取 entpcourseid 获取作业列表
*/
const initHomeWork = async()=> {
tasklist_loading.value = true;
// const { res, chapterId } = await useGetHomework(courseObj.node);
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
console.log('entpcourseid', chapterId);
console.log('res', res);
// entpcourseid.value = chapterId;
taskList.value = res;
tasklist_loading.value = false;
}
</script>
<style scoped lang="scss">
.pagqe-quiz-upload {
height: 100%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
.page-left {
min-width: 500px;
height: 100%;
padding: 0 5px;
margin: 0 5px;
overflow: hidden;
border-radius: 10px;
background-color: white;
:deep(.el-tabs__nav) {
.el-tabs__item{
font-weight: bold;
font-size: 18px;
}
}
.prepare-center-zglr{
height: 100%;
display: flex;
flex-direction: column;
}
}
.page-right {
width: 100%;
height: 100%;
background: #ffffff;
border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
display: flex;
flex-direction: column;
}
}
</style>