baigl #261

Merged
baigl merged 14 commits from baigl into main 2024-09-24 16:34:39 +08:00
4 changed files with 684 additions and 235 deletions
Showing only changes of commit 96098c899f - Show all commits

View File

@ -62,3 +62,12 @@ export function updateClassworkdata(data) {
data: data data: data
}) })
} }
// 修改classwork
export function updateClasswork(data) {
return request({
url: '/education/classwork',
method: 'put',
data: data
})
}

View File

@ -1,111 +1,121 @@
<template> <template>
<div class="page-typeview flex"> <div class="page-typeview">
<el-form ref="classWorkForm" :model="classWorkForm" label-width="90" style="height: calc(100% - 55px);display: flex;flex-direction: column;"> <el-form ref="classWorkFormRef" :model="classWorkForm" label-width="90" style=" height: 100%;overflow: hidden;">
<!-- 标题 --> <!-- 标题 -->
<el-row> <div class="container">
<el-col :span="24"> <!-- 作业类型 -->
<el-form-item label="作业类型:"> <el-row class="top">
<el-radio-group v-model="formType" @change="changeFormType"> <el-col :span="24">
<template v-for="(item) in listWorkType" :key="item"> <el-form-item label="作业类型:">
<el-radio :value="item" >{{ item }}</el-radio> <el-radio-group v-model="formType" @change="changeFormType">
</template> <template v-for="(item) in listWorkType" :key="item">
</el-radio-group> <el-radio :value="item" >{{ item }}</el-radio>
</el-form-item> </template>
</el-col> </el-radio-group>
<el-col :span="24"> </el-form-item>
<el-form-item label="作业资源:" class="el-form-work-list"> </el-col>
<el-col :span="15" class="work-left"> </el-row>
<div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;"> <!-- 作业资源 -->
<el-row :gutter="10"> <el-row class="middle">
<el-col :span="6"> <el-col :span="24" style="height: 100%; overflow: hidden;">
<el-form-item label="题型" label-width="70"> <el-form-item label="作业资源:" class="el-form-work-list">
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" > <el-col :span="15" class="work-left">
<el-option v-for="(item, index) in entpCourseWorkTypeList" :key="index" :label="item.label" :value="item"> <!-- 习题训练 -->
</el-option> <div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;">
</el-select> <!-- 习题筛选1 -->
</el-form-item> <el-row :gutter="10" class="top">
</el-col> <el-col :span="6">
<el-col :span="6"> <el-form-item label="题型" label-width="70">
<el-form-item label="题源" label-width="70"> <el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
<el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" > <el-option v-for="(item, index) in entpCourseWorkTypeList" :key="index" :label="item.label" :value="item">
<el-option v-for="(item, index) in entpCourseWorkGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="6">
<el-form-item label="知识点" label-width="70"> <el-form-item label="题源" label-width="70">
<el-cascader <el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" >
v-model="entpCourseWorkQueryParams.point" <el-option v-for="(item, index) in entpCourseWorkGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option>
clearable </el-select>
style="width: 100%" </el-form-item>
:options="entpCourseWorkPointList" </el-col>
:props="knowledgePointProps" <el-col :span="11">
popper-class="my-popper" <el-form-item label="知识点" label-width="70">
:show-all-levels="false" <el-cascader
collapse-tags v-model="entpCourseWorkQueryParams.point"
collapse-tags-tooltip clearable
/> style="width: 100%"
</el-form-item> :options="entpCourseWorkPointList"
</el-col> :props="knowledgePointProps"
</el-row> popper-class="my-popper"
<el-row :gutter="10" style="margin-top: 4px"> :show-all-levels="false"
<el-col :span="6"> collapse-tags
<el-form-item label="年份" label-width="70"> collapse-tags-tooltip
<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-form-item>
</el-select> </el-col>
</el-form-item> </el-row>
</el-col> <!-- 习题筛选2 -->
<el-col :span="15"> <el-row :gutter="10" style="margin-top: 4px" class="top">
<el-form-item label="关键词" label-width="70"> <el-col :span="6">
<el-input <el-form-item label="年份" label-width="70">
v-model="entpCourseWorkQueryParams.keyWord" <el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
style="width: 70%" type="text" <el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option>
placeholder="请输入关键词" </el-select>
/> </el-form-item>
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button> </el-col>
</el-form-item> <el-col :span="15">
</el-col> <el-form-item label="关键词" label-width="70">
</el-row> <el-input
v-model="entpCourseWorkQueryParams.keyWord"
<el-table :data="workResource.entpCourseWorkList" style="width: 100%;"> style="width: 70%" type="text"
<el-table-column type="index" width="60" /> placeholder="请输入关键词"
<el-table-column align="left" > />
<template #header> <el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
<div style="display: flex"> </el-form-item>
<div style="align-items: center;">题目内容</div> </el-col>
</div> </el-row>
</template> <!-- 习题表格 -->
<template #default="scope"> <div class="middle" >
<div> <el-table :data="workResource.entpCourseWorkList" style="width: 100%; height: 100%;">
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div> <el-table-column type="index" width="60" />
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div> <el-table-column align="left" >
<el-col :span="24" style="display: flex"> <template #header>
<div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div> <div style="display: flex">
<div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div> <div style="align-items: center;">题目内容</div>
</el-col> </div>
</div> </template>
</template> <template #default="scope">
</el-table-column> <div>
<el-table-column align="left" width="100"> <div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
<template #default="scope"> <div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button> <el-col :span="24" style="display: flex">
</template> <div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div>
</el-table-column> <div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div>
</el-table> </el-col>
<div style="height: 55px;"> </div>
<!-- 分页 --> </template>
<pagination </el-table-column>
v-show="entpCourseWorkTotal > 0" <el-table-column align="left" width="100">
v-model:page="paginationParams.pageNum" <template #default="scope">
v-model:limit="paginationParams.pageSize" <el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
:total="entpCourseWorkTotal" </template>
:style="{ position: 'relative', 'margin-top': '5px' }" </el-table-column>
@pagination="getPaginationList" /> </el-table>
</div>
<!-- 分页 这里不用-->
<!-- <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>
</div> <!-- <div v-if="classWorkForm.worktype!='习题训练'">
<!-- <div v-if="classWorkForm.worktype!='习题训练'"> <div :style="{ 'overflow': 'auto'}">
<div :style="{ 'overflow': 'auto'}">
<template v-if="classWorkForm.worktype!='常规作业'"> <template v-if="classWorkForm.worktype!='常规作业'">
<template v-for="(item, index) in workResource.teachResourceList" :key="item"> <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 v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
@ -135,116 +145,140 @@
</template> </template>
</div> </div>
</div> --> </div> -->
<!-- <div v-if="classWorkForm.activeIndex==3"> <!-- <div v-if="classWorkForm.activeIndex==3">
<el-row> <el-row>
<el-col :span="20"> <el-col :span="20">
<el-form-item label="查找筛选条件"> <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> </el-form-item>
<div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" @click="handleClassWorkFormQuizRemove(index)">删除</el-button></div> </el-col>
</div> <el-col :span="4" style="text-align: right;">
<el-button @click="handleQueryFromEntpCourseWork" icon="Search">更多</el-button>
</div> </el-col>
</template> </el-row>
</div> <div :style="{ 'overflow': 'auto'}">
<template v-for="(item, index) in workResource.classWorkList" :key="item.id">
<div v-if="classWorkForm.worktype!='习题训练'" :style="{'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}"> <template v-if="item.classid > 0">
<div style="margin: 5px; background-color: white"> <div style="margin-bottom: 30px; padding-left: 15px">
<template v-for="(item,index) in chooseWorkLists" :key="item.id"> <div style="font-size: 1.2em; font-weight: bold">{{ item.worktype }}</div>
<div v-if="item.worktype==classWorkForm.worktype"> <div style="display: flex; justify-content: space-between;">
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;"> <div style="color: silver; display: flex">
<div style="font-size: 1.2em; font-weight: bold;margin-right: 5px">{{ item.worktype }}</div> <el-image :src="item.edituserheadimgurl" style="height: 30px; width: 30px; border-radius: 50%;"></el-image>
<div style="display: flex;align-items: center; justify-content: space-around; margin-left: 15px; margin-right: 15px;flex: 1;"> <div style="margin-top: 5px; margin-left: 10px">{{ item.editusername }} 来自{{ item.parententpname }} {{ item.entpname }}</div>
<div style="color: silver; display: flex;align-items: center;flex: 1;"> </div>
<el-form-item label="分值"> <div style="color: silver; margin-right: 15px; padding-top: 5px">{{item.workdate}}</div>
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number > </div>
</el-form-item> <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>
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
<el-button @click="deleteClassWorkAddOfResource(item)" type="danger" icon="Delete">删除</el-button>
</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="9" class="work-right">
<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>
</div> </div>
</template> </template>
</div> </div>
</div>
</el-col> <div v-if="classWorkForm.worktype!='习题训练'" :style="{'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
</el-form-item> <div style="margin: 5px; background-color: white">
</el-col> <template v-for="(item,index) in chooseWorkLists" :key="item.id">
</el-row> <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-row class="bottom">
<el-col :span="12">
<el-form-item label="作业说明" style="margin: 10px 0;">
<el-col :span="15" style="padding: 0px">
<!-- <el-input v-model="classWorkForm.title" type="textarea" :rows="1" placeholder="请输入作业说明"/> -->
<el-input v-model="classWorkForm.title" style="width: 400px" placeholder="请输入作业说明"/>
</el-col>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button type="primary" @click="handleClassWorkSave"> </el-button>
</el-col>
</el-row>
</div>
</el-form> </el-form>
</div> </div>
</template> </template>
<script setup> <script setup>
import { onMounted, ref, toRaw,watch, reactive } from 'vue' import { onMounted, ref, nextTick, watch, reactive, getCurrentInstance } from 'vue'
import { ElMessage } from 'element-plus'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'
import { getCurrentTime } from '@/utils/date' import { getCurrentTime } from '@/utils/date'
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList'
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork' import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
import { updateClasswork } from '@/api/classTask'
import { useGetHomework } from '@/hooks/useGetHomework'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user const userStore = useUserStore().user
const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
bookobj: { bookobj: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
}, },
uniquekey: {
type: String,
default: ''
}
}) })
@ -253,7 +287,9 @@ const toolStore = useToolState()
const openDialog = () => { const openDialog = () => {
isDialogOpen.value = true isDialogOpen.value = true
} }
const classWorkFormRef = ref(null);
const formType = ref('习题训练') const formType = ref('习题训练')
const newWorkSpaceEdit = ref(false); //
// --------------------------------------------------- // ---------------------------------------------------
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); // const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //
@ -318,15 +354,15 @@ const workResource = reactive({
quiztype: '', quiztype: '',
queryForm: {}, queryForm: {},
classWorkList: [], // classWorkList: [], //
entpCourseWorkList: [], entpCourseWorkList: [], //
entpCourseWorkTotal: 0, //
}); // }); //
const classWorkForm = reactive({ let classWorkForm = reactive({
uniquekey: props.uniquekey, //
worktype: '习题训练', // worktype: '习题训练', //
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1), title: '',//
quizlist: [], //
}) })
const entpCourseWorkList = ref([]); //
const entpCourseWorkTotal = ref(0); //
@ -335,7 +371,7 @@ const entpCourseWorkTotal = ref(0); // 习题总数
*/ */
const changeFormType = (val) => { const changeFormType = (val) => {
console.log(val) console.log(val)
classWorkForm.value.worktype = val; classWorkForm.worktype = val;
} }
const queryForm = reactive({ const queryForm = reactive({
@ -372,7 +408,7 @@ const queryForm = reactive({
* 1 - 按条件查询 * 1 - 按条件查询
* 2 - 按关键词查询 * 2 - 按关键词查询
*/ */
const handleQueryFromEntpCourseWork= (queryType) => { const handleQueryFromEntpCourseWork= (queryType) => {
//queryForm.pageNum = this.paginationParams.pageNum; //queryForm.pageNum = this.paginationParams.pageNum;
//queryForm.pageSize = this.paginationParams.pageSize; //queryForm.pageSize = this.paginationParams.pageSize;
@ -382,8 +418,6 @@ const queryForm = reactive({
// queryForm.edusubject = ''; // queryForm.edusubject = '';
// } // }
console.log(queryForm)
listEntpcourseworkNew(queryForm).then(entpcourseworkres => { listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '') { // if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '') {
// // , // // ,
@ -394,57 +428,462 @@ const queryForm = reactive({
// } else { // } else {
// workResource.entpCourseWorkList = entpcourseworkres.rows; // workResource.entpCourseWorkList = entpcourseworkres.rows;
// } // }
if(entpcourseworkres.data == null) {
workResource.entpCourseWorkList = [];
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()
// if(entpcourseworkres.data&&entpcourseworkres.data.length>0){
processList(workResource.entpCourseWorkList); workResource.entpCourseWorkList = entpcourseworkres.data;
workResource.entpCourseWorkTotal = entpcourseworkres.data.length;
workResource.entpCourseWorkList.forEach(item=> {
if (item.worktype == '选择题') {
item.worktype = '单选题'
}
})
//
processList(workResource.entpCourseWorkList);
}else{
workResource.entpCourseWorkList = [];
workResource.entpCourseWorkTotal = 0
}
}) })
} }
/**
* 添加资源
* @param fromsrc - 试题来源
* @param entpcourseworkid
*/
const handleClassWorkQuizAdd = (fromsrc, entpcourseworkid) => {
var exist = false;
for (var i=0; i< classWorkForm.quizlist.length; i++) {
if (classWorkForm.quizlist[i].id == entpcourseworkid) {
exist = true;
break;
}
}
if (exist == false) {
getEntpcoursework(entpcourseworkid).then(res => {
//res.data.titletext = res.data.title.replace(/<[^>]+>/g, '');
//
if(res.data.score == null){
res.data.score = 4;
}
classWorkForm.quizlist.push(res.data);
//
processList(classWorkForm.quizlist);
})
} else {
ElMessage('试题已经存在')
}
};
/**
* 作业设计-提交
*/
const handleClassWorkSave = async () => {
await nextTick(); // DOM
proxy.$refs["classWorkFormRef"].validate(async valid => {
if (valid) {
if (classWorkForm.id != null) {
// []
updateClasswork(classWorkForm).then(response => {
ElMessage("修改成功");
// this.workConfDialogOpen = false;
//
// this.getClassWorkAllList(); //
});
} else {
// [] newWorkSpaceEdit true
if(newWorkSpaceEdit.value ) {
// 0.
if (this.currentTag == '习题训练') {
if (this.classWorkForm.quizlist.length == 0) {
ElMessage.error('请先添加作业资源!');
return;
}
}
else if (this.currentTag == '课堂展示' || this.currentTag == '常规作业') {
//
}
else {
if (this.chooseWorkLists.length == 0) {
ElMessage.error('请先添加作业资源!');
return;
}
}
//
let classWorkParams = {
id: this.currentTask.id,
uniquekey: this.classWorkForm.uniquekey, // []
//title: classWorkForm.title, // []
}
//
if (this.currentTag=='习题训练'){
// console.log(this.workConfObj.quizlist);
// console.log(this.currentTask);
// console.log(this.classWorkList);
// 1.
let needUplEval = false;
if (this.classWorkForm.quizlist.length !== this.currentTask.entpcourseworklistarray.length) {
needUplEval = true;
}
else {
//
// for (let cur of this.classWorkForm.quizlist){
// let isSame = false;
// for (let last of this.currentTask.entpcourseworklistarray) {
// if (last.id === cur.id && last.score === cur.score){
// isSame = true;
// break;
// }
// }
// if (!isSame) {
// needUplEval = true;
// break;
// }
// }
needUplEval = this.classWorkForm.quizlist.some(cur =>
!this.currentTask.entpcourseworklistarray.some(last =>
last.id === cur.id && last.score === cur.score
)
);
}
// 2.eval
if (needUplEval) {
// : , ,
// 2.1.workidid
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.workidid
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
if (wevalres.rows.length == 0) {
ElMessage.error('未找到原框架梳理任务,请或退出重试');
return;
}
// 2.
let needUplEval = false;
if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
needUplEval = true;
}
else {
//
needUplEval = this.chooseWorkLists.some(cur =>
!this.currentTask.entpcourseworklistarray.some(last =>
last.id === cur.id && last.score === cur.score
)
);
}
if (needUplEval) {
const uplParams = {
id: wevalres.rows[0].id,
entpcourseworkid: this.chooseWorkLists[0].id,
score: this.chooseWorkLists[0].score,
}
let res = await updateClassworkeval(uplParams);
}
}
else if (this.currentTag=='课堂展示') {
}
else if (this.currentTag=='常规作业') {
// 1. (, )
classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
}
// 3.
let res = await updateClasswork(classWorkParams);
this.fileHomeworkList = [];
this.chooseWorkLists = [];
// 4.
this.getClassWorkAllList();
this.classWorkForm.worktype = "习题训练";
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
return;
}
const { res, chapterId } = await useGetHomework(this.currentNode)
// this.entpcourseid = chapterId
if (classWorkForm.worktype === "课堂展示") {
this.boardLoading = true
let canvasJson = this.$refs.boardref.getCanvasJson()
let canvasBase64 = await this.$refs.boardref.getCanvasBase64()
var formObj = {};
formObj.id = 0;
formObj.workdate = this.classWorkForm.workdate;
formObj.deaddate = '';
formObj.entpid = this.userStore.deptId;
formObj.level = 1;
formObj.parentid = 0;
formObj.worktype = this.classWorkForm.worktype;
formObj.workkey = '';
formObj.worktag = this.question;
formObj.uniquekey = this.classWorkForm.uniquekey;
formObj.classid = 0;
formObj.classcourseid = 0;
formObj.entpcourseid = this.courseObj.id;
formObj.slideid = 0;
formObj.title = this.classWorkForm.title;
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
formObj.edusubject = this.courseObj.edusubject;
formObj.evalid = this.courseObj.evalid;
formObj.edustage = this.userStore.edustage;
formObj.status = '10'; //2024-09-11
formObj.edituserid = this.userStore.id;
formObj.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
try {
addClassworkReturnId(formObj).then(() => {
this.classWorkForm.worktype = "习题训练";
this.chooseWorkLists = [];
this.whiteboardObj = '';
// refresh the list
this.getClassWorkAllList();
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
})
} finally {
this.boardLoading = false
}
}
else if(classWorkForm.worktype === "常规作业"){
this.fileLoading = true
var formObj = {};
formObj.id = 0;
formObj.workdate = this.classWorkForm.workdate;
formObj.deaddate = '';
formObj.entpid = this.userStore.deptId;
formObj.level = 1;
formObj.parentid = 0;
formObj.worktype = this.classWorkForm.worktype;
formObj.workkey = '';
formObj.worktag = '';
formObj.uniquekey = this.classWorkForm.uniquekey;
formObj.classid = 0;
formObj.classcourseid = 0;
formObj.entpcourseid = this.courseObj.id;
formObj.slideid = 0;
formObj.title = this.classWorkForm.title;
formObj.workcodes = JSON.stringify(this.fileHomeworkList);
formObj.edusubject = this.courseObj.edusubject;
formObj.evalid = this.courseObj.evalid;
formObj.edustage = this.userStore.edustage;
formObj.status = '10'; //2024-09-11
formObj.edituserid = this.userStore.id;
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
try {
addClassworkReturnId(formObj).then(() => {
this.classWorkForm.worktype = "习题训练";
this.chooseWorkLists = [];
this.fileHomeworkList = []
this.whiteboardObj = '';
// refresh the list
this.getClassWorkAllList();
this.newWorkSpace = false;
this.newWorkSpaceEdit = false;
this.workEdit = false;
})
} finally {
this.fileLoading = false
}
}
else {
//
var ll = [];
if (classWorkForm.worktype === "习题训练") {
for (var i=0; i< classWorkForm.quizlist.length; i++) {
//
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
}
}else {
// TODO ------------
// this.chooseWorkLists.filter((item, index) => {
// if (item.worktype === this.classWorkForm.worktype) {
// ll.push({'id':item.id, 'score': item.score});
// }
// })
}
console.log(userStore,'userStoreuserStoreuserStore')
const cform = {
id: 0,
workdate: classWorkForm.workdate, // //
deaddate: '', //
entpid: userStore.deptId, //
level: 1,
parentid: 0,
worktype: classWorkForm.worktype, //
workkey: '',
worktag: '',
uniquekey: classWorkForm.uniquekey,//
classid: 0,
classcourseid: 0,
entpcourseid: chapterId, //
slideid: 0,
title: classWorkForm.title, //
workcodes: JSON.stringify(classWorkForm.workcodes), //
edusubject: userStore.edusubject, //
evalid: props.bookobj.levelSecondId, //userStore.evalid, // // ID
edustage: userStore.edustage, // ,,
status: '10', //2024-09-11
edituserid: userStore.userId, // id
};
if (ll.length > 0) {
cform.entpcourseworklist = JSON.stringify(ll);
} else {
cform.entpcourseworklist = '';
}
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
console.log(cform,'提交的数据');
// addClassworkReturnId(cform).then(workres => {
// this.classWorkForm.worktype = "";
// this.chooseWorkLists = [];
// this.whiteboardObj = '';
// // refresh the list
// this.getClassWorkAllList();
// // 使 240603
// // var slist = [];
// // for (var i=0; i<this.classStudentList.length; i++) {
// // slist.push({studentid: this.classStudentList[i].studentid, name: this.classStudentList[i].name});
// // }
// // var quizll = [];
// // for (var i=0; i<this.classWorkForm.quizlist.length; i++) {
// // quizll.push({id: this.classWorkForm.quizlist[i].id});
// // }
// // var ttt = {
// // id: workres,
// // studentlist: slist,
// // entpcourseworklist: quizll
// // }
// // var wForm = {};
// // wForm.classworkarray = '['+JSON.stringify(ttt)+']';
// //pushClassWorkByArray(wForm).then(response => {});
// this.newWorkSpace = false;
// this.newWorkSpaceEdit = false;
// this.workEdit = false;
// })
}
}
}
});
};
onMounted(() => { onMounted(() => {
handleQueryFromEntpCourseWork(0);
}) })
// watch(() => sourceStore.query.fileSource,() => { watch(() => props.bookobj.levelSecondId, (newVal) => {
// sourceStore.query.fileSource === ''?isThird.value = true:isThird.value = false console.log(props.bookobj,'课程选择')
// }) queryForm.eid = props.bookobj.levelSecondId,
queryForm.sectionName = props.bookobj.coursetitle,
handleQueryFromEntpCourseWork(0);
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-typeview{ .page-typeview{
padding-top: 10px; // padding-top: 10px;
height: 100%; height: 100%;
.container {
display: flex;
flex-direction: column;
height: 100%;
}
.top, .bottom {
flex: 0 0 auto;
}
.middle {
flex: 1;
height: 100%;
overflow: hidden;
}
.el-form-work-list{ .el-form-work-list{
height: 100%;
margin-bottom: 0px;
overflow: hidden;
:deep(.el-form-item__content){ :deep(.el-form-item__content){
align-items: normal; align-items: normal;
} }
.work-left{ .work-left{
height: 50vh; height: 100%;
background-color: white; background-color: white;
padding-right: 0; padding-right: 0;
padding-left: 0; padding-left: 0;
border:1px dotted blue; border:1px dotted blue;
border-radius:5px; border-radius:5px;
overflow: hidden;
}
.work-right {
height: 100%;
padding: 0 0 0 5px;
overflow: auto;
line-height: 26px;
overflow: hidden;
} }

View File

@ -1,19 +1,19 @@
<template> <template>
<div class="page-resource flex"> <div class="page-newcalsetask flex">
<el-menu <el-menu
default-active="1" default-active="1"
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
:collapse="isCollapse" :collapse="isCollapse"
> >
<!--左侧 教材 目录--> <!--左侧 教材 目录-->
<div v-if="!isCollapse"> <div v-if="!isCollapse" style="height: 100%;overflow: hidden;">
<ChooseTextbook @change-book="getData" @node-click="getData" /> <ChooseTextbook @change-book="getData" @node-click="getData" />
</div> </div>
</el-menu> </el-menu>
<div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}"> <div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}">
<!-- 标题 --> <!-- 标题 -->
<el-row style="align-items: center; margin-bottom: 0px"> <el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
<el-col :span="12" style="padding-left: 20px; text-align: left;"> <el-col :span="12" style="padding-left: 20px; text-align: left;">
<div class="unit-top-left" @click="isCollapse = !isCollapse"> <div class="unit-top-left" @click="isCollapse = !isCollapse">
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i> <i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
@ -30,7 +30,7 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 作业类型:内容 --> <!-- 作业类型:内容 -->
<task-type-view :bookobj="courseObj" /> <task-type-view :bookobj="courseObj" :uniquekey="classWorkForm.uniquekey" style="flex: 1; overflow: hidden;"/>
</div> </div>
</div> </div>
</template> </template>
@ -116,9 +116,10 @@ const init = () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-resource { .page-newcalsetask {
padding-top: 10px; padding-top: 10px;
height: 100%; height: 100%;
overflow: hidden;
.el-menu--collapse { .el-menu--collapse {
width: 0px; width: 0px;

View File

@ -106,9 +106,9 @@ const menuList = [{
{ {
name: '作业设计', name: '作业设计',
icon: 'icon-jiaoxuefansi', icon: 'icon-jiaoxuefansi',
isOuter: true, // isOuter: true,
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' //path: '/teaching/classtaskassign?titleName=&openDialog=newClassTask'
//path: '/newClassTask' path: '/newClassTask'
//path: '/classTaskAssign' //path: '/classTaskAssign'
//isOuter: true, //isOuter: true,
//path: '/teaching/classtaskassign?titleName=&&openDialog=newClassTask' //path: '/teaching/classtaskassign?titleName=&&openDialog=newClassTask'