|
|
|
@ -1,111 +1,121 @@
|
|
|
|
|
<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;">
|
|
|
|
|
<div class="page-typeview">
|
|
|
|
|
<el-form ref="classWorkFormRef" :model="classWorkForm" label-width="90" style=" height: 100%;overflow: hidden;">
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
<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 class="container">
|
|
|
|
|
<!-- 作业类型 -->
|
|
|
|
|
<el-row class="top">
|
|
|
|
|
<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-row>
|
|
|
|
|
<!-- 作业资源 -->
|
|
|
|
|
<el-row class="middle">
|
|
|
|
|
<el-col :span="24" style="height: 100%; overflow: hidden;">
|
|
|
|
|
<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;">
|
|
|
|
|
<!-- 习题筛选1 -->
|
|
|
|
|
<el-row :gutter="10" class="top">
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 习题筛选2 -->
|
|
|
|
|
<el-row :gutter="10" style="margin-top: 4px" class="top">
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 习题表格 -->
|
|
|
|
|
<div class="middle" >
|
|
|
|
|
<el-table :data="workResource.entpCourseWorkList" style="width: 100%; height: 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>
|
|
|
|
|
<!-- 分页 这里不用-->
|
|
|
|
|
<!-- <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 v-if="classWorkForm.worktype!='习题训练'">
|
|
|
|
|
<div :style="{ 'overflow': 'auto'}">
|
|
|
|
|
<!-- <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;">
|
|
|
|
@ -135,116 +145,140 @@
|
|
|
|
|
</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 >
|
|
|
|
|
<!-- <div v-if="classWorkForm.activeIndex==3">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="20">
|
|
|
|
|
<el-form-item label="查找筛选条件">
|
|
|
|
|
本节课、本单元,其他单元
|
|
|
|
|
</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>
|
|
|
|
|
</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>
|
|
|
|
|
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
|
|
|
|
|
<el-button @click="deleteClassWorkAddOfResource(item)" type="danger" icon="Delete">删除</el-button>
|
|
|
|
|
</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>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<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-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>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<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 { getCurrentTime } from '@/utils/date'
|
|
|
|
|
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'
|
|
|
|
|
const userStore = useUserStore().user
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
bookobj: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: () => ({})
|
|
|
|
|
},
|
|
|
|
|
uniquekey: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -253,7 +287,9 @@ const toolStore = useToolState()
|
|
|
|
|
const openDialog = () => {
|
|
|
|
|
isDialogOpen.value = true
|
|
|
|
|
}
|
|
|
|
|
const classWorkFormRef = ref(null);
|
|
|
|
|
const formType = ref('习题训练')
|
|
|
|
|
const newWorkSpaceEdit = ref(false); //修改学习任务
|
|
|
|
|
// ---------------------------------------------------
|
|
|
|
|
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
|
|
|
|
|
|
|
|
@ -318,15 +354,15 @@ const workResource = reactive({
|
|
|
|
|
quiztype: '',
|
|
|
|
|
queryForm: {},
|
|
|
|
|
classWorkList: [], // 教学分析里产生的学习任务
|
|
|
|
|
entpCourseWorkList: [],
|
|
|
|
|
entpCourseWorkList: [], // 习题列表
|
|
|
|
|
entpCourseWorkTotal: 0, // 习题总数
|
|
|
|
|
}); // 作业资源
|
|
|
|
|
const classWorkForm = reactive({
|
|
|
|
|
let classWorkForm = reactive({
|
|
|
|
|
uniquekey: props.uniquekey, // 作业唯一标识 作业名称
|
|
|
|
|
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) => {
|
|
|
|
|
console.log(val)
|
|
|
|
|
classWorkForm.value.worktype = val;
|
|
|
|
|
classWorkForm.worktype = val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const queryForm = reactive({
|
|
|
|
@ -372,7 +408,7 @@ const queryForm = reactive({
|
|
|
|
|
* 1 - 按条件查询
|
|
|
|
|
* 2 - 按关键词查询
|
|
|
|
|
*/
|
|
|
|
|
const handleQueryFromEntpCourseWork= (queryType) => {
|
|
|
|
|
const handleQueryFromEntpCourseWork= (queryType) => {
|
|
|
|
|
//queryForm.pageNum = this.paginationParams.pageNum;
|
|
|
|
|
//queryForm.pageSize = this.paginationParams.pageSize;
|
|
|
|
|
|
|
|
|
@ -382,8 +418,6 @@ const queryForm = reactive({
|
|
|
|
|
// queryForm.edusubject = '道德与法治';
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(queryForm)
|
|
|
|
|
listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
|
|
|
|
|
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') {
|
|
|
|
|
// // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】
|
|
|
|
@ -394,57 +428,462 @@ const queryForm = reactive({
|
|
|
|
|
// } 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);
|
|
|
|
|
if(entpcourseworkres.data&&entpcourseworkres.data.length>0){
|
|
|
|
|
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.先查询该workid下所有的id
|
|
|
|
|
let arrEvalids = [];
|
|
|
|
|
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
|
|
|
|
|
wevalres.rows.forEach(element => {
|
|
|
|
|
arrEvalids.push(element.id);
|
|
|
|
|
});
|
|
|
|
|
const ids = arrEvalids.join(',');
|
|
|
|
|
|
|
|
|
|
// 2.2.删除原作业
|
|
|
|
|
const delRes = await delClassworkeval(ids);
|
|
|
|
|
|
|
|
|
|
// 2.3.重新添加新作业
|
|
|
|
|
for(let i=0; i<this.classWorkForm.quizlist.length; i++){
|
|
|
|
|
const addRes = await addClassworkeval({
|
|
|
|
|
'workid': this.currentTask.id,
|
|
|
|
|
'entpcourseworkid': this.classWorkForm.quizlist[i].id,
|
|
|
|
|
'workdataid': 0,
|
|
|
|
|
'score': this.classWorkForm.quizlist[i].score}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 3.更新作业任务信息
|
|
|
|
|
// const evalid = this.homeworkLesson.length==0 ? '' : this.homeworkLesson.length==1 ? this.homeworkLesson[0] : this.homeworkLesson[1];
|
|
|
|
|
// const formObj = {
|
|
|
|
|
// id: this.currentTask.id,
|
|
|
|
|
// uniquekey: this.classWorkForm.uniquekey, // 更新[作业名称]
|
|
|
|
|
// // warn: 这里需确认是否可支持修改当前作业任务更换单元章节
|
|
|
|
|
// //evalid = evalid, // 更新[作业范围]
|
|
|
|
|
// }
|
|
|
|
|
// let res = await updateClasswork(formObj);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (this.currentTag=='框架梳理') {
|
|
|
|
|
// 1.先查询该workid下所有的id
|
|
|
|
|
const wevalres = await listClassworkeval({'workid': this.currentTask.id});
|
|
|
|
|
if (wevalres.rows.length == 0) {
|
|
|
|
|
ElMessage.error('未找到原框架梳理任务,请或退出重试');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2.更新作业任务下的框架梳理
|
|
|
|
|
let needUplEval = false;
|
|
|
|
|
if (this.chooseWorkLists.length !== this.currentTask.entpcourseworklistarray.length) {
|
|
|
|
|
needUplEval = true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// 只要有一个不一致则说明需要更新
|
|
|
|
|
needUplEval = this.chooseWorkLists.some(cur =>
|
|
|
|
|
!this.currentTask.entpcourseworklistarray.some(last =>
|
|
|
|
|
last.id === cur.id && last.score === cur.score
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (needUplEval) {
|
|
|
|
|
const uplParams = {
|
|
|
|
|
id: wevalres.rows[0].id,
|
|
|
|
|
entpcourseworkid: this.chooseWorkLists[0].id,
|
|
|
|
|
score: this.chooseWorkLists[0].score,
|
|
|
|
|
}
|
|
|
|
|
let res = await updateClassworkeval(uplParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (this.currentTag=='课堂展示') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (this.currentTag=='常规作业') {
|
|
|
|
|
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
|
|
|
|
classWorkParams.workcodes = JSON.stringify(this.fileHomeworkList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 3.更新作业任务本身
|
|
|
|
|
let res = await updateClasswork(classWorkParams);
|
|
|
|
|
this.fileHomeworkList = [];
|
|
|
|
|
this.chooseWorkLists = [];
|
|
|
|
|
|
|
|
|
|
// 4.操作完成后重新更新表单数据
|
|
|
|
|
this.getClassWorkAllList();
|
|
|
|
|
|
|
|
|
|
this.classWorkForm.worktype = "习题训练";
|
|
|
|
|
this.newWorkSpace = false;
|
|
|
|
|
this.newWorkSpaceEdit = false;
|
|
|
|
|
this.workEdit = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { res, chapterId } = await useGetHomework(this.currentNode)
|
|
|
|
|
// this.entpcourseid = chapterId
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (classWorkForm.worktype === "课堂展示") {
|
|
|
|
|
this.boardLoading = true
|
|
|
|
|
let canvasJson = this.$refs.boardref.getCanvasJson()
|
|
|
|
|
let canvasBase64 = await this.$refs.boardref.getCanvasBase64()
|
|
|
|
|
var formObj = {};
|
|
|
|
|
formObj.id = 0;
|
|
|
|
|
formObj.workdate = this.classWorkForm.workdate;
|
|
|
|
|
formObj.deaddate = '';
|
|
|
|
|
formObj.entpid = this.userStore.deptId;
|
|
|
|
|
formObj.level = 1;
|
|
|
|
|
formObj.parentid = 0;
|
|
|
|
|
formObj.worktype = this.classWorkForm.worktype;
|
|
|
|
|
formObj.workkey = '';
|
|
|
|
|
formObj.worktag = this.question;
|
|
|
|
|
formObj.uniquekey = this.classWorkForm.uniquekey;
|
|
|
|
|
formObj.classid = 0;
|
|
|
|
|
formObj.classcourseid = 0;
|
|
|
|
|
formObj.entpcourseid = this.courseObj.id;
|
|
|
|
|
formObj.slideid = 0;
|
|
|
|
|
formObj.title = this.classWorkForm.title;
|
|
|
|
|
formObj.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
|
|
|
|
formObj.edusubject = this.courseObj.edusubject;
|
|
|
|
|
formObj.evalid = this.courseObj.evalid;
|
|
|
|
|
formObj.edustage = this.userStore.edustage;
|
|
|
|
|
formObj.status = '10'; //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
|
|
|
|
formObj.edituserid = this.userStore.id;
|
|
|
|
|
formObj.entpcourseworklist = JSON.stringify([{'id':-1, 'score': '10'}]);
|
|
|
|
|
try {
|
|
|
|
|
addClassworkReturnId(formObj).then(() => {
|
|
|
|
|
this.classWorkForm.worktype = "习题训练";
|
|
|
|
|
this.chooseWorkLists = [];
|
|
|
|
|
this.whiteboardObj = '';
|
|
|
|
|
// refresh the list
|
|
|
|
|
this.getClassWorkAllList();
|
|
|
|
|
this.newWorkSpace = false;
|
|
|
|
|
this.newWorkSpaceEdit = false;
|
|
|
|
|
this.workEdit = false;
|
|
|
|
|
})
|
|
|
|
|
} finally {
|
|
|
|
|
this.boardLoading = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(classWorkForm.worktype === "常规作业"){
|
|
|
|
|
this.fileLoading = true
|
|
|
|
|
var formObj = {};
|
|
|
|
|
formObj.id = 0;
|
|
|
|
|
formObj.workdate = this.classWorkForm.workdate;
|
|
|
|
|
formObj.deaddate = '';
|
|
|
|
|
formObj.entpid = this.userStore.deptId;
|
|
|
|
|
formObj.level = 1;
|
|
|
|
|
formObj.parentid = 0;
|
|
|
|
|
formObj.worktype = this.classWorkForm.worktype;
|
|
|
|
|
formObj.workkey = '';
|
|
|
|
|
formObj.worktag = '';
|
|
|
|
|
formObj.uniquekey = this.classWorkForm.uniquekey;
|
|
|
|
|
formObj.classid = 0;
|
|
|
|
|
formObj.classcourseid = 0;
|
|
|
|
|
formObj.entpcourseid = this.courseObj.id;
|
|
|
|
|
formObj.slideid = 0;
|
|
|
|
|
formObj.title = this.classWorkForm.title;
|
|
|
|
|
formObj.workcodes = JSON.stringify(this.fileHomeworkList);
|
|
|
|
|
formObj.edusubject = this.courseObj.edusubject;
|
|
|
|
|
formObj.evalid = this.courseObj.evalid;
|
|
|
|
|
formObj.edustage = this.userStore.edustage;
|
|
|
|
|
formObj.status = '10'; //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
|
|
|
|
formObj.edituserid = this.userStore.id;
|
|
|
|
|
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
|
|
|
|
try {
|
|
|
|
|
addClassworkReturnId(formObj).then(() => {
|
|
|
|
|
this.classWorkForm.worktype = "习题训练";
|
|
|
|
|
this.chooseWorkLists = [];
|
|
|
|
|
this.fileHomeworkList = []
|
|
|
|
|
this.whiteboardObj = '';
|
|
|
|
|
// refresh the list
|
|
|
|
|
this.getClassWorkAllList();
|
|
|
|
|
this.newWorkSpace = false;
|
|
|
|
|
this.newWorkSpaceEdit = false;
|
|
|
|
|
this.workEdit = false;
|
|
|
|
|
})
|
|
|
|
|
} finally {
|
|
|
|
|
this.fileLoading = false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// 正常新任务
|
|
|
|
|
var ll = [];
|
|
|
|
|
if (classWorkForm.worktype === "习题训练") {
|
|
|
|
|
for (var i=0; i< classWorkForm.quizlist.length; i++) {
|
|
|
|
|
// 更新 题目分值
|
|
|
|
|
ll.push({'id': classWorkForm.quizlist[i].id, 'score': classWorkForm.quizlist[i].score});
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
// TODO 待定 非习题训练------------
|
|
|
|
|
// this.chooseWorkLists.filter((item, index) => {
|
|
|
|
|
// if (item.worktype === this.classWorkForm.worktype) {
|
|
|
|
|
// ll.push({'id':item.id, 'score': item.score});
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
console.log(userStore,'userStoreuserStoreuserStore')
|
|
|
|
|
const cform = {
|
|
|
|
|
id: 0,
|
|
|
|
|
workdate: classWorkForm.workdate, // //作业类型
|
|
|
|
|
deaddate: '', // 截止时间
|
|
|
|
|
entpid: userStore.deptId, //
|
|
|
|
|
level: 1,
|
|
|
|
|
parentid: 0,
|
|
|
|
|
worktype: classWorkForm.worktype, // 作业类型
|
|
|
|
|
workkey: '',
|
|
|
|
|
worktag: '',
|
|
|
|
|
uniquekey: classWorkForm.uniquekey,// 作业名称、编码
|
|
|
|
|
classid: 0,
|
|
|
|
|
classcourseid: 0,
|
|
|
|
|
entpcourseid: chapterId, // 当前课程
|
|
|
|
|
slideid: 0,
|
|
|
|
|
title: classWorkForm.title, // 作业说明?
|
|
|
|
|
workcodes: JSON.stringify(classWorkForm.workcodes), // 作业内容?
|
|
|
|
|
edusubject: userStore.edusubject, // 学科 语文 数学
|
|
|
|
|
evalid: props.bookobj.levelSecondId, //userStore.evalid, // // 单元下的课ID
|
|
|
|
|
edustage: userStore.edustage, // 学段 年纪 高中,初中,小学
|
|
|
|
|
status: '10', //2024-09-11 作业布置分离后的 新模版数据; 之前老版本为空
|
|
|
|
|
edituserid: userStore.userId, // 当前用户id
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (ll.length > 0) {
|
|
|
|
|
cform.entpcourseworklist = JSON.stringify(ll);
|
|
|
|
|
} else {
|
|
|
|
|
cform.entpcourseworklist = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(cform.entpcourseworklist == '') return ElMessage({ type: 'warning', message: '请先添加作业资源!'});
|
|
|
|
|
console.log(cform,'提交的数据');
|
|
|
|
|
// addClassworkReturnId(cform).then(workres => {
|
|
|
|
|
// this.classWorkForm.worktype = "习题训练";
|
|
|
|
|
// this.chooseWorkLists = [];
|
|
|
|
|
// this.whiteboardObj = '';
|
|
|
|
|
// // refresh the list
|
|
|
|
|
// this.getClassWorkAllList();
|
|
|
|
|
|
|
|
|
|
// // 此方法此处不再使用 240603
|
|
|
|
|
// // var slist = [];
|
|
|
|
|
// // for (var i=0; i<this.classStudentList.length; i++) {
|
|
|
|
|
// // slist.push({studentid: this.classStudentList[i].studentid, name: this.classStudentList[i].name});
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
|
|
// // var quizll = [];
|
|
|
|
|
// // for (var i=0; i<this.classWorkForm.quizlist.length; i++) {
|
|
|
|
|
// // quizll.push({id: this.classWorkForm.quizlist[i].id});
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
|
|
// // var ttt = {
|
|
|
|
|
// // id: workres,
|
|
|
|
|
// // studentlist: slist,
|
|
|
|
|
// // entpcourseworklist: quizll
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
|
|
// // var wForm = {};
|
|
|
|
|
// // wForm.classworkarray = '['+JSON.stringify(ttt)+']';
|
|
|
|
|
|
|
|
|
|
// //pushClassWorkByArray(wForm).then(response => {});
|
|
|
|
|
|
|
|
|
|
// this.newWorkSpace = false;
|
|
|
|
|
// this.newWorkSpaceEdit = false;
|
|
|
|
|
// this.workEdit = false;
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
handleQueryFromEntpCourseWork(0);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// watch(() => sourceStore.query.fileSource,() => {
|
|
|
|
|
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
|
|
|
|
// })
|
|
|
|
|
watch(() => props.bookobj.levelSecondId, (newVal) => {
|
|
|
|
|
console.log(props.bookobj,'课程选择')
|
|
|
|
|
queryForm.eid = props.bookobj.levelSecondId,
|
|
|
|
|
queryForm.sectionName = props.bookobj.coursetitle,
|
|
|
|
|
handleQueryFromEntpCourseWork(0);
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-typeview{
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
// padding-top: 10px;
|
|
|
|
|
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{
|
|
|
|
|
height: 100%;
|
|
|
|
|
margin-bottom: 0px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
:deep(.el-form-item__content){
|
|
|
|
|
align-items: normal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.work-left{
|
|
|
|
|
height: 50vh;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-color: white;
|
|
|
|
|
padding-right: 0;
|
|
|
|
|
padding-left: 0;
|
|
|
|
|
border:1px dotted blue;
|
|
|
|
|
border-radius:5px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.work-right {
|
|
|
|
|
height: 100%;
|
|
|
|
|
padding: 0 0 0 5px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
line-height: 26px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|