diff --git a/package.json b/package.json index 0f89d82..e8adfd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.6", + "version": "2.5.7", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", diff --git a/src/renderer/index.html b/src/renderer/index.html index 8bb269e..6e072ed 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue index 0354fba..9f36ccc 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -25,6 +25,12 @@
常规作业
+ +
+ +
科学实验
+
+
@@ -157,6 +163,10 @@ const type = ref([ { label: '框架梳理', value: 'primary' + }, + { + label: '科学实验', + value: 'primary' } ]) diff --git a/src/renderer/src/api/aiGeneratedImage/index.js b/src/renderer/src/api/aiGeneratedImage/index.js index 9939c5d..3225b30 100644 --- a/src/renderer/src/api/aiGeneratedImage/index.js +++ b/src/renderer/src/api/aiGeneratedImage/index.js @@ -68,7 +68,7 @@ export function textSensitiveWord(data) { // 图片上传资源库 export function uploadPicture(data) { return axios({ - url: '/dev-api/smarttalk/file/upload', + url: import.meta.env.VITE_APP_BASE_API + '/smarttalk/file/upload', method: 'post', headers: { 'Accept': '*/*', diff --git a/src/renderer/src/components/grid-pic/index.vue b/src/renderer/src/components/grid-pic/index.vue index 4769a98..9725af6 100644 --- a/src/renderer/src/components/grid-pic/index.vue +++ b/src/renderer/src/components/grid-pic/index.vue @@ -1,3 +1,16 @@ + - - - 添加 - - - 画笔 - - @@ -26,10 +44,18 @@ import {ref, computed, onMounted} from 'vue' import Draggable from 'vuedraggable' import ViewerItem from "./viewer-item.vue"; - import Fabric from 'fabric'; + // import Fabric from 'fabric'; const gridPicList = ref([]) const inputValue = ref('') const isShow = ref(false) + const emits = defineEmits(['clear','outIndex']); + + const props = defineProps({ + showToolbar: { + type: Boolean, + default: true + } + }) // 获取图片样式 const getWH = (item,index)=>{ return { @@ -118,13 +144,19 @@ } }) + const pushPic = () => { + let src = inputValue.value||picList[gridPicList.value.length] + addPic(src) + } // 添加图片 - const addPic = () => { + const addPic = (src) => { if (gridPicList.value.length >= 9) { + console.log("超出九个图片") + emits('outIndex') return } - let src = inputValue.value||picList[gridPicList.value.length] if (!src) { + console.log("图片链接不能为空") return; } gridPicList.value.push({ @@ -133,6 +165,11 @@ }) inputValue.value = '' } + // 清空图片 + const clearPic = () => { + gridPicList.value = [] + emits('clear') + } //开始画笔 const startPencil = () => { isShow.value = !isShow.value @@ -148,7 +185,7 @@ b = b.length === 1? '0' + b : b; return `#${r}${g}${b}`; } - //初始化画笔 + /* //初始化画笔 const initPend = () => { let canvas = new Fabric.fabric.Canvas('canvas_pic_001',{ interactive: false, @@ -162,10 +199,11 @@ canvas.freeDrawingBrush = new Fabric.fabric.PencilBrush(canvas) canvas.freeDrawingBrush.width = 1//设置画笔粗细 canvas.freeDrawingBrush.color = "red"//设置画笔颜色 - } - onMounted(() => { + }*/ + /*onMounted(() => { initPend() - }) + })*/ + defineExpose({addPic,clearPic}) + diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue new file mode 100644 index 0000000..e539610 --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/selectClass.vue @@ -0,0 +1,186 @@ + + + + + + \ No newline at end of file diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/index.vue new file mode 100644 index 0000000..6728919 --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/index.vue @@ -0,0 +1,105 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index cf07db2..7af5ff9 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -58,9 +58,9 @@ - + @@ -77,6 +77,11 @@ +
+
+ +
+
@@ -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' @@ -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); @@ -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 = []; @@ -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,6 +804,10 @@ 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); @@ -865,6 +914,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/classTask/newClassTaskAssign/questToPPTist/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue index 2d7e448..156da53 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue @@ -6,9 +6,9 @@ - + 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 af02b1e..2196474 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -10,7 +10,7 @@ 新建文枢课件 AI一键生成 - + 打开宫格 导入PPT