作业管理
This commit is contained in:
parent
9534622067
commit
5cbe56d1bf
|
@ -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'),
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue