作业管理

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', name: 'classTaskAssign',
meta: { title: '作业布置', showBread: true } 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', path: 'classTask',
component: () => import('@/views/classTask/classTask.vue'), component: () => import('@/views/classTask/classTask.vue'),

View File

@ -16,7 +16,6 @@
<!-- <i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i> --> <!-- <i v-if="!isCollapse" class="iconfont icon-xiangzuo" style="color: blue;"></i> -->
<span>作业设计</span> <span>作业设计</span>
<!-- <i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i> --> <!-- <i v-if="isCollapse" class="iconfont icon-xiangyou" style="color: blue;"></i> -->
<el-button type="primary" @click="goToNewClassTaskAssign">新版作业管理</el-button>
</div> </div>
<div v-else class="unit-top-left"> <div v-else class="unit-top-left">
<i class="iconfont icon-xiangzuo cursor-pointer" style="color: blue;" @click="goBack">返回上页</i> <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) => { const getData = (data) => {

View File

@ -196,7 +196,7 @@ onMounted(() => {
}) })
const goToQuestUpload = () => { 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 = () => { const initPageParams = () => {

View File

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

View File

@ -2,7 +2,8 @@
<div> <div>
<div class="mb-4"> <div class="mb-4">
<el-button type="primary" @click="onchange('/model/curriculum')">课标研读</el-button> <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="onchange('/model/teaching')">教材研读</el-button>
<el-button type="success" @click="openPPTist">打开PPTist</el-button> <el-button type="success" @click="openPPTist">打开PPTist</el-button>
<!-- <el-button type="info" @click="onchange('/model/examination')">考试分析</el-button> --> <!-- <el-button type="info" @click="onchange('/model/examination')">考试分析</el-button> -->
@ -12,18 +13,57 @@
</template> </template>
<script setup> <script setup>
import { onMounted, ref, watch, reactive } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { createWindow } from '@/utils/tool' // import { createWindow } from '@/utils/tool' //
import ChooseTextbook from '@/components/choose-textbook/index.vue' import ChooseTextbook from '@/components/choose-textbook/index.vue'
const router = useRouter() 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 = () =>{ const openPPTist = () =>{
createWindow('open-win', {url: '/pptist'}) createWindow('open-win', {url: '/pptist'})
} }
const onchange = (path) =>{ const onchange = (path) =>{
router.push(path) if(path == '/model/newClassTaskAssign'){
//
router.push({path, query: { courseObj: JSON.stringify(courseObj)}})
}else{
router.push(path)
}
} }
</script> </script>