[教学实践] - 优化教学活动中修改任务
This commit is contained in:
parent
6da745ced8
commit
c625fb5787
|
@ -15,7 +15,7 @@ const size = ref('default')
|
|||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
/* text-align: center; */
|
||||
color: #2c3e50;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -169,6 +169,10 @@ const emits = defineEmits(['getData'])
|
|||
// 这个代表的是是否从ppt里面添加的作业
|
||||
const isShow = ref(false)
|
||||
|
||||
const propsQueryTask = {
|
||||
id: route.query.classTaskId, // 需编辑的作业任务id
|
||||
isInit: false, // 是否已编辑
|
||||
}
|
||||
const propsQueryCourseObj = route.query.courseObj;//作业布置的内容对象
|
||||
const courseObj = reactive({
|
||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||
|
@ -198,7 +202,7 @@ const boardLoading = ref(false);
|
|||
const fileLoading = ref(false); // 常规作业loading
|
||||
|
||||
onMounted(() => {
|
||||
console.log("----onMounted-------")
|
||||
//console.log("----onMounted-------");
|
||||
currentRow.value.id = 0
|
||||
if(propsQueryCourseObj){
|
||||
if(JSON.parse(propsQueryCourseObj)){
|
||||
|
@ -319,6 +323,16 @@ const initHomeWork = async()=> {
|
|||
console.log('res', res);
|
||||
entpcourseid.value = chapterId;
|
||||
taskList.value = res;
|
||||
// 判断当前是否存在其他页面跳转编辑, 如果初次且存在id,则选中该任务
|
||||
const taskId = propsQueryTask?.id ?? 0;
|
||||
if (!propsQueryTask.isInit && taskId!=0){
|
||||
const activeRow = taskList.value.find(o => o.id == taskId);
|
||||
if (activeRow){
|
||||
propsQueryTask.isInit = true; // 清空避免重新保存后再次选中该任务
|
||||
taskTable.value.setCurrentRow(activeRow);
|
||||
handleCurrentChange(activeRow);
|
||||
}
|
||||
}
|
||||
tasklist_loading.value = false;
|
||||
}
|
||||
|
||||
|
@ -414,7 +428,6 @@ const successHomework = () => {
|
|||
initHomeWork();
|
||||
})
|
||||
}
|
||||
|
||||
// --------------------作业编辑
|
||||
let classWorkForm = reactive({
|
||||
id: '',// cloneDeep(props.propsformobj.id),
|
||||
|
@ -819,6 +832,7 @@ const editWork = async (cform) =>{
|
|||
if(isShow.value){
|
||||
currentRow.value.id = 1;
|
||||
}else{
|
||||
handleNewAllClass();
|
||||
currentRow.value.id = 0;
|
||||
}
|
||||
initHomeWork();
|
||||
|
|
|
@ -1027,7 +1027,7 @@ export default {
|
|||
goNewClassTask(){
|
||||
// router.push({ path: '/newClassTask' });
|
||||
this.$router.push({
|
||||
path: '/newClassTask',
|
||||
path: '/model/newClassTaskAssign',
|
||||
query: {
|
||||
isBack: true,
|
||||
}
|
||||
|
@ -1054,14 +1054,13 @@ export default {
|
|||
coursetitle: this.currentNode.itemtitle, // (单元/章节) 名称,
|
||||
node: this.currentNode, // 选择的课程节点
|
||||
}
|
||||
console.log('courseObj', courseObj)
|
||||
editListItem(row, courseObj).then((obj) => {
|
||||
if(obj){
|
||||
//前往作业设计
|
||||
this.$router.push({
|
||||
path: '/newClassTask',
|
||||
path: '/model/newClassTaskAssign',
|
||||
query: {
|
||||
classtaskObj: JSON.stringify(obj),
|
||||
classTaskId: parseInt(obj.id),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue