作业布置,模版编辑
This commit is contained in:
parent
e72710f027
commit
cc26ea4780
|
@ -454,6 +454,7 @@ const handleWorkEdit = (row, index) =>{
|
|||
// 作业内容编辑-跳转到设计界面-传参
|
||||
let classtaskObj = reactive({
|
||||
id: '', //
|
||||
bookName: '', // 课程名称
|
||||
uniquekey: '', // 设计中的标题
|
||||
title: '', // 设计中的说明
|
||||
worktype: '', // 设计中的作业类型
|
||||
|
@ -485,6 +486,7 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
|
||||
if (listCourseWork.length > 0) {
|
||||
classtaskObj.id= row.id; //
|
||||
classtaskObj.bookName = row.evaltitle? row.evalparenttitle+'/'+row.evaltitle: row.evalparenttitle// 课程名称:单元/章节: 单元
|
||||
classtaskObj.uniquekey= row.uniquekey; // 设计中的标题
|
||||
classtaskObj.title= row.title; // 设计中的说明
|
||||
classtaskObj.worktype= row.worktype; // 设计中的作业类型
|
||||
|
@ -527,7 +529,8 @@ const newHandleWorkEdit2ClassWorkQuizAdd =(row, index) =>{
|
|||
});
|
||||
|
||||
classtaskObj.quizlist = idres.rows;
|
||||
// 跳转作业设计 页面
|
||||
// 跳转 作业设计 进行编辑页面
|
||||
classtaskObj.bookObj = courseObj; // 教材对象
|
||||
router.push({
|
||||
path: '/newClassTask',
|
||||
query: {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<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>
|
||||
<el-radio :value="item" :disabled="props.isedit">{{ item }}</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
@ -279,6 +279,10 @@ const props = defineProps({
|
|||
propsformobj: {
|
||||
type: Object,
|
||||
default: () =>({})
|
||||
},
|
||||
isedit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -360,7 +364,7 @@ const workResource = reactive({
|
|||
}); // 作业资源
|
||||
let classWorkForm = reactive({
|
||||
id: cloneDeep(props.propsformobj.id),
|
||||
uniquekey: cloneDeep(props.propsformobj.uniquekey), // 作业唯一标识 作业名称
|
||||
uniquekey: props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):'', // 作业唯一标识 作业名称
|
||||
worktype: props.propsformobj.worktype?cloneDeep(props.propsformobj.worktype): '习题训练', //作业类型
|
||||
title: props.propsformobj.title?cloneDeep(props.propsformobj.title):'',// 作业说明
|
||||
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[] // 作业习题列表内容
|
||||
|
@ -902,6 +906,7 @@ const editWork = async (cform) =>{
|
|||
// //evalid = evalid, // 更新[作业范围]
|
||||
// }
|
||||
// let res = await updateClasswork(cform);
|
||||
// console.log('更新作业任务信息', cform);
|
||||
let res = await updateClasswork(cform);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('更新成功');
|
||||
|
@ -968,7 +973,12 @@ const editWork = async (cform) =>{
|
|||
onMounted(() => {
|
||||
})
|
||||
|
||||
|
||||
watch(() => props.propsformobj.uniquekey, (newVal) => {
|
||||
console.log(props.propsformobj,'propsformobj')
|
||||
if(props.propsformobj.uniquekey){
|
||||
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; // 作业唯一标识 作业名称
|
||||
}
|
||||
})
|
||||
watch(() => props.bookobj.levelSecondId, (newVal) => {
|
||||
console.log(props.bookobj,'课程选择')
|
||||
// 习题资源
|
||||
|
|
|
@ -15,11 +15,15 @@
|
|||
<!-- 标题 -->
|
||||
<el-row style="align-items: center; margin-bottom: 0px; flex: 0 0 auto">
|
||||
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
||||
<div class="unit-top-left" @click="isCollapse = !isCollapse">
|
||||
<div v-if="!isOpenLeftBook" class="unit-top-left" @click="onOpenLeftBook">
|
||||
<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>
|
||||
</div>
|
||||
<div v-else class="unit-top-left">
|
||||
<span>课程:</span>
|
||||
<span>{{bookTitle}}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="classtype-right">
|
||||
|
@ -30,13 +34,13 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<!-- 作业类型:内容 -->
|
||||
<task-type-view :bookobj="courseObj" :propsformobj="classWorkForm" style="flex: 1; overflow: hidden;"/>
|
||||
<task-type-view :bookobj="courseObj" :propsformobj="classWorkForm" :isedit="isOpenLeftBook" style="flex: 1; overflow: hidden;"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
import { onMounted, ref, toRaw,watch, reactive, getCurrentInstance } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
|
@ -45,8 +49,12 @@ import { getCurrentTime } from '@/utils/date'
|
|||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const classtaskObj = route.query.classtaskObj;//作业布置的内容对象
|
||||
const bookTitle = ref(classtaskObj? JSON.parse(classtaskObj).bookName: '');// 课程名称
|
||||
const isOpenLeftBook = ref(classtaskObj? JSON.parse(classtaskObj).id ? true : false: false ); // 是否打开左侧目录
|
||||
const isCollapse = ref(isOpenLeftBook.value?true:false); // 是否展开左侧目录: false 默认展开,编辑状态关闭
|
||||
// ---------------------------------------------------
|
||||
const classWorkForm = reactive({
|
||||
id: classtaskObj? JSON.parse(classtaskObj).id : '', // 设计中的id
|
||||
|
@ -56,7 +64,6 @@ const classWorkForm = reactive({
|
|||
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], // 设计中的试题列表
|
||||
})
|
||||
|
||||
const isCollapse = ref(false)
|
||||
|
||||
const courseObj = reactive({
|
||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||
|
@ -67,7 +74,6 @@ const courseObj = reactive({
|
|||
node: null, // 选择的课程节点
|
||||
//
|
||||
})
|
||||
|
||||
// ---------------------------------------------------
|
||||
|
||||
|
||||
|
@ -94,16 +100,28 @@ const getData = (data) => {
|
|||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
}
|
||||
|
||||
const onOpenLeftBook = () => {
|
||||
if(isOpenLeftBook.value){
|
||||
// 编辑状态
|
||||
proxy.$modal.msgError(`当前为编辑状态不可选择课程!`);
|
||||
}else{
|
||||
// 新增状态
|
||||
isCollapse.value = !isCollapse.value
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// init()
|
||||
// sourceStore.getCreate()
|
||||
// 编辑状态下……更新课程信息
|
||||
if(classtaskObj&&JSON.parse(classtaskObj).bookObj){
|
||||
const bookobj = JSON.parse(classtaskObj).bookObj;
|
||||
courseObj.textbookId = bookobj.bookObj // 版本
|
||||
courseObj.levelFirstId = bookobj.levelFirstId // 单元
|
||||
courseObj.levelSecondId = bookobj.levelSecondId // 章节
|
||||
courseObj.coursetitle = bookobj.node.itemtitle // (单元/章节) 名称
|
||||
courseObj.node = bookobj.node; // 保存当前节点
|
||||
}
|
||||
})
|
||||
|
||||
// const init = () => {
|
||||
// classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
|
||||
|
||||
// }
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue