@@ -140,6 +145,7 @@ import { editListItem } from '@/hooks/useClassTask'
import MyQuestion from '@/views/classTask/newClassTaskAssign/myQuestion/index.vue'
import SchoolQuestion from '@/views/classTask/newClassTaskAssign/schoolQuestion/index.vue'
import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
+import ExperimentQuestion from "@/views/classTask/newClassTaskAssign/experimentQuestion/index.vue";
import whiteboard from '@/components/whiteboard/whiteboard.vue'
import FileUpload from "@/components/FileUpload/index.vue";
import Right from './Right/index.vue'
@@ -194,7 +200,7 @@ const fileLoading = ref(false); // 常规作业loading
onMounted(() => {
console.log("----onMounted-------")
- currentRow.value = {id:0};
+ currentRow.value.id = 0
if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj // 版本
@@ -229,7 +235,7 @@ const isInToMyQuestion = () => {
if(useClassTaskStores.isOpenQuestUploadView){
useClassTaskStores.isOpenQuestUploadView = false;
- currentRow.value = {id:1}; // 作业设计
+ currentRow.value.id = 1; // 作业设计
activeAptTab.value = "个人题库";
//提交内容清空 重置
classWorkForm.id = 0;
@@ -258,6 +264,16 @@ watch(() => props.currentCourse, (newVal, oldVal) => {
}
console.log(newVal,'newval');
},{deep:true})
+
+// ------------科学实验
+const getExpObj = (obj)=>{
+ // obj:{
+ // fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html"
+ // label: "数量比较"
+ // subject: "math"
+ // }
+ classWorkForm.fileHomeworkList = [obj];
+}
//---------作业设计---
const handleItemClick = (itemName) => {
console.log('itemName', itemName);
@@ -266,7 +282,7 @@ const handleItemClick = (itemName) => {
return;
}
- currentRow.value = {id:1}; // 作业设计
+ currentRow.value.id = 1; // 作业设计
/**
* 智能推荐?AI设计作业?
* 习题训练: 自主搜题 校本题库 个人题库
@@ -309,7 +325,7 @@ const initHomeWork = async()=> {
const handleNewAllClass = () => {
taskTable.value.setCurrentRow({});// 清除表格选中项背景色
- currentRow.value = {id:0}; // 作业设计
+ currentRow.value.id = 0; // 作业设计
//--------
classWorkForm.id = 0;
classWorkForm.uniquekey = ""; // 作业唯一标识 作业名称
@@ -336,7 +352,7 @@ const handleDelete =() => {
return delClasswork(ids.join(','));
}).then(() => {
taskTable.value.setCurrentRow({});// 清除表格选中项背景色
- currentRow.value = {id:0}; // 作业设计
+ currentRow.value.id = 0; // 作业设计
taskList.value = [];
// initHomeWork();
setTimeout(() => {
@@ -430,7 +446,7 @@ const handleCurrentChange = (val) => {
console.log(val,'???????????')
if(val && val.id >0 ) {
- currentRow.value = val;
+ currentRow.value.id = 1;
classWorkForm.worktype = val.worktype; //作业类型
editListItem(val, courseObj).then((obj) => {
if(obj){
@@ -582,6 +598,32 @@ const handleClassWorkFormQuizRemove = (index) =>{
fileLoading.value = false
}
}
+ else if(classWorkForm.worktype === "科学实验"){
+ if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
+ cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
+ cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
+ try {
+ console.log(cform,'科学实验')
+ addClassworkReturnId(cform).then((res) => {
+ ElMessage({ type: 'success', message: '作业设计成功!'});
+ // 重置提交表单
+ classWorkForm.worktype = "科学实验";
+ classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
+ classWorkForm.title = "";
+ classWorkForm.quizlist = [], // 作业习题列表内容
+
+ // 情况选择的资源缓存
+ classWorkForm.chooseWorkLists = []; // 框架梳理list
+ classWorkForm.whiteboardObj = ''; // ? // 清空白板
+ classWorkForm.fileHomeworkList = []; // 常规作业list
+ classWorkForm.id = res
+ emits('getData',classWorkForm)
+ // TODO 科学实验 待完善
+ })
+ } finally{
+ //
+ }
+ }
else {
// 正常新任务
var ll = [];
@@ -628,9 +670,9 @@ const handleClassWorkFormQuizRemove = (index) =>{
console.log('该清空左侧列表数据了');
// 清空左侧 选中的布置列表 并刷新列表
if(isShow.value){
- currentRow.value = {id:1};
+ currentRow.value.id = 1;
}else{
- currentRow.value = {id:0};
+ currentRow.value.id = 0;
}
initHomeWork();
@@ -667,7 +709,10 @@ const editWork = async (cform) =>{
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
- }else {
+ }else if( classWorkForm.worktype == '科学实验') {
+ if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!'});
+ }
+ else {
if (classWorkForm.chooseWorkLists.length == 0) {
// 框架梳理
ElMessage.error('请先添加作业资源!');
@@ -759,13 +804,21 @@ const editWork = async (cform) =>{
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
}
+ else if (classWorkForm.worktype=='科学实验') { //TODO 注意,fileHomeworkList字段与常规作业共用
+ // 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
+ cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
+ }
// 3.更新作业任务本身
let res = await updateClasswork(cform);
if (res.code == 200) {
ElMessage.success('更新成功');
// 清空左侧 选中的布置列表 并刷新列表
- currentRow.value = {id:0};
+ if(isShow.value){
+ currentRow.value.id = 1;
+ }else{
+ currentRow.value.id = 0;
+ }
initHomeWork();
// // 返回上一页
// router.back()
@@ -865,6 +918,11 @@ const editWork = async (cform) =>{
padding: 20px;
box-sizing: border-box;
}
+
+ .experiment-homework{
+ padding: 15px;
+ height: 100%;
+ }
}
.page-right {
overflow: hidden;
diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue
index 4bc6ebb..dd15098 100644
--- a/src/renderer/src/views/model/index.vue
+++ b/src/renderer/src/views/model/index.vue
@@ -98,10 +98,13 @@ import progressDialog from '@/views/teachingDesign/container/progress-dialog.vue
import msgUtils from "@/plugins/modal";
import * as commUtils from "@/utils/comm";
import * as Api_server from "@/api/apiService"; // 学科名字文生图
+import useClassTaskStore from '@/store/modules/classTask'
+
const router = useRouter()
const userStore = useUserStore().user // 用户信息
const currentNode = ref({})
const refs = ref([]);
+const classTaskStore = useClassTaskStore();
const collectRef = (key) => {
return (el) => {
@@ -513,7 +516,9 @@ const changeClass = async (type, row, other) => {
}
// 页面加载
-onMounted(() => {
+onMounted(async () => {
+ // 更新第三方题型题类
+ await classTaskStore.initJYInfo(userStore);
})
diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue
index 3413602..bd0b57b 100644
--- a/src/renderer/src/views/prepare/index.vue
+++ b/src/renderer/src/views/prepare/index.vue
@@ -195,7 +195,7 @@ import outLink from '@/utils/linkConfig'
import { createWindow, sessionStore, getAppInstallUrl, ipcMsgSend } from '@/utils/tool'
import { cloneDeep } from 'lodash'
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
-import { updateClasscourse } from '@/api/teaching/classcourse'
+import { updateClasscourse, getClasscourse } from '@/api/teaching/classcourse'
import { getClassInfo, getSelfReserv, endClass } from '@/api/classManage'
import { useGetHomework } from '@/hooks/useGetHomework'
import { editListItem } from '@/hooks/useClassTask'
@@ -390,12 +390,13 @@ export default {
if (res.code == 200) {
const resource = res.data
if (resource.filetype != 'aippt') this.$refs.calssRef.open(aptFileId, row)
- else {
+ else { // aippt 继续上课
if (!!sessionStore.get('curr.classcourse')) return ElMessage.warning('公屏已打开,请勿重复操作')
+ const { data:classcourse } = await getClasscourse(row.id) // 获取最新课堂信息
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
setTimeout(()=>{
msgEl.close()
- this.openPublicScreen('class', resource, row) // 打开公屏-窗口
+ this.openPublicScreen('class', resource, classcourse||row) // 打开公屏-窗口
}, 2000)
}
} else ElMessage.error(res.msg||'获取课件信息失败')