作业管理

This commit is contained in:
白了个白 2024-11-20 15:30:18 +08:00
parent 9534622067
commit 5cbe56d1bf
5 changed files with 100 additions and 56 deletions

View File

@ -81,6 +81,18 @@ export const constantRoutes = [
// },
// ]
},
{
path: 'newClassTaskAssign',
component: () => import('@/views/classTask/newClassTaskAssign/index.vue'),
name: 'newClassTaskAssign',
meta: { title: '作业管理' }
},
{
path: 'questionUpload',
component: () => import('@/views/classTask/newClassTaskAssign/questionUpload/index.vue'),
name: 'questionUpload',
meta: { title: '习题上传' }
},
]
},
@ -136,18 +148,6 @@ const dynamicRoutes = [
name: 'classTaskAssign',
meta: { title: '作业布置', showBread: true }
},
{
path: 'newClassTaskAssign',
component: () => import('@/views/classTask/newClassTaskAssign/index.vue'),
name: 'newClassTaskAssign',
meta: { title: '新作业管理', showBread: true }
},
{
path: 'questionUpload',
component: () => import('@/views/classTask/newClassTaskAssign/questionUpload/index.vue'),
name: 'questionUpload',
meta: { title: '新作业管理', showBread: true }
},
{
path: 'classTask',
component: () => import('@/views/classTask/classTask.vue'),

View File

@ -16,7 +16,6 @@
<!-- <i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i> -->
<span>作业设计</span>
<!-- <i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i> -->
<el-button type="primary" @click="goToNewClassTaskAssign">新版作业管理</el-button>
</div>
<div v-else class="unit-top-left">
<i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i>
@ -81,9 +80,6 @@ const courseObj = reactive({
})
// ---------------------------------------------------
const goToNewClassTaskAssign = () => {
router.push({ path: '/newClassTaskAssign', query: { courseObj: JSON.stringify(courseObj)} });
}
//
const getData = (data) => {

View File

@ -196,7 +196,7 @@ onMounted(() => {
})
const goToQuestUpload = () => {
router.push({ path: '/questionUpload', query: { courseObj: JSON.stringify(props.bookobj) } });
router.push({ path: '/model/questionUpload', query: { courseObj: JSON.stringify(props.bookobj) } });
}
const initPageParams = () => {

View File

@ -36,7 +36,7 @@
<el-input v-model="questForm.worktag" placeholder="请输入题源详情" style="width:50%"></el-input>
</el-form-item>
<el-form-item label="单元章节" prop="evalidArr">
<!-- <el-form-item label="单元章节" prop="evalidArr">
<el-cascader
v-model="questForm.evalidArr"
:options="curLessionList"
@ -45,7 +45,7 @@
@change="onchange"
style="width:90%"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="知识点" prop="knowledgePointIdArr">
<el-cascader
@ -541,7 +541,8 @@ const questForm = reactive({
worktag: '',
workgroup: 0,
checkAnswer: [],
evalidArr: props.evalidArr,
// evalidArr: props.evalidArr,
evalidArr: '',
knowledgePointIdArr: [],
timelength: 60,
workanswer: '',
@ -628,7 +629,7 @@ const MainRules = reactive({
workgroup: [{ required: true, message: "题源不能为空", trigger: "blur" }],
worktag: [{ required: true, message: "题源详情不能为空", trigger: "blur" }],
evalidArr: [{ required: true, message: "单元课目不能为空", trigger: "blur" }],
// evalidArr: [{ required: true, message: "", trigger: "blur" }],
//knowledgePointIdArr: [{ required: true, message: "", trigger: "blur" }],
timelength: [{ required: true, message: "完成时长不能为空", trigger: "blur" }],
@ -735,7 +736,8 @@ const reset = () =>{
workgroup: 0,
worktag: '',
checkAnswer: [],
evalidArr: props.evalidArr,
// evalidArr: props.evalidArr,
evalidArr: '',
timelength: 60,
workanswer: '',
analyse: '',
@ -1078,7 +1080,8 @@ const updateForm= async(item, submitIndex=0, submitType=1) =>{
worktag: tag,
workgroup: parseInt(item.workgroup),
checkAnswer: selList,
evalidArr: props.evalidArr,
// evalidArr: props.evalidArr,
evalidArr: '',
knowledgePointIdArr: knowledgePointIdArr,
timelength: 60,
workanswer: item.workanswer,
@ -1349,23 +1352,30 @@ const submitForm=(formName) =>{
// }
const newWorktag = `${questForm.worktagYear}${questForm.worktag}`;
// [id](workKey)
let workKey = questForm.evalidArr[0][0].toString();
//-------------------------
// web
// // [id](workKey)
// let workKey = questForm.evalidArr[0][0].toString();
// let workKey = '';
// []
let len = questForm.evalidArr[0].length;
let evalid = questForm.evalidArr[0][len-1];
// []
let evalids = '';
questForm.evalidArr.forEach(element => {
let len = element.length;
evalids += `${element[len-1]},`;
});
evalids = evalids.slice(0, -1);
// let len = questForm.evalidArr[0].length;
// let evalid = questForm.evalidArr[0][len-1];
// // []
// let evalids = '';
// questForm.evalidArr.forEach(element => {
// let len = element.length;
// evalids += `${element[len-1]},`;
// });
// evalids = evalids.slice(0, -1);
// [id](workKey)
let workKey = props.bookobj.textbookId; // ? id textbookId
let evalids = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId ;
// let workKey = '';
// let evalid = '123456';
// let evalids = '123456'
//----------------------end-------
// []
let knowledgePoint = '';
@ -1400,7 +1410,7 @@ const submitForm=(formName) =>{
entpid: userStore.deptId,
entpcourseid: 0,
workgroup: questForm.workgroup, // 1: 0
evalid: evalid, // ID
evalid: evalids, // ID
evalids: evalids, // ID
evalnodeid: knowledgePoint, // ID()
worktype: workType, //
@ -1584,29 +1594,27 @@ const submitForm=(formName) =>{
}
console.log('param', param);
if(questForm.id == 0){
//
const res = await addEntpcoursework(param);
param.id = res;
console.log("单题上传", res)
proxy.$modal.msgSuccess("单题上传成功");
// dlgSingleAdd.open = false;
// getList();
}else{
//
const res = updateEntpcoursework(param);
proxy.$modal.msgSuccess("单题修改成功");
}
// TODO
// if(questForm.id == 0){
// //
// const res = await addEntpcoursework(param);
// param.id = res;
// console.log("", res)
// proxy.$modal.msgSuccess("");
// }else{
// //
// const res = updateEntpcoursework(param);
// proxy.$modal.msgSuccess("");
// }
// (form, []param)
param.submitIndex = questForm.submitIndex;
param.submitType = questForm.submitType;
emit('submit-exam-single-callback', param);
// param.submitIndex = questForm.submitIndex;
// param.submitType = questForm.submitType;
// emit('submit-exam-single-callback', param);
// form
proxy.reset();
proxy.resetForm("questFormRef");
// return;
// proxy.reset();
// proxy.resetForm("questFormRef");
} else {
myMessageShow('失败', '单题上传参数有误', 'error');
return;

View File

@ -2,7 +2,8 @@
<div>
<div class="mb-4">
<el-button type="primary" @click="onchange('/model/curriculum')">课标研读</el-button>
<el-button type="primary" @click="onchange('/model/management')">作业管理</el-button>
<!-- <el-button type="primary" @click="onchange('/model/management')">作业管理</el-button> -->
<el-button type="primary" @click="onchange('/model/newClassTaskAssign')">作业管理</el-button>
<el-button type="success" @click="onchange('/model/teaching')">教材研读</el-button>
<el-button type="success" @click="openPPTist">打开PPTist</el-button>
<!-- <el-button type="info" @click="onchange('/model/examination')">考试分析</el-button> -->
@ -12,18 +13,57 @@
</template>
<script setup>
import { onMounted, ref, watch, reactive } from 'vue'
import { useRouter } from 'vue-router'
import { createWindow } from '@/utils/tool' //
import ChooseTextbook from '@/components/choose-textbook/index.vue'
const router = useRouter()
const courseObj = reactive({
// : id,id,id,
textbookId: '',
levelFirstId: '',
levelSecondId: '',
coursetitle:'',
node: null, //
//
})
//
const getData = (data) => {
const { textBook, node } = data
let textbookId = textBook.curBookId
let levelSecondId = node.id
let levelFirstId
if (node.parentNode) {
levelFirstId = node.parentNode.id
} else {
levelFirstId = node.id
levelSecondId = ''
}
courseObj.textbookId = textbookId //
courseObj.levelFirstId = levelFirstId //
courseObj.levelSecondId = levelSecondId //
courseObj.coursetitle = node.itemtitle // (/)
courseObj.node = node; //
// ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
}
const openPPTist = () =>{
createWindow('open-win', {url: '/pptist'})
}
const onchange = (path) =>{
router.push(path)
if(path == '/model/newClassTaskAssign'){
//
router.push({path, query: { courseObj: JSON.stringify(courseObj)}})
}else{
router.push(path)
}
}
</script>