Compare commits
No commits in common. "76f053d8c854fc405c938bf7b1d4afad7bf205d5" and "e2e8cae690f8555b518feed897ada8727fc15ffe" have entirely different histories.
76f053d8c8
...
e2e8cae690
|
@ -72,21 +72,7 @@ export function updateClasswork(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除classworkeval
|
|
||||||
export function delClassworkeval(id) {
|
|
||||||
return request({
|
|
||||||
url: '/education/classworkeval/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 新增classworkeval
|
|
||||||
export function addClassworkeval(data) {
|
|
||||||
return request({
|
|
||||||
url: '/education/classworkeval',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询evaluationclue列表
|
// 查询evaluationclue列表
|
||||||
export function listEvaluationclue(query) {
|
export function listEvaluationclue(query) {
|
||||||
|
|
|
@ -51,9 +51,7 @@ const goBack = () =>{
|
||||||
.el-container {
|
.el-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
// background: url(@/assets/images/login/login-bg.png) no-repeat center;
|
// background: url(@/assets/images/login/login-bg.png) no-repeat center;
|
||||||
// background: #EAEFF8;
|
background: #EAEFF8;
|
||||||
background: linear-gradient(to bottom right, #cce6ff 0%, #79d0fc 100%);
|
|
||||||
// background: linear-gradient(to top, #a6e3e9, #e3fdfd);
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,6 @@ export const constantRoutes = [
|
||||||
// component: ()=> import('../login/index.vue'),
|
// component: ()=> import('../login/index.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/teachClassTask',
|
|
||||||
component: () => import('@/views/classTask/teachClassTask.vue'),
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|
|
@ -18,7 +18,6 @@ export const useToolState = defineStore('tool', {
|
||||||
showBoardAll: false, // 全屏画板-是否显示
|
showBoardAll: false, // 全屏画板-是否显示
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
isTaskWin: false, // 批改窗口是否打开
|
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
},
|
||||||
|
|
|
@ -112,7 +112,6 @@ export function ipcHandle(fn,key, cb) {
|
||||||
*/
|
*/
|
||||||
let wins_tool = null
|
let wins_tool = null
|
||||||
let winPdf=null
|
let winPdf=null
|
||||||
let winChild=null
|
|
||||||
export const createWindow = async (type, data) => {
|
export const createWindow = async (type, data) => {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'tool-sphere': { // 创建-悬浮球
|
case 'tool-sphere': { // 创建-悬浮球
|
||||||
|
@ -170,36 +169,6 @@ export const createWindow = async (type, data) => {
|
||||||
winPdf=win
|
winPdf=win
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'open-taskwin': { //作业批改-web
|
|
||||||
if(winChild){ //判断是否已经打开
|
|
||||||
winChild.focus();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const option = data.option||{}
|
|
||||||
const defOption = {
|
|
||||||
// width: 1280,// 1920,
|
|
||||||
// height: 720,// 1080,
|
|
||||||
width: 1450,
|
|
||||||
minWidth: 1200,
|
|
||||||
height: 800,
|
|
||||||
minHeight: 700,
|
|
||||||
frame: true, // 要创建无边框窗口
|
|
||||||
// resizable: true, // 禁止窗口大小缩放
|
|
||||||
alwaysOnTop: false, // 窗口是否总是显示在其他窗口之前
|
|
||||||
title:'子窗口',
|
|
||||||
show: false, //创建时窗口不可见
|
|
||||||
maximizable: true,
|
|
||||||
autoHideMenuBar: true,// 自动隐藏菜单栏
|
|
||||||
}
|
|
||||||
data.isConsole = true // 是否开启控制台
|
|
||||||
data.option = {...defOption, ...option}
|
|
||||||
winChild = await toolWindow(data)
|
|
||||||
winChild.type = type // 唯一标识
|
|
||||||
winChild.show()
|
|
||||||
winChild.setFullScreen(false) // 设置窗口为全屏
|
|
||||||
eventHandles(type, winChild) // 事件监听处理
|
|
||||||
return winChild
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -277,7 +246,6 @@ const eventHandles = (type, win) => {
|
||||||
if(onClosed) onClosed() // 自定义关闭事件
|
if(onClosed) onClosed() // 自定义关闭事件
|
||||||
win = null
|
win = null
|
||||||
wins_tool = null
|
wins_tool = null
|
||||||
winChild=null
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 新窗口-创建事件(如:主进程加载远程服务)
|
// 新窗口-创建事件(如:主进程加载远程服务)
|
||||||
|
@ -336,27 +304,6 @@ const eventHandles = (type, win) => {
|
||||||
}
|
}
|
||||||
publicMethods(on) // 加载公共方法
|
publicMethods(on) // 加载公共方法
|
||||||
break}
|
break}
|
||||||
case 'open-taskwin': { // -子窗口
|
|
||||||
// 监听窗口的激活事件
|
|
||||||
win.on('focus', async () => {
|
|
||||||
toolState.isTaskWin=true
|
|
||||||
win&&win.reload(); //刷新该窗口
|
|
||||||
});
|
|
||||||
// 监听窗口关闭事件
|
|
||||||
win.on('closed', function () {
|
|
||||||
console.log('关闭窗口')
|
|
||||||
// 设置状态(再次设置-防止未设置到)
|
|
||||||
if(toolState.isTaskWin) toolState.isTaskWin = false
|
|
||||||
winChild=null
|
|
||||||
win&&win.destroy()
|
|
||||||
});
|
|
||||||
const on = {
|
|
||||||
onClosed: () => {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publicMethods(on) // 加载公共方法
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,9 +266,6 @@ const btnSave = () => {
|
||||||
}
|
}
|
||||||
//新建小组
|
//新建小组
|
||||||
const addGroup = () => {
|
const addGroup = () => {
|
||||||
// 做清空处理
|
|
||||||
groupForm.groupname = ''
|
|
||||||
groupForm.orderidx = 0
|
|
||||||
groupVisible.value = true
|
groupVisible.value = true
|
||||||
}
|
}
|
||||||
const btnGroupSave = () => {
|
const btnGroupSave = () => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<el-descriptions-item label="班级名称">{{ classInfo.caption }}</el-descriptions-item>
|
<el-descriptions-item label="班级名称">{{ classInfo.caption }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="教师">
|
<el-descriptions-item label="教师">
|
||||||
<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 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>
|
||||||
|
|
|
@ -57,28 +57,24 @@
|
||||||
></el-empty>
|
></el-empty>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog> -->
|
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, computed, watch } from 'vue'
|
import { ref, onMounted, onUnmounted, computed, watch, reactive } from 'vue'
|
||||||
import { listByDeadDate, listClassworkdata } from '@/api/classTask'
|
import { listByDeadDate, listClassworkdataByDeadDate, listClassworkdata } from '@/api/classTask'
|
||||||
|
|
||||||
import TaskItem from '@/views/classTask/container/task-item.vue'
|
import TaskItem from '@/views/classTask/container/task-item.vue'
|
||||||
// import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import useClassTaskStore from "@/store/modules/classTask";
|
import useClassTaskStore from "@/store/modules/classTask";
|
||||||
import {sessionStore, createWindow} from '@/utils/tool'
|
|
||||||
|
|
||||||
|
|
||||||
const toolState = useToolState();
|
|
||||||
|
|
||||||
const classTaskStore = useClassTaskStore()
|
const classTaskStore = useClassTaskStore()
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
// const itemDialogRef = ref(null)
|
const itemDialogRef = ref(null)
|
||||||
const tabOptions = ref(['进行中', '已结束'])
|
const tabOptions = ref(['进行中', '已结束'])
|
||||||
const tabActive = ref('进行中')
|
const tabActive = ref('进行中')
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
|
@ -89,8 +85,6 @@ const classWorkList = ref([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const activeDataList = computed(() => {
|
const activeDataList = computed(() => {
|
||||||
return classWorkList.value
|
return classWorkList.value
|
||||||
})
|
})
|
||||||
|
@ -215,9 +209,7 @@ const getClassWorkList = async () => {
|
||||||
/**
|
/**
|
||||||
* 3、获取多个班级学生作业数据
|
* 3、获取多个班级学生作业数据
|
||||||
*/
|
*/
|
||||||
const getStudentClassWorkData = async() => {
|
const getStudentClassWorkData = () => {
|
||||||
// const { chapterId } = await useGetHomework(props.bookobj.node)
|
|
||||||
// this.entpcourseid = chapterId
|
|
||||||
if(classTaskStore.classListIds.length>0){
|
if(classTaskStore.classListIds.length>0){
|
||||||
// listClassworkdataByDeadDate({
|
// listClassworkdataByDeadDate({
|
||||||
// edituserid: userStore.userId, // 老师的id
|
// edituserid: userStore.userId, // 老师的id
|
||||||
|
@ -331,6 +323,9 @@ const getStudentClassWorkData = async() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const toolStore = useToolState()
|
||||||
|
|
||||||
// 将标签中的双引号增加转义
|
// 将标签中的双引号增加转义
|
||||||
const escapeHtmlQuotes = (str) => {
|
const escapeHtmlQuotes = (str) => {
|
||||||
// 后端已replace双引号, 故前端不用在处理
|
// 后端已replace双引号, 故前端不用在处理
|
||||||
|
@ -344,7 +339,7 @@ const pollingST = ref(null) //轮询定时器标识
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData() // 加载数据
|
getData() // 加载数据
|
||||||
// 轮询查询
|
// 轮询查询
|
||||||
closeDialog();
|
getStudentClassWorkDataPolling()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 轮询查询 学生作业进度
|
// 轮询查询 学生作业进度
|
||||||
|
@ -358,25 +353,13 @@ const getStudentClassWorkDataPolling = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
clearInterval(pollingST.value) // 关闭轮询
|
console.log('关闭弹窗,开启作业进度轮询')
|
||||||
getStudentClassWorkDataPolling()
|
getStudentClassWorkDataPolling()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 开启新批改弹窗
|
|
||||||
* @param item 作业对象
|
|
||||||
*/
|
|
||||||
const onClickItem = (item) => {
|
const onClickItem = (item) => {
|
||||||
console.log('开启弹窗,关闭作业进度轮询')
|
console.log('开启弹窗,关闭作业进度轮询')
|
||||||
clearInterval(pollingST.value)
|
clearInterval(pollingST.value)
|
||||||
// itemDialogRef.value.openDialog(item)
|
itemDialogRef.value.openDialog(item)
|
||||||
|
|
||||||
// 新跳转子窗口链接
|
|
||||||
// 1、本地缓存item数据,2、打开子窗口 3、子窗口加载item数据
|
|
||||||
// localStorage.setItem('teachClassWorkItem', JSON.stringify(item))
|
|
||||||
sessionStore.set('teachClassWorkItem', item)
|
|
||||||
toolState.isTaskWin=true //设置打开批改窗口
|
|
||||||
createWindow('open-taskwin',{url:'/teachClassTask'})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,11 +413,6 @@ const getStudentVisible = async () => {
|
||||||
// 更新批阅数
|
// 更新批阅数
|
||||||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
||||||
} else {
|
} else {
|
||||||
// 学生未完成,但是老师批改了?
|
|
||||||
if(curWork && curWork.workdataresultcount == 0){
|
|
||||||
// 更新批改数
|
|
||||||
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
|
|
||||||
}
|
|
||||||
classWorkList.value[t].finishpercent = 0
|
classWorkList.value[t].finishpercent = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -445,13 +423,9 @@ const getStudentVisible = async () => {
|
||||||
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [dataList, toolState.isTaskWin],
|
() => [dataList, toolStore.isToolWin],
|
||||||
() => {
|
() => {
|
||||||
console.log('=监听到批改窗口打开了===', toolState.isTaskWin)
|
console.log('====', toolStore)
|
||||||
if(!toolState.isTaskWin){
|
|
||||||
|
|
||||||
closeDialog();// 开启轮询
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(tabActive, (newVal,oldVal)=>{
|
watch(tabActive, (newVal,oldVal)=>{
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
<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" style="color: blue;"></i>
|
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
||||||
<span>课程目录</span>
|
<span>课程目录</span>
|
||||||
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
|
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -132,8 +132,8 @@
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<!-- <el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
|
<el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
|
||||||
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button> -->
|
:disabled="checkTaskAssigned(currentWorkEdit.currentTask)" @click="handleWorkEdit2ClassWorkQuizAdd">添加作业</el-button>
|
||||||
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
|
||||||
@click="submitStudy('submit')">确 定</el-button>
|
@click="submitStudy('submit')">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
|
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||||
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
||||||
|
@ -168,7 +168,6 @@ import { getCurrentTime } from '@/utils/date'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
initDataProps: {
|
initDataProps: {
|
||||||
|
@ -268,7 +267,7 @@ const getTaskList = async () => {
|
||||||
const { chapterId } = await useGetHomework(courseObj.node)
|
const { chapterId } = await useGetHomework(courseObj.node)
|
||||||
// this.entpcourseid = chapterId
|
// this.entpcourseid = chapterId
|
||||||
// 新版查询方式
|
// 新版查询方式
|
||||||
homeworklist({entpcourseid: chapterId, orderby: "deaddate DESC" , edituserid: userStore.userId, pageSize: 500}).then(res => {
|
homeworklist({entpcourseid: chapterId, orderby: "concat(deaddate,uniquekey) DESC" , edituserid: userStore.userId, pageSize: 100}).then(res => {
|
||||||
let model = [];
|
let model = [];
|
||||||
let mission = [];
|
let mission = [];
|
||||||
|
|
||||||
|
@ -354,6 +353,7 @@ const getTaskList = async () => {
|
||||||
}
|
}
|
||||||
list.push(item);
|
list.push(item);
|
||||||
}
|
}
|
||||||
|
console.log(list,'========================')
|
||||||
taskList.value = list;
|
taskList.value = list;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
})
|
})
|
||||||
|
@ -369,21 +369,20 @@ const handleWorkTitleEdit = (row, index) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 作业内容-查看详情
|
// 编辑作业内容
|
||||||
const handleWorkEdit = (row, index) =>{
|
const handleWorkEdit = (row, index) =>{
|
||||||
console.log(row, index)
|
|
||||||
workEdit.value = true
|
workEdit.value = true
|
||||||
currentWorkEdit.currentTask = row;
|
// this.currentTask = row;
|
||||||
// currentWorkEdit.currentIndex = index;
|
// this.currentIndex = index;
|
||||||
currentTag.value = row.worktype;
|
currentTag.value = row.worktype;
|
||||||
// this.attainmentList = row.workcodesList?.attlist;
|
this.attainmentList = row.workcodesList?.attlist;
|
||||||
// this.courseQualityList = row.workcodesList?.qualist;
|
this.courseQualityList = row.workcodesList?.qualist;
|
||||||
if (row.worktype == '框架梳理') {
|
if (row.worktype == '框架梳理') {
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.getFlowData()
|
this.getFlowData()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// if (row.worktype == '学科定位') {
|
// if (currentTag.value.worktype == '学科定位') {
|
||||||
// // TODO 后续需要再迁
|
// // TODO 后续需要再迁
|
||||||
// rootid:entpcoursework里的id rootid: row.entpcourseworklistarray[0].id,
|
// rootid:entpcoursework里的id rootid: row.entpcourseworklistarray[0].id,
|
||||||
// listEvaluationclue({ cluegroup: 'graph', edusubject: this.courseObj.edusubject, pageSize: 1000 }).then((res) => {
|
// listEvaluationclue({ cluegroup: 'graph', edusubject: this.courseObj.edusubject, pageSize: 1000 }).then((res) => {
|
||||||
|
@ -399,8 +398,7 @@ const handleWorkEdit = (row, index) =>{
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // 课标研读 目标设定 教材研读 框架梳理 学科定位
|
// // 课标研读 目标设定 教材研读 框架梳理 学科定位
|
||||||
if (row.worktype == '习题训练') {
|
if (currentTag.value.worktype == '习题训练') {
|
||||||
console.log('习题训练')
|
|
||||||
var idlist = JSON.parse('['+row.entpcourseworklist+']');
|
var idlist = JSON.parse('['+row.entpcourseworklist+']');
|
||||||
var ids = [];
|
var ids = [];
|
||||||
for (var i=0; i<idlist.length; i++) {
|
for (var i=0; i<idlist.length; i++) {
|
||||||
|
@ -428,14 +426,14 @@ const handleWorkEdit = (row, index) =>{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log(workConfObj.quizlist,'workConfObj.quizlist');
|
|
||||||
// 格式化试题信息
|
// 格式化试题信息
|
||||||
processList(workConfObj.quizlist);
|
processList(workConfObj.quizlist);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 常规作业、课堂展示
|
// 常规作业、课堂展示
|
||||||
if(row.worktype == '常规作业' || row.worktype == '课堂展示'){
|
if(currentTag.value.worktype == '常规作业' || row.worktype == '课堂展示'){
|
||||||
console.log(row,'常规作业-课堂展示');
|
console.log(row,'常规作业-课堂展示');
|
||||||
// 老师布置的附件 workcodes ?? 与批改哪里这个字段值不一样
|
// 老师布置的附件 workcodes ?? 与批改哪里这个字段值不一样
|
||||||
if(row.workcodes != ''){
|
if(row.workcodes != ''){
|
||||||
|
@ -451,138 +449,44 @@ const handleWorkEdit = (row, index) =>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 作业内容编辑-跳转到设计界面-传参
|
|
||||||
let classtaskObj = reactive({
|
|
||||||
id: '', //
|
|
||||||
uniquekey: '', // 设计中的标题
|
|
||||||
title: '', // 设计中的说明
|
|
||||||
worktype: '', // 设计中的作业类型
|
|
||||||
quizlist: [], // 设计中的试题列表
|
|
||||||
})
|
|
||||||
// 作业内容编辑-跳转到设计界面
|
|
||||||
const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|
||||||
// this.newWorkSpace = true;
|
|
||||||
// this.newWorkSpaceEdit = true;
|
|
||||||
// this.currentTask = row;
|
|
||||||
// this.currentIndex = index;
|
|
||||||
// this.currentTag = row.worktype;
|
|
||||||
// this.attainmentList = row.workcodesList?.attlist;
|
|
||||||
// this.courseQualityList = row.workcodesList?.qualist;
|
|
||||||
|
|
||||||
// 更新新任务中的各数据
|
// 作业内容编辑-确认
|
||||||
// this.classWorkForm.uniquekey = this.currentTask.uniquekey;
|
const submitWorkTitle = () => {
|
||||||
// this.classWorkForm.title = this.currentTask.title;
|
console.log(taskList.value)
|
||||||
// 更新新任务中作业类型
|
console.log(currentWorkEdit)
|
||||||
// this.classWorkForm.worktype = this.currentTask.worktype;
|
// ? taskList是新组合的,有的变成子项了, 根据currentIndex获取不到,下面判断暂弃!
|
||||||
|
// if (taskList.value[currentWorkEdit.currentIndex].title == currentWorkEdit.currentTitle) {
|
||||||
//重新更新[新任务]中右侧列表数据
|
// currentWorkEdit.workTitleEdit = false;
|
||||||
var listCourseWork = [];
|
// return;
|
||||||
for (var i=0; i < row.entpcourseworklistarray.length; i++) {
|
// }
|
||||||
listCourseWork.push(row.entpcourseworklistarray[i]);
|
taskList.value&&taskList.value.forEach((item)=>{
|
||||||
}
|
if(item.children.length>0){
|
||||||
|
item.children.map(_item=>{
|
||||||
|
if(_item.title == currentWorkEdit.currentTitle){
|
||||||
|
currentWorkEdit.workTitleEdit = false;
|
||||||
if (listCourseWork.length > 0) {
|
return;
|
||||||
classtaskObj.id= row.id; //
|
|
||||||
classtaskObj.uniquekey= row.uniquekey; // 设计中的标题
|
|
||||||
classtaskObj.title= row.title; // 设计中的说明
|
|
||||||
classtaskObj.worktype= row.worktype; // 设计中的作业类型
|
|
||||||
classtaskObj.quizlist= []; // 设计中的试题列表
|
|
||||||
|
|
||||||
|
|
||||||
if (row.worktype == '框架梳理') {
|
|
||||||
// 框架梳理对应只有一个内容
|
|
||||||
// let queryParams = {}
|
|
||||||
// queryParams.id = listCourseWork[0].id;
|
|
||||||
// queryParams.ppttype = '教材分析';
|
|
||||||
// queryParams.title = '框架梳理';
|
|
||||||
// queryParams.filetype = 'draw';
|
|
||||||
// const res = await getEvaluationclue(listCourseWork[0].id);
|
|
||||||
// if ( res.data==null || res.data==undefined ) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.chooseWorkLists = [];
|
|
||||||
// res.data.worktype = '框架梳理';
|
|
||||||
// res.data.score = listCourseWork[0].score;
|
|
||||||
// this.chooseWorkLists.push(res.data);
|
|
||||||
}
|
|
||||||
else if (row.worktype == '习题训练') {
|
|
||||||
const ids = listCourseWork.map(item => item.id).join(",");
|
|
||||||
listEntpcoursework({ids: ids, pageSize: 50}).then(idres => {
|
|
||||||
// for (var i=0; i<idres.rows.length; i++) {
|
|
||||||
// idres.rows[i].titletext = idres.rows[i].title.replace(/<[^>]+>/g, '');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 格式化试题
|
|
||||||
if(idres.rows&&idres.rows.length > 0){
|
|
||||||
processList(idres.rows);
|
|
||||||
//重新将task中的分值更新
|
|
||||||
row.entpcourseworklistarray.forEach(item => {
|
|
||||||
const quizItem = idres.rows.find(quiz => quiz.id === item.id);
|
|
||||||
if (quizItem) {
|
|
||||||
quizItem.score = item.score;
|
|
||||||
quizItem.scoreOrigin = item.score;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
classtaskObj.quizlist = idres.rows;
|
|
||||||
// 跳转作业设计 页面
|
|
||||||
router.push({
|
|
||||||
path: '/newClassTask',
|
|
||||||
query: {
|
|
||||||
classtaskObj: JSON.stringify(classtaskObj),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}else{
|
||||||
else if (this.classWorkForm.worktype == '课堂展示') {
|
if(item.title == currentWorkEdit.currentTitle){
|
||||||
|
currentWorkEdit.workTitleEdit = false;
|
||||||
// const workcodes = JSON.parse(this.currentTask.workcodes);
|
return;
|
||||||
// const jsonString = JSON.stringify(workcodes.json);
|
}
|
||||||
|
|
||||||
// await this.$nextTick();
|
|
||||||
// this.isShowBoard = true
|
|
||||||
// this.whiteboardObj = jsonString;
|
|
||||||
}
|
}
|
||||||
else if (this.classWorkForm.worktype == '常规作业') {
|
})
|
||||||
// this.fileHomeworkList = [];
|
console.log('有更改!')
|
||||||
// if(isJson(this.currentTask.workcodes)){
|
|
||||||
// this.fileHomeworkList = JSON.parse(this.currentTask.workcodes);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 作业说明编辑-确认
|
|
||||||
const submitWorkTitle = () => {
|
|
||||||
if(currentWorkEdit.currentTask.title == currentWorkEdit.currentTitle){
|
|
||||||
currentWorkEdit.workTitleEdit = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 有修改时才进行更新
|
// 有修改时才进行更新
|
||||||
updateClasswork({id: currentWorkEdit.currentTask.id, title: currentWorkEdit.currentTitle}).then(response => {
|
taskList.value[currentWorkEdit.currentIndex].title = currentWorkEdit.currentTitle;
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
updateClasswork({id: taskList.value[currentWorkEdit.currentIndex].id, title: currentWorkEdit.currentTitle}).then(response => {
|
||||||
|
ElMessage("修改成功");
|
||||||
currentWorkEdit.workTitleEdit = false;
|
currentWorkEdit.workTitleEdit = false;
|
||||||
// 刷新列表,重新获取数据
|
//this.getClassWorkAllList();
|
||||||
getTaskList();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 当前是否为已推送作业
|
// 当前是否为已推送作业
|
||||||
const checkTaskAssigned = (row) => {
|
const checkTaskAssigned = (row) => {
|
||||||
|
console.log(row,'checkTaskAssigned')
|
||||||
// 只要有一个taskconfig的id不为0,就是已推送过任务了
|
// 只要有一个taskconfig的id不为0,就是已推送过任务了
|
||||||
let bAssigned = false;
|
let bAssigned = false;
|
||||||
for (let i=0; i<row.taskconfig.length; i++) {
|
for (let i=0; i<row.taskconfig.length; i++) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore" style="height: 100%">
|
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore">
|
||||||
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
|
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
|
||||||
<div class="teacher_content" :style="{ height: '100%' }">
|
<div class="teacher_content" :style="{ height: '72vh' }">
|
||||||
<div style="font-size: 18px; width: 100%; padding: 5px 10px; flex: 0 0 auto;">
|
<div style="font-size: 18px; width: 100%; padding: 5px 10px" class="sticky">
|
||||||
{{ classWorkFormScore.name }} 答题详情
|
{{ classWorkFormScore.name }} 答题详情
|
||||||
</div>
|
</div>
|
||||||
<div class="teacher_content_con">
|
<div class="teacher_content_con">
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<!-- 习题训练 -->
|
<!-- 习题训练 -->
|
||||||
<div v-if="dialogProps.studentObj.worktype == '习题训练'">
|
<div v-if="dialogProps.studentObj.worktype == '习题训练'">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" style="padding: 10px;text-align: left;">
|
<el-col :span="24" style="padding: 10px">
|
||||||
<!-- 题源、题目标题、题目选项 -->
|
<!-- 题源、题目标题、题目选项 -->
|
||||||
<span>{{ quItem.worktag }}</span>
|
<span>{{ quItem.worktag }}</span>
|
||||||
<span style="margin-left: 4px" v-html="quItem.titleFormat"></span>
|
<span style="margin-left: 4px" v-html="quItem.titleFormat"></span>
|
||||||
|
@ -171,10 +171,10 @@
|
||||||
<el-collapse-item title="老师布置详情" name="1">
|
<el-collapse-item title="老师布置详情" name="1">
|
||||||
<div class="image_list">
|
<div class="image_list">
|
||||||
<div v-if="teachImageList.length > 0">
|
<div v-if="teachImageList.length > 0">
|
||||||
<div style="margin-bottom: 5px;text-align: left;">
|
<div style="margin-bottom: 5px">
|
||||||
<span style="color: red">温馨提示:点击图片可放大预览 </span>
|
<span style="color: red">温馨提示:点击图片可放大预览 </span>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(imageItem, index) in teachImageList" :key="index" style="text-align: left;">
|
<div v-for="(imageItem, index) in teachImageList" :key="index">
|
||||||
<el-image
|
<el-image
|
||||||
style="width: 400px; height: 400px"
|
style="width: 400px; height: 400px"
|
||||||
:src="imageItem.url"
|
:src="imageItem.url"
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="teachFileList.length > 0">
|
<div v-if="teachFileList.length > 0">
|
||||||
<div style="margin: 10px 0;text-align: left;">
|
<div style="margin: 10px 0">
|
||||||
<span style="color: red" @click="openFile"
|
<span style="color: red" @click="openFile"
|
||||||
>温馨提示:点击此处 可预览其他类型附件!
|
>温馨提示:点击此处 可预览其他类型附件!
|
||||||
</span>
|
</span>
|
||||||
|
@ -214,16 +214,16 @@
|
||||||
<div v-if="feedContentList.length > 0">
|
<div v-if="feedContentList.length > 0">
|
||||||
<div v-if="dialogProps.studentObj.worktype == '常规作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
|
<div v-if="dialogProps.studentObj.worktype == '常规作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
|
||||||
<!-- 常规作业:学生有的会答复 -->
|
<!-- 常规作业:学生有的会答复 -->
|
||||||
<p style="padding: 10px 0;text-align: left;">学生答复内容</p>
|
<p style="padding: 10px 0;">学生答复内容</p>
|
||||||
<div style="padding: 0 20px;text-align: left;">{{stuItem.rightanswer}}</div>
|
<div style="padding: 0 20px">{{stuItem.rightanswer}}</div>
|
||||||
</div>
|
</div>
|
||||||
<p style="text-align: left;">学生答题附件内容</p>
|
<p>学生答题附件内容</p>
|
||||||
<div class="image_list">
|
<div class="image_list">
|
||||||
<div v-if="imageList.length > 0">
|
<div v-if="imageList.length > 0">
|
||||||
<div style="margin-bottom: 5px;text-align: left;">
|
<div style="margin-bottom: 5px">
|
||||||
<span style="color: red">温馨提示:点击图片可放大预览 </span>
|
<span style="color: red">温馨提示:点击图片可放大预览 </span>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(imageItem, index) in imageList" :key="index" style="text-align: left;">
|
<div v-for="(imageItem, index) in imageList" :key="index">
|
||||||
<el-image
|
<el-image
|
||||||
style="width: 500px; height: 500px"
|
style="width: 500px; height: 500px"
|
||||||
:src="imageItem.url"
|
:src="imageItem.url"
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="fileList.length > 0">
|
<div v-if="fileList.length > 0">
|
||||||
<div style="margin: 10px 0;text-align: left;">
|
<div style="margin: 10px 0">
|
||||||
<span style="color: red" @click="openFile"
|
<span style="color: red" @click="openFile"
|
||||||
>温馨提示:点击此处 可预览其他类型附件!
|
>温馨提示:点击此处 可预览其他类型附件!
|
||||||
</span>
|
</span>
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 无附件内容 -->
|
<!-- 无附件内容 -->
|
||||||
<div v-if="imageList.length == 0 && fileList.length == 0" style="padding: 0 20px;text-align: left;">未提交附件内容</div>
|
<div v-if="imageList.length == 0 && fileList.length == 0" style="padding: 0 20px">未提交附件内容</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
@ -924,7 +924,6 @@ defineExpose({
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.teacher_content {
|
.teacher_content {
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
@ -936,16 +935,11 @@ defineExpose({
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
}
|
}
|
||||||
.tacher_conten_foot {
|
.tacher_conten_foot {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header{
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image_list {
|
.image_list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
|
@ -991,8 +985,4 @@ defineExpose({
|
||||||
background-color: red;
|
background-color: red;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header{
|
|
||||||
align-items: left;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -247,12 +247,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance } from 'vue'
|
import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { cloneDeep } from 'lodash'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
|
|
||||||
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,readFile, listClassworkeval,delClassworkeval,addClassworkeval } from '@/api/classTask'
|
import { updateClasswork, listEvaluationclue,readFile } from '@/api/classTask'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
||||||
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
||||||
|
@ -265,20 +263,19 @@ import FileUpload from "@/components/FileUpload/index.vue";
|
||||||
import whiteboard from '@/components/whiteboard/whiteboard.vue'
|
import whiteboard from '@/components/whiteboard/whiteboard.vue'
|
||||||
|
|
||||||
|
|
||||||
import { useToolState } from '@/store/modules/tool'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
bookobj: {
|
bookobj: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
},
|
},
|
||||||
propsformobj: {
|
uniquekey: {
|
||||||
type: Object,
|
type: String,
|
||||||
default: () =>({})
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -359,11 +356,10 @@ const workResource = reactive({
|
||||||
entpCourseWorkTotal: 0, // 习题总数
|
entpCourseWorkTotal: 0, // 习题总数
|
||||||
}); // 作业资源
|
}); // 作业资源
|
||||||
let classWorkForm = reactive({
|
let classWorkForm = reactive({
|
||||||
id: cloneDeep(props.propsformobj.id),
|
uniquekey: props.uniquekey, // 作业唯一标识 作业名称
|
||||||
uniquekey: cloneDeep(props.propsformobj.uniquekey), // 作业唯一标识 作业名称
|
worktype: '习题训练', //作业类型
|
||||||
worktype: props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
title: '',// 作业说明
|
||||||
title: props.propsformobj.title?cloneDeep(props.propsformobj.title):'',// 作业说明
|
quizlist: [], // 作业习题列表内容
|
||||||
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[] // 作业习题列表内容
|
|
||||||
}); // 提交的作业内容
|
}); // 提交的作业内容
|
||||||
const chooseWorkLists = ref([]); // 框架梳理、?课堂展示
|
const chooseWorkLists = ref([]); // 框架梳理、?课堂展示
|
||||||
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
const whiteboardObj = ref(''); // 作业资源 - 课堂展示 白板
|
||||||
|
@ -389,8 +385,7 @@ const changeFormType = (val) => {
|
||||||
classWorkForm.worktype = val;
|
classWorkForm.worktype = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(props.propsformobj)
|
|
||||||
console.log(classWorkForm,'==============zizujian===================')
|
|
||||||
/**
|
/**
|
||||||
* @desc: 根据查询参数查询试题
|
* @desc: 根据查询参数查询试题
|
||||||
* @return: {*}
|
* @return: {*}
|
||||||
|
@ -667,304 +662,322 @@ 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) {
|
||||||
//
|
if (classWorkForm.id != null) {
|
||||||
const { chapterId } = await useGetHomework(props.bookobj.node)
|
// 当前为[编辑]状态下点进来得处理
|
||||||
// this.entpcourseid = chapterId
|
updateClasswork(classWorkForm).then(response => {
|
||||||
|
ElMessage("修改成功");
|
||||||
|
// this.workConfDialogOpen = false;
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList(); // 更新表单数据
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 当前为[编辑]状态下点进来得处理 newWorkSpaceEdit true 为编辑状态
|
||||||
|
if(newWorkSpaceEdit.value ) {
|
||||||
|
|
||||||
const cform = {
|
// 0.右侧作业资源添加检测
|
||||||
id: 0,
|
if (this.currentTag == '习题训练') {
|
||||||
workdate: classWorkForm.workdate, // //作业类型?web端这里貌似没有这个时间
|
if (this.classWorkForm.quizlist.length == 0) {
|
||||||
deaddate: '', // 截止时间
|
ElMessage.error('请先添加作业资源!');
|
||||||
entpid: userStore.deptId, //
|
return;
|
||||||
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
|
|
||||||
entpcourseworklist: '', // 选择的 习题训练 list 需要转字符串
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 当前为[编辑]状态下点进来得处理 newWorkSpaceEdit true 为编辑状态
|
|
||||||
if(classWorkForm.id != '' ) {// 编辑状态 有id
|
|
||||||
|
|
||||||
editWork(cform); // 编辑作业
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (classWorkForm.worktype === "课堂展示") {
|
|
||||||
boardLoading.value = true
|
|
||||||
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
|
||||||
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
|
||||||
// 课堂展示提交内容
|
|
||||||
// cform.worktag = question.value;
|
|
||||||
cform.title = question.value;
|
|
||||||
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
|
||||||
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
|
|
||||||
try {
|
|
||||||
addClassworkReturnId(cform).then(() => {
|
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
|
||||||
// 重置提交表单
|
|
||||||
classWorkForm.worktype = "课堂展示";
|
|
||||||
classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
|
||||||
classWorkForm.title = "";
|
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
|
||||||
chooseWorkLists.value = [];
|
|
||||||
whiteboardObj.value = ''; // ? // 清空白板
|
|
||||||
// refresh the list
|
|
||||||
//这里分离了,所以不需要更新表单数据了
|
|
||||||
// this.getClassWorkAllList();
|
|
||||||
|
|
||||||
// TODO 后续看是否跳转到 作业布置页面
|
|
||||||
|
|
||||||
//TODO 下面3个后续看是啥
|
|
||||||
// this.newWorkSpace = false;
|
|
||||||
// this.newWorkSpaceEdit = false;
|
|
||||||
// this.workEdit = false;
|
|
||||||
boardLoading.value = false
|
|
||||||
})
|
|
||||||
} finally {
|
|
||||||
boardLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(classWorkForm.worktype === "常规作业"){
|
|
||||||
fileLoading.value = true
|
|
||||||
cform.workcodes = JSON.stringify(fileHomeworkList.value);
|
|
||||||
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
|
||||||
try {
|
|
||||||
addClassworkReturnId(cform).then(() => {
|
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
|
||||||
// 重置提交表单
|
|
||||||
classWorkForm.worktype = "常规作业";
|
|
||||||
classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
|
||||||
classWorkForm.title = "";
|
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
|
||||||
chooseWorkLists.value = [];
|
|
||||||
whiteboardObj.value = ''; // ? // 清空白板
|
|
||||||
fileHomeworkList.value = []; // 常规作业list
|
|
||||||
// refresh the list
|
|
||||||
//这里分离了,所以不需要更新表单数据了
|
|
||||||
// this.getClassWorkAllList();
|
|
||||||
|
|
||||||
// TODO 后续看是否跳转到 作业布置页面
|
|
||||||
|
|
||||||
//TODO 下面3个后续看是啥
|
|
||||||
// this.newWorkSpace = false;
|
|
||||||
// this.newWorkSpaceEdit = false;
|
|
||||||
// this.workEdit = false;
|
|
||||||
|
|
||||||
fileLoading.value = false
|
|
||||||
})
|
|
||||||
} finally {
|
|
||||||
fileLoading.value = 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 if( classWorkForm.worktype === "框架梳理") {
|
|
||||||
chooseWorkLists.value.filter((item) => {
|
|
||||||
if (item.worktype === classWorkForm.worktype) {
|
|
||||||
ll.push({'id':item.id, 'score': item.score});
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
else if (this.currentTag == '课堂展示' || this.currentTag == '常规作业') {
|
||||||
// 习题训练 右侧选择的资源list
|
// 不做校验
|
||||||
if (ll.length > 0) {
|
|
||||||
cform.entpcourseworklist = JSON.stringify(ll);
|
|
||||||
} else {
|
|
||||||
cform.entpcourseworklist = '';
|
|
||||||
}
|
|
||||||
console.log(cform,'提交的数据');
|
|
||||||
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
|
||||||
|
|
||||||
addClassworkReturnId(cform).then(workres => {
|
|
||||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
|
||||||
// 重置提交表单
|
|
||||||
classWorkForm.worktype = "习题训练";
|
|
||||||
classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
|
||||||
classWorkForm.title = "";
|
|
||||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
|
||||||
|
|
||||||
// 情况选择的资源缓存
|
}
|
||||||
chooseWorkLists.value = [];
|
else {
|
||||||
whiteboardObj.value = ''; // ? // 清空白板
|
if (this.chooseWorkLists.length == 0) {
|
||||||
// refresh the list
|
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.getClassWorkAllList();
|
||||||
|
|
||||||
// TODO 后续看是否跳转到 作业布置页面
|
this.classWorkForm.worktype = "习题训练";
|
||||||
|
this.newWorkSpace = false;
|
||||||
|
this.newWorkSpaceEdit = false;
|
||||||
|
this.workEdit = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//TODO 下面3个后续看是啥
|
//
|
||||||
// this.newWorkSpace = false;
|
const { chapterId } = await useGetHomework(props.bookobj.node)
|
||||||
// this.newWorkSpaceEdit = false;
|
// this.entpcourseid = chapterId
|
||||||
// this.workEdit = false;
|
|
||||||
})
|
const cform = {
|
||||||
|
id: 0,
|
||||||
|
workdate: classWorkForm.workdate, // //作业类型?web端这里貌似没有这个时间
|
||||||
|
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
|
||||||
|
entpcourseworklist: '', // 选择的 习题训练 list 需要转字符串
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
if (classWorkForm.worktype === "课堂展示") {
|
||||||
|
boardLoading.value = true
|
||||||
|
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
||||||
|
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
||||||
|
// 课堂展示提交内容
|
||||||
|
// cform.worktag = question.value;
|
||||||
|
cform.title = question.value;
|
||||||
|
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
||||||
|
cform.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
|
||||||
|
try {
|
||||||
|
addClassworkReturnId(cform).then(() => {
|
||||||
|
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||||
|
// 重置提交表单
|
||||||
|
classWorkForm.worktype = "课堂展示";
|
||||||
|
classWorkForm.uniquekey = props.uniquekey, // 作业唯一标识 作业名称
|
||||||
|
classWorkForm.title = "";
|
||||||
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
|
// 情况选择的资源缓存
|
||||||
|
chooseWorkLists.value = [];
|
||||||
|
whiteboardObj.value = ''; // ? // 清空白板
|
||||||
|
// refresh the list
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
|
// TODO 后续看是否跳转到 作业布置页面
|
||||||
|
|
||||||
|
//TODO 下面3个后续看是啥
|
||||||
|
// this.newWorkSpace = false;
|
||||||
|
// this.newWorkSpaceEdit = false;
|
||||||
|
// this.workEdit = false;
|
||||||
|
boardLoading.value = false
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
boardLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(classWorkForm.worktype === "常规作业"){
|
||||||
|
fileLoading.value = true
|
||||||
|
cform.workcodes = JSON.stringify(fileHomeworkList.value);
|
||||||
|
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||||
|
try {
|
||||||
|
addClassworkReturnId(cform).then(() => {
|
||||||
|
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||||
|
// 重置提交表单
|
||||||
|
classWorkForm.worktype = "常规作业";
|
||||||
|
classWorkForm.uniquekey = props.uniquekey, // 作业唯一标识 作业名称
|
||||||
|
classWorkForm.title = "";
|
||||||
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
|
// 情况选择的资源缓存
|
||||||
|
chooseWorkLists.value = [];
|
||||||
|
whiteboardObj.value = ''; // ? // 清空白板
|
||||||
|
fileHomeworkList.value = []; // 常规作业list
|
||||||
|
// refresh the list
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
|
// TODO 后续看是否跳转到 作业布置页面
|
||||||
|
|
||||||
|
//TODO 下面3个后续看是啥
|
||||||
|
// this.newWorkSpace = false;
|
||||||
|
// this.newWorkSpaceEdit = false;
|
||||||
|
// this.workEdit = false;
|
||||||
|
|
||||||
|
fileLoading.value = false
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
fileLoading.value = 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 if( classWorkForm.worktype === "框架梳理") {
|
||||||
|
chooseWorkLists.value.filter((item) => {
|
||||||
|
if (item.worktype === classWorkForm.worktype) {
|
||||||
|
ll.push({'id':item.id, 'score': item.score});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 习题训练 右侧选择的资源list
|
||||||
|
if (ll.length > 0) {
|
||||||
|
cform.entpcourseworklist = JSON.stringify(ll);
|
||||||
|
} else {
|
||||||
|
cform.entpcourseworklist = '';
|
||||||
|
}
|
||||||
|
console.log(cform,'提交的数据');
|
||||||
|
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
||||||
|
|
||||||
|
addClassworkReturnId(cform).then(workres => {
|
||||||
|
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||||
|
// 重置提交表单
|
||||||
|
classWorkForm.worktype = "习题训练";
|
||||||
|
classWorkForm.uniquekey = props.uniquekey, // 作业唯一标识 作业名称
|
||||||
|
classWorkForm.title = "";
|
||||||
|
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||||
|
|
||||||
|
// 情况选择的资源缓存
|
||||||
|
chooseWorkLists.value = [];
|
||||||
|
whiteboardObj.value = ''; // ? // 清空白板
|
||||||
|
// refresh the list
|
||||||
|
//这里分离了,所以不需要更新表单数据了
|
||||||
|
// this.getClassWorkAllList();
|
||||||
|
|
||||||
|
// TODO 后续看是否跳转到 作业布置页面
|
||||||
|
|
||||||
|
//TODO 下面3个后续看是啥
|
||||||
|
// this.newWorkSpace = false;
|
||||||
|
// this.newWorkSpaceEdit = false;
|
||||||
|
// this.workEdit = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const editWork = async (cform) =>{
|
|
||||||
// 基础参数
|
|
||||||
cform.id= classWorkForm.id;
|
|
||||||
|
|
||||||
// 0.右侧作业资源添加检测
|
|
||||||
if (classWorkForm.worktype == '习题训练') {
|
|
||||||
if (classWorkForm.quizlist.length == 0) {
|
|
||||||
ElMessage.error('请先添加作业资源!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
|
|
||||||
// 不做校验
|
|
||||||
|
|
||||||
}else {
|
|
||||||
if (chooseWorkLists.value.length == 0) {
|
|
||||||
// 框架梳理
|
|
||||||
ElMessage.error('请先添加作业资源!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 根据作业类型分类处理
|
|
||||||
if (classWorkForm.worktype=='习题训练'){
|
|
||||||
|
|
||||||
// 1.判断当前添加的作业是否与原来不同(跟父组件传来的值对比)
|
|
||||||
let needUplEval = false;
|
|
||||||
if (classWorkForm.quizlist.length != props.propsformobj.quizlist.length) {
|
|
||||||
needUplEval = true;
|
|
||||||
}else {
|
|
||||||
// 只要有一个不一致则说明需要更新
|
|
||||||
needUplEval = classWorkForm.quizlist.some(cur =>
|
|
||||||
!props.propsformobj.quizlist.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': classWorkForm.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< classWorkForm.quizlist.length; i++){
|
|
||||||
const addRes = await addClassworkeval({
|
|
||||||
'workid': classWorkForm.id,
|
|
||||||
'entpcourseworkid': classWorkForm.quizlist[i].id,
|
|
||||||
'workdataid': 0,
|
|
||||||
'score': 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(cform);
|
|
||||||
let res = await updateClasswork(cform);
|
|
||||||
if (res.code == 200) {
|
|
||||||
ElMessage.success('更新成功');
|
|
||||||
// 返回上一页
|
|
||||||
router.back()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// else if (classWorkForm.worktype=='框架梳理') {
|
|
||||||
// // 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 (classWorkForm.worktype=='课堂展示') {
|
|
||||||
|
|
||||||
|
|
||||||
// }else if (classWorkForm.worktype=='常规作业') {
|
|
||||||
// // 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
|
||||||
// classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 3.更新作业任务本身
|
|
||||||
// let res = await updateClasswork(cform);
|
|
||||||
// this.fileHomeworkList = [];
|
|
||||||
// this.chooseWorkLists = [];
|
|
||||||
|
|
||||||
// // 4.操作完成后重新更新表单数据
|
|
||||||
// //这里分离了,所以不需要更新表单数据了
|
|
||||||
// // this.getClassWorkAllList();
|
|
||||||
|
|
||||||
// this.classWorkForm.worktype = "习题训练";
|
|
||||||
// this.newWorkSpace = false;
|
|
||||||
// this.newWorkSpaceEdit = false;
|
|
||||||
// this.workEdit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-row class="c-warp" :gutter="10">
|
<el-row class="c-warp" :gutter="10">
|
||||||
<el-col class="left" :span="12">
|
<el-col class="left" :span="16">
|
||||||
<el-collapse class="c-item" v-model="activeTopic" accordion>
|
<el-collapse class="c-item" v-model="activeTopic" accordion>
|
||||||
<template v-for="(item, index) in dataList">
|
<template v-for="(item, index) in dataList">
|
||||||
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
|
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="right" :span="12">
|
<el-col class="right" :span="8">
|
||||||
<div class="c-item">
|
<div class="c-item">
|
||||||
<div class="title">答题情况</div>
|
<div class="title">答题情况</div>
|
||||||
<div class="respond">
|
<div class="respond">
|
||||||
|
@ -309,7 +309,7 @@ watchEffect(() => { initData() })
|
||||||
// 弹窗容器
|
// 弹窗容器
|
||||||
.c-warp{
|
.c-warp{
|
||||||
background: #F2F3F5;
|
background: #F2F3F5;
|
||||||
height: 100%;
|
height: 73vh;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
.left{padding-left: 0 !important;}
|
.left{padding-left: 0 !important;}
|
||||||
.right{padding-right: 0 !important;}
|
.right{padding-right: 0 !important;}
|
||||||
|
@ -318,7 +318,7 @@ watchEffect(() => { initData() })
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 100%;
|
height: 73vh;
|
||||||
}
|
}
|
||||||
.collapse-item{
|
.collapse-item{
|
||||||
.item-title-o{
|
.item-title-o{
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
| 截止时间:{{ item.deaddate }} | {{ tabactive }}
|
| 截止时间:{{ item.deaddate }} | {{ tabactive }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <el-switch v-model="value1" active-text="云同步"> </el-switch> -->
|
||||||
<div class="class-reserv-item-tool">
|
<div class="class-reserv-item-tool">
|
||||||
<span>
|
<span>
|
||||||
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</span>
|
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</span>
|
||||||
|
@ -67,8 +68,60 @@ const props = defineProps({
|
||||||
default: () => ''
|
default: () => ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
const value1 = ref(true);
|
||||||
|
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
|
const toolStore = useToolState() // 获取状态管理-tool
|
||||||
|
const openEdit = () => {
|
||||||
|
emit('openEdit', props.item)
|
||||||
|
}
|
||||||
|
const deleteReserv = () => {
|
||||||
|
deleteSmartReserv([props.item.id]).then((res) => {
|
||||||
|
if (res.data === true) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
emit('deleteReserv', props.item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const startClassR = (item) => {
|
||||||
|
// startClass(item.id).then((res) => {
|
||||||
|
// if (res.data === true) {
|
||||||
|
// item.status = '上课中'
|
||||||
|
// openLesson()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
item.status = '上课中'
|
||||||
|
openLesson()
|
||||||
|
}
|
||||||
|
// const toolStore = useToolState()
|
||||||
|
let wins = null;
|
||||||
|
// 上课-工具类悬浮
|
||||||
|
const openLesson = () => {
|
||||||
|
// startClass(props.item.id)
|
||||||
|
listEntpcourse({
|
||||||
|
evalid: props.item.ex2,
|
||||||
|
edituserid: useUserStore().user.userId,
|
||||||
|
pageSize: 500
|
||||||
|
}).then(async res=>{
|
||||||
|
if (res.rows[0].id) {
|
||||||
|
wins = await createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const endClassR = (item) => {
|
||||||
|
endClass(item.id).then((res) => {
|
||||||
|
if (res.data === true) {
|
||||||
|
ElMessage({
|
||||||
|
message: '下课成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
item.status = '已结束'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.class-reserv-item {
|
.class-reserv-item {
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
<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" style="color: blue;"></i>
|
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
||||||
<span>课程目录</span>
|
<span>课程目录</span>
|
||||||
<i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i>
|
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -30,34 +30,28 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 作业类型:内容 -->
|
<!-- 作业类型:内容 -->
|
||||||
<task-type-view :bookobj="courseObj" :propsformobj="classWorkForm" style="flex: 1; overflow: hidden;"/>
|
<task-type-view :bookobj="courseObj" :uniquekey="classWorkForm.uniquekey" style="flex: 1; overflow: hidden;"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
|
||||||
|
|
||||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||||
import TaskTypeView from '@/views/classTask/container/newTask/taskTypeView.vue'
|
import TaskTypeView from '@/views/classTask/container/newTask/taskTypeView.vue'
|
||||||
import { getCurrentTime } from '@/utils/date'
|
import { getCurrentTime } from '@/utils/date'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const classtaskObj = route.query.classtaskObj;//作业布置的内容对象
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
const classWorkForm = reactive({
|
const classWorkForm = reactive({
|
||||||
id: classtaskObj? JSON.parse(classtaskObj).id : '', // 设计中的id
|
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
||||||
uniquekey: classtaskObj? JSON.parse(classtaskObj).uniquekey : userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1), // 设计中的标题
|
uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1),
|
||||||
title: classtaskObj? JSON.parse(classtaskObj).title : '', // 设计中的说明
|
|
||||||
worktype: classtaskObj? JSON.parse(classtaskObj).worktype : '', // 设计中的作业类型
|
|
||||||
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], // 设计中的试题列表
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const isCollapse = ref(false)
|
const isCollapse = ref(false)
|
||||||
|
|
||||||
|
|
||||||
const courseObj = reactive({
|
const courseObj = reactive({
|
||||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||||
textbookId: '',
|
textbookId: '',
|
||||||
|
@ -95,15 +89,18 @@ const getData = (data) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// init()
|
init()
|
||||||
// sourceStore.getCreate()
|
// sourceStore.getCreate()
|
||||||
})
|
})
|
||||||
|
|
||||||
// const init = () => {
|
const init = () => {
|
||||||
// classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
|
classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
// watch(() => sourceStore.query.fileSource,() => {
|
||||||
|
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
||||||
|
// })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -1,791 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="teachClassTask">
|
|
||||||
<div class="teachClassTask_header">
|
|
||||||
<div style="font-size: 18px; display: flex; flex-wrap: nowrap">
|
|
||||||
<div style="flex: 1">
|
|
||||||
{{ classWorkAnalysis.title }}答题情况
|
|
||||||
<el-tag :type="classWorkAnalysis.workclass" size="large" style="height: 25px">{{
|
|
||||||
classWorkAnalysis.worktype
|
|
||||||
}}</el-tag>
|
|
||||||
</div>
|
|
||||||
<!-- classWorkAnalysis.entpcourseworklistarray 当前学习任务所包含的试题ID -->
|
|
||||||
<div
|
|
||||||
v-if="classWorkAnalysis.entpcourseworklistarray.length > 0"
|
|
||||||
style="margin: 0 auto; flex: 1"
|
|
||||||
>
|
|
||||||
<el-button-group style="margin-bottom: 10px">
|
|
||||||
<el-button
|
|
||||||
:type="classWorkAnalysis.view == 'studentview' ? 'success' : ''"
|
|
||||||
@click="classWorkAnalysis.view = 'studentview'"
|
|
||||||
>作业批阅</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="classWorkAnalysis.row.worktype == '习题训练'"
|
|
||||||
:type="classWorkAnalysis.view == 'quizStats' ? 'success' : ''"
|
|
||||||
@click="workHandle('quizStats')"
|
|
||||||
>作业概况</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="classWorkAnalysis.row.worktype == '习题训练'"
|
|
||||||
:type="classWorkAnalysis.view == 'report' ? 'success' : ''"
|
|
||||||
@click="handleClassOverviewOpen('report')"
|
|
||||||
>作业报告</el-button
|
|
||||||
>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<div style="flex: 1">
|
|
||||||
<!-- <div
|
|
||||||
style="float: right; padding: 0 10px; cursor: pointer"
|
|
||||||
icon="el-icon-close"
|
|
||||||
@click="closeDialog"
|
|
||||||
>
|
|
||||||
x
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="teachClassTask_content">
|
|
||||||
<!-- 如果当前学习没有试题 :height="mainHeight" height:73vh;-->
|
|
||||||
<div
|
|
||||||
v-if="classWorkAnalysis.view == 'studentview'"
|
|
||||||
style="width: 100%; "
|
|
||||||
class="clwk_dialog_view"
|
|
||||||
>
|
|
||||||
<div class="view_table">
|
|
||||||
<el-radio-group
|
|
||||||
v-model="tableRadio.value"
|
|
||||||
style="margin-bottom: 1px"
|
|
||||||
@change="tableRadioChange"
|
|
||||||
>
|
|
||||||
<el-radio-button :value="1" :label="'已交' + '(' + tableRadio.num1 + ')'" />
|
|
||||||
<el-radio-button :value="0" :label="'未交' + '(' + tableRadio.num0 + ')'" />
|
|
||||||
</el-radio-group>
|
|
||||||
<!-- 学生列表:classWorkAnalysis.classworkdata; 已交未交:tableRadio.list -->
|
|
||||||
<el-table
|
|
||||||
v-loading="loading_dt_table"
|
|
||||||
:data="tableRadio.list"
|
|
||||||
row-key="id"
|
|
||||||
style="height: 100%;overflow: hidden;"
|
|
||||||
highlight-current-row
|
|
||||||
@row-click="getStudentClassWorkDataDetail"
|
|
||||||
>
|
|
||||||
<el-table-column type="index" label="序号" width="52" reserve-selection align="center" />
|
|
||||||
<el-table-column label="姓名" prop="studentname" width="100" align="center" />
|
|
||||||
<el-table-column label="提交时间" prop="updatedate" width="170" align="center" />
|
|
||||||
<el-table-column label="批阅状态" prop="teacherRating" align="center" width="120" sortable>
|
|
||||||
<template #default="scope">
|
|
||||||
<template v-if="scope.row.teacherRating == 0"
|
|
||||||
><span style="color: #2196f3">待批阅</span></template
|
|
||||||
>
|
|
||||||
<!-- 1-优 2-优减 3-良 4-良减 5-差 -->
|
|
||||||
<template v-if="scope.row.teacherRating == 1"
|
|
||||||
><el-tag type="danger">优</el-tag></template
|
|
||||||
>
|
|
||||||
<template v-if="scope.row.teacherRating == 2"
|
|
||||||
><el-tag type="danger">优-</el-tag></template
|
|
||||||
>
|
|
||||||
<template v-if="scope.row.teacherRating == 3"
|
|
||||||
><el-tag type="warning">良</el-tag></template
|
|
||||||
>
|
|
||||||
<template v-if="scope.row.teacherRating == 4"
|
|
||||||
><el-tag type="info">良-</el-tag></template
|
|
||||||
>
|
|
||||||
<template v-if="scope.row.teacherRating == 5"
|
|
||||||
><el-tag type="info">差</el-tag></template
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="view_teachrting">
|
|
||||||
<div class="classwork-score">
|
|
||||||
<div v-if="classWorkAnalysis.activeStudentQuizlist.length == 0">
|
|
||||||
<el-empty
|
|
||||||
description="点击左侧表格学生信息可查看批阅详情"
|
|
||||||
style="width: 100%; height: 500px"
|
|
||||||
></el-empty>
|
|
||||||
</div>
|
|
||||||
<div v-else style="height: 100%;">
|
|
||||||
<div v-if="isopen_dtwk_table" style="height: 100%;">
|
|
||||||
<div v-show="classWorkAnalysis.activeStudentQuizlist.length > 0" style="height: 100%;">
|
|
||||||
<item-dialog-score
|
|
||||||
ref="classWorkAnalysisScoreDialogRef"
|
|
||||||
@class_work_score_submit="onClassWorkScoreSubmit"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<el-empty
|
|
||||||
description="点击左侧表格学生信息可查看批阅详情"
|
|
||||||
style="width: 100%; height: 500px"
|
|
||||||
></el-empty>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 作业概况 -->
|
|
||||||
<div v-else-if="classWorkAnalysis.view == 'quizStats'" style="width: 100%;">
|
|
||||||
<quiz-stats :active-data="classWorkActiveData" style="width: 100%;height: 100%;"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 作业报告-->
|
|
||||||
<div v-else-if="classWorkAnalysis.view == 'report'" style="width: 100%;overflow-y: scroll">
|
|
||||||
<!-- <ClassOverview :table-list="overviewData" :eval-id="courseObj.evalid"></ClassOverview> -->
|
|
||||||
<ClassOverview :table-list="overviewData" style="width: 100%;"></ClassOverview>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup name="itemDialogRef">
|
|
||||||
import { ref, defineExpose, onMounted, reactive, computed, watch, onUnmounted, nextTick, getCurrentInstance } from 'vue'
|
|
||||||
import { listClassworkdata, listEntpcoursework, listClassworkeval } from '@/api/classTask'
|
|
||||||
import useUserStore from '@/store/modules/user'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { getCurrentTime, getAfterMinutes } from '@/utils/date'
|
|
||||||
import { processList } from '@/hooks/useProcessList'
|
|
||||||
import ItemDialogScore from '@/views/classTask/container/item-dialog-score.vue'
|
|
||||||
// zdg: 组件导入
|
|
||||||
import quizStats from '@/views/classTask/container/quizStats.vue'
|
|
||||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
|
||||||
import {sessionStore} from '@/utils/tool'
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
|
||||||
const emit = defineEmits(['cle-click'])
|
|
||||||
const props = defineProps({
|
|
||||||
bookId: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const mainHeight = ref(document.documentElement.clientHeight - 110)
|
|
||||||
const classWorkAnalysis = reactive({
|
|
||||||
open: false,
|
|
||||||
entpcourseworklistarray: [], // 当前学习任务所包含的试题ID
|
|
||||||
})
|
|
||||||
const tableRadio = reactive({
|
|
||||||
value: '1', // 已交
|
|
||||||
list: [], // 已交list
|
|
||||||
num1: 0, // 已交人数
|
|
||||||
num0: 0 // 未交人数
|
|
||||||
}) // 批阅 是否已交
|
|
||||||
const loading_dt_table = ref(false)
|
|
||||||
const isopen_dtwk_table = ref(false)
|
|
||||||
|
|
||||||
// zdg: 作业概况
|
|
||||||
const classWorkActiveData = reactive({
|
|
||||||
quizlist: [], // 当前习题列表
|
|
||||||
studentList: [], // 当前课程-所有学生
|
|
||||||
workFeedList: [], // 当前课程-所有学生反馈数据
|
|
||||||
timerId: 0 // 定时器id
|
|
||||||
})
|
|
||||||
//所选学生题目- 答题题目分析与评价
|
|
||||||
const classWorkAnalysisScore = reactive({
|
|
||||||
studentObj: {}, // 当前学生的作业题型等信息
|
|
||||||
studentQuizAllList: [], // 选择学生的回答list
|
|
||||||
quizlist: [] // 选择学生的题目list
|
|
||||||
})
|
|
||||||
|
|
||||||
//查看学生概况数据
|
|
||||||
const overviewData = ref([])
|
|
||||||
|
|
||||||
// watch(
|
|
||||||
// // () => props.currentNode,
|
|
||||||
// (newValue, oldValue) => {
|
|
||||||
// form.name = newValue.label
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
const openDialog = (data) => {
|
|
||||||
console.log(data, '点击的item答题情况')
|
|
||||||
|
|
||||||
classWorkAnalysis.title = data.uniquekey ? data.uniquekey + '--' : ''
|
|
||||||
classWorkAnalysis.worktype = data.worktype
|
|
||||||
classWorkAnalysis.workclass = data.workclass
|
|
||||||
// 重置学生列表
|
|
||||||
tableRadio.list = []
|
|
||||||
tableRadio.value = '1'
|
|
||||||
tableRadio.num0 = 0
|
|
||||||
tableRadio.num1 = 0
|
|
||||||
|
|
||||||
classWorkAnalysis.open = true
|
|
||||||
// 默认显示是学生作业反馈
|
|
||||||
classWorkAnalysis.view = 'studentview'
|
|
||||||
// 当前学习任务所包含的试题ID
|
|
||||||
classWorkAnalysis.entpcourseworklistarray = data.entpcourseworklistarray
|
|
||||||
// 默认选中的学生
|
|
||||||
classWorkAnalysis.activeStudentQuizlist = []
|
|
||||||
// 默认选中的试题
|
|
||||||
classWorkAnalysis.activeQuizAnalysisData = []
|
|
||||||
|
|
||||||
classWorkAnalysis.row = data
|
|
||||||
window.test = this
|
|
||||||
// zdg: 学生列表
|
|
||||||
const studentArr = data.classworkdatastudentids
|
|
||||||
? JSON.parse(`[${data.classworkdatastudentids}]`)
|
|
||||||
: []
|
|
||||||
classWorkActiveData.studentList = studentArr
|
|
||||||
/** 学生完成情况分析--获取作业学生list数据 */
|
|
||||||
getClassWorkStudentList(data.id)
|
|
||||||
|
|
||||||
// 课程列表idlist
|
|
||||||
var ids = []
|
|
||||||
for (var i = 0; i < data.entpcourseworklistarray.length; i++) {
|
|
||||||
ids.push(data.entpcourseworklistarray[i].id)
|
|
||||||
}
|
|
||||||
// 课程作业列表
|
|
||||||
listEntpcoursework({ ids: ids.join(','), pageSize: 500 }).then((idres) => {
|
|
||||||
for (var i = 0; i < idres.rows.length; i++) {
|
|
||||||
// //新增了 复合题、主观题(背景+小题目) 题目标题优化一下 .replace(/!@#\$%/g,'')
|
|
||||||
idres.rows[i].titletext = idres.rows[i].title.replace(/!@#\$%/g, '')
|
|
||||||
}
|
|
||||||
classWorkAnalysis.quizlist = idres.rows
|
|
||||||
classWorkActiveData.quizlist = idres.rows // zdg: 作业概览组件使用
|
|
||||||
|
|
||||||
// 统计每个题目的正误率
|
|
||||||
// 这个学习任务所有题目+所有学生的答题数据 , pageSize: 100
|
|
||||||
listClassworkeval({ workid: data.id, pageSize: 1000 }).then((wevalres) => {
|
|
||||||
for (var i = 0; i < classWorkAnalysis.quizlist.length; i++) {
|
|
||||||
// 分析每一道题目
|
|
||||||
var scoingCount = 0
|
|
||||||
var feedcount = 0
|
|
||||||
// 全部人数
|
|
||||||
var evalCount = 0
|
|
||||||
for (var w = 0; w < wevalres.rows.length; w++) {
|
|
||||||
if (wevalres.rows[w].entpcourseworkid == classWorkAnalysis.quizlist[i].id) {
|
|
||||||
evalCount++
|
|
||||||
|
|
||||||
// 只统计有回答的题目
|
|
||||||
if (wevalres.rows[w].feedcontent != '') {
|
|
||||||
// 已经作答的人数
|
|
||||||
feedcount++
|
|
||||||
// 简单判断正误
|
|
||||||
if (wevalres.rows[w].feedcontent == wevalres.rows[w].rightanswer) {
|
|
||||||
wevalres.rows[w].scoingStatus = true
|
|
||||||
scoingCount++
|
|
||||||
// 学生回答与参考答案一样,则:得分=分值
|
|
||||||
wevalres.rows[w].teacherRating = wevalres.rows[w].score
|
|
||||||
} else {
|
|
||||||
wevalres.rows[w].scoingStatus = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
classWorkAnalysis.quizlist[i].evalCount = evalCount
|
|
||||||
// 作答人数
|
|
||||||
classWorkAnalysis.quizlist[i].feedcount = feedcount
|
|
||||||
// 得分率 这里优化一下(没回答会是NaN%) scoingRate
|
|
||||||
if (scoingCount == 0 && feedcount == 0) {
|
|
||||||
classWorkAnalysis.quizlist[i].scoingRate = '0%'
|
|
||||||
} else {
|
|
||||||
classWorkAnalysis.quizlist[i].scoingRate =
|
|
||||||
((scoingCount / feedcount) * 100).toFixed(0) + '%'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// zdg: 所有反馈数据
|
|
||||||
const getStudentid = (workdataid) => {
|
|
||||||
// 获取学生id
|
|
||||||
const classworkdata = (classWorkAnalysis.classworkdata || []).find(
|
|
||||||
(o) => o.id === workdataid
|
|
||||||
)
|
|
||||||
return classworkdata ? classworkdata.studentid : ''
|
|
||||||
}
|
|
||||||
wevalres.rows.forEach((o) => {
|
|
||||||
o.studentid = getStudentid(o.workdataid)
|
|
||||||
})
|
|
||||||
classWorkActiveData.workFeedList = wevalres.rows
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log(classWorkAnalysis, '点击进度后获得的数据')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//#region 学生完成情况分析
|
|
||||||
/** 1、获取作业学生列表 */
|
|
||||||
const getClassWorkStudentList = (rowId) => {
|
|
||||||
// 本地保存这个rowid,老师批改后续中使用
|
|
||||||
localStorage.setItem('activeClassWorkRowId', rowId)
|
|
||||||
// 先清空表格中的数据
|
|
||||||
classWorkAnalysis.classworkdata = []
|
|
||||||
// 加载中_
|
|
||||||
loading_dt_table.value = true
|
|
||||||
// 找当前学习任务的classworkdata数据
|
|
||||||
listClassworkdata({ classworkid: rowId, pageSize: 100 })
|
|
||||||
.then((response) => {
|
|
||||||
for (var i = 0; i < response.rows.length; i++) {
|
|
||||||
if (response.rows[i].entpcourseworklist != '') {
|
|
||||||
response.rows[i].entpcourseworkarray = JSON.parse(
|
|
||||||
'[' + response.rows[i].entpcourseworklist + ']'
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
response.rows[i].entpcourseworkarray = []
|
|
||||||
}
|
|
||||||
|
|
||||||
// 老师批阅状态 默认0 未批改
|
|
||||||
response.rows[i].teacherRating = 0
|
|
||||||
|
|
||||||
// 计算每个学生的得分率
|
|
||||||
if (
|
|
||||||
response.rows[i].classworkevallist != '' &&
|
|
||||||
response.rows[i].classworkevallist != null &&
|
|
||||||
response.rows[i].classworkevallist != 'null'
|
|
||||||
) {
|
|
||||||
// 将标签中双引号改为转义, 测试数据: "{\"id\":172910, \"feedcontent\":\"毛泽东,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
|
||||||
// 常规作业(去除【】前后引号).replace(/"(\[.*\])"/g, '$1'); :eg: "feedcontent\":\"[{\"name\":\"Bliss.jpg\",\"url\":\"https://wzyzoss.3b8daa474.jpg\"}]\",
|
|
||||||
// json转换会报错; .replace(/""/g, '"') eg: ""宇宙环境安全""
|
|
||||||
response.rows[i].classworkevallist = escapeHtmlQuotes(response.rows[i].classworkevallist)
|
|
||||||
console.log('学生完成情况分析classworkevallist', response.rows[i].classworkevallist)
|
|
||||||
const evalarray = JSON.parse('[' + response.rows[i].classworkevallist + ']')
|
|
||||||
var scoingCount = 0
|
|
||||||
var feedcount = 0
|
|
||||||
for (var e = 0; e < evalarray.length; e++) {
|
|
||||||
if (evalarray[e].feedcontent != '') {
|
|
||||||
feedcount++
|
|
||||||
// 与答案对比正误。注意注意,这里仅限单选题
|
|
||||||
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
|
|
||||||
scoingCount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(evalarray, 'evalarray------------------------------------')
|
|
||||||
if (feedcount > 0) {
|
|
||||||
// 多个题目的总得分率: 正确题数/(题目数*100)
|
|
||||||
response.rows[i].scoingRate = ((scoingCount / feedcount) * 100).toFixed(0) + '%'
|
|
||||||
} else {
|
|
||||||
response.rows[i].scoingRate = '0%'
|
|
||||||
}
|
|
||||||
// 批阅状态 优良类 :注意:这里题目中的评价都是一样的,所以取第一个
|
|
||||||
if (evalarray[0].rating != '') {
|
|
||||||
response.rows[i].teacherRating = evalarray[0].rating
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
response.rows[i].scoingRate = '0%'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
classWorkAnalysis.classworkdata = response.rows
|
|
||||||
loading_dt_table.value = false
|
|
||||||
|
|
||||||
// 默认获取已交的学生列表
|
|
||||||
tableRadio.list =
|
|
||||||
classWorkAnalysis.classworkdata &&
|
|
||||||
classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0')
|
|
||||||
tableRadio.value = '1'
|
|
||||||
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length
|
|
||||||
tableRadio.num1 = tableRadio.list.length
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
loading_dt_table.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/** 2、查看某一个学生的学习任务完成详情*/
|
|
||||||
const getStudentClassWorkDataDetail = (row) => {
|
|
||||||
// 这里取出的是学生完成情况
|
|
||||||
// 具体的题目数据在this.classWorkAnalysis.quizlist里
|
|
||||||
console.log(row, '点击了左侧学生')
|
|
||||||
//更新到待批改的学生信息中
|
|
||||||
classWorkAnalysisScore.studentObj = row
|
|
||||||
listClassworkeval({ workdataid: row.id, pageSize: 100 })
|
|
||||||
.then((wevalres) => {
|
|
||||||
for (var i = 0; i < classWorkAnalysis.quizlist.length; i++) {
|
|
||||||
// 分析每一道题目
|
|
||||||
for (var w = 0; w < wevalres.rows.length; w++) {
|
|
||||||
if (wevalres.rows[w].entpcourseworkid == classWorkAnalysis.quizlist[i].id) {
|
|
||||||
wevalres.rows[w].quiztitle = classWorkAnalysis.quizlist[i].title
|
|
||||||
wevalres.rows[w].quiztitletext = classWorkAnalysis.quizlist[i].title.replace(
|
|
||||||
/<[^>]*>/g,
|
|
||||||
''
|
|
||||||
)
|
|
||||||
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
|
|
||||||
|
|
||||||
// 参考答案 去除下html标签
|
|
||||||
wevalres.rows[w].rightanswer =
|
|
||||||
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
|
|
||||||
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
|
|
||||||
: wevalres.rows[w].rightanswer
|
|
||||||
// 学生回答 去除下html标签
|
|
||||||
wevalres.rows[w].feedcontent =
|
|
||||||
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
|
|
||||||
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
|
|
||||||
: wevalres.rows[w].feedcontent
|
|
||||||
|
|
||||||
if (classWorkAnalysis.row.worktype == '常规作业') {
|
|
||||||
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)
|
|
||||||
}
|
|
||||||
if (wevalres.rows[w].feedcontent != '') {
|
|
||||||
if (wevalres.rows[w].feedcontent == wevalres.rows[w].rightanswer) {
|
|
||||||
wevalres.rows[w].scoingStatus = true
|
|
||||||
// 学生回答与参考答案一样,则:得分=分值
|
|
||||||
wevalres.rows[w].teacherRating = wevalres.rows[w].score
|
|
||||||
} else {
|
|
||||||
wevalres.rows[w].scoingStatus = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
wevalres.rows[w].scoingStatus = ''
|
|
||||||
}
|
|
||||||
// 计算得分
|
|
||||||
}
|
|
||||||
// "回答" prop="feedcontent" width="200" align="center"></el-table-column>
|
|
||||||
// <el-table-column label="参考答案" prop="rightanswer"
|
|
||||||
//新增了 复合题、主观题(背景+小题目) 题目标题优化一下
|
|
||||||
wevalres.rows[w].worktitle = wevalres.rows[w].worktitle.replace(/!@#\$%/g, '')
|
|
||||||
|
|
||||||
// 将feedcontent中的\r替换为<br />
|
|
||||||
wevalres.rows[w].feedcontent = wevalres.rows[w].feedcontent.replace(/(?<!\\)\n/g, '<br />'); //替换\n而不替换\\n 为 \\n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
classWorkAnalysis.activeStudentQuizlist = wevalres.rows
|
|
||||||
// 加载右边表格
|
|
||||||
isopen_dtwk_table.value = true
|
|
||||||
// 加载右边评语区域
|
|
||||||
if (wevalres.rows.length > 0) {
|
|
||||||
handleClassWorkAnalysissScoreOpen(row)
|
|
||||||
} else {
|
|
||||||
ElMessage({
|
|
||||||
type: 'warning',
|
|
||||||
message: '未获取到答题信息,请稍后再看,或者联系管理员查看情况!'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
console.log('获取答题情况失败')
|
|
||||||
ElMessage({
|
|
||||||
type: 'warning',
|
|
||||||
message: '未获取到答题信息!'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/** 3、教师批改后返回的方法*/
|
|
||||||
const onClassWorkScoreSubmit = () => {
|
|
||||||
console.log('批改后返回的方法')
|
|
||||||
loading_dt_table.value = true
|
|
||||||
isopen_dtwk_table.value = false
|
|
||||||
// 1、清空答题情况的两个table数据,- 左侧学生列表:classWorkAnalysis.classworkdata;- 右侧学生回答题目列表:classWorkAnalysis.activeStudentQuizlist
|
|
||||||
// - 左侧学生列表
|
|
||||||
classWorkAnalysis.classworkdata = []
|
|
||||||
classWorkAnalysis.activeStudentQuizlist = []
|
|
||||||
// 2、刷新左侧学生列表数据,更新批改状态
|
|
||||||
const rowid = localStorage.getItem('activeClassWorkRowId')
|
|
||||||
getClassWorkStudentList(rowid)
|
|
||||||
}
|
|
||||||
// 查看并批改一个学生的题目作答(答题题目分析与评价)
|
|
||||||
const handleClassWorkAnalysissScoreOpen = (row) => {
|
|
||||||
console.log(row, '所选点击的信息')
|
|
||||||
|
|
||||||
// 当前学生的回答list
|
|
||||||
classWorkAnalysisScore.studentQuizAllList = classWorkAnalysis.activeStudentQuizlist
|
|
||||||
// 当前学生的所有题目list
|
|
||||||
classWorkAnalysisScore.quizlist = classWorkAnalysis.quizlist
|
|
||||||
// 格式化试题格式信息
|
|
||||||
processList(classWorkAnalysisScore.quizlist)
|
|
||||||
// 屏幕高度
|
|
||||||
classWorkAnalysisScore.maxheight = mainHeight.value - 100
|
|
||||||
|
|
||||||
// 防止组件未渲染完成 调用里面方法报错
|
|
||||||
nextTick(() => {
|
|
||||||
proxy.$refs.classWorkAnalysisScoreDialogRef.acceptParams(classWorkAnalysisScore)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
/** 批阅:已交未交事件 */
|
|
||||||
const tableRadioChange = (e) => {
|
|
||||||
// 关闭右侧批阅ui
|
|
||||||
isopen_dtwk_table.value = false;
|
|
||||||
console.log(e,'??????')
|
|
||||||
console.log("学生列表:", classWorkAnalysis.classworkdata)
|
|
||||||
if(e=='1'){
|
|
||||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0')
|
|
||||||
tableRadio.value = '1';
|
|
||||||
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
|
|
||||||
tableRadio.num1 = tableRadio.list.length;
|
|
||||||
}else if(e=='0'){
|
|
||||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0')
|
|
||||||
tableRadio.value = '0';
|
|
||||||
tableRadio.num0 = tableRadio.list.length;
|
|
||||||
tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将标签中的双引号增加转义
|
|
||||||
const escapeHtmlQuotes = (str) => {
|
|
||||||
// 后端已replace双引号, 故前端不用在处理
|
|
||||||
const regex1 = /\\+/g; // 匹配多个反斜杠
|
|
||||||
let result = str.replace(regex1, '\\');
|
|
||||||
result = str.replace(/(?<!\\)\n/g, '<br />'); //替换\n而不替换\\n 为 \\n
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//#region 作业概况
|
|
||||||
// 查看学生-作业概览
|
|
||||||
const workHandle = (type) => {
|
|
||||||
// 关闭右侧批阅ui
|
|
||||||
isopen_dtwk_table.value = false;
|
|
||||||
classWorkAnalysis.view = type
|
|
||||||
const isClose = type != 'quizStats' && !! classWorkActiveData.timerId
|
|
||||||
const isOpen = type == 'quizStats' && !classWorkActiveData.timerId
|
|
||||||
if(type == 'quizStats') {
|
|
||||||
getWorkFeedList();
|
|
||||||
}
|
|
||||||
if (isClose) clearInterval(classWorkActiveData.timerId) // 关闭定时器
|
|
||||||
if (isOpen) {
|
|
||||||
// 轮询 更新学生作答数据
|
|
||||||
classWorkActiveData.timerId = setInterval(() => {
|
|
||||||
console.log('zdg: 定时执行')
|
|
||||||
getWorkFeedList()
|
|
||||||
}, 20 * 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取学生答题回馈数据-更新
|
|
||||||
const getWorkFeedList = async() =>{
|
|
||||||
const workid = classWorkAnalysis.row.id
|
|
||||||
const res = await listClassworkeval({workid, isFinish: 1, pageSize: 1000})
|
|
||||||
const getStudentid = (workdataid) => { // 获取学生id
|
|
||||||
const classworkdata = (classWorkAnalysis.classworkdata||[]).find(o => o.id === workdataid)
|
|
||||||
return classworkdata ? classworkdata.studentid : ''
|
|
||||||
}
|
|
||||||
res.rows.forEach(o => { o.studentid = getStudentid(o.workdataid) })
|
|
||||||
classWorkActiveData.workFeedList = res.rows
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
|
|
||||||
//#regin 作业报告
|
|
||||||
/*
|
|
||||||
author: yangws
|
|
||||||
time: 2024-8-06 16:35:33
|
|
||||||
function:作业报告的处理
|
|
||||||
*/
|
|
||||||
const handleClassOverviewOpen = (type) =>{
|
|
||||||
// 关闭右侧批阅ui
|
|
||||||
isopen_dtwk_table.value = false;
|
|
||||||
classWorkAnalysis.view = type
|
|
||||||
const data = classWorkAnalysis.row
|
|
||||||
//获取所有学生列表
|
|
||||||
listClassworkdata({classworkid: data.id, pageSize: 100}).then((response) => {
|
|
||||||
if(response.code === 200){
|
|
||||||
response.rows.forEach(item => {
|
|
||||||
let rightAnswer = 0
|
|
||||||
let answers = 0
|
|
||||||
if(!item.classworkevallist) return
|
|
||||||
// 使用正则表达式替换字符串值中的双引号为单引号
|
|
||||||
let replacedString = item.classworkevallist.replace(/""/g, "\"");
|
|
||||||
// 将标签中双引号改为转义, 测试数据: "{\"id\":172907, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358520, \"feedcontent\":\"④①⑤③②\", \"score\":4, \"rightanswer\":\"④①⑤③②\"},{\"id\":172908, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358521, \"feedcontent\":\"气壮山威,鲲鹏展翅楚云飞\", \"score\":4, \"rightanswer\":\"志远天高,春风杨柳麓山青\"},{\"id\":172909, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363096, \"feedcontent\":\"《红烛》化用“蜡矩”这一古典意象,赋予它新的含义,赞美了红烛以“蜡炬成灰”来点亮世界的奉献精神。\", \"score\":4, \"rightanswer\":\"《立在地球边上放号》中,全诗采用间接抒情的方式,描绘了太平洋的浪潮,吟唱了一曲惊心动魄的力的颂歌,意在赞美摧毁旧世界、创造新生活的“五四”精神。\"},{\"id\":172910, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363098, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
|
||||||
replacedString = escapeHtmlQuotes(item.classworkevallist);
|
|
||||||
let allTopic
|
|
||||||
try{
|
|
||||||
allTopic = JSON.parse(`[${item.classworkevallist}]`)
|
|
||||||
}catch{
|
|
||||||
allTopic = JSON.parse(`[${replacedString}]`)
|
|
||||||
}
|
|
||||||
if(item.classworkevallist != ''){
|
|
||||||
allTopic.forEach(itemTopic => {
|
|
||||||
if(itemTopic.feedcontent != ''){
|
|
||||||
answers ++
|
|
||||||
//正确答案,仅限单选题
|
|
||||||
if(itemTopic.feedcontent === itemTopic.rightanswer){
|
|
||||||
rightAnswer ++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
rightAnswer > 0?item.scoingRate = (rightAnswer/answers * 100).toFixed(0):item.scoingRate = ''
|
|
||||||
}else{
|
|
||||||
item.scoingRate = ''
|
|
||||||
}
|
|
||||||
//获得总分
|
|
||||||
const point = allTopic.reduce((acc, cur) => {
|
|
||||||
if(cur.rating !== 0){
|
|
||||||
return acc + cur.teacherRating;
|
|
||||||
}
|
|
||||||
},0)
|
|
||||||
// item.chapter = this.courseObj.evalid
|
|
||||||
item.point = point || 0
|
|
||||||
item.rating = allTopic[0].rating
|
|
||||||
|
|
||||||
})
|
|
||||||
overviewData.value = [...response.rows]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
const onBeforeClose = () =>{
|
|
||||||
console.log('非正常关闭dialog?esc、dialog外部区域')
|
|
||||||
closeDialog()
|
|
||||||
}
|
|
||||||
const closeDialog = () => {
|
|
||||||
classWorkAnalysis.open = false
|
|
||||||
emit('cle-click')
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
|
|
||||||
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
|
||||||
const data = sessionStore.get('teachClassWorkItem');
|
|
||||||
// console.log(data,'????????????????????' )
|
|
||||||
if(data){
|
|
||||||
openDialog(data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(classWorkAnalysis, (newVal, oldVal) => {
|
|
||||||
if(newVal.view != 'quizStats'){
|
|
||||||
console.log('关闭zdg: 定时执行')
|
|
||||||
clearInterval(classWorkActiveData.timerId) // 关闭定时器 作业概况的
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
clearInterval(classWorkActiveData.timerId) // 关闭定时器 作业概况的
|
|
||||||
})
|
|
||||||
|
|
||||||
// defineExpose({
|
|
||||||
// })
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style src="@/assets/styles/JYStyle.css"></style>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.teachClassTask{
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.teachClassTask_header{
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.teachClassTask_content{
|
|
||||||
flex: 1;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.clwk_dialog_view {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-start;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.view_table {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.view_teachrting {
|
|
||||||
flex: 1;
|
|
||||||
height: 100%;
|
|
||||||
/*overflow-y: auto; */
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.classwork-score{
|
|
||||||
// overflow-y: auto;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// .clwk_dialog {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .clwk_dialog {
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: center;
|
|
||||||
// overflow: hidden;
|
|
||||||
// }
|
|
||||||
// .clwk_dialog .el-dialog {
|
|
||||||
// margin: 0 auto !important;
|
|
||||||
// height: 85%!important;
|
|
||||||
// overflow: hidden;
|
|
||||||
// }
|
|
||||||
// .clwk_dialog .el-dialog__header {
|
|
||||||
// /* position: absolute;
|
|
||||||
// top: 0;
|
|
||||||
// left: 0; */
|
|
||||||
// width: 100%!important;
|
|
||||||
// }
|
|
||||||
// .clwk_dialog .el-dialog__body {
|
|
||||||
// position: absolute;
|
|
||||||
// left: 0;
|
|
||||||
// top: 15px;
|
|
||||||
// bottom: 1px;
|
|
||||||
// right:0;
|
|
||||||
// padding:5px;
|
|
||||||
// z-index:1;
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// overflow: hidden;
|
|
||||||
// /* overflow:hidden;
|
|
||||||
// overflow-y: auto; */
|
|
||||||
// }
|
|
||||||
// .clwk_dialog .el-dialog__footer{
|
|
||||||
// position: absolute;
|
|
||||||
// bottom: 10px;
|
|
||||||
// right: 10px;
|
|
||||||
// }
|
|
||||||
// .clwk_dialog .classwork-score{
|
|
||||||
// overflow-y: auto;
|
|
||||||
// }
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* .clwk_dialog {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.clwk_dialog .el-dialog {
|
|
||||||
margin: 0 auto !important;
|
|
||||||
height: 85%!important;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.clwk_dialog .el-dialog__header {
|
|
||||||
/* position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%!important;
|
|
||||||
}
|
|
||||||
.clwk_dialog .el-dialog__body {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 15px;
|
|
||||||
bottom: 1px;
|
|
||||||
right:0;
|
|
||||||
padding:5px;
|
|
||||||
z-index:1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
/* overflow:hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.clwk_dialog .el-dialog__footer{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
right: 10px;
|
|
||||||
}
|
|
||||||
.clwk_dialog .classwork-score{
|
|
||||||
overflow-y: auto;
|
|
||||||
} */
|
|
||||||
</style>
|
|
|
@ -28,20 +28,20 @@
|
||||||
</ul>
|
</ul>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, watch } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||||
import {sessionStore, createWindow} from '@/utils/tool'
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
|
||||||
|
|
||||||
const user = useUserStore().user
|
const user = useUserStore().user
|
||||||
const toolState = useToolState();
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const homeworkList = ref([])
|
const homeworkList = ref([])
|
||||||
|
const itemDialogRef = ref(null)
|
||||||
|
|
||||||
// 获取作业
|
// 获取作业
|
||||||
const getHomework = async () => {
|
const getHomework = async () => {
|
||||||
|
@ -70,11 +70,12 @@ const getHomework = async () => {
|
||||||
// 批改作业
|
// 批改作业
|
||||||
const onClickItem = (item) => {
|
const onClickItem = (item) => {
|
||||||
console.log('开启弹窗')
|
console.log('开启弹窗')
|
||||||
// itemDialogRef.value.openDialog(item)
|
itemDialogRef.value.openDialog(item)
|
||||||
// 调用新窗口批改页面
|
}
|
||||||
sessionStore.set('teachClassWorkItem', item)
|
// 批阅关闭
|
||||||
toolState.isTaskWin=true //设置打开批改窗口
|
const closeDialog = () => {
|
||||||
createWindow('open-taskwin',{url:'/teachClassTask'})
|
console.log('关闭弹窗,查询一下作业数据,更新界面')
|
||||||
|
getHomework()
|
||||||
}
|
}
|
||||||
|
|
||||||
const tagType = (time) => {
|
const tagType = (time) => {
|
||||||
|
@ -85,16 +86,6 @@ const tagType = (time) => {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getHomework()
|
getHomework()
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => [toolState.isTaskWin],
|
|
||||||
() => {
|
|
||||||
console.log('=监听到批改窗口是否关闭了===', toolState.isTaskWin)
|
|
||||||
if(!toolState.isTaskWin){
|
|
||||||
getHomework()// 更新数据
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue