baigl #220
|
@ -0,0 +1,201 @@
|
|||
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 = ''
|
||||
}
|
||||
// 头部 教材分析、作业设计:打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
|
||||
// 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
|
||||
}
|
||||
|
|
@ -97,6 +97,9 @@ export const getCurrentTime = (format)=> {
|
|||
if(format == 'HH:mm'){
|
||||
return `${hours}:${minutes}`;
|
||||
}
|
||||
if(format == 'MMDD'){
|
||||
return `${month}${day}`;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -0,0 +1,454 @@
|
|||
<template>
|
||||
<div class="page-typeview flex">
|
||||
<el-form ref="classWorkForm" :model="classWorkForm" label-width="90" style="height: calc(100% - 55px);display: flex;flex-direction: column;">
|
||||
<!-- 标题 -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="作业类型:">
|
||||
<el-radio-group v-model="formType" @change="changeFormType">
|
||||
<template v-for="(item) in listWorkType" :key="item">
|
||||
<el-radio :value="item" >{{ item }}</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="作业资源:" class="el-form-work-list">
|
||||
<el-col :span="15" class="work-left">
|
||||
<div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="题型" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkTypeList" :key="index" :label="item.label" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="题源" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="知识点" label-width="70">
|
||||
<el-cascader
|
||||
v-model="entpCourseWorkQueryParams.point"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:options="entpCourseWorkPointList"
|
||||
:props="knowledgePointProps"
|
||||
popper-class="my-popper"
|
||||
:show-all-levels="false"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" style="margin-top: 4px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年份" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-form-item label="关键词" label-width="70">
|
||||
<el-input
|
||||
v-model="entpCourseWorkQueryParams.keyWord"
|
||||
style="width: 70%" type="text"
|
||||
placeholder="请输入关键词"
|
||||
/>
|
||||
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> 查找</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="workResource.entpCourseWorkList" style="width: 100%;">
|
||||
<el-table-column type="index" width="60" />
|
||||
<el-table-column align="left" >
|
||||
<template #header>
|
||||
<div style="display: flex">
|
||||
<div style="align-items: center;">题目内容</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
||||
<el-col :span="24" style="display: flex">
|
||||
<div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div>
|
||||
<div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" width="100">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="height: 55px;">
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="entpCourseWorkTotal > 0"
|
||||
v-model:page="paginationParams.pageNum"
|
||||
v-model:limit="paginationParams.pageSize"
|
||||
:total="entpCourseWorkTotal"
|
||||
:style="{ position: 'relative', 'margin-top': '5px' }"
|
||||
@pagination="getPaginationList" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div v-if="classWorkForm.worktype!='习题训练'">
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-if="classWorkForm.worktype!='常规作业'">
|
||||
<template v-for="(item, index) in workResource.teachResourceList" :key="item">
|
||||
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
<div style="font-size: 1.2em; font-weight: bold;margin-right: 5px">{{ item.worktype }}</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="color: silver; display: flex;align-items: center;">
|
||||
<el-image :src="item.userheadimgurl" style="height: 30px; width: 30px; border-radius: 50%;"></el-image>
|
||||
<div style="line-height: 18px">
|
||||
<div style="margin-top: 5px; margin-left: 5px">{{ item.username }} 来自{{ item.parententpname }} {{ item.userentpname }}</div>
|
||||
<div style="margin-top: 5px; margin-left: 5px">{{ item.timestamp }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center; justify-content: space-around; margin-left: 15px; margin-right: 15px;">
|
||||
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
|
||||
<el-button @click="handleClassWorkAddOfResource(item)" icon="FolderAdd">添加到作业</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="classWorkForm.worktype =='常规作业'">
|
||||
<div class="upload-homework" v-loading="fileLoading">
|
||||
<FileUpload v-model="fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div v-if="classWorkForm.activeIndex==3">
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="查找筛选条件">
|
||||
本节课、本单元,其他单元
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: right;">
|
||||
<el-button @click="handleQueryFromEntpCourseWork" icon="Search">更多</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-for="(item, index) in workResource.classWorkList" :key="item.id">
|
||||
<template v-if="item.classid > 0">
|
||||
<div style="margin-bottom: 30px; padding-left: 15px">
|
||||
<div style="font-size: 1.2em; font-weight: bold">{{ item.worktype }}</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="color: silver; display: flex">
|
||||
<el-image :src="item.edituserheadimgurl" style="height: 30px; width: 30px; border-radius: 50%;"></el-image>
|
||||
<div style="margin-top: 5px; margin-left: 10px">{{ item.editusername }} 来自{{ item.parententpname }} {{ item.entpname }}</div>
|
||||
</div>
|
||||
<div style="color: silver; margin-right: 15px; padding-top: 5px">{{item.workdate}}</div>
|
||||
</div>
|
||||
<div style="font-size: 1em; margin-top: 10px; margin-bottom: 10px; display: flex">
|
||||
<div style="max-width: 100%;word-wrap: break-word;">{{ item.workcontent }}</div>
|
||||
<div v-if="item.entpcourseworklistarray.length>0" style="margin-top: -5px; margin-left: 15px">
|
||||
<el-button v-if="item.expanded==false" style="margin-right: 4px" @click="handleClassWorkResNodeClick(index)">展开</el-button>
|
||||
<el-button v-if="item.expanded==true" @click="handleClassWorkResNodeClick(index)">缩回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="item.expanded == true">
|
||||
<template v-for="(qitem, qindex) in item.quizlist" :key="qitem.id">
|
||||
<el-row style="margin-bottom: 20px; border: 1px dotted; padding: 20px" >
|
||||
<el-col :span="22">
|
||||
<div v-html="qitem.titleFormat" style="overflow: hidden; text-overflow: ellipsis"></div>
|
||||
<div v-html="qitem.workdescFormat" style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;"></div>
|
||||
</el-col>
|
||||
<el-col :span="2"><el-button type="primary" @click="handleClassWorkQuizAdd('classworklist', qitem.id)"><el-icon><CirclePlus /></el-icon> 添加</el-button></el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</template>
|
||||
<div style="display: flex; justify-content: end; margin-left: 15px; margin-right: 15px">
|
||||
<el-button @click="handleClassWorkPackAdd(index)" icon="FolderAdd">添加到作业</el-button>
|
||||
</div>
|
||||
<el-divider />
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-col>
|
||||
<el-col :span="8" style="padding: 0 0 0 5px;height: 60vh; overflow: auto; line-height: 26px">
|
||||
<div v-if="classWorkForm.worktype=='习题训练'" :style="{ 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
||||
<div style="display: flex;">
|
||||
<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="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" @click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div v-if="classWorkForm.worktype!='习题训练'" :style="{'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<template v-for="(item,index) in chooseWorkLists" :key="item.id">
|
||||
<div v-if="item.worktype==classWorkForm.worktype">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
<div style="font-size: 1.2em; font-weight: bold;margin-right: 5px">{{ item.worktype }}</div>
|
||||
<div style="display: flex;align-items: center; justify-content: space-around; margin-left: 15px; margin-right: 15px;flex: 1;">
|
||||
<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>
|
||||
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
|
||||
<el-button @click="deleteClassWorkAddOfResource(item)" type="danger" icon="Delete">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { getCurrentTime } from '@/utils/date'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
|
||||
const props = defineProps({
|
||||
bookobj: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
const isDialogOpen = ref(false)
|
||||
const toolStore = useToolState()
|
||||
const openDialog = () => {
|
||||
isDialogOpen.value = true
|
||||
}
|
||||
const formType = ref('习题训练')
|
||||
// ---------------------------------------------------
|
||||
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
||||
|
||||
const entpCourseWorkTypeList = ref([
|
||||
{value: 0, label: "不限"},
|
||||
{value: 1, label: "单选题"},
|
||||
{value: 2, label: "填空题"},
|
||||
{value: 3, label: "多选题"},
|
||||
{value: 4, label: "判断题"},
|
||||
{value: 5, label: "主观题"},
|
||||
{value: 6, label: "复合题"},
|
||||
]); // 习题查询条件 - 题型
|
||||
|
||||
const entpCourseWorkGroupList = ref([{
|
||||
Key: -1,
|
||||
Value: '不限',
|
||||
}, {
|
||||
Key: 1,
|
||||
Value: '真题',
|
||||
}, {
|
||||
Key: 0,
|
||||
Value: '非真题',
|
||||
}]); // 习题查询条件 - 题源
|
||||
|
||||
const entpCourseWorkPointList = ref([
|
||||
{label: '不限', value: []},
|
||||
]); // 习题查询条件 - 知识点
|
||||
|
||||
const entpCourseWorkYearList =ref([
|
||||
{label: '不限', value: '-1'},
|
||||
{label: '2024', value: '2024'},
|
||||
{label: '2023', value: '2023'},
|
||||
{label: '2022', value: '2022'},
|
||||
{label: '2021', value: '2021'},
|
||||
{label: '2020', value: '2020'},
|
||||
]); // 习题查询条件 - 年份
|
||||
|
||||
|
||||
const paginationParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}); // 分页传参
|
||||
|
||||
// 习题查询参数条件
|
||||
const entpCourseWorkQueryParams = reactive({
|
||||
worktype: {
|
||||
label: '不限',
|
||||
value: 0,
|
||||
},
|
||||
workgroup: 0,
|
||||
yearStr: '-1',
|
||||
point: [],
|
||||
keyWord: '',
|
||||
});
|
||||
|
||||
const workResource = reactive({
|
||||
options: ['学习任务', '云题库'],
|
||||
worktype: '全部',
|
||||
activeIndex: "3",
|
||||
dialogOfTaskOpen: false,
|
||||
dislogOfAssignOpen: false,
|
||||
quiztype: '',
|
||||
queryForm: {},
|
||||
classWorkList: [], // 教学分析里产生的学习任务
|
||||
entpCourseWorkList: [],
|
||||
}); // 作业资源
|
||||
const classWorkForm = reactive({
|
||||
worktype: '习题训练', //作业类型
|
||||
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
||||
|
||||
})
|
||||
const entpCourseWorkList = ref([]); // 习题列表
|
||||
const entpCourseWorkTotal = ref(0); // 习题总数
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 作业类型切换
|
||||
*/
|
||||
const changeFormType = (val) => {
|
||||
console.log(val)
|
||||
classWorkForm.value.worktype = val;
|
||||
}
|
||||
|
||||
const queryForm = reactive({
|
||||
// 课程相关参数
|
||||
eid: props.bookobj.levelSecondId,
|
||||
sectionName: props.bookobj.coursetitle,
|
||||
edusubject: userStore.edusubject,
|
||||
edustage: userStore.edustage,
|
||||
//
|
||||
// 题类
|
||||
worktype: entpCourseWorkQueryParams.worktype.label,
|
||||
workTypeId: entpCourseWorkQueryParams.worktype.value,
|
||||
// 题源
|
||||
workgroup: entpCourseWorkQueryParams.workgroup,
|
||||
// 年份
|
||||
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
|
||||
// 知识点
|
||||
thirdId: entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
|
||||
// 关键字
|
||||
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
|
||||
|
||||
// 分页参数
|
||||
// pageNum: paginationParams.pageNum,
|
||||
// pageSize: paginationParams.pageSize,
|
||||
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 新查询试题
|
||||
* @return: {*}
|
||||
* @param {*} queryType
|
||||
* 0 - 标准查询
|
||||
* 1 - 按条件查询
|
||||
* 2 - 按关键词查询
|
||||
*/
|
||||
const handleQueryFromEntpCourseWork= (queryType) => {
|
||||
//queryForm.pageNum = this.paginationParams.pageNum;
|
||||
//queryForm.pageSize = this.paginationParams.pageSize;
|
||||
|
||||
// 初中政治特殊处理( warn: 需确认是否修改 )
|
||||
// if (this.courseObj.edusubject=='政治' && this.courseObj.edustage=='初中') {
|
||||
// // [初中+政治]需改为[初中+道德与法治]
|
||||
// queryForm.edusubject = '道德与法治';
|
||||
// }
|
||||
|
||||
|
||||
console.log(queryForm)
|
||||
listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
|
||||
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') {
|
||||
// // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】
|
||||
// const allowedWorkTypes = ['单选题', '填空题', '多选题', '判断题', '复合题'];
|
||||
// workResource.entpCourseWorkList = entpcourseworkres.rows.filter(item => {
|
||||
// return !allowedWorkTypes.includes(item.worktype);
|
||||
// });
|
||||
// } else {
|
||||
// workResource.entpCourseWorkList = entpcourseworkres.rows;
|
||||
// }
|
||||
if(entpcourseworkres.data == null) {
|
||||
workResource.entpCourseWorkList = [];
|
||||
entpCourseWorkTotal.value = 0
|
||||
return;
|
||||
}
|
||||
entpCourseWorkList.value = entpcourseworkres.data;
|
||||
workResource.entpCourseWorkList.forEach(item=> {
|
||||
if (item.worktype == '选择题') {
|
||||
item.worktype = '单选题'
|
||||
}
|
||||
})
|
||||
// 同步数量
|
||||
entpCourseWorkTotal.value = 0;
|
||||
if (entpcourseworkres.data.length > 0) {
|
||||
entpCourseWorkTotal.value = entpcourseworkres.data.length;
|
||||
}
|
||||
|
||||
if()
|
||||
|
||||
//格式化试题信息
|
||||
processList(workResource.entpCourseWorkList);
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQueryFromEntpCourseWork(0);
|
||||
})
|
||||
|
||||
|
||||
// watch(() => sourceStore.query.fileSource,() => {
|
||||
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-typeview{
|
||||
padding-top: 10px;
|
||||
height: 100%;
|
||||
|
||||
.el-form-work-list{
|
||||
:deep(.el-form-item__content){
|
||||
align-items: normal;
|
||||
}
|
||||
|
||||
.work-left{
|
||||
height: 50vh;
|
||||
background-color: white;
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
border:1px dotted blue;
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -4,84 +4,53 @@
|
|||
default-active="1"
|
||||
class="el-menu-vertical-demo"
|
||||
:collapse="isCollapse"
|
||||
:style="{ width: isCollapse ? '64px' : '300px'}"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
>
|
||||
<!--左侧 教材 目录-->
|
||||
<!-- <div v-show="!isCollapse">
|
||||
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
||||
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
|
||||
</div> -->
|
||||
<div >
|
||||
<el-menu-item index="1">
|
||||
<el-icon><document /></el-icon>
|
||||
<template #title>
|
||||
<Third v-if="isThird" @node-click="getDataOther"></Third>
|
||||
<ChooseTextbook v-else @change-book="getData" @node-click="getData" />
|
||||
</template>
|
||||
</el-menu-item>
|
||||
<div v-if="!isCollapse">
|
||||
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||
</div>
|
||||
</el-menu>
|
||||
|
||||
<div class="page-right">
|
||||
<el-form ref="classWorkForm" :model="classWorkForm" label-width="120" style="height: calc(100% - 55px);display: flex;flex-direction: column;">
|
||||
<div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}">
|
||||
<!-- 标题 -->
|
||||
<el-row :gutter="30">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作业范围">
|
||||
<el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
|
||||
<el-radio-button :value="false">打开</el-radio-button>
|
||||
<el-radio-button :value="true">折叠</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
<el-row style="align-items: center; margin-bottom: 0px">
|
||||
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
||||
<div class="unit-top-left" @click="isCollapse = !isCollapse">
|
||||
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
||||
<span>作业范围</span>
|
||||
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="classtype-right">
|
||||
<el-form-item label="作业名称">
|
||||
<el-input type="text" v-model="classWorkForm.uniquekey" placeholder="请输入作业名称"/>
|
||||
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- 搜索 -->
|
||||
<!-- <ResoureSearch #add>
|
||||
<el-button
|
||||
v-if="sourceStore.isCreate"
|
||||
type="primary"
|
||||
round
|
||||
class="create-btn"
|
||||
@click="openDialog"
|
||||
>
|
||||
<i class="iconfont icon-jiahao"></i>
|
||||
新建资源</el-button
|
||||
>
|
||||
</ResoureSearch> -->
|
||||
<!-- 列表 -->
|
||||
<!-- 第三方列表-->
|
||||
<ThirdList v-if="isThird" />
|
||||
<ResoureList v-else />
|
||||
<!-- 作业类型:内容 -->
|
||||
<task-type-view :bookobj="courseObj" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 上传弹窗 -->
|
||||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch } from 'vue'
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
// import useResoureStore from './store'
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import Third from '@/components/choose-textbook/third.vue'
|
||||
// import ResoureSearch from './container/resoure-search.vue'
|
||||
// import ResoureList from './container/resoure-list.vue'
|
||||
// import ThirdList from './container/third-list.vue'
|
||||
import TaskTypeView from '@/views/classTask/container/newTask/taskTypeView.vue'
|
||||
import uploadDialog from '@/components/upload-dialog/index.vue'
|
||||
import uploaderState from '@/store/modules/uploader'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
// import { createWindow } from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { getCurrentTime } from '@/utils/date'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
|
||||
// const sourceStore = useResoureStore()
|
||||
const isDialogOpen = ref(false)
|
||||
const toolStore = useToolState()
|
||||
|
@ -89,19 +58,26 @@ const openDialog = () => {
|
|||
isDialogOpen.value = true
|
||||
}
|
||||
// ---------------------------------------------------
|
||||
const classWorkForm = ref({})
|
||||
const classWorkForm = reactive({
|
||||
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
||||
uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1),
|
||||
|
||||
})
|
||||
const isCollapse = ref(false)
|
||||
|
||||
|
||||
const courseObj = reactive({
|
||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||
textbookId: '',
|
||||
levelFirstId: '',
|
||||
levelSecondId: '',
|
||||
coursetitle:'',
|
||||
//
|
||||
})
|
||||
|
||||
// ---------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//判断是否去查看第三方资源
|
||||
const isThird = ref(false)
|
||||
|
||||
// 查询
|
||||
const getData = (data) => {
|
||||
const { textBook, node } = data
|
||||
|
@ -114,50 +90,26 @@ const getData = (data) => {
|
|||
levelFirstId = node.id
|
||||
levelSecondId = ''
|
||||
}
|
||||
// sourceStore.query.levelFirstId = levelFirstId
|
||||
// sourceStore.query.levelSecondId = levelSecondId
|
||||
// sourceStore.query.textbookId = textbookId
|
||||
// sourceStore.nodeData = {
|
||||
// textbookId,
|
||||
// levelFirstId,
|
||||
// levelSecondId
|
||||
// }
|
||||
// sourceStore.handleQuery()
|
||||
|
||||
courseObj.textbookId = textbookId // 版本
|
||||
courseObj.levelFirstId = levelFirstId // 单元
|
||||
courseObj.levelSecondId = levelSecondId // 章节
|
||||
courseObj.coursetitle = node.itemtitle // (单元/章节) 名称
|
||||
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
}
|
||||
const getDataOther = (data) => {
|
||||
// sourceStore.thirdQuery.chapterId = data.chapterId
|
||||
// sourceStore.thirdQuery.bookId = data.bookId
|
||||
// sourceStore.thirdQuery.stage = data.stage
|
||||
// sourceStore.thirdQuery.subjectId = data.subjectId
|
||||
// sourceStore.handleQuery()
|
||||
}
|
||||
|
||||
// 提交文件
|
||||
const submitFile = (data) => {
|
||||
// let fileList = toRaw(data)
|
||||
// const { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot } = sourceStore.query
|
||||
// // 给每个文件添加属性
|
||||
// fileList.forEach((item) => {
|
||||
// let fileData = { textbookId, levelFirstId, levelSecondId, fileSource, fileRoot }
|
||||
// fileData.fileShowName = item.fileData.fileShowName
|
||||
// fileData.fileFlag = item.fileData.fileFlag
|
||||
// item.fileData = fileData
|
||||
// item.callback = fileCallBack
|
||||
// })
|
||||
// uploaderState().pushFile(fileList)
|
||||
}
|
||||
|
||||
const fileCallBack = (res) => {
|
||||
// if (res.code == 200) {
|
||||
// sourceStore.handleQuery()
|
||||
// }
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
// sourceStore.getCreate()
|
||||
})
|
||||
|
||||
const init = () => {
|
||||
classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
|
||||
|
||||
}
|
||||
|
||||
// watch(() => sourceStore.query.fileSource,() => {
|
||||
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
||||
// })
|
||||
|
@ -168,10 +120,29 @@ onMounted(() => {
|
|||
padding-top: 10px;
|
||||
height: 100%;
|
||||
|
||||
.el-menu--collapse {
|
||||
width: 0px;
|
||||
min-height: 100%;
|
||||
}
|
||||
.el-menu-vertical-demo:not(.el-menu--collapse) {
|
||||
width: 300px;
|
||||
min-height: 100%;
|
||||
}
|
||||
.unit-top-left {
|
||||
cursor: pointer;
|
||||
|
||||
.icon-xiangzuo {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.classtype-right{
|
||||
padding: 5px;
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
.el-form-item--default{
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.page-right {
|
||||
min-width: 0;
|
||||
|
|
|
@ -45,6 +45,8 @@ import { useRouter } from 'vue-router'
|
|||
import workTrend from './container/work-trend.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import * as echarts from 'echarts'
|
||||
import { useGetClassWork } from '@/hooks/useGetClassWork'
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
@ -104,10 +106,10 @@ const menuList = [{
|
|||
{
|
||||
name: '作业设计',
|
||||
icon: 'icon-jiaoxuefansi',
|
||||
//isOuter: true,
|
||||
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||
isOuter: true,
|
||||
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask'
|
||||
//path: '/newClassTask'
|
||||
path: '/classTaskAssign'
|
||||
//path: '/classTaskAssign'
|
||||
//isOuter: true,
|
||||
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||
},
|
||||
|
@ -164,6 +166,13 @@ const clickMenu = ({isOuter, path, disabled}) =>{
|
|||
if(isOuter){
|
||||
let configObj = outLink().getBaseData()
|
||||
let fullPath = configObj.fullPath + path
|
||||
if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask'){
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
|
||||
|
||||
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||
fullPath = fullPath + `&unitId=${unitId}`
|
||||
}
|
||||
fullPath = fullPath.replaceAll('//', '/')
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
|
@ -222,9 +231,22 @@ onMounted(async ()=>{
|
|||
]
|
||||
}
|
||||
chartInstance.setOption(option);
|
||||
// 初始化 获取教材下面的单元 + 章节
|
||||
getSubjectInit();
|
||||
|
||||
})
|
||||
|
||||
const getSubjectInit = async () => {
|
||||
//查看本地是否有缓存
|
||||
let unitId = localStorage.getItem('unitId')
|
||||
if(unitId){
|
||||
// 有缓存不用管
|
||||
} else{
|
||||
// 没有 就获取 获取教材下面的单元 + 章节
|
||||
useGetClassWork();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue