作业设计
This commit is contained in:
parent
ef6c3d2a2b
commit
96098c899f
|
@ -62,3 +62,12 @@ export function updateClassworkdata(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改classwork
|
||||||
|
export function updateClasswork(data) {
|
||||||
|
return request({
|
||||||
|
url: '/education/classwork',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page-typeview flex">
|
<div class="page-typeview">
|
||||||
<el-form ref="classWorkForm" :model="classWorkForm" label-width="90" style="height: calc(100% - 55px);display: flex;flex-direction: column;">
|
<el-form ref="classWorkFormRef" :model="classWorkForm" label-width="90" style=" height: 100%;overflow: hidden;">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<el-row>
|
<div class="container">
|
||||||
|
<!-- 作业类型 -->
|
||||||
|
<el-row class="top">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="作业类型:">
|
<el-form-item label="作业类型:">
|
||||||
<el-radio-group v-model="formType" @change="changeFormType">
|
<el-radio-group v-model="formType" @change="changeFormType">
|
||||||
|
@ -12,11 +14,16 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
</el-row>
|
||||||
|
<!-- 作业资源 -->
|
||||||
|
<el-row class="middle">
|
||||||
|
<el-col :span="24" style="height: 100%; overflow: hidden;">
|
||||||
<el-form-item label="作业资源:" class="el-form-work-list">
|
<el-form-item label="作业资源:" class="el-form-work-list">
|
||||||
<el-col :span="15" class="work-left">
|
<el-col :span="15" class="work-left">
|
||||||
|
<!-- 习题训练 -->
|
||||||
<div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;">
|
<div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;">
|
||||||
<el-row :gutter="10">
|
<!-- 习题筛选1 -->
|
||||||
|
<el-row :gutter="10" class="top">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="题型" label-width="70">
|
<el-form-item label="题型" label-width="70">
|
||||||
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
|
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
|
||||||
|
@ -48,7 +55,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" style="margin-top: 4px">
|
<!-- 习题筛选2 -->
|
||||||
|
<el-row :gutter="10" style="margin-top: 4px" class="top">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="年份" label-width="70">
|
<el-form-item label="年份" label-width="70">
|
||||||
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
|
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
|
||||||
|
@ -67,8 +75,9 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<!-- 习题表格 -->
|
||||||
<el-table :data="workResource.entpCourseWorkList" style="width: 100%;">
|
<div class="middle" >
|
||||||
|
<el-table :data="workResource.entpCourseWorkList" style="width: 100%; height: 100%;">
|
||||||
<el-table-column type="index" width="60" />
|
<el-table-column type="index" width="60" />
|
||||||
<el-table-column align="left" >
|
<el-table-column align="left" >
|
||||||
<template #header>
|
<template #header>
|
||||||
|
@ -93,8 +102,9 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="height: 55px;">
|
</div>
|
||||||
<!-- 分页 -->
|
<!-- 分页 这里不用-->
|
||||||
|
<!-- <div style="height: 55px;">
|
||||||
<pagination
|
<pagination
|
||||||
v-show="entpCourseWorkTotal > 0"
|
v-show="entpCourseWorkTotal > 0"
|
||||||
v-model:page="paginationParams.pageNum"
|
v-model:page="paginationParams.pageNum"
|
||||||
|
@ -102,7 +112,7 @@
|
||||||
:total="entpCourseWorkTotal"
|
:total="entpCourseWorkTotal"
|
||||||
:style="{ position: 'relative', 'margin-top': '5px' }"
|
:style="{ position: 'relative', 'margin-top': '5px' }"
|
||||||
@pagination="getPaginationList" />
|
@pagination="getPaginationList" />
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <div v-if="classWorkForm.worktype!='习题训练'">
|
<!-- <div v-if="classWorkForm.worktype!='习题训练'">
|
||||||
<div :style="{ 'overflow': 'auto'}">
|
<div :style="{ 'overflow': 'auto'}">
|
||||||
|
@ -186,7 +196,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" style="padding: 0 0 0 5px;height: 60vh; overflow: auto; line-height: 26px">
|
<el-col :span="9" class="work-right">
|
||||||
<div v-if="classWorkForm.worktype=='习题训练'" :style="{ 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
<div v-if="classWorkForm.worktype=='习题训练'" :style="{ 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||||
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
|
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
|
||||||
<div style="margin: 5px; background-color: white">
|
<div style="margin: 5px; background-color: white">
|
||||||
|
@ -226,25 +236,49 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<!-- 作业说明 -->
|
||||||
|
<el-row class="bottom">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="作业说明" style="margin: 10px 0;">
|
||||||
|
<el-col :span="15" style="padding: 0px">
|
||||||
|
<!-- <el-input v-model="classWorkForm.title" type="textarea" :rows="1" placeholder="请输入作业说明"/> -->
|
||||||
|
<el-input v-model="classWorkForm.title" style="width: 400px" placeholder="请输入作业说明"/>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button type="primary" @click="handleClassWorkSave">确 定</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { getCurrentTime } from '@/utils/date'
|
import { getCurrentTime } from '@/utils/date'
|
||||||
import { processList } from '@/hooks/useProcessList'
|
import { processList } from '@/hooks/useProcessList'
|
||||||
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
|
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
||||||
|
import { updateClasswork } from '@/api/classTask'
|
||||||
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
|
|
||||||
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
bookobj: {
|
bookobj: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
},
|
},
|
||||||
|
uniquekey: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,7 +287,9 @@ const toolStore = useToolState()
|
||||||
const openDialog = () => {
|
const openDialog = () => {
|
||||||
isDialogOpen.value = true
|
isDialogOpen.value = true
|
||||||
}
|
}
|
||||||
|
const classWorkFormRef = ref(null);
|
||||||
const formType = ref('习题训练')
|
const formType = ref('习题训练')
|
||||||
|
const newWorkSpaceEdit = ref(false); //修改学习任务
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
||||||
|
|
||||||
|
@ -318,15 +354,15 @@ const workResource = reactive({
|
||||||
quiztype: '',
|
quiztype: '',
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
classWorkList: [], // 教学分析里产生的学习任务
|
classWorkList: [], // 教学分析里产生的学习任务
|
||||||
entpCourseWorkList: [],
|
entpCourseWorkList: [], // 习题列表
|
||||||
|
entpCourseWorkTotal: 0, // 习题总数
|
||||||
}); // 作业资源
|
}); // 作业资源
|
||||||
const classWorkForm = reactive({
|
let classWorkForm = reactive({
|
||||||
|
uniquekey: props.uniquekey, // 作业唯一标识 作业名称
|
||||||
worktype: '习题训练', //作业类型
|
worktype: '习题训练', //作业类型
|
||||||
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
title: '',// 作业说明
|
||||||
|
quizlist: [], // 作业习题列表内容
|
||||||
})
|
})
|
||||||
const entpCourseWorkList = ref([]); // 习题列表
|
|
||||||
const entpCourseWorkTotal = ref(0); // 习题总数
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -335,7 +371,7 @@ const entpCourseWorkTotal = ref(0); // 习题总数
|
||||||
*/
|
*/
|
||||||
const changeFormType = (val) => {
|
const changeFormType = (val) => {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
classWorkForm.value.worktype = val;
|
classWorkForm.worktype = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryForm = reactive({
|
const queryForm = reactive({
|
||||||
|
@ -372,7 +408,7 @@ const queryForm = reactive({
|
||||||
* 1 - 按条件查询
|
* 1 - 按条件查询
|
||||||
* 2 - 按关键词查询
|
* 2 - 按关键词查询
|
||||||
*/
|
*/
|
||||||
const handleQueryFromEntpCourseWork= (queryType) => {
|
const handleQueryFromEntpCourseWork= (queryType) => {
|
||||||
//queryForm.pageNum = this.paginationParams.pageNum;
|
//queryForm.pageNum = this.paginationParams.pageNum;
|
||||||
//queryForm.pageSize = this.paginationParams.pageSize;
|
//queryForm.pageSize = this.paginationParams.pageSize;
|
||||||
|
|
||||||
|
@ -382,8 +418,6 @@ const queryForm = reactive({
|
||||||
// queryForm.edusubject = '道德与法治';
|
// queryForm.edusubject = '道德与法治';
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
console.log(queryForm)
|
|
||||||
listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
|
listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
|
||||||
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') {
|
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') {
|
||||||
// // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】
|
// // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】
|
||||||
|
@ -394,57 +428,462 @@ const queryForm = reactive({
|
||||||
// } else {
|
// } else {
|
||||||
// workResource.entpCourseWorkList = entpcourseworkres.rows;
|
// workResource.entpCourseWorkList = entpcourseworkres.rows;
|
||||||
// }
|
// }
|
||||||
if(entpcourseworkres.data == null) {
|
|
||||||
workResource.entpCourseWorkList = [];
|
if(entpcourseworkres.data&&entpcourseworkres.data.length>0){
|
||||||
entpCourseWorkTotal.value = 0
|
workResource.entpCourseWorkList = entpcourseworkres.data;
|
||||||
return;
|
workResource.entpCourseWorkTotal = entpcourseworkres.data.length;
|
||||||
}
|
|
||||||
entpCourseWorkList.value = entpcourseworkres.data;
|
|
||||||
workResource.entpCourseWorkList.forEach(item=> {
|
workResource.entpCourseWorkList.forEach(item=> {
|
||||||
if (item.worktype == '选择题') {
|
if (item.worktype == '选择题') {
|
||||||
item.worktype = '单选题'
|
item.worktype = '单选题'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 同步数量
|
|
||||||
entpCourseWorkTotal.value = 0;
|
|
||||||
if (entpcourseworkres.data.length > 0) {
|
|
||||||
entpCourseWorkTotal.value = entpcourseworkres.data.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
if()
|
|
||||||
|
|
||||||
//格式化试题信息
|
//格式化试题信息
|
||||||
processList(workResource.entpCourseWorkList);
|
processList(workResource.entpCourseWorkList);
|
||||||
|
}else{
|
||||||
|
workResource.entpCourseWorkList = [];
|
||||||
|
workResource.entpCourseWorkTotal = 0
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加资源
|
||||||
|
* @param fromsrc - 试题来源
|
||||||
|
* @param entpcourseworkid
|
||||||
|
*/
|
||||||
|
const handleClassWorkQuizAdd = (fromsrc, entpcourseworkid) => {
|
||||||
|
var exist = false;
|
||||||
|
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
||||||
|
if (classWorkForm.quizlist[i].id == entpcourseworkid) {
|
||||||
|
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);
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElMessage('试题已经存在')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作业设计-提交
|
||||||
|
*/
|
||||||
|
const handleClassWorkSave = async () => {
|
||||||
|
await nextTick(); // 确保DOM更新完成
|
||||||
|
proxy.$refs["classWorkFormRef"].validate(async valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (classWorkForm.id != null) {
|
||||||
|
// 当前为[编辑]状态下点进来得处理
|
||||||
|
updateClasswork(classWorkForm).then(response => {
|
||||||
|
ElMessage("修改成功");
|
||||||
|
// this.workConfDialogOpen = false;
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList(); // 更新表单数据
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 当前为[编辑]状态下点进来得处理 newWorkSpaceEdit true 为编辑状态
|
||||||
|
if(newWorkSpaceEdit.value ) {
|
||||||
|
|
||||||
|
// 0.右侧作业资源添加检测
|
||||||
|
if (this.currentTag == '习题训练') {
|
||||||
|
if (this.classWorkForm.quizlist.length == 0) {
|
||||||
|
ElMessage.error('请先添加作业资源!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.currentTag == '课堂展示' || this.currentTag == '常规作业') {
|
||||||
|
// 不做校验
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (this.chooseWorkLists.length == 0) {
|
||||||
|
ElMessage.error('请先添加作业资源!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基础参数
|
||||||
|
let classWorkParams = {
|
||||||
|
id: this.currentTask.id,
|
||||||
|
uniquekey: this.classWorkForm.uniquekey, // 更新[作业名称]
|
||||||
|
//title: classWorkForm.title, // 更新[作业说明]
|
||||||
|
}
|
||||||
|
// 根据作业类型分类处理
|
||||||
|
if (this.currentTag=='习题训练'){
|
||||||
|
|
||||||
|
// console.log(this.workConfObj.quizlist);
|
||||||
|
// console.log(this.currentTask);
|
||||||
|
// console.log(this.classWorkList);
|
||||||
|
|
||||||
|
// 1.判断当前添加的作业是否与原来不同
|
||||||
|
let needUplEval = false;
|
||||||
|
if (this.classWorkForm.quizlist.length !== this.currentTask.entpcourseworklistarray.length) {
|
||||||
|
needUplEval = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 只要有一个不一致则说明需要更新
|
||||||
|
|
||||||
|
// for (let cur of this.classWorkForm.quizlist){
|
||||||
|
// let isSame = false;
|
||||||
|
// for (let last of this.currentTask.entpcourseworklistarray) {
|
||||||
|
// if (last.id === cur.id && last.score === cur.score){
|
||||||
|
// isSame = true;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (!isSame) {
|
||||||
|
// needUplEval = true;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
needUplEval = this.classWorkForm.quizlist.some(cur =>
|
||||||
|
!this.currentTask.entpcourseworklistarray.some(last =>
|
||||||
|
last.id === cur.id && last.score === cur.score
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.需要重新更新eval的数据
|
||||||
|
if (needUplEval) {
|
||||||
|
// 说明: 因试题分值也需修改, 故无法通过按钮的增长删除来处理, 故将原作业全部删除后再重新添加
|
||||||
|
// 2.1.先查询该workid下所有的id
|
||||||
|
let arrEvalids = [];
|
||||||
|
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
|
||||||
|
wevalres.rows.forEach(element => {
|
||||||
|
arrEvalids.push(element.id);
|
||||||
|
});
|
||||||
|
const ids = arrEvalids.join(',');
|
||||||
|
|
||||||
|
// 2.2.删除原作业
|
||||||
|
const delRes = await delClassworkeval(ids);
|
||||||
|
|
||||||
|
// 2.3.重新添加新作业
|
||||||
|
for(let i=0; i<this.classWorkForm.quizlist.length; i++){
|
||||||
|
const addRes = await addClassworkeval({
|
||||||
|
'workid': this.currentTask.id,
|
||||||
|
'entpcourseworkid': this.classWorkForm.quizlist[i].id,
|
||||||
|
'workdataid': 0,
|
||||||
|
'score': this.classWorkForm.quizlist[i].score}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3.更新作业任务信息
|
||||||
|
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
|
||||||
|
// const formObj = {
|
||||||
|
// id: this.currentTask.id,
|
||||||
|
// uniquekey: this.classWorkForm.uniquekey, // 更新[作业名称]
|
||||||
|
// // warn: 这里需确认是否可支持修改当前作业任务更换单元章节
|
||||||
|
// //evalid = evalid, // 更新[作业范围]
|
||||||
|
// }
|
||||||
|
// let res = await updateClasswork(formObj);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (this.currentTag=='框架梳理') {
|
||||||
|
// 1.先查询该workid下所有的id
|
||||||
|
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
|
||||||
|
if (wevalres.rows.length == 0) {
|
||||||
|
ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.更新作业任务下的框架梳理
|
||||||
|
let needUplEval = false;
|
||||||
|
if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
|
||||||
|
needUplEval = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 只要有一个不一致则说明需要更新
|
||||||
|
needUplEval = this.chooseWorkLists.some(cur =>
|
||||||
|
!this.currentTask.entpcourseworklistarray.some(last =>
|
||||||
|
last.id === cur.id && last.score === cur.score
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (needUplEval) {
|
||||||
|
const uplParams = {
|
||||||
|
id: wevalres.rows[0].id,
|
||||||
|
entpcourseworkid: this.chooseWorkLists[0].id,
|
||||||
|
score: this.chooseWorkLists[0].score,
|
||||||
|
}
|
||||||
|
let res = await updateClassworkeval(uplParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (this.currentTag=='课堂展示') {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (this.currentTag=='常规作业') {
|
||||||
|
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||||
|
classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3.更新作业任务本身
|
||||||
|
let res = await updateClasswork(classWorkParams);
|
||||||
|
this.fileHomeworkList = [];
|
||||||
|
this.chooseWorkLists = [];
|
||||||
|
|
||||||
|
// 4.操作完成后重新更新表单数据
|
||||||
|
this.getClassWorkAllList();
|
||||||
|
|
||||||
|
this.classWorkForm.worktype = "习题训练";
|
||||||
|
this.newWorkSpace = false;
|
||||||
|
this.newWorkSpaceEdit = false;
|
||||||
|
this.workEdit = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { res, chapterId } = await useGetHomework(this.currentNode)
|
||||||
|
// this.entpcourseid = chapterId
|
||||||
|
|
||||||
|
|
||||||
|
if (classWorkForm.worktype === "课堂展示") {
|
||||||
|
this.boardLoading = true
|
||||||
|
let canvasJson = this.$refs.boardref.getCanvasJson()
|
||||||
|
let canvasBase64 = await this.$refs.boardref.getCanvasBase64()
|
||||||
|
var formObj = {};
|
||||||
|
formObj.id = 0;
|
||||||
|
formObj.workdate = this.classWorkForm.workdate;
|
||||||
|
formObj.deaddate = '';
|
||||||
|
formObj.entpid = this.userStore.deptId;
|
||||||
|
formObj.level = 1;
|
||||||
|
formObj.parentid = 0;
|
||||||
|
formObj.worktype = this.classWorkForm.worktype;
|
||||||
|
formObj.workkey = '';
|
||||||
|
formObj.worktag = this.question;
|
||||||
|
formObj.uniquekey = this.classWorkForm.uniquekey;
|
||||||
|
formObj.classid = 0;
|
||||||
|
formObj.classcourseid = 0;
|
||||||
|
formObj.entpcourseid = this.courseObj.id;
|
||||||
|
formObj.slideid = 0;
|
||||||
|
formObj.title = this.classWorkForm.title;
|
||||||
|
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
||||||
|
formObj.edusubject = this.courseObj.edusubject;
|
||||||
|
formObj.evalid = this.courseObj.evalid;
|
||||||
|
formObj.edustage = this.userStore.edustage;
|
||||||
|
formObj.status = '10'; //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
||||||
|
formObj.edituserid = this.userStore.id;
|
||||||
|
formObj.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
|
||||||
|
try {
|
||||||
|
addClassworkReturnId(formObj).then(() => {
|
||||||
|
this.classWorkForm.worktype = "习题训练";
|
||||||
|
this.chooseWorkLists = [];
|
||||||
|
this.whiteboardObj = '';
|
||||||
|
// refresh the list
|
||||||
|
this.getClassWorkAllList();
|
||||||
|
this.newWorkSpace = false;
|
||||||
|
this.newWorkSpaceEdit = false;
|
||||||
|
this.workEdit = false;
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.boardLoading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(classWorkForm.worktype === "常规作业"){
|
||||||
|
this.fileLoading = true
|
||||||
|
var formObj = {};
|
||||||
|
formObj.id = 0;
|
||||||
|
formObj.workdate = this.classWorkForm.workdate;
|
||||||
|
formObj.deaddate = '';
|
||||||
|
formObj.entpid = this.userStore.deptId;
|
||||||
|
formObj.level = 1;
|
||||||
|
formObj.parentid = 0;
|
||||||
|
formObj.worktype = this.classWorkForm.worktype;
|
||||||
|
formObj.workkey = '';
|
||||||
|
formObj.worktag = '';
|
||||||
|
formObj.uniquekey = this.classWorkForm.uniquekey;
|
||||||
|
formObj.classid = 0;
|
||||||
|
formObj.classcourseid = 0;
|
||||||
|
formObj.entpcourseid = this.courseObj.id;
|
||||||
|
formObj.slideid = 0;
|
||||||
|
formObj.title = this.classWorkForm.title;
|
||||||
|
formObj.workcodes = JSON.stringify(this.fileHomeworkList);
|
||||||
|
formObj.edusubject = this.courseObj.edusubject;
|
||||||
|
formObj.evalid = this.courseObj.evalid;
|
||||||
|
formObj.edustage = this.userStore.edustage;
|
||||||
|
formObj.status = '10'; //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
||||||
|
formObj.edituserid = this.userStore.id;
|
||||||
|
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||||
|
try {
|
||||||
|
addClassworkReturnId(formObj).then(() => {
|
||||||
|
this.classWorkForm.worktype = "习题训练";
|
||||||
|
this.chooseWorkLists = [];
|
||||||
|
this.fileHomeworkList = []
|
||||||
|
this.whiteboardObj = '';
|
||||||
|
// refresh the list
|
||||||
|
this.getClassWorkAllList();
|
||||||
|
this.newWorkSpace = false;
|
||||||
|
this.newWorkSpaceEdit = false;
|
||||||
|
this.workEdit = false;
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.fileLoading = false
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 正常新任务
|
||||||
|
var ll = [];
|
||||||
|
if (classWorkForm.worktype === "习题训练") {
|
||||||
|
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
||||||
|
// 更新 题目分值
|
||||||
|
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// TODO 待定 非习题训练------------
|
||||||
|
// this.chooseWorkLists.filter((item, index) => {
|
||||||
|
// if (item.worktype === this.classWorkForm.worktype) {
|
||||||
|
// ll.push({'id':item.id, 'score': item.score});
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
console.log(userStore,'userStoreuserStoreuserStore')
|
||||||
|
const cform = {
|
||||||
|
id: 0,
|
||||||
|
workdate: classWorkForm.workdate, // //作业类型
|
||||||
|
deaddate: '', // 截止时间
|
||||||
|
entpid: userStore.deptId, //
|
||||||
|
level: 1,
|
||||||
|
parentid: 0,
|
||||||
|
worktype: classWorkForm.worktype, // 作业类型
|
||||||
|
workkey: '',
|
||||||
|
worktag: '',
|
||||||
|
uniquekey: classWorkForm.uniquekey,// 作业名称、编码
|
||||||
|
classid: 0,
|
||||||
|
classcourseid: 0,
|
||||||
|
entpcourseid: chapterId, // 当前课程
|
||||||
|
slideid: 0,
|
||||||
|
title: classWorkForm.title, // 作业说明?
|
||||||
|
workcodes: JSON.stringify(classWorkForm.workcodes), // 作业内容?
|
||||||
|
edusubject: userStore.edusubject, // 学科 语文 数学
|
||||||
|
evalid: props.bookobj.levelSecondId, //userStore.evalid, // // 单元下的课ID
|
||||||
|
edustage: userStore.edustage, // 学段 年纪 高中,初中,小学
|
||||||
|
status: '10', //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
||||||
|
edituserid: userStore.userId, // 当前用户id
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ll.length > 0) {
|
||||||
|
cform.entpcourseworklist = JSON.stringify(ll);
|
||||||
|
} else {
|
||||||
|
cform.entpcourseworklist = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
||||||
|
console.log(cform,'提交的数据');
|
||||||
|
// addClassworkReturnId(cform).then(workres => {
|
||||||
|
// this.classWorkForm.worktype = "习题训练";
|
||||||
|
// this.chooseWorkLists = [];
|
||||||
|
// this.whiteboardObj = '';
|
||||||
|
// // refresh the list
|
||||||
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
|
// // 此方法此处不再使用 240603
|
||||||
|
// // var slist = [];
|
||||||
|
// // for (var i=0; i<this.classStudentList.length; i++) {
|
||||||
|
// // slist.push({studentid: this.classStudentList[i].studentid, name: this.classStudentList[i].name});
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // var quizll = [];
|
||||||
|
// // for (var i=0; i<this.classWorkForm.quizlist.length; i++) {
|
||||||
|
// // quizll.push({id: this.classWorkForm.quizlist[i].id});
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // var ttt = {
|
||||||
|
// // id: workres,
|
||||||
|
// // studentlist: slist,
|
||||||
|
// // entpcourseworklist: quizll
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // var wForm = {};
|
||||||
|
// // wForm.classworkarray = '['+JSON.stringify(ttt)+']';
|
||||||
|
|
||||||
|
// //pushClassWorkByArray(wForm).then(response => {});
|
||||||
|
|
||||||
|
// this.newWorkSpace = false;
|
||||||
|
// this.newWorkSpaceEdit = false;
|
||||||
|
// this.workEdit = false;
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handleQueryFromEntpCourseWork(0);
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// watch(() => sourceStore.query.fileSource,() => {
|
watch(() => props.bookobj.levelSecondId, (newVal) => {
|
||||||
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
console.log(props.bookobj,'课程选择')
|
||||||
// })
|
queryForm.eid = props.bookobj.levelSecondId,
|
||||||
|
queryForm.sectionName = props.bookobj.coursetitle,
|
||||||
|
handleQueryFromEntpCourseWork(0);
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page-typeview{
|
.page-typeview{
|
||||||
padding-top: 10px;
|
// padding-top: 10px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top, .bottom {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.middle {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.el-form-work-list{
|
.el-form-work-list{
|
||||||
|
height: 100%;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
:deep(.el-form-item__content){
|
:deep(.el-form-item__content){
|
||||||
align-items: normal;
|
align-items: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-left{
|
.work-left{
|
||||||
height: 50vh;
|
height: 100%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
border:1px dotted blue;
|
border:1px dotted blue;
|
||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.work-right {
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 0 0 5px;
|
||||||
|
overflow: auto;
|
||||||
|
line-height: 26px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page-resource flex">
|
<div class="page-newcalsetask flex">
|
||||||
<el-menu
|
<el-menu
|
||||||
default-active="1"
|
default-active="1"
|
||||||
class="el-menu-vertical-demo"
|
class="el-menu-vertical-demo"
|
||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
>
|
>
|
||||||
<!--左侧 教材 目录-->
|
<!--左侧 教材 目录-->
|
||||||
<div v-if="!isCollapse">
|
<div v-if="!isCollapse" style="height: 100%;overflow: hidden;">
|
||||||
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||||
</div>
|
</div>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
|
|
||||||
<div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}">
|
<div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<el-row style="align-items: center; margin-bottom: 0px">
|
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
||||||
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
||||||
<div class="unit-top-left" @click="isCollapse = !isCollapse">
|
<div class="unit-top-left" @click="isCollapse = !isCollapse">
|
||||||
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 作业类型:内容 -->
|
<!-- 作业类型:内容 -->
|
||||||
<task-type-view :bookobj="courseObj" />
|
<task-type-view :bookobj="courseObj" :uniquekey="classWorkForm.uniquekey" style="flex: 1; overflow: hidden;"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -116,9 +116,10 @@ const init = () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.page-resource {
|
.page-newcalsetask {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.el-menu--collapse {
|
.el-menu--collapse {
|
||||||
width: 0px;
|
width: 0px;
|
||||||
|
|
|
@ -106,9 +106,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'
|
path: '/newClassTask'
|
||||||
//path: '/classTaskAssign'
|
//path: '/classTaskAssign'
|
||||||
//isOuter: true,
|
//isOuter: true,
|
||||||
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||||
|
|
Loading…
Reference in New Issue