Compare commits

..

14 Commits

Author SHA1 Message Date
qinqing 506f95060b 优化PDF插件工具栏 2024-10-14 17:17:04 +08:00
qinqing fcc0af04cb Merge branch 'main' into qinqing_dev 2024-10-14 16:25:00 +08:00
lyc 14c4ede80e Merge pull request '删除 hooks、useGetClassWork.js' (#314) from lyc-dev into main 2024-10-14 15:11:49 +08:00
lyc bf642ddc79 删除 hooks、useGetClassWork.js 2024-10-14 15:12:05 +08:00
baigl 35af866a53 Merge pull request '作业布置:推送多个班级的学生bug修复' (#313) from baigl into main
Reviewed-on: #313
2024-10-14 10:59:55 +08:00
白了个白 58988313b7 作业布置:推送多个班级的学生bug修复 2024-10-14 10:57:02 +08:00
qinqing eca1a927c0 Merge pull request 'qinqing_dev' (#312) from qinqing_dev into main
Reviewed-on: #312
2024-10-11 16:39:10 +08:00
baigl 3fb3af9cae Merge pull request 'baigl' (#311) from baigl into main
Reviewed-on: #311
2024-10-11 16:33:56 +08:00
白了个白 96ef7da95a Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into baigl 2024-10-11 16:32:17 +08:00
zouyf ee4088ad75 Merge pull request 'zouyf_dev' (#310) from zouyf_dev into main
Reviewed-on: #310
2024-10-11 16:31:18 +08:00
“zouyf” 082a824adf Merge branch 'main' into zouyf_dev 2024-10-11 16:30:20 +08:00
“zouyf” b35cba4e31 1 2024-10-11 16:30:07 +08:00
白了个白 2ad1904802 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk into baigl 2024-10-11 16:28:04 +08:00
白了个白 8ff117ab53 作业批改:页面缓存读取bug修复 2024-10-11 16:27:39 +08:00
7 changed files with 71 additions and 261 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,202 +0,0 @@
import { nextTick, toRaw } from 'vue'
import useUserStore from '@/store/modules/user'
import { listEvaluation } from '@/api/subject'
const userStore = useUserStore()
const { edustage, edusubject } = userStore.user
let evaluationList = []; // 教材版本list
let subjectList = []; // 教材list
//当前教材ID
let curBookId = -1;
/**
* 外部链接初始化获取 跳转web端的 unitId 专用
* 暂时 初始化作业设计专用后期可能会取消
*/
export const useGetClassWork = async () => {
const params = {
edusubject,
edustage,
// entpcourseedituserid: userId,
itemgroup: 'textbook',
orderby: 'orderidx asc',
pageSize: 10000
}
if(localStorage.getItem('evaluationList')){
evaluationList = JSON.parse(localStorage.getItem('evaluationList'))
}else{
const { rows } = await listEvaluation(params)
localStorage.setItem('evaluationList', JSON.stringify(rows))
evaluationList = rows
}
//获取教材版本
await getSubject()
//上册
/**
* 不区分上下册
* 2024/08/20调整
*/
// volumeOne = data.filter(item => item.level == 1 && item.semester == '上册')
// volumeTwo = data.filter(item => item.level == 1 && item.semester == '下册')
getTreeData()
}
//获取教材
const getSubject = async () => {
if(localStorage.getItem('subjectList')){
subjectList = JSON.parse(localStorage.getItem('subjectList'))
}else{
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', })
// subjectList = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
subjectList = rows
localStorage.setItem('subjectList', JSON.stringify(subjectList))
}
// 默认第一个
if(!subjectList.length) return
// curBookName = subjectList[0].itemtitle
curBookId = subjectList[0].id
// curBookImg = BaseUrl + subjectList[0].avartar
// curBookPath = subjectList[0].fileurl
}
const getTreeData = () => {
//数据过滤
let upData = transData(evaluationList)
if(upData.length){
// treeData = [...upData]
}else{
// treeData = []
return
}
nextTick(() => {
// defaultExpandedKeys = [treeData[0].id]
// let currentNodeObj = {...getLastLevelData(upData)[0]}
let currentNodeId = getLastLevelData(upData)[0].id
let currentNodeName = getLastLevelData(upData)[0].label
let curNode = {
id: currentNodeId,
label: currentNodeName,
// itemtitle: currentNodeObj.itemtitle,
// edudegree: currentNodeObj.edudegree,
// edustage: currentNodeObj.edustage,
// edusubject: currentNodeObj.edusubject,
}
let parentNode = findParentByChildId(upData, currentNodeId)
curNode.parentNode = toRaw(parentNode)
let levelFirstId = '';
let levelSecondId = '';
if (curNode.parentNode) {
levelFirstId = curNode.parentNode.id
} else {
levelFirstId = curNode.id
levelSecondId = ''
}
let bookeId = curBookId
// 头部 教材分析、作业设计打开外部链接需要当前章节ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId, bookeId}))
// const data = {
// textBook: {
// curBookId: curBookId,
// curBookName: curBookName,
// curBookImg: curBookImg,
// curBookPath: curBookPath
// },
// node: curNode
// }
// emit('changeBook', data)
})
}
const getLastLevelData = (tree) => {
let lastLevelData = [];
// 递归函数遍历树形结构
function traverseTree(nodes) {
nodes.forEach((node) => {
// 如果当前节点有子节点,继续遍历
if (node.children && node.children.length > 0) {
traverseTree(node.children);
} else {
// 如果没有子节点,说明是最后一层的节点
lastLevelData.push(node);
}
});
}
// 调用递归函数开始遍历
traverseTree(tree);
// 返回最后一层的数据
return lastLevelData;
}
// 根据id 拿到父节点数据
const findParentByChildId = (treeData, targetNodeId) => {
// 递归查找函数
// 遍历树中的每个节点
for (let node of treeData) {
// 检查当前节点的子节点是否包含目标子节点 ID
if (node.children && node.children.some(child => child.id === targetNodeId)) {
// 如果当前节点的某个子节点的 ID 匹配目标子节点 ID则当前节点即为父节点
return node;
}
// 如果当前节点没有匹配的子节点,则递归检查当前节点的子节点
if (node.children) {
let parentNode = findParentByChildId(node.children, targetNodeId);
if (parentNode) {
return parentNode;
}
}
}
// 如果未找到匹配的父节点,则返回 null 或者适当的默认值
return null;
}
const transData = (data) => {
let ary = []
data.forEach(item => {
let obj = {}
// 根据当前教材ID 过滤出对应的单元、章节
if (item.rootid == curBookId) {
if(item.level == 1){
obj.label = item.itemtitle
obj.id = item.id
obj.itemtitle = item.itemtitle
obj.edudegree = item.edudegree
obj.edustage = item.edustage
obj.edusubject = item.edusubject
let ary2 = []
evaluationList.forEach(el => {
let obj2 = {}
if (item.id == el.parentid) {
obj2 = {
label: el.itemtitle,
id: el.id,
itemtitle : el.itemtitle,
edudegree : el.edudegree,
edustage : el.edustage,
edusubject : el.edusubject,
}
ary2.push(obj2)
}
obj.children = ary2
})
ary.push(obj)
}
}
})
return ary
}

View File

@ -1,8 +1,3 @@
<!--
* @Author: 苦逼程序猿
* @Date: 2024-09-06 16:58:59
* @Warning: 千行代码Bug露锋芒
-->
<template>
<el-container class="class-reserv-wrap">
<div style="display: flex; justify-content: space-between;">
@ -71,7 +66,8 @@ import { useToolState } from '@/store/modules/tool'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import useUserStore from '@/store/modules/user'
import useClassTaskStore from "@/store/modules/classTask";
import {sessionStore, createWindow} from '@/utils/tool'
import {createWindow} from '@/utils/tool'
import {sessionStore} from '@/utils/store'
import {throttle,debounce } from '@/utils/comm'
@ -120,7 +116,7 @@ const getData = async () => {
classWorkList.value = []
loading.value = true
// 1
//getClassList()
// getClassList()
// 2
await getClassWorkList()
// 3

View File

@ -101,11 +101,7 @@
<!-- 作业内容编辑 -->
<el-dialog v-model="workEdit" title="作业内容详情" width="90%" append-to-body>
<div v-if="currentTag=='学习目标定位'" style="display: flex;">
<degreeevolution :attainmentList="attainmentList" :show-class="true" :courseQualityList="courseQualityList"/>
</div>
<!-- 课标研读 目标设定 教材研读 框架梳理 学科定位 -->
<div v-if="currentTag=='习题训练'" :style="{'padding': '15px', 'overflow': 'auto'}">
<el-table :data="workConfObj.quizlist" style="width: 100%;">
<el-table-column type="index" width="60" />
@ -130,6 +126,32 @@
</el-table>
</div>
<div v-if="currentTag=='框架梳理'" :style="{'padding': '15px', 'overflow': 'auto'}">
<div style="margin: 5px; background-color: white">
<template v-for="(item) in workConfObj.chooseWorkLists" :key="item.id">
<div v-if="item.worktype==workConfObj.worktype">
<div class="choose-work">
<div class="choose-work-title">{{ item.worktype }}</div>
<div class="choose-work-content">
<div style="color: silver; display: flex;align-items: center;flex: 1;">
<el-form-item label="分值">
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
</el-form-item>
<div style="display: flex;align-items: center;flex: 1;justify-content: flex-end;">
<el-button @click="prevRead(item)">预览</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
<div style="display: flex">
<!-- <el-button v-if="currentTag=='习题训练'" style="margin-right: auto" type="primary"
@ -137,7 +159,6 @@
<el-button type="primary" style="margin-left: auto" :disabled="checkTaskAssigned(currentWorkEdit.currentTask)"
@click="submitStudy('submit')"> </el-button>
</div>
</div>
</el-dialog>
@ -467,8 +488,22 @@ const handleWorkTitleEdit = (row, index) => {
};
// -
const handleWorkEdit = (row, index) =>{
// --
let classtaskObj = reactive({
id: '', //
bookName: '', //
uniquekey: '', //
title: '', //
worktype: '', //
quizlist: [], //
chooseWorkLists: [],// list
fileHomeworkList: [],// list
whiteboardObj: '',//
})
/**
* 作业内容-查看详情
* */
const handleWorkEdit = (row, index) =>{
console.log(row, index)
workEdit.value = true
currentWorkEdit.currentTask = row;
@ -549,34 +584,8 @@ const handleWorkEdit = (row, index) =>{
}
}
};
// --
let classtaskObj = reactive({
id: '', //
bookName: '', //
uniquekey: '', //
title: '', //
worktype: '', //
quizlist: [], //
chooseWorkLists: [],// list
fileHomeworkList: [],// list
whiteboardObj: '',//
})
// -
const newHandleWorkEdit2ClassWorkQuizAdd = async (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;
// this.classWorkForm.title = this.currentTask.title;
//
// this.classWorkForm.worktype = this.currentTask.worktype;
//[]
var listCourseWork = [];
for (var i=0; i < row.entpcourseworklistarray.length; i++) {
@ -600,11 +609,6 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
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;
@ -615,6 +619,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
res.data.score = listCourseWork[0].score;
classtaskObj.chooseWorkLists.push(res.data);
//
ToNewClassTask(classtaskObj);
}
else if (row.worktype == '习题训练') {
const ids = listCourseWork.map(item => item.id).join(",");
@ -636,6 +641,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
classtaskObj.quizlist = idres.rows;
//
ToNewClassTask(classtaskObj);
}
})
}
@ -644,23 +650,29 @@ const newHandleWorkEdit2ClassWorkQuizAdd = async (row, index) =>{
const workcodes = JSON.parse(row.workcodes);
classtaskObj.whiteboardObj = JSON.stringify(workcodes.json);
//
ToNewClassTask(classtaskObj);
}
else if (row.worktype == '常规作业') {
if(isJson(row.workcodes)){
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
//
ToNewClassTask(classtaskObj);
}
}
//
}
};
/**
* 跳转 作业设计 进行编辑页面
* @param classtaskObj
*/
const ToNewClassTask = (classtaskObj) => {
router.push({
path: '/newClassTask',
query: {
classtaskObj: JSON.stringify(classtaskObj),
}
})
}
};
}
const isJson = (str) => {
if (typeof str == 'string') {
@ -877,6 +889,8 @@ const handleWorkConfigUpdate = (key,row) => {
classWorkConfigForm.classWorkConfigList = [];
//
for (var i=0; i<clist.length; i++) {
// clist classWorkConfigForm.studentlist studentlistid
const clsStuList = classWorkConfigForm.studentlist&&classWorkConfigForm.studentlist.filter(item=>item.classid == clist[i].id);
classWorkConfigForm.classWorkConfigList.push({
id: 0,
classid: clist[i].id,
@ -892,7 +906,7 @@ const handleWorkConfigUpdate = (key,row) => {
workdate: '',
title: '',
workcodes: '',
studentlist: classWorkConfigForm.studentlist,
studentlist: clsStuList,
timelength: classWorkConfigForm.timelength,
weights: classWorkConfigForm.weights,
feedtype: classWorkConfigForm.feedtype,
@ -1006,6 +1020,7 @@ const handleTaskAssignToAllClassType = async() => {
var wForm = {};
wForm.classworkarray = JSON.stringify(ttt);
console.log(wForm,'推送的配置信息------------')
saveByClassWorkArray(wForm).then(response => {
console.log(response,'===============response');
// this.classWorkToStudent_Loading = false;

View File

@ -1,7 +1,7 @@
<template>
<el-row class="c-warp" :gutter="10">
<el-col class="left" :span="14">
<el-collapse class="c-item" v-model="activeTopic" accordion>
<el-collapse class="c-item" v-model="activeTopic">
<template v-for="(item, index) in dataList">
<el-collapse-item class="collapse-item" :name="index+1" :id="'collapse-'+(index+1)">
<template #title>

View File

@ -156,7 +156,7 @@ 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'
import {sessionStore} from '@/utils/store'
const { proxy } = getCurrentInstance()
const emit = defineEmits(['cle-click'])
@ -636,7 +636,7 @@ onMounted(() => {
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
const data = sessionStore.get('teachClassWorkItem');
// console.log(data,'????????????????????' )
console.log(data,'????????????????????' )
if(data){
openDialog(data)
}

View File

@ -35,7 +35,8 @@ import { ref, onMounted, watch } from 'vue'
import useUserStore from '@/store/modules/user'
import { homeworklist } from '@/api/teaching/classwork'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import {sessionStore, createWindow} from '@/utils/tool'
import {sessionStore} from '@/utils/store'
import {createWindow} from '@/utils/tool'
import { useToolState } from '@/store/modules/tool'
import {throttle,debounce } from '@/utils/comm'