Merge branch 'main' into lyc-dev
This commit is contained in:
commit
797ac57441
|
@ -38,12 +38,12 @@ export class Classcourse {
|
||||||
if (isCourse) {
|
if (isCourse) {
|
||||||
// 连接socket
|
// 连接socket
|
||||||
ChatWs.id = classcourse.timgroupid // 群组id
|
ChatWs.id = classcourse.timgroupid // 群组id
|
||||||
if (!ChatWs.ws) {
|
// if (!ChatWs.ws) {
|
||||||
ChatWs.init().then(_ => {
|
// ChatWs.init().then(_ => {
|
||||||
isPublic && ChatWs.sendMsg('open', {id: classcourse.id})
|
// isPublic && ChatWs.sendMsg('open', {id: classcourse.id})
|
||||||
// isPublic && console.log('socket-开课消息-已发送')
|
// // isPublic && console.log('socket-开课消息-已发送')
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
this.classcourse = classcourse // 课堂信息
|
this.classcourse = classcourse // 课堂信息
|
||||||
this.id = classcourse.id // 课堂id
|
this.id = classcourse.id // 课堂id
|
||||||
// 如果课堂信息有paging,则更新当前页码
|
// 如果课堂信息有paging,则更新当前页码
|
||||||
|
|
|
@ -90,6 +90,12 @@ export const constantRoutes = [
|
||||||
name: 'questionUpload',
|
name: 'questionUpload',
|
||||||
meta: { title: '习题上传', showBread: true }
|
meta: { title: '习题上传', showBread: true }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'groupTestPaper',
|
||||||
|
component: () => import('@/views/classTask/groupTestPaper/index.vue'),
|
||||||
|
name: 'groupTestPaper',
|
||||||
|
meta: { title: '自动组卷', showBread: true }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'aiKolors',
|
path: 'aiKolors',
|
||||||
component: () => import('@/components/ai-kolors/index.vue'),
|
component: () => import('@/components/ai-kolors/index.vue'),
|
||||||
|
|
|
@ -9,11 +9,8 @@
|
||||||
<div style="font-size: 16px;font-weight: bold;color: #000;text-align: left;margin-bottom: 5px">可用分组</div>
|
<div style="font-size: 16px;font-weight: bold;color: #000;text-align: left;margin-bottom: 5px">可用分组</div>
|
||||||
<div class="groupList">
|
<div class="groupList">
|
||||||
<template v-for="(item,index) in groupList" :key="index">
|
<template v-for="(item,index) in groupList" :key="index">
|
||||||
<el-card style="width: 20%;
|
<el-card
|
||||||
margin-right: 10px;
|
class="card_div"
|
||||||
margin-bottom: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;"
|
|
||||||
v-if="item.parentid === 0"
|
v-if="item.parentid === 0"
|
||||||
@mouseenter="cardEnter(item,index)"
|
@mouseenter="cardEnter(item,index)"
|
||||||
@mouseleave="cardLeave(item,index)"
|
@mouseleave="cardLeave(item,index)"
|
||||||
|
@ -391,6 +388,7 @@ watch(()=> props.classId,()=> {
|
||||||
.groupList{
|
.groupList{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
gap:10px;
|
||||||
}
|
}
|
||||||
.card-row {
|
.card-row {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -415,4 +413,10 @@ watch(()=> props.classId,()=> {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
.card_div{
|
||||||
|
width: calc(20% - 10px);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,14 +1,69 @@
|
||||||
<template>
|
<template>
|
||||||
<el-card style="width: 100%;height: 100%">
|
<el-card style="width: 100%;height: 100%">
|
||||||
<el-descriptions :column="1">
|
<el-descriptions
|
||||||
<el-descriptions-item label="班级名称">{{ classInfo.caption }}</el-descriptions-item>
|
class="margin-top"
|
||||||
<el-descriptions-item label="教师">
|
:column="6"
|
||||||
|
:size="size"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-descriptions-item :span="2" :width="120">
|
||||||
|
<template #label>
|
||||||
|
<div class="cell-item">
|
||||||
|
<el-icon :style="iconStyle">
|
||||||
|
<user />
|
||||||
|
</el-icon>
|
||||||
|
班级名称
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
{{ classInfo.caption }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :width="120">
|
||||||
|
<template #label>
|
||||||
|
<div class="cell-item">
|
||||||
|
<el-icon :style="iconStyle">
|
||||||
|
<tickets />
|
||||||
|
</el-icon>
|
||||||
|
学段
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
{{ currentGrade }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :width="120">
|
||||||
|
<template #label>
|
||||||
|
<div class="cell-item">
|
||||||
|
<el-icon :style="iconStyle">
|
||||||
|
<location />
|
||||||
|
</el-icon>
|
||||||
|
年级
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
{{ currentGradeName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :width="120">
|
||||||
|
<template #label>
|
||||||
|
<div class="cell-item">
|
||||||
|
<el-icon :style="iconStyle">
|
||||||
|
<iphone />
|
||||||
|
</el-icon>
|
||||||
|
学生人数
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
{{ classInfo.classstudentcount || 0 }}人
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="4" :width="120">
|
||||||
|
<template #label>
|
||||||
|
<div class="cell-item">
|
||||||
|
<el-icon :style="iconStyle">
|
||||||
|
<office-building />
|
||||||
|
</el-icon>
|
||||||
|
教师
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template v-if="classInfo.teacher.length > 0">
|
<template v-if="classInfo.teacher.length > 0">
|
||||||
<el-tag style="margin-right: 5px;margin-bottom: 5px;" type="primary" v-for="(item, index) in classInfo.teacher" :key="index">{{item.name}}</el-tag>
|
<el-tag style="margin-right: 5px;margin-bottom: 5px;" type="primary" v-for="(item, index) in classInfo.teacher" :key="index">{{item.name}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>{{ classInfo.teachername }}</template>
|
<template v-else>{{ classInfo.teachername }}</template>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="学生人数">{{ classInfo.classstudentcount || 0 }}人</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
@ -17,7 +72,7 @@
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
|
import { getClassmain,listClassuser,leaveClass} from '@/api/classManage/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {reactive,onMounted,nextTick,watch} from 'vue'
|
import {reactive,onMounted,nextTick,watch,ref} from 'vue'
|
||||||
import delClassDemo from '@/store/modules/delClass'
|
import delClassDemo from '@/store/modules/delClass'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
classId: {
|
classId: {
|
||||||
|
@ -31,6 +86,36 @@
|
||||||
})
|
})
|
||||||
const isDelClass = delClassDemo()
|
const isDelClass = delClassDemo()
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
|
// 当前年级
|
||||||
|
const currentGradeName = ref('')
|
||||||
|
// 当前学段
|
||||||
|
const currentGrade = ref('')
|
||||||
|
// 获取年级
|
||||||
|
const gradeDataList = reactive([
|
||||||
|
[
|
||||||
|
{ label: '一年级', agekey: 1, checked: false, current: 1 },
|
||||||
|
{ label: '二年级', agekey: 2, checked: false, current: 1 },
|
||||||
|
{ label: '三年级', agekey: 3, checked: false, current: 1 },
|
||||||
|
{ label: '四年级', agekey: 4, checked: false, current: 1 },
|
||||||
|
{ label: '五年级', agekey: 5, checked: false, current: 1 },
|
||||||
|
{ label: '六年级', agekey: 6, checked: false, current: 1 },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ label: '初一', agekey: 7, checked: false, current: 2 },
|
||||||
|
{ label: '初二', agekey: 8, checked: false, current: 2 },
|
||||||
|
{ label: '初三', agekey: 9, checked: false, current: 2 },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ label: '高一', agekey: 10, checked: false, current: 3 },
|
||||||
|
{ label: '高二', agekey: 11, checked: false, current: 3 },
|
||||||
|
{ label: '高三', agekey: 12, checked: false, current: 3 },
|
||||||
|
],
|
||||||
|
])
|
||||||
|
const gradeData = reactive([
|
||||||
|
{current:1, label:'小学',},
|
||||||
|
{current:2, label:'初中',},
|
||||||
|
{current:3, label:'高中',},
|
||||||
|
])
|
||||||
//删除教室
|
//删除教室
|
||||||
const deleteClassRoom = () => {
|
const deleteClassRoom = () => {
|
||||||
ElMessageBox.alert('确认删除该班级?', {
|
ElMessageBox.alert('确认删除该班级?', {
|
||||||
|
@ -53,6 +138,14 @@
|
||||||
if(props.classId){
|
if(props.classId){
|
||||||
getClassmain(props.classId).then(response => {
|
getClassmain(props.classId).then(response => {
|
||||||
Object.assign(classInfo,response.data)
|
Object.assign(classInfo,response.data)
|
||||||
|
//先把二级数组转化为一级数组,用于筛选
|
||||||
|
const flatGradeDataList = gradeDataList.flat();
|
||||||
|
//学段和年级的回显处理
|
||||||
|
const currentIndex = flatGradeDataList.findIndex(item => item.agekey === Number(response.data.agekey));
|
||||||
|
currentGradeName.value = flatGradeDataList[currentIndex].label
|
||||||
|
const current = flatGradeDataList[currentIndex].current
|
||||||
|
currentGrade.value = gradeData.find(item => item.current === current).label
|
||||||
|
console.log(classInfo,'classInfo');
|
||||||
listClassuser({classid:props.classId,pageSize:100}).then(res => {
|
listClassuser({classid:props.classId,pageSize:100}).then(res => {
|
||||||
classInfo.teacher = res.rows.filter(item => item.inrole === 'teacher')
|
classInfo.teacher = res.rows.filter(item => item.inrole === 'teacher')
|
||||||
classInfo.student = res.rows.filter(item => item.inrole === 'student')
|
classInfo.student = res.rows.filter(item => item.inrole === 'student')
|
||||||
|
@ -71,5 +164,14 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.el-descriptions {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.cell-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.margin-top {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,195 @@
|
||||||
|
<template>
|
||||||
|
<div class="page-testpaper">
|
||||||
|
<div class="page-center">
|
||||||
|
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||||
|
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
|
||||||
|
<SearchQuestion :bookobj="courseObj" @addQuizItem="handleClassWorkQuizItemAdd" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<!-- <el-tab-pane label="校本题库" name="校本题库" class="prepare-center-xbtk">
|
||||||
|
<SchoolQuestion />
|
||||||
|
</el-tab-pane> -->
|
||||||
|
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
|
||||||
|
<MyQuestion :bookobj="courseObj" @addQuizItem="handleClassWorkQuizItemAdd"/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
<div class="page-right">
|
||||||
|
<p>总{{ classWorkForm.quizlist.length }}题 <span>进入组卷中心</span></p>
|
||||||
|
<div v-for="(item, index) in classWorkForm.worktypeList" :key="index" class="page-right-item">
|
||||||
|
<span>{{ item.key }}: {{ item.value }}题</span> <span @click="handleDeleteQuizItem(item)">删除</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick, defineEmits } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
import { processList } from '@/hooks/useProcessList'
|
||||||
|
|
||||||
|
import MyQuestion from '@/views/classTask/newClassTaskAssign/myQuestion/index.vue'
|
||||||
|
import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
|
||||||
|
|
||||||
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import useClassTaskStore from '@/store/modules/classTask'
|
||||||
|
|
||||||
|
const userStore = useUserStore().user
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter()
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
|
const emits = defineEmits(['getData'])
|
||||||
|
const props = defineProps({
|
||||||
|
currentCourse: Object,
|
||||||
|
})
|
||||||
|
|
||||||
|
const propsQueryCourseObj = route.query.courseObj;//作业布置的内容对象
|
||||||
|
const courseObj = reactive({
|
||||||
|
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||||
|
textbookId: '',
|
||||||
|
levelFirstId: '',
|
||||||
|
levelSecondId: '',
|
||||||
|
coursetitle:'',
|
||||||
|
node: null, // 选择的课程节点
|
||||||
|
//
|
||||||
|
})
|
||||||
|
const activeAptTab = ref("自主搜题");
|
||||||
|
let classWorkForm = reactive({
|
||||||
|
id: '',// ,
|
||||||
|
uniquekey: '',// , // 作业唯一标识 作业名称
|
||||||
|
worktype: '',// '习题训练', //作业类型
|
||||||
|
worktypeList: [],// '习题训练', //作业类型
|
||||||
|
title: '',// // 作业说明
|
||||||
|
quizlist: [],// // 作业习题列表内容
|
||||||
|
}); // 需要提交 提交的作业内容
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if(propsQueryCourseObj){
|
||||||
|
if(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; // 保存当前节点
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加作业
|
||||||
|
* @param entpcourseworkid
|
||||||
|
*/
|
||||||
|
const handleClassWorkQuizItemAdd = (row) => {
|
||||||
|
var exist = false;
|
||||||
|
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
||||||
|
if (classWorkForm.quizlist[i].id == row.id) {
|
||||||
|
exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (exist == false) {
|
||||||
|
// getEntpcoursework(entpcourseworkid).then(res => {
|
||||||
|
// //res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
|
||||||
|
// // 暂时手动新增试题的分数
|
||||||
|
// if(res.data.score == null){
|
||||||
|
// res.data.score = 4;
|
||||||
|
// }
|
||||||
|
// classWorkForm.quizlist.push(res.data);
|
||||||
|
// // 格式化试题
|
||||||
|
// processList(classWorkForm.quizlist);
|
||||||
|
// })
|
||||||
|
|
||||||
|
// TODO 先写死
|
||||||
|
classWorkForm.quizlist.push(row);
|
||||||
|
// 格式化试题
|
||||||
|
processList(classWorkForm.quizlist);
|
||||||
|
|
||||||
|
console.log(classWorkForm.quizlist)
|
||||||
|
// 作业类型分类
|
||||||
|
classWorkForm.quizlist && classWorkForm.quizlist.forEach(item => {
|
||||||
|
if(!classWorkForm.worktypeList.some(i => i.key.includes(item.worktype))){
|
||||||
|
const num = classWorkForm.quizlist.filter(_item => _item.key == item.worktype).length
|
||||||
|
const obj = {
|
||||||
|
key: item.worktype,
|
||||||
|
value: num
|
||||||
|
}
|
||||||
|
classWorkForm.worktypeList.push(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(classWorkForm.worktypeList)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ElMessage('试题已经存在')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除作业类型试题
|
||||||
|
* @param row
|
||||||
|
*/
|
||||||
|
const handleDeleteQuizItem = (row) => {
|
||||||
|
for (var i=0; i< classWorkForm.worktypeList.length; i++) {
|
||||||
|
if (classWorkForm.worktypeList[i].key == row.key) {
|
||||||
|
classWorkForm.worktypeList.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var j=0; j< classWorkForm.quizlist.length; j++) {
|
||||||
|
if (classWorkForm.quizlist[j].worktype == row.key) {
|
||||||
|
classWorkForm.quizlist.splice(j, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
watch(() => props.currentCourse, (newVal, oldVal) => {
|
||||||
|
|
||||||
|
},{deep:true})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page-testpaper {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
.page-center{
|
||||||
|
flex: 1;
|
||||||
|
//min-width: calc(100% - 675px);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 5px;
|
||||||
|
margin: 0 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: white;
|
||||||
|
|
||||||
|
.prepare-center-zzst{
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.prepare-center-xbtk{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.prepare-center-grst{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.page-right{
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -38,6 +38,7 @@ const items = shallowRef([
|
||||||
// { title: 'AI设计作业', description: '通过AI助手,根据课标、教材、考试等分析结果,智能创建作业。', icon: '#icon-jiqiren_o',type:'danger' },
|
// { title: 'AI设计作业', description: '通过AI助手,根据课标、教材、考试等分析结果,智能创建作业。', icon: '#icon-jiqiren_o',type:'danger' },
|
||||||
{ title: '习题上传', description: '自己上传个人题库。', icon: '#icon-shangchuan',type:'danger' },
|
{ title: '习题上传', description: '自己上传个人题库。', icon: '#icon-shangchuan',type:'danger' },
|
||||||
{ title: '科学实验', description: '学生完成虚拟仿真实验,并提交实验结果。', icon: '#icon-shangchuan',type:'primary' },
|
{ title: '科学实验', description: '学生完成虚拟仿真实验,并提交实验结果。', icon: '#icon-shangchuan',type:'primary' },
|
||||||
|
// { title: '自主组卷', description: '老师自主选择试题组卷。', icon: '#icon-shangchuan',type:'primary' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const handleClick = (item) => {
|
const handleClick = (item) => {
|
||||||
|
|
|
@ -1,27 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="page-top" v-if="!isShow">
|
<div class="page-top" v-if="!isShow">
|
||||||
<div class="page-top-left">
|
<div>
|
||||||
<el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
|
<el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
|
||||||
<el-button type="success" @click="handleTaskAssignToAllClass()">批量推送</el-button>
|
<el-button type="success" @click="handleTaskAssignToAllClass()">批量推送</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="currentRow.id > 0" class="page-top-right">
|
<div style="margin-left: 20px;">
|
||||||
<el-button type="primary" @click="handleNewAllClass" :icon="Plus">设计新作业</el-button>
|
<div v-if="currentRow.id > 0">
|
||||||
|
<el-button type="primary" @click="handleNewAllClass"><i class="iconfont icon-fanhui"></i>返回 设计作业</el-button>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<span style="font-size: 14px; color: red">温馨提示:选择下列作业类型可进行作业设计</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-resource">
|
<div class="page-resource">
|
||||||
<div class="page-left" v-if="!isShow">
|
<div class="page-left" v-if="!isShow">
|
||||||
<el-table
|
<el-table ref="taskTable" v-loading="tasklist_loading" :data="taskList" :tree-props="{ checkStrictly: true }"
|
||||||
ref="taskTable"
|
row-key="id" style="width: 100%;height: 100%; border: 1px solid #dcdfe6;border-radius: 3px;flex:1"
|
||||||
v-loading="tasklist_loading"
|
highlight-current-row @current-change="handleCurrentChange">
|
||||||
:data="taskList"
|
<el-table-column type="selection" min-width="2%" align="center" :selectable="selectable" />
|
||||||
:tree-props="{checkStrictly: true}"
|
|
||||||
row-key="id"
|
|
||||||
style="width: 100%;height: 100%; border: 1px solid #dcdfe6;border-radius: 3px;flex:1"
|
|
||||||
highlight-current-row
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" min-width="2%" align="center" :selectable="selectable"/>
|
|
||||||
<el-table-column label="作业布置" min-width="15%" align="center">
|
<el-table-column label="作业布置" min-width="15%" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div style="height: 100px;cursor: pointer">
|
<div style="height: 100px;cursor: pointer">
|
||||||
|
@ -31,11 +29,13 @@
|
||||||
<span>{{ scope.row.uniquekey }}</span>
|
<span>{{ scope.row.uniquekey }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="pageleft-table-top" style="display: flex;justify-content: space-between">
|
<div class="pageleft-table-top" style="display: flex;justify-content: space-between">
|
||||||
<el-tag style="padding:0 2px" :type="scope.row.workclass" size="default">{{ scope.row.worktype }}</el-tag>
|
<el-tag style="padding:0 2px" :type="scope.row.workclass" size="default">{{ scope.row.worktype
|
||||||
|
}}</el-tag>
|
||||||
<el-text size="small" style="color:#ccc;white-space:nowrap">{{ scope.row.timestamp }}</el-text>
|
<el-text size="small" style="color:#ccc;white-space:nowrap">{{ scope.row.timestamp }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
<div class="pageleft-table-cont">
|
<div class="pageleft-table-cont">
|
||||||
<div :title="scope.row.worktag || scope.row.title" class="ellipsis "> {{ scope.row.worktype == "课堂展示" ? scope.row.worktag : scope.row.title }}</div>
|
<div :title="scope.row.worktag || scope.row.title" class="ellipsis "> {{ scope.row.worktype ==
|
||||||
|
"课堂展示" ? scope.row.worktag : scope.row.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<svg class="icon iconfont" aria-hidden="true">
|
<svg class="icon iconfont" aria-hidden="true">
|
||||||
|
@ -53,7 +53,8 @@
|
||||||
<Right @itemClick="handleItemClick" />
|
<Right @itemClick="handleItemClick" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="(currentRow.worktype == '习题训练' || classWorkForm.worktype == '习题训练') && currentRow.id>0" class="page-center">
|
<div v-if="(currentRow.worktype == '习题训练' || classWorkForm.worktype == '习题训练') && currentRow.id > 0"
|
||||||
|
class="page-center">
|
||||||
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||||
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
|
<el-tab-pane label="自主搜题" name="自主搜题" class="prepare-center-zzst">
|
||||||
<SearchQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" />
|
<SearchQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" />
|
||||||
|
@ -62,59 +63,65 @@
|
||||||
<SchoolQuestion />
|
<SchoolQuestion />
|
||||||
</el-tab-pane> -->
|
</el-tab-pane> -->
|
||||||
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
|
<el-tab-pane label="个人题库" name="个人题库" class="prepare-center-grst">
|
||||||
<MyQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd"/>
|
<MyQuestion :bookobj="courseObj" @addQuiz="handleClassWorkQuizAdd" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id>0" class="page-center">
|
<div v-if="(currentRow.worktype == '课堂展示' || classWorkForm.worktype == '课堂展示') && currentRow.id > 0"
|
||||||
|
class="page-center">
|
||||||
<div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;">
|
<div v-loading="boardLoading" class="board-wrap" style="height: 100%; flex: 1; overflow: hidden;">
|
||||||
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false" :data="classWorkForm.whiteboardObj" />
|
<whiteboard ref="boardref" height="100%" width="100%" :isShowSave="false"
|
||||||
|
:data="classWorkForm.whiteboardObj" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业')&& currentRow.id>0" class="page-center">
|
<div v-if="(currentRow.worktype == '常规作业' || classWorkForm.worktype == '常规作业') && currentRow.id > 0"
|
||||||
|
class="page-center">
|
||||||
<div v-loading="fileLoading" class="upload-homework">
|
<div v-loading="fileLoading" class="upload-homework">
|
||||||
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800"
|
||||||
|
:fileType="['mp3', 'mp4', 'doc', 'docx', 'xlsx', 'xls', 'pdf', 'ppt', 'pptx', 'jpg', 'jpeg', 'gif', 'png', 'txt']" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="(currentRow.worktype == '科学实验' || classWorkForm.worktype == '科学实验')&& currentRow.id>0" class="page-center">
|
<div v-if="(currentRow.worktype == '科学实验' || classWorkForm.worktype == '科学实验') && currentRow.id > 0"
|
||||||
|
class="page-center">
|
||||||
<div class="experiment-homework">
|
<div class="experiment-homework">
|
||||||
<ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" />
|
<ExperimentQuestion :expObj="classWorkForm.fileHomeworkList&&classWorkForm.fileHomeworkList[0]" @clickExpObj="getExpObj" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="currentRow.id>0 " class="page-right">
|
<div v-if="currentRow.id > 0" class="page-right">
|
||||||
<div class="prepare-top" >
|
<div class="prepare-top">
|
||||||
<el-button v-if="currentRow.id != 1 " type="success" @click="openSet(currentRow,'item')">推 送</el-button>
|
<span>作业详情说明</span>
|
||||||
|
<el-button v-if="currentRow.id != 1" type="success" @click="openSet(currentRow, 'item')">推 送</el-button>
|
||||||
<el-button type="primary" @click="handleClassWorkSave">保 存</el-button>
|
<el-button type="primary" @click="handleClassWorkSave">保 存</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="prepare-con" >
|
<div class="prepare-con">
|
||||||
<el-form
|
<el-form ref="classWorkFormRef" :model="classWorkForm" label-width="90"
|
||||||
ref="classWorkFormRef"
|
style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;">
|
||||||
:model="classWorkForm"
|
<div>
|
||||||
label-width="90"
|
|
||||||
style=" height: 100%; overflow: hidden;display: flex;flex-direction: column;"
|
|
||||||
>
|
|
||||||
<div >
|
|
||||||
<el-form-item label="作业名称">
|
<el-form-item label="作业名称">
|
||||||
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/>
|
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="作业说明" style="margin: 10px 0;">
|
<el-form-item label="作业说明" style="margin: 10px 0;">
|
||||||
<el-input v-if="classWorkForm.worktype != '课堂展示'" v-model="classWorkForm.title" style="width: 400px" placeholder="请输入作业说明"/>
|
<el-input v-if="classWorkForm.worktype != '课堂展示'" v-model="classWorkForm.title" style="width: 400px"
|
||||||
|
placeholder="请输入作业说明" />
|
||||||
<!-- 课堂展示 这里字段不一样 -->
|
<!-- 课堂展示 这里字段不一样 -->
|
||||||
<el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea" placeholder="请输入作业说明" />
|
<el-input v-if="classWorkForm.worktype == '课堂展示'" v-model="classWorkForm.question" type="textarea"
|
||||||
|
placeholder="请输入作业说明" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list">
|
<div v-if="classWorkForm.worktype == '习题训练'" class="pageRight-list">
|
||||||
<div :style="{height: '100%', 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
<div
|
||||||
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
|
:style="{ height: '100%', 'overflow': 'auto', 'border': '1px dotted blue', 'border-radius': '5px', 'background-color': '#f7f7f7' }">
|
||||||
|
<template v-for="(item, index) in classWorkForm.quizlist" :key="item.id">
|
||||||
<div style="margin: 5px; background-color: white; text-align: left;">
|
<div style="margin: 5px; background-color: white; text-align: left;">
|
||||||
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<el-form-item label="分值">
|
<el-form-item label="分值">
|
||||||
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
|
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" @click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
|
<div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger"
|
||||||
|
@click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -126,7 +133,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 推送作业的配置对话框 -->
|
<!-- 推送作业的配置对话框 -->
|
||||||
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :rows="rowsList" @on-close="closeHomework" @on-success="successHomework"/>
|
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :rows="rowsList" @on-close="closeHomework"
|
||||||
|
@on-success="successHomework" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -135,9 +143,9 @@ import { ElMessage } from 'element-plus'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { Plus, Delete } from '@element-plus/icons-vue'
|
import { Plus, Delete } from '@element-plus/icons-vue'
|
||||||
import { delClasswork } from '@/api/teaching/classwork'
|
import { delClasswork } from '@/api/teaching/classwork'
|
||||||
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
import { listEntpcoursework, listEntpcourseworkNew, getEntpcoursework } from '@/api/education/entpCourseWork'
|
||||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||||
import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval,addClassworkeval,updateClassworkeval } from '@/api/classTask'
|
import { updateClasswork, listEvaluationclue, listClassworkeval, delClassworkeval, addClassworkeval, updateClassworkeval } from '@/api/classTask'
|
||||||
|
|
||||||
import { processList } from '@/hooks/useProcessList'
|
import { processList } from '@/hooks/useProcessList'
|
||||||
import { editListItem } from '@/hooks/useClassTask'
|
import { editListItem } from '@/hooks/useClassTask'
|
||||||
|
@ -180,12 +188,12 @@ const courseObj = reactive({
|
||||||
textbookId: '',
|
textbookId: '',
|
||||||
levelFirstId: '',
|
levelFirstId: '',
|
||||||
levelSecondId: '',
|
levelSecondId: '',
|
||||||
coursetitle:'',
|
coursetitle: '',
|
||||||
node: null, // 选择的课程节点
|
node: null, // 选择的课程节点
|
||||||
//
|
//
|
||||||
})
|
})
|
||||||
const taskTable = ref(null);
|
const taskTable = ref(null);
|
||||||
const activeAptTab = ref("自主搜题");
|
const activeAptTab = ref("自主搜题");
|
||||||
const taskList = ref([]); // 作业列表
|
const taskList = ref([]); // 作业列表
|
||||||
const tasklist_loading = ref(false); // 加载中
|
const tasklist_loading = ref(false); // 加载中
|
||||||
const classWorkFormRef = ref(null);
|
const classWorkFormRef = ref(null);
|
||||||
|
@ -195,7 +203,7 @@ const setDialog = ref(false); // 推送配置 弹窗
|
||||||
const rowsList = ref([]) // 当前需要推送行的数据
|
const rowsList = ref([]) // 当前需要推送行的数据
|
||||||
const entpcourseid = ref('') // 当前课程id
|
const entpcourseid = ref('') // 当前课程id
|
||||||
|
|
||||||
const currentRow = ref({id:0}); // 当前选中的行--左侧作业布置模版列表
|
const currentRow = ref({ id: 0 }); // 当前选中的行--左侧作业布置模版列表
|
||||||
|
|
||||||
// 课堂展示-------
|
// 课堂展示-------
|
||||||
const boardLoading = ref(false);
|
const boardLoading = ref(false);
|
||||||
|
@ -205,16 +213,16 @@ const fileLoading = ref(false); // 常规作业loading
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//console.log("----onMounted-------");
|
//console.log("----onMounted-------");
|
||||||
currentRow.value.id = 0
|
currentRow.value.id = 0
|
||||||
if(propsQueryCourseObj){
|
if (propsQueryCourseObj) {
|
||||||
if(JSON.parse(propsQueryCourseObj)){
|
if (JSON.parse(propsQueryCourseObj)) {
|
||||||
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // 版本
|
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // 版本
|
||||||
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId // 单元
|
courseObj.levelFirstId = JSON.parse(propsQueryCourseObj).levelFirstId // 单元
|
||||||
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId // 章节
|
courseObj.levelSecondId = JSON.parse(propsQueryCourseObj).levelSecondId // 章节
|
||||||
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (单元/章节) 名称
|
courseObj.coursetitle = JSON.parse(propsQueryCourseObj).coursetitle // (单元/章节) 名称
|
||||||
courseObj.node = JSON.parse(propsQueryCourseObj).node; // 保存当前节点
|
courseObj.node = JSON.parse(propsQueryCourseObj).node; // 保存当前节点
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if(props.currentCourse){
|
if (props.currentCourse) {
|
||||||
courseObj.textbookId = props.currentCourse.textbookId // 版本
|
courseObj.textbookId = props.currentCourse.textbookId // 版本
|
||||||
courseObj.levelFirstId = props.currentCourse.levelFirstId // 单元
|
courseObj.levelFirstId = props.currentCourse.levelFirstId // 单元
|
||||||
courseObj.levelSecondId = props.currentCourse.levelSecondId // 章节
|
courseObj.levelSecondId = props.currentCourse.levelSecondId // 章节
|
||||||
|
@ -222,11 +230,11 @@ onMounted(() => {
|
||||||
courseObj.node = props.currentCourse.node; // 保存当前节点
|
courseObj.node = props.currentCourse.node; // 保存当前节点
|
||||||
classWorkForm.worktype = props.currentCourse.worktype
|
classWorkForm.worktype = props.currentCourse.worktype
|
||||||
currentRow.value = {
|
currentRow.value = {
|
||||||
id:props.currentCourse.id,
|
id: props.currentCourse.id,
|
||||||
worktype:props.currentCourse.worktype
|
worktype: props.currentCourse.worktype
|
||||||
}
|
}
|
||||||
isShow.value = true;
|
isShow.value = true;
|
||||||
}else{
|
} else {
|
||||||
isShow.value = false;
|
isShow.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,8 +243,8 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
// 是否进入个人题库
|
// 是否进入个人题库
|
||||||
const isInToMyQuestion = () => {
|
const isInToMyQuestion = () => {
|
||||||
console.log('isOpenQuestUploadView',useClassTaskStores.isOpenQuestUploadView);
|
console.log('isOpenQuestUploadView', useClassTaskStores.isOpenQuestUploadView);
|
||||||
if(useClassTaskStores.isOpenQuestUploadView){
|
if (useClassTaskStores.isOpenQuestUploadView) {
|
||||||
useClassTaskStores.isOpenQuestUploadView = false;
|
useClassTaskStores.isOpenQuestUploadView = false;
|
||||||
|
|
||||||
currentRow.value.id = 1; // 作业设计
|
currentRow.value.id = 1; // 作业设计
|
||||||
|
@ -254,23 +262,23 @@ const isInToMyQuestion = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
watch(() => props.currentCourse, (newVal, oldVal) => {
|
watch(() => props.currentCourse, (newVal, oldVal) => {
|
||||||
if(newVal){
|
if (newVal) {
|
||||||
courseObj.textbookId = newVal.textbookId // 版本
|
courseObj.textbookId = newVal.textbookId // 版本
|
||||||
courseObj.levelFirstId = newVal.levelFirstId // 单元
|
courseObj.levelFirstId = newVal.levelFirstId // 单元
|
||||||
courseObj.levelSecondId = newVal.levelSecondId // 章节
|
courseObj.levelSecondId = newVal.levelSecondId // 章节
|
||||||
courseObj.coursetitle = newVal.coursetitle // (单元/章节) 名称
|
courseObj.coursetitle = newVal.coursetitle // (单元/章节) 名称
|
||||||
courseObj.node = newVal.node; // 保存当前节点
|
courseObj.node = newVal.node; // 保存当前节点
|
||||||
classWorkForm.worktype = newVal.worktype
|
classWorkForm.worktype = newVal.worktype
|
||||||
currentRow.value = {
|
currentRow.value = {
|
||||||
id:props.currentCourse.id,
|
id: props.currentCourse.id,
|
||||||
worktype:props.currentCourse.worktype
|
worktype: props.currentCourse.worktype
|
||||||
}
|
|
||||||
}
|
}
|
||||||
console.log(newVal,'newval');
|
}
|
||||||
},{deep:true})
|
console.log(newVal, 'newval');
|
||||||
|
}, { deep: true })
|
||||||
|
|
||||||
// ------------科学实验
|
// ------------科学实验
|
||||||
const getExpObj = (obj)=>{
|
const getExpObj = (obj) => {
|
||||||
// obj:{
|
// obj:{
|
||||||
// fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html"
|
// fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html"
|
||||||
// label: "数量比较"
|
// label: "数量比较"
|
||||||
|
@ -281,10 +289,14 @@ const getExpObj = (obj)=>{
|
||||||
//---------作业设计---
|
//---------作业设计---
|
||||||
const handleItemClick = (itemName) => {
|
const handleItemClick = (itemName) => {
|
||||||
console.log('itemName', itemName);
|
console.log('itemName', itemName);
|
||||||
if(itemName == '习题上传'){
|
if (itemName == '习题上传') {
|
||||||
router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(courseObj) } });
|
router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(courseObj) } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (itemName == '自主组卷') {
|
||||||
|
router.push({ path: '/model/groupTestPaper', query: { courseObj: JSON.stringify(courseObj) } });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
currentRow.value.id = 1; // 作业设计
|
currentRow.value.id = 1; // 作业设计
|
||||||
/**
|
/**
|
||||||
|
@ -293,7 +305,7 @@ const handleItemClick = (itemName) => {
|
||||||
* 课堂展示
|
* 课堂展示
|
||||||
* 常规作业
|
* 常规作业
|
||||||
*/
|
*/
|
||||||
const typeName = itemName == "自主搜题" || itemName == "校本题库"|| itemName == "个人题库" ? "习题训练" : itemName;
|
const typeName = itemName == "自主搜题" || itemName == "校本题库" || itemName == "个人题库" ? "习题训练" : itemName;
|
||||||
activeAptTab.value = itemName;
|
activeAptTab.value = itemName;
|
||||||
//提交内容清空 重置
|
//提交内容清空 重置
|
||||||
classWorkForm.id = 0;
|
classWorkForm.id = 0;
|
||||||
|
@ -310,13 +322,13 @@ const handleItemClick = (itemName) => {
|
||||||
|
|
||||||
|
|
||||||
//---------作业布置列表相关--------------
|
//---------作业布置列表相关--------------
|
||||||
const selectable=(row, index)=>{
|
const selectable = (row, index) => {
|
||||||
return row.status == '10';
|
return row.status == '10';
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 获取 entpcourseid 获取作业列表
|
* 获取 entpcourseid 获取作业列表
|
||||||
*/
|
*/
|
||||||
const initHomeWork = async ()=> {
|
const initHomeWork = async () => {
|
||||||
tasklist_loading.value = true;
|
tasklist_loading.value = true;
|
||||||
// const { res, chapterId } = await useGetHomework(courseObj.node);
|
// const { res, chapterId } = await useGetHomework(courseObj.node);
|
||||||
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
|
const { res, chapterId } = await useGetHomework(sessionStore.get('subject.curNode'));
|
||||||
|
@ -326,9 +338,9 @@ const initHomeWork = async ()=> {
|
||||||
taskList.value = res;
|
taskList.value = res;
|
||||||
// 判断当前是否存在其他页面跳转编辑, 如果初次且存在id,则选中该任务
|
// 判断当前是否存在其他页面跳转编辑, 如果初次且存在id,则选中该任务
|
||||||
const taskId = propsQueryTask?.id ?? 0;
|
const taskId = propsQueryTask?.id ?? 0;
|
||||||
if (!propsQueryTask.isInit && taskId!=0){
|
if (!propsQueryTask.isInit && taskId != 0) {
|
||||||
const activeRow = taskList.value.find(o => o.id == taskId);
|
const activeRow = taskList.value.find(o => o.id == taskId);
|
||||||
if (activeRow){
|
if (activeRow) {
|
||||||
propsQueryTask.isInit = true; // 清空避免重新保存后再次选中该任务
|
propsQueryTask.isInit = true; // 清空避免重新保存后再次选中该任务
|
||||||
taskTable.value.setCurrentRow(activeRow);
|
taskTable.value.setCurrentRow(activeRow);
|
||||||
handleCurrentChange(activeRow);
|
handleCurrentChange(activeRow);
|
||||||
|
@ -355,10 +367,10 @@ const handleNewAllClass = () => {
|
||||||
/**
|
/**
|
||||||
* 删除按钮操作
|
* 删除按钮操作
|
||||||
* */
|
* */
|
||||||
const handleDelete =() => {
|
const handleDelete = () => {
|
||||||
let rows = proxy.$refs.taskTable.getSelectionRows();
|
let rows = proxy.$refs.taskTable.getSelectionRows();
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
proxy.$modal.confirm('是否确认选中的学习任务?').then(()=> {
|
proxy.$modal.confirm('是否确认选中的学习任务?').then(() => {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
ids.push(rows[i].id);
|
ids.push(rows[i].id);
|
||||||
|
@ -374,8 +386,8 @@ const handleDelete =() => {
|
||||||
}, 1500);
|
}, 1500);
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
|
||||||
}).catch(() => {})
|
}).catch(() => { })
|
||||||
}else{
|
} else {
|
||||||
proxy.$modal.alertWarning("请选择删除项")
|
proxy.$modal.alertWarning("请选择删除项")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -386,12 +398,12 @@ const handleDelete =() => {
|
||||||
const handleTaskAssignToAllClass = () => {
|
const handleTaskAssignToAllClass = () => {
|
||||||
let rows = proxy.$refs.taskTable.getSelectionRows();
|
let rows = proxy.$refs.taskTable.getSelectionRows();
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
proxy.$modal.confirm('是否确认推送选中的学习任务?').then(()=> {
|
proxy.$modal.confirm('是否确认推送选中的学习任务?').then(() => {
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 弹出配置窗口 ,让用户配置推送策略
|
// 弹出配置窗口 ,让用户配置推送策略
|
||||||
openSet(rows,'list');
|
openSet(rows, 'list');
|
||||||
}).catch(() => {})
|
}).catch(() => { })
|
||||||
}else{
|
} else {
|
||||||
return proxy.$modal.alertWarning("请选择需要推送的任务!");
|
return proxy.$modal.alertWarning("请选择需要推送的任务!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,12 +412,12 @@ const handleTaskAssignToAllClass = () => {
|
||||||
* //改为list形式,有地方需要批量布置推送
|
* //改为list形式,有地方需要批量布置推送
|
||||||
*/
|
*/
|
||||||
// 打开布置作业窗口
|
// 打开布置作业窗口
|
||||||
const openSet=(row, type)=> {
|
const openSet = (row, type) => {
|
||||||
if(type == 'list'){
|
if (type == 'list') {
|
||||||
// 批量布置推送 row 是多个rows,直接赋值
|
// 批量布置推送 row 是多个rows,直接赋值
|
||||||
rowsList.value = row;
|
rowsList.value = row;
|
||||||
setDialog.value = true;
|
setDialog.value = true;
|
||||||
}else{
|
} else {
|
||||||
// 单个布置推送 row 是单个row,变成数组
|
// 单个布置推送 row 是单个row,变成数组
|
||||||
rowsList.value = [row];
|
rowsList.value = [row];
|
||||||
setDialog.value = true;
|
setDialog.value = true;
|
||||||
|
@ -414,7 +426,7 @@ const openSet=(row, type)=> {
|
||||||
/**
|
/**
|
||||||
* 关闭布置作业窗口
|
* 关闭布置作业窗口
|
||||||
*/
|
*/
|
||||||
const closeHomework = () => {
|
const closeHomework = () => {
|
||||||
rowsList.value = [];
|
rowsList.value = [];
|
||||||
setDialog.value = false;
|
setDialog.value = false;
|
||||||
}
|
}
|
||||||
|
@ -430,7 +442,7 @@ const successHomework = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// --------------------作业编辑
|
// --------------------作业编辑
|
||||||
let classWorkForm = reactive({
|
let classWorkForm = reactive({
|
||||||
id: '',// cloneDeep(props.propsformobj.id),
|
id: '',// cloneDeep(props.propsformobj.id),
|
||||||
uniquekey: '',// props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):'', // 作业唯一标识 作业名称
|
uniquekey: '',// props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):'', // 作业唯一标识 作业名称
|
||||||
worktype: '',// props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
worktype: '',// props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
||||||
|
@ -457,12 +469,14 @@ let propsformobj = reactive({
|
||||||
*/
|
*/
|
||||||
const handleCurrentChange = (val) => {
|
const handleCurrentChange = (val) => {
|
||||||
|
|
||||||
console.log(val,'???????????')
|
console.log(val, '选中的布置作业')
|
||||||
if(val && val.id >0 ) {
|
if (val && val.id > 0) {
|
||||||
currentRow.value.id = 1;
|
currentRow.value.id = 1;
|
||||||
|
const typeName = val.worktype == "习题训练" ? "自主搜题" : "";
|
||||||
|
activeAptTab.value = typeName;
|
||||||
classWorkForm.worktype = val.worktype; //作业类型
|
classWorkForm.worktype = val.worktype; //作业类型
|
||||||
editListItem(val, courseObj).then((obj) => {
|
editListItem(val, courseObj).then((obj) => {
|
||||||
if(obj){
|
if (obj) {
|
||||||
propsformobj = obj;
|
propsformobj = obj;
|
||||||
// 新赋值的作业内容
|
// 新赋值的作业内容
|
||||||
classWorkForm.id = obj.id;
|
classWorkForm.id = obj.id;
|
||||||
|
@ -484,7 +498,7 @@ const handleCurrentChange = (val) => {
|
||||||
*/
|
*/
|
||||||
const handleClassWorkQuizAdd = (entpcourseworkid) => {
|
const handleClassWorkQuizAdd = (entpcourseworkid) => {
|
||||||
var exist = false;
|
var exist = false;
|
||||||
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
for (var i = 0; i < classWorkForm.quizlist.length; i++) {
|
||||||
if (classWorkForm.quizlist[i].id == entpcourseworkid) {
|
if (classWorkForm.quizlist[i].id == entpcourseworkid) {
|
||||||
exist = true;
|
exist = true;
|
||||||
break;
|
break;
|
||||||
|
@ -494,7 +508,7 @@ const handleClassWorkQuizAdd = (entpcourseworkid) => {
|
||||||
getEntpcoursework(entpcourseworkid).then(res => {
|
getEntpcoursework(entpcourseworkid).then(res => {
|
||||||
//res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
|
//res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
|
||||||
// 暂时手动新增试题的分数
|
// 暂时手动新增试题的分数
|
||||||
if(res.data.score == null){
|
if (res.data.score == null) {
|
||||||
res.data.score = 4;
|
res.data.score = 4;
|
||||||
}
|
}
|
||||||
classWorkForm.quizlist.push(res.data);
|
classWorkForm.quizlist.push(res.data);
|
||||||
|
@ -506,14 +520,14 @@ const handleClassWorkQuizAdd = (entpcourseworkid) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 右侧资源删除按钮 习题list */
|
/** 右侧资源删除按钮 习题list */
|
||||||
const handleClassWorkFormQuizRemove = (index) =>{
|
const handleClassWorkFormQuizRemove = (index) => {
|
||||||
classWorkForm.quizlist.splice(index, 1);
|
classWorkForm.quizlist.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业设计-提交
|
* 作业设计-提交
|
||||||
*/
|
*/
|
||||||
const handleClassWorkSave = async () => {
|
const handleClassWorkSave = async () => {
|
||||||
await nextTick(); // 确保DOM更新完成
|
await nextTick(); // 确保DOM更新完成
|
||||||
proxy.$refs["classWorkFormRef"].validate(async valid => {
|
proxy.$refs["classWorkFormRef"].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -544,16 +558,16 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
entpcourseworklist: '', // 选择的 习题训练 list 需要转字符串
|
entpcourseworklist: '', // 选择的 习题训练 list 需要转字符串
|
||||||
};
|
};
|
||||||
|
|
||||||
if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
|
if (cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!' });
|
||||||
|
|
||||||
// 当前为[编辑]状态下点进来得处理 newWorkSpaceEdit true 为编辑状态
|
// 当前为[编辑]状态下点进来得处理 newWorkSpaceEdit true 为编辑状态
|
||||||
if(isShow.value === false){
|
if (isShow.value === false) {
|
||||||
if(classWorkForm.id != '' ) {// 编辑状态 有id
|
if (classWorkForm.id != '') {// 编辑状态 有id
|
||||||
editWork(cform); // 编辑作业
|
editWork(cform); // 编辑作业
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (classWorkForm.worktype === "课堂展示") {
|
if (classWorkForm.worktype === "课堂展示") {
|
||||||
boardLoading.value = true
|
boardLoading.value = true
|
||||||
|
@ -562,11 +576,11 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
// 课堂展示提交内容
|
// 课堂展示提交内容
|
||||||
cform.worktag = classWorkForm.question;
|
cform.worktag = classWorkForm.question;
|
||||||
cform.title = classWorkForm.title;
|
cform.title = classWorkForm.title;
|
||||||
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
cform.workcodes = JSON.stringify({ json: canvasJson, base64: canvasBase64 });
|
||||||
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
|
cform.entpcourseworklist = JSON.stringify([{ 'id': -1, 'score': '10' }]);
|
||||||
try {
|
try {
|
||||||
addClassworkReturnId(cform).then((res) => {
|
addClassworkReturnId(cform).then((res) => {
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
ElMessage({ type: 'success', message: '作业设计成功!' });
|
||||||
// 重置提交表单
|
// 重置提交表单
|
||||||
classWorkForm.worktype = "课堂展示";
|
classWorkForm.worktype = "课堂展示";
|
||||||
classWorkForm.uniquekey = '';// classWorkForm.uniquekey, // 作业唯一标识 作业名称
|
classWorkForm.uniquekey = '';// classWorkForm.uniquekey, // 作业唯一标识 作业名称
|
||||||
|
@ -574,67 +588,67 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
classWorkForm.question = "";
|
classWorkForm.question = "";
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
// 情况选择的资源缓存
|
||||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||||
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
||||||
classWorkForm.id = res
|
classWorkForm.id = res
|
||||||
emits('getData',classWorkForm)
|
emits('getData', classWorkForm)
|
||||||
boardLoading.value = false
|
boardLoading.value = false
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
boardLoading.value = false
|
boardLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(classWorkForm.worktype === "常规作业"){
|
else if (classWorkForm.worktype === "常规作业") {
|
||||||
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
|
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!' });
|
||||||
fileLoading.value = true
|
fileLoading.value = true
|
||||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||||
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
cform.entpcourseworklist = JSON.stringify([{ 'id': -2, 'score': '10' }]);
|
||||||
try {
|
try {
|
||||||
addClassworkReturnId(cform).then((res) => {
|
addClassworkReturnId(cform).then((res) => {
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
ElMessage({ type: 'success', message: '作业设计成功!' });
|
||||||
// 重置提交表单
|
// 重置提交表单
|
||||||
classWorkForm.worktype = "常规作业";
|
classWorkForm.worktype = "常规作业";
|
||||||
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
||||||
classWorkForm.title = "";
|
classWorkForm.title = "";
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
// 情况选择的资源缓存
|
||||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||||
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
||||||
classWorkForm.fileHomeworkList = []; // 常规作业list
|
classWorkForm.fileHomeworkList = []; // 常规作业list
|
||||||
classWorkForm.id = res
|
classWorkForm.id = res
|
||||||
emits('getData',classWorkForm)
|
emits('getData', classWorkForm)
|
||||||
fileLoading.value = false
|
fileLoading.value = false
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
fileLoading.value = false
|
fileLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(classWorkForm.worktype === "科学实验"){
|
else if (classWorkForm.worktype === "科学实验") {
|
||||||
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
|
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!' });
|
||||||
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo; // 当前实验的学段学科, 格式为[小学-数学]
|
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo; // 当前实验的学段学科, 格式为[小学-数学]
|
||||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); // 实验信息
|
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); // 实验信息
|
||||||
cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
|
cform.entpcourseworklist = JSON.stringify([{ 'id': -3, 'score': '10' }]);
|
||||||
try {
|
try {
|
||||||
console.log(cform,'科学实验')
|
console.log(cform, '科学实验')
|
||||||
addClassworkReturnId(cform).then((res) => {
|
addClassworkReturnId(cform).then((res) => {
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
ElMessage({ type: 'success', message: '作业设计成功!' });
|
||||||
// 重置提交表单
|
// 重置提交表单
|
||||||
classWorkForm.worktype = "科学实验";
|
classWorkForm.worktype = "科学实验";
|
||||||
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
||||||
classWorkForm.title = "";
|
classWorkForm.title = "";
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
// 情况选择的资源缓存
|
||||||
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
classWorkForm.chooseWorkLists = []; // 框架梳理list
|
||||||
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
||||||
classWorkForm.fileHomeworkList = []; // 常规作业list
|
classWorkForm.fileHomeworkList = []; // 常规作业list
|
||||||
classWorkForm.id = res
|
classWorkForm.id = res
|
||||||
emits('getData',classWorkForm)
|
emits('getData', classWorkForm)
|
||||||
// TODO 科学实验 待完善
|
// TODO 科学实验 待完善
|
||||||
})
|
})
|
||||||
} finally{
|
} finally {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -642,14 +656,14 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
// 正常新任务
|
// 正常新任务
|
||||||
var ll = [];
|
var ll = [];
|
||||||
if (classWorkForm.worktype === "习题训练") {
|
if (classWorkForm.worktype === "习题训练") {
|
||||||
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
for (var i = 0; i < classWorkForm.quizlist.length; i++) {
|
||||||
// 更新 题目分值
|
// 更新 题目分值
|
||||||
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
|
ll.push({ 'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score });
|
||||||
}
|
}
|
||||||
}else if( classWorkForm.worktype === "框架梳理") {
|
} else if (classWorkForm.worktype === "框架梳理") {
|
||||||
classWorkForm.chooseWorkLists.filter((item) => {
|
classWorkForm.chooseWorkLists.filter((item) => {
|
||||||
if (item.worktype === classWorkForm.worktype) {
|
if (item.worktype === classWorkForm.worktype) {
|
||||||
ll.push({'id':item.id, 'score': item.score});
|
ll.push({ 'id': item.id, 'score': item.score });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -659,22 +673,22 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
} else {
|
} else {
|
||||||
cform.entpcourseworklist = '';
|
cform.entpcourseworklist = '';
|
||||||
}
|
}
|
||||||
console.log(cform,'提交的数据');
|
console.log(cform, '提交的数据');
|
||||||
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
if (cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!' });
|
||||||
|
|
||||||
addClassworkReturnId(cform).then(res => {
|
addClassworkReturnId(cform).then(res => {
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
ElMessage({ type: 'success', message: '作业设计成功!' });
|
||||||
// 重置提交表单
|
// 重置提交表单
|
||||||
classWorkForm.worktype = "习题训练";
|
classWorkForm.worktype = "习题训练";
|
||||||
classWorkForm.uniquekey = '',// props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
classWorkForm.uniquekey = '',// props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
||||||
classWorkForm.title = "";
|
classWorkForm.title = "";
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
// 情况选择的资源缓存
|
||||||
classWorkForm.chooseWorkLists = [];
|
classWorkForm.chooseWorkLists = [];
|
||||||
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
classWorkForm.whiteboardObj = ''; // ? // 清空白板
|
||||||
classWorkForm.id = res
|
classWorkForm.id = res
|
||||||
emits('getData',classWorkForm)
|
emits('getData', classWorkForm)
|
||||||
// refresh the list
|
// refresh the list
|
||||||
//这里分离了,所以不需要更新表单数据了
|
//这里分离了,所以不需要更新表单数据了
|
||||||
// this.getClassWorkAllList();
|
// this.getClassWorkAllList();
|
||||||
|
@ -683,9 +697,9 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
}
|
}
|
||||||
console.log('该清空左侧列表数据了');
|
console.log('该清空左侧列表数据了');
|
||||||
// 清空左侧 选中的布置列表 并刷新列表
|
// 清空左侧 选中的布置列表 并刷新列表
|
||||||
if(isShow.value){
|
if (isShow.value) {
|
||||||
currentRow.value.id = 1;
|
currentRow.value.id = 1;
|
||||||
}else{
|
} else {
|
||||||
currentRow.value.id = 0;
|
currentRow.value.id = 0;
|
||||||
}
|
}
|
||||||
initHomeWork();
|
initHomeWork();
|
||||||
|
@ -706,9 +720,9 @@ const handleClassWorkFormQuizRemove = (index) =>{
|
||||||
* 编辑作业内容
|
* 编辑作业内容
|
||||||
* @param cform 表单数据
|
* @param cform 表单数据
|
||||||
*/
|
*/
|
||||||
const editWork = async (cform) =>{
|
const editWork = async (cform) => {
|
||||||
// 基础参数
|
// 基础参数
|
||||||
cform.id= classWorkForm.id;
|
cform.id = classWorkForm.id;
|
||||||
|
|
||||||
// 0.右侧作业资源添加检测
|
// 0.右侧作业资源添加检测
|
||||||
if (classWorkForm.worktype == '习题训练') {
|
if (classWorkForm.worktype == '习题训练') {
|
||||||
|
@ -716,15 +730,15 @@ const editWork = async (cform) =>{
|
||||||
ElMessage.error('请先添加作业资源!');
|
ElMessage.error('请先添加作业资源!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
|
} else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
|
||||||
// 不做校验
|
// 不做校验
|
||||||
if(classWorkForm.worktype == '课堂展示'){
|
if (classWorkForm.worktype == '课堂展示') {
|
||||||
//
|
//
|
||||||
}else{
|
} else {
|
||||||
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
|
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!' });
|
||||||
}
|
}
|
||||||
}else if( classWorkForm.worktype == '科学实验') {
|
} else if (classWorkForm.worktype == '科学实验') {
|
||||||
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!'});
|
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!' });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (classWorkForm.chooseWorkLists.length == 0) {
|
if (classWorkForm.chooseWorkLists.length == 0) {
|
||||||
|
@ -736,13 +750,13 @@ const editWork = async (cform) =>{
|
||||||
|
|
||||||
|
|
||||||
// 根据作业类型分类处理
|
// 根据作业类型分类处理
|
||||||
if (classWorkForm.worktype=='习题训练'){
|
if (classWorkForm.worktype == '习题训练') {
|
||||||
|
|
||||||
// 1.判断当前添加的作业是否与原来不同(跟父组件传来的值对比)
|
// 1.判断当前添加的作业是否与原来不同(跟父组件传来的值对比)
|
||||||
let needUplEval = false;
|
let needUplEval = false;
|
||||||
if (classWorkForm.quizlist.length != propsformobj.quizlist.length) {
|
if (classWorkForm.quizlist.length != propsformobj.quizlist.length) {
|
||||||
needUplEval = true;
|
needUplEval = true;
|
||||||
}else {
|
} else {
|
||||||
// 只要有一个不一致则说明需要更新
|
// 只要有一个不一致则说明需要更新
|
||||||
needUplEval = classWorkForm.quizlist.some(cur =>
|
needUplEval = classWorkForm.quizlist.some(cur =>
|
||||||
!propsformobj.quizlist.some(last =>
|
!propsformobj.quizlist.some(last =>
|
||||||
|
@ -756,7 +770,7 @@ const editWork = async (cform) =>{
|
||||||
// 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加
|
// 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加
|
||||||
// 2.1.先查询该workid下所有的id
|
// 2.1.先查询该workid下所有的id
|
||||||
let arrEvalids = [];
|
let arrEvalids = [];
|
||||||
const wevalres = await listClassworkeval({'workid': classWorkForm.id});
|
const wevalres = await listClassworkeval({ 'workid': classWorkForm.id });
|
||||||
wevalres.rows.forEach(element => {
|
wevalres.rows.forEach(element => {
|
||||||
arrEvalids.push(element.id);
|
arrEvalids.push(element.id);
|
||||||
});
|
});
|
||||||
|
@ -766,21 +780,22 @@ const editWork = async (cform) =>{
|
||||||
const delRes = await delClassworkeval(ids);
|
const delRes = await delClassworkeval(ids);
|
||||||
|
|
||||||
// 2.3.重新添加新作业
|
// 2.3.重新添加新作业
|
||||||
for(let i=0; i< classWorkForm.quizlist.length; i++){
|
for (let i = 0; i < classWorkForm.quizlist.length; i++) {
|
||||||
const addRes = await addClassworkeval({
|
const addRes = await addClassworkeval({
|
||||||
'workid': classWorkForm.id,
|
'workid': classWorkForm.id,
|
||||||
'entpcourseworkid': classWorkForm.quizlist[i].id,
|
'entpcourseworkid': classWorkForm.quizlist[i].id,
|
||||||
'workdataid': 0,
|
'workdataid': 0,
|
||||||
'score': classWorkForm.quizlist[i].score}
|
'score': classWorkForm.quizlist[i].score
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.更新作业任务信息-判断最后更新了
|
// 3.更新作业任务信息-判断最后更新了
|
||||||
}
|
}
|
||||||
else if (classWorkForm.worktype=='框架梳理') {
|
else if (classWorkForm.worktype == '框架梳理') {
|
||||||
// 1.先查询该workid下所有的id
|
// 1.先查询该workid下所有的id
|
||||||
const wevalres = await listClassworkeval({'workid': classWorkForm.id});
|
const wevalres = await listClassworkeval({ 'workid': classWorkForm.id });
|
||||||
if (wevalres.rows.length == 0) {
|
if (wevalres.rows.length == 0) {
|
||||||
ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
||||||
return;
|
return;
|
||||||
|
@ -790,7 +805,7 @@ const editWork = async (cform) =>{
|
||||||
let needUplEval = false;
|
let needUplEval = false;
|
||||||
if (classWorkForm.chooseWorkLists.length !== propsformobj.chooseWorkLists.length) {
|
if (classWorkForm.chooseWorkLists.length !== propsformobj.chooseWorkLists.length) {
|
||||||
needUplEval = true;
|
needUplEval = true;
|
||||||
}else {
|
} else {
|
||||||
// 只要有一个不一致则说明需要更新
|
// 只要有一个不一致则说明需要更新
|
||||||
needUplEval = classWorkForm.chooseWorkLists.some(cur =>
|
needUplEval = classWorkForm.chooseWorkLists.some(cur =>
|
||||||
!propsformobj.chooseWorkLists.some(last =>
|
!propsformobj.chooseWorkLists.some(last =>
|
||||||
|
@ -808,17 +823,17 @@ const editWork = async (cform) =>{
|
||||||
let res = await updateClassworkeval(uplParams);
|
let res = await updateClassworkeval(uplParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (classWorkForm.worktype=='课堂展示') {
|
else if (classWorkForm.worktype == '课堂展示') {
|
||||||
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
||||||
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
||||||
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
cform.workcodes = JSON.stringify({ json: canvasJson, base64: canvasBase64 });
|
||||||
cform.worktag = classWorkForm.question;
|
cform.worktag = classWorkForm.question;
|
||||||
}
|
}
|
||||||
else if (classWorkForm.worktype=='常规作业') {
|
else if (classWorkForm.worktype == '常规作业') {
|
||||||
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||||
}
|
}
|
||||||
else if (classWorkForm.worktype=='科学实验') { //TODO 注意,fileHomeworkList字段与常规作业共用
|
else if (classWorkForm.worktype == '科学实验') { //TODO 注意,fileHomeworkList字段与常规作业共用
|
||||||
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||||
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
|
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
|
||||||
|
@ -830,9 +845,9 @@ const editWork = async (cform) =>{
|
||||||
ElMessage.success('更新成功');
|
ElMessage.success('更新成功');
|
||||||
taskList.value = [];
|
taskList.value = [];
|
||||||
// 清空左侧 选中的布置列表 并刷新列表
|
// 清空左侧 选中的布置列表 并刷新列表
|
||||||
if(isShow.value){
|
if (isShow.value) {
|
||||||
currentRow.value.id = 1;
|
currentRow.value.id = 1;
|
||||||
}else{
|
} else {
|
||||||
handleNewAllClass();
|
handleNewAllClass();
|
||||||
currentRow.value.id = 0;
|
currentRow.value.id = 0;
|
||||||
}
|
}
|
||||||
|
@ -865,29 +880,33 @@ const handlePrint = () => {
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.page {
|
.page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.page-top {
|
.page-top {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-direction: row;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-resource {
|
.page-resource {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
height: calc(100% - 55px);
|
height: calc(100% - 55px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
:deep(.el-tabs__nav) {
|
:deep(.el-tabs__nav) {
|
||||||
.el-tabs__item{
|
.el-tabs__item {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-left {
|
.page-left {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
@ -900,6 +919,7 @@ const handlePrint = () => {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pageleft-table-cont {
|
.pageleft-table-cont {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
// width: 100%;
|
// width: 100%;
|
||||||
|
@ -908,21 +928,30 @@ const handlePrint = () => {
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
// flex-direction: row;
|
// flex-direction: row;
|
||||||
// text-overflow: ellipsis;
|
// text-overflow: ellipsis;
|
||||||
width: 100%; /* 设置容器的宽度 */
|
width: 100%;
|
||||||
overflow: hidden; /* 隐藏超出容器的部分 */
|
/* 设置容器的宽度 */
|
||||||
white-space: nowrap; /* 防止文本换行 */
|
overflow: hidden;
|
||||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
/* 隐藏超出容器的部分 */
|
||||||
|
white-space: nowrap;
|
||||||
|
/* 防止文本换行 */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
/* 超出部分显示省略号 */
|
||||||
.ellipsis {
|
.ellipsis {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
overflow: hidden; /* 隐藏超出容器的部分 */
|
overflow: hidden;
|
||||||
white-space: nowrap; /* 防止文本换行 */
|
/* 隐藏超出容器的部分 */
|
||||||
text-overflow: ellipsis; /* 超出部分显示省略号 */
|
white-space: nowrap;
|
||||||
|
/* 防止文本换行 */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* 超出部分显示省略号 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.page-center{
|
|
||||||
|
.page-center {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
//min-width: calc(100% - 675px);
|
//min-width: calc(100% - 675px);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -932,31 +961,34 @@ const handlePrint = () => {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
.prepare-center-zzst{
|
.prepare-center-zzst {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.prepare-center-xbtk{
|
|
||||||
|
.prepare-center-xbtk {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.prepare-center-grst{
|
|
||||||
|
.prepare-center-grst {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.upload-homework{
|
.upload-homework {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.experiment-homework{
|
.experiment-homework {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-right {
|
.page-right {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -968,15 +1000,17 @@ const handlePrint = () => {
|
||||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.prepare-top {
|
.prepare-top {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
border-bottom: 2px solid #e5e7eb;
|
border-bottom: 2px solid #e5e7eb;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.prepare-con{
|
|
||||||
|
.prepare-con {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
<el-table-column align="left" width="100">
|
<el-table-column align="left" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
|
<el-button v-if="props.isHtml2canvas" type="primary" @click="captureScreenshot(scope.row.id)">选取该题</el-button>
|
||||||
<el-button v-else type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
|
<el-button v-else type="primary" @click="handleClassWorkQuizAdd(scope.row, scope.row.id)">添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -126,7 +126,7 @@ import useUserStore from '@/store/modules/user'
|
||||||
import useClassTaskStore from '@/store/modules/classTask'
|
import useClassTaskStore from '@/store/modules/classTask'
|
||||||
|
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
let emit = defineEmits(['addQuiz', 'addQuizImgBs64'])
|
let emit = defineEmits(['addQuiz', 'addQuizImgBs64', "addQuizItem"])
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const {
|
const {
|
||||||
|
@ -420,11 +420,13 @@ const getPaginationList = async ( page, limit ) => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加资源
|
* 添加资源
|
||||||
* @param fromsrc - 试题来源
|
* @param rw - 试题itemINFO
|
||||||
* @param entpcourseworkid
|
* @param entpcourseworkid
|
||||||
*/
|
*/
|
||||||
const handleClassWorkQuizAdd = (fromsrc, entpcourseworkid) => {
|
const handleClassWorkQuizAdd = (row, entpcourseworkid) => {
|
||||||
emit('addQuiz', entpcourseworkid);
|
emit('addQuiz', entpcourseworkid);
|
||||||
|
emit('addQuizItem', row); // TODO 暂时使用,后面修改逻辑---添加到 自主组卷
|
||||||
|
|
||||||
// var exist = false;
|
// var exist = false;
|
||||||
// for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
// for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
||||||
// if (classWorkForm.quizlist[i].id == entpcourseworkid) {
|
// if (classWorkForm.quizlist[i].id == entpcourseworkid) {
|
||||||
|
|
Loading…
Reference in New Issue