lsc 10 달 전
부모
커밋
6b0069031f

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.7615aadf1cc6915e7190dbfdf6fe9668.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.ee476e38463461edca63.js></script><script type=text/javascript src=./static/js/app.89484f9cd1866e378560.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.75a5dba6a379f297eff410f11b31f635.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.ee476e38463461edca63.js></script><script type=text/javascript src=./static/js/app.b899c717cdee800252f9.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/css/app.75a5dba6a379f297eff410f11b31f635.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/css/app.75a5dba6a379f297eff410f11b31f635.css.map


BIN
dist/static/img/model6-1-2.e0e3a50.png


BIN
dist/static/img/model6-1.5fc18af.png


BIN
dist/static/img/model6-2.9bb3b2b.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/app.b899c717cdee800252f9.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/app.b899c717cdee800252f9.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


BIN
src/assets/icon/ppt/model6-1-2.png


BIN
src/assets/icon/ppt/model6-1.png


BIN
src/assets/icon/ppt/model6-2.png


+ 37 - 11
src/components/pages/aiAddCourse/addCourse.vue

@@ -8222,7 +8222,7 @@ export default {
                 });
         }
     },
-    async generate2(a, html, index) {
+    async generate2(a, html, index, callback) {
       // 将html文件中需要用到的数据挂载到store上
       const content = `<!DOCTYPE html>
       <html lang="en">
@@ -8246,9 +8246,9 @@ export default {
         type: "text/plain;charset='utf-8'",
       });
       const file = new File([blob], dname, { type: 'application/msword' });
-      await this.beforeUploadHtml2(file, index)
+      await this.beforeUploadHtml2(file, index, callback)
     },
-    beforeUploadHtml2(event, index) {
+    beforeUploadHtml2(event, index, callback) {
         var file = event;
         var credentials = {
             accessKeyId: "AKIATLPEDU37QV5CHLMH",
@@ -8288,6 +8288,7 @@ export default {
                     _this.loading = false
                   }
                   if (err) {
+                      callback ? callback() : ''
                       _this.$message.error("上传失败");
                   } else {
                     let fileid = await _this.createFileid(data.Location)
@@ -8304,6 +8305,7 @@ export default {
                         fileid: fileid,
                     })
                     console.log(data.Location);
+                    callback ? callback() : ''
                   }
                 });
         }
@@ -12575,6 +12577,15 @@ export default {
             if(res.data[3].length){
               try {
                 this.aiJson = JSON.parse(res.data[3][0].tips);
+                this.aiJson.teacherDetail2 = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
+                this.aiJson.aiAbstract = this.aiJson.aiAbstract ? this.aiJson.aiAbstract : '从用户提供的教案资料(文件形式)中,自动总结教案摘要与教案的学科关键词(每个学科3个)。注意,在提取信息方面你绝对不能虚拟出不存在的东西。然后,你基于用户上传的教案,生成项目的驱动性问题和最终作品。'
+                this.aiJson.aiTarget = this.aiJson.aiTarget ? this.aiJson.aiTarget : '从用户提供的教案资料中,提取出课程目标(如不存在课程目标则返回“未提取到目标”。注意,在提取信息方面你绝对不能虚拟出不存在的东西。'
+                this.aiJson.aiSearchFile = this.aiJson.aiSearchFile ? this.aiJson.aiSearchFile : '请根据<关键词>,从你的相应知识库去检索5个最相关的信息。'
+                this.aiJson.aiTarget2 = this.aiJson.aiTarget2 ? this.aiJson.aiTarget2 : '请根据课程标题<课程标题>,从你的知识库去检索5个最相关的信息'
+                if(this.templateid == '61c628b9-3d96-11ef-b873-005056b86db5'){
+                  this.aiJson.aiOutlineTask = this.aiJson.aiOutlineTask ? this.aiJson.aiOutlineTask : '请根据<课程名字>以及该课程的<课程简要描述>来为该课程生成100字以内的序列课程任务,序列任务要求彼此连结紧密且没有重复。'
+                  this.aiJson.aiOutlineDetail = this.aiJson.aiOutlineDetail ? this.aiJson.aiOutlineDetail : '参考<课程名字>、<任务名>和<课程简要描述>的内容,为该序列生成任务详情。任务详情中需要包含教学目标,任务设计和评价标准。'
+                }
                 this.templateid = res.data[3][0].template;
               }catch(error){
                 console.error(error)
@@ -12702,6 +12713,15 @@ export default {
             if(res.data[3].length){
               try {
                 this.aiJson = JSON.parse(res.data[3][0].tips);
+                this.aiJson.teacherDetail2 = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
+                this.aiJson.aiAbstract = this.aiJson.aiAbstract ? this.aiJson.aiAbstract : '从用户提供的教案资料(文件形式)中,自动总结教案摘要与教案的学科关键词(每个学科3个)。注意,在提取信息方面你绝对不能虚拟出不存在的东西。然后,你基于用户上传的教案,生成项目的驱动性问题和最终作品。'
+                this.aiJson.aiTarget = this.aiJson.aiTarget ? this.aiJson.aiTarget : '从用户提供的教案资料中,提取出课程目标(如不存在课程目标则返回“未提取到目标”。注意,在提取信息方面你绝对不能虚拟出不存在的东西。'
+                this.aiJson.aiSearchFile = this.aiJson.aiSearchFile ? this.aiJson.aiSearchFile : '请根据<关键词>,从你的相应知识库去检索5个最相关的信息。'
+                this.aiJson.aiTarget2 = this.aiJson.aiTarget2 ? this.aiJson.aiTarget2 : '请根据课程标题<课程标题>,从你的知识库去检索5个最相关的信息'
+                if(this.templateid == '61c628b9-3d96-11ef-b873-005056b86db5'){
+                  this.aiJson.aiOutlineTask = this.aiJson.aiOutlineTask ? this.aiJson.aiOutlineTask : '请根据<课程名字>以及该课程的<课程简要描述>来为该课程生成100字以内的序列课程任务,序列任务要求彼此连结紧密且没有重复。'
+                  this.aiJson.aiOutlineDetail = this.aiJson.aiOutlineDetail ? this.aiJson.aiOutlineDetail : '参考<课程名字>、<任务名>和<课程简要描述>的内容,为该序列生成任务详情。任务详情中需要包含教学目标,任务设计和评价标准。'
+                }
                 this.templateid = res.data[3][0].template;
               }catch(error){
                 console.error(error)
@@ -15007,6 +15027,7 @@ export default {
 // ${this.infoData.length ? '使用文件检索的方式完整的去分析文件内容,并请完全按照要求输出。' : ''}
 let txt = (!this.yiKeTemplateArray.includes(this.templateid)) ? '任务设计、评价标准和教学目标(markdown格式)' : '任务设计和评价标准'
 let courseText = this.courseText ? this.courseText : this.teacherCourseText
+let target = this.targetCourseText2 ? this.targetCourseText2 : this.targetcoursetext
         let message = `NOTICE
 Role: 你是创建课程的老师,可以利用file_search的方式完整的去分析文件内容(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容),并生成需要的JSON数据。
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
@@ -15022,6 +15043,7 @@ ${msg} 以及##参考资料
 ${courseText ? '课程简要描述:' + courseText : ''}
 ${sub.length ? '学科:' + sub.join(",") : ''}
 ${mclass.length ? '面向年级:' + mclass.join(",") : ''}
+${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','') : ''}
 ${this.templatePan.includes(this.templateid) ? '课程节数:'+this.courseJie+'节' : ''}
 ${this.templatePan.includes(this.templateid) ? '课程时长:'+this.courseTime+'min' : ''}
 detail输出不要输出成json,文本或者markdown都可以
@@ -15035,6 +15057,7 @@ detail输出不要输出成json,文本或者markdown都可以
         })
       } else if (this.aitype == "aiOutline2") {
         this.loading = true
+        let target = this.targetCourseText2 ? this.targetCourseText2 : this.targetcoursetext
         let message = `NOTICE
 Role: 你是创建课程的老师,可以利用file_search的方式完整的去分析文件内容(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容),并生成需要的JSON数据。
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
@@ -15050,6 +15073,7 @@ ${msg} 以及##参考资料
 ${this.courseText ? '课程简要描述:' + this.courseText : ''}
 ${sub.length ? '学科:' + sub.join(",") : ''}
 ${mclass.length ? '面向年级:' + mclass.join(",") : ''}
+${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','') : ''}
 ${this.templatePan.includes(this.templateid) ? '课程节数:'+this.courseJie+'节' : ''}
 ${this.templatePan.includes(this.templateid) ? '课程时长:'+this.courseTime+'min' : ''}
 
@@ -15299,7 +15323,7 @@ ${msg}。相关信息内容至少要有300tokens,可以是markdown格式
 // 补充描述:${this.courseText2} ##补充参考资料和
       let target = this.targetCourseText2 ? this.targetCourseText2 : this.targetcoursetext
       let msg = `NOTICE
-Role: 你是创建课程的老师,内容以markdown形式出现
+Role: 你是创建课程的老师,内容以markdown形式出现(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容)
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -17469,7 +17493,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[_this.taskCount].taskDetail3.replace
         }
       }
       let messages = `NOTICE
-Role: 你是创建课程的老师,内容不要以markdown形式出现,只需要口语化的形式。
+Role: 你是创建课程的老师,内容不要以markdown形式出现,只需要口语化的形式(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容)
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -18735,7 +18759,7 @@ ${this.aitype == 'aiCpote4' ? '## 目标层\n'+this.cpote['cpote3'] : ''}`
       }
 
       let messages = `NOTICE
-Role: 你是创建课程的老师,内容以markdown形式出现。
+Role: 你是创建课程的老师,内容以markdown形式出现(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容)
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -18900,7 +18924,7 @@ ${this.teacherCourseText && this.aiCallback == 2 ? '注意,优化原有的<参
       }
 
       let messages = `NOTICE
-Role: 你是创建课程的老师,内容以markdown形式出现。
+Role: 你是创建课程的老师,内容以markdown形式出现(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容)
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -19051,7 +19075,7 @@ ${this.targetCourseText && this.aiCallback == 2 ? '注意,优化原有的<参
       }
 
       let messages = `NOTICE
-Role: 你是创建课程的老师,内容以markdown形式出现。
+Role: 你是创建课程的老师,内容以markdown形式出现(注:如果文件内容里面不包含需要检索的内容,就不引用文件内容)
 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
 ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
 Instruction: Based on the context, follow "Format example", write content.
@@ -19307,7 +19331,7 @@ ${this.targetCourseText && this.aiCallback == 2 ? '注意,优化原有的<参
             try {
               dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
             } catch (error) {
-                callback ? callback() : ''
+                // callback ? callback() : ''
                 console.log("error_________________" + error);
               try {
                   let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
@@ -19315,6 +19339,7 @@ ${this.targetCourseText && this.aiCallback == 2 ? '注意,优化原有的<参
                   dArray = JSON.parse(match[0]);
               } catch (error) {
                 callback ? callback() : ''
+                _this.$message.error("生成的json格式错误,请重新点击获取")
                 console.log("error_________________" + error);
               }
             }
@@ -19324,9 +19349,10 @@ ${this.targetCourseText && this.aiCallback == 2 ? '注意,优化原有的<参
               let md = new MarkdownIt();
               let _html =  content ? md.render(content) : ''
               setTimeout(()=>{
-                _this.generate2(name, _html, i)
                 if(i == (dArray.length - 1)){
-                  callback ? callback() : ''
+                  _this.generate2(name, _html, i, callback)
+                }else {
+                  _this.generate2(name, _html, i)
                 }
               }, 500 * i)
             }

+ 524 - 82
src/components/pages/aiAddCourse/aiCreateDialog.vue

@@ -11,8 +11,8 @@
                 </el-radio-group>
             </div> -->
             <div class="t_box" v-if="steps == 1" style="height: 100%">
-                <textarea style="height: 100%;width:calc(100% - 260px)" rows="10" class="binfo_input binfo_textarea" cols
-                    placeholder="请生成大纲" v-model="outline"></textarea>
+                <textarea style="height: 100%;width:calc(100% - 260px)" rows="10" class="binfo_input binfo_textarea"
+                    cols placeholder="请生成大纲" v-model="outline"></textarea>
                 <div class="template_box">
                     <span class="title">选择模板</span>
                     <div class="template_list">
@@ -31,7 +31,7 @@
             <el-button @click="aiGet(2)" type="primary" :disabled="loading">重新生成大纲</el-button>
             <el-button @click="aiGet(1)" type="primary" :disabled="loading">{{
                 url ? "重新生成PPT" : "生成PPT"
-            }}</el-button>
+                }}</el-button>
             <el-button @click="steps = 1" type="primary" v-if="steps == 2">上一步</el-button>
             <el-button @click="steps = 2" type="primary" v-else-if="steps == 1 && url">下一步</el-button>
             <el-button @click="confirm" type="primary">确 定</el-button>
@@ -111,17 +111,393 @@ export default {
             uJson: {},
             outline: "",
             steps: 1,
+            // templateList: [
+            //     // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-11719468995661.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-21719469026755.png',color:'17094F' },
+            //     // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-11719469051869.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-21719469040181.png',color:'052B37' },
+            //     // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-11719469071576.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-21719469092087.png',color:'1D5869' },
+            //     // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model4-11719469106190.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model-4-21719469125318.png',color:'372213' },
+            //     // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-11719295908696.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-21719295930345.png',color:'674D40' },
+            //     { img: require('../../../assets/icon/ppt/model1-1.png'), img2: require('../../../assets/icon/ppt/model1-2.png'),color:'17094F' },
+            //     { img: require('../../../assets/icon/ppt/model2-1.png'), img2: require('../../../assets/icon/ppt/model2-2.png'),color:'052B37' },
+            //     { img: require('../../../assets/icon/ppt/model3-1.png'), img2: require('../../../assets/icon/ppt/model3-2.png'),color:'1D5869' },
+            //     { img: require('../../../assets/icon/ppt/model4-1.png'), img2: require('../../../assets/icon/ppt/model4-2.png'),color:'372213' },
+            //     { img: require('../../../assets/icon/ppt/model5-1.png'), img2: require('../../../assets/icon/ppt/model5-2.png'),color:'674D40' },
+            // ],
             templateList: [
-                // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-11719468995661.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-21719469026755.png',color:'17094F' },
-                // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-11719469051869.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-21719469040181.png',color:'052B37' },
-                // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-11719469071576.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-21719469092087.png',color:'1D5869' },
-                // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model4-11719469106190.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model-4-21719469125318.png',color:'372213' },
-                // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-11719295908696.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-21719295930345.png',color:'674D40' },
-                { img: require('../../../assets/icon/ppt/model1-1.png'), img2: require('../../../assets/icon/ppt/model1-2.png'),color:'17094F' },
-                { img: require('../../../assets/icon/ppt/model2-1.png'), img2: require('../../../assets/icon/ppt/model2-2.png'),color:'052B37' },
-                { img: require('../../../assets/icon/ppt/model3-1.png'), img2: require('../../../assets/icon/ppt/model3-2.png'),color:'1D5869' },
-                { img: require('../../../assets/icon/ppt/model4-1.png'), img2: require('../../../assets/icon/ppt/model4-2.png'),color:'372213' },
-                { img: require('../../../assets/icon/ppt/model5-1.png'), img2: require('../../../assets/icon/ppt/model5-2.png'),color:'674D40' },
+                {
+                    img: require('../../../assets/icon/ppt/model1-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model1-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '17094F',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img: require('../../../assets/icon/ppt/model1-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '17094F',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "222222",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "444444",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model1-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '17094F',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    }
+                },
+                {
+                    img: require('../../../assets/icon/ppt/model2-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model2-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '052B37',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img: require('../../../assets/icon/ppt/model2-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '052B37',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "222222",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "444444",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model2-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '052B37',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    }
+                },
+                {
+                    img: require('../../../assets/icon/ppt/model3-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model3-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '1D5869',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img: require('../../../assets/icon/ppt/model3-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '1D5869',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "222222",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "444444",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model3-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '1D5869',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    }
+                },
+                {
+                    img: require('../../../assets/icon/ppt/model4-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model4-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '372213',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img: require('../../../assets/icon/ppt/model4-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '372213',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "222222",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "444444",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model4-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '372213',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    color: '372213'
+                },
+                {
+                    img: require('../../../assets/icon/ppt/model5-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model5-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '674D40',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img: require('../../../assets/icon/ppt/model5-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '674D40',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "222222",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "444444",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model5-1.png'),
+                        setting: {
+                            x: "5%",
+                            y: 3,
+                            w: "90%",
+                            color: '674D40',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                },
+                {
+                    img: require('../../../assets/icon/ppt/model6-1.png'),
+                    img1: {
+                        img: require('../../../assets/icon/ppt/model6-1-2.png'),
+                        setting: {
+                            x: "35%",
+                            y: 2.3,
+                            w: "60%",
+                            bold: true,
+                            color: 'EA7A93',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                    img2: [
+                        {
+                            img:require('../../../assets/icon/ppt/model6-2.png'),
+                            title: {
+                                x: "5%", // 横坐标
+                                y: 1.1,
+                                w: "90%",
+                                color: '4F73DA',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "center",
+                            },
+                            subTitle: {
+                                x: "5%", // 横坐标
+                                y: 1.8,
+                                w: "90%",
+                                color: "333333",
+                                fontSize: 20, // 字号
+                                align: "center",
+                            },
+                            content: {
+                                x: "20%", // 横坐标
+                                y: 3.2,
+                                w: "60%",
+                                color: "333333",
+                                fontSize: 18, // 字号
+                                align: "center",
+                            }
+                        },
+                        {
+                            img: require('../../../assets/icon/ppt/model6-2.png'),
+                            title: {
+                                x: "2.5%", // 横坐标
+                                y: 2.3,
+                                w: "30%",
+                                color: 'ffffff',
+                                bold: true,
+                                fontSize: 35, // 字号
+                                align: "left",
+                            },
+                            subTitle: {
+                                x: "2.5%", // 横坐标
+                                y: 3.1,
+                                w: "30%",
+                                color: "ffffff",
+                                fontSize: 20, // 字号
+                                align: "left",
+                            },
+                            content: {
+                                x: "45%", // 横坐标
+                                y: 2.8,
+                                w: "45%",
+                                color: "333333",
+                                fontSize: 18, // 字号
+                                align: "left",
+                            },
+                            square: {
+                                x: 0,
+                                y: 0,
+                                w: "35%",
+                                h: "100%",
+                                fill: { color: "4F73DA" }
+                            },
+                            square2: {
+                                x: "35%",
+                                y: 0,
+                                w: "2.5%",
+                                h: "100%",
+                                fill: { color: "C2CFEF" }
+                            }
+                        }
+                    ],
+                    imgEnd: {
+                        img: require('../../../assets/icon/ppt/model6-1-2.png'),
+                        setting: {
+                            x: "35%",
+                            y: 2.3,
+                            w: "60%",
+                            color: 'EA7A93',
+                            fontSize: 38,
+                            align: "center",
+                        }
+                    },
+                },
             ],
             templateIndex: 0,
         };
@@ -131,6 +507,9 @@ export default {
             if (newValue) {
                 this.loading = false;
                 this.aiGet(2);
+                // this.templateIndex = 5
+                // this.createPpt();
+
             }
         },
     },
@@ -253,12 +632,12 @@ Instruction: Based on the context, follow "Format example", write content.
 - 内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。
 
 ## 大纲内容
-${_this.outline.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
+${_this.outline.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
 
 # Format example
 [{"page": "页码(数字)","title": "学科概念(请从给你的大纲中摘取)(标题)","task": "知识点(请从给你的大纲中摘取)(子标题)","points": "内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。"}]`;
             } else {
-                if(this.courseState == 4){
+                if (this.courseState == 4) {
                     message = `# 任务
 请根据参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt的大纲,大纲的主要内容课程知识点的讲解与相关练习和测试。你的输出应该符合#输出格式
 
@@ -272,12 +651,12 @@ ${mclass.length ? "#参考资料\n面向年级:" + mclass.join(",") : ""}
 # 限制
 - 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
 - 你不能输出违反伦理的内容`;
-                }else if(this.courseState == 5){
+                } else if (this.courseState == 5) {
                     message = `# 任务
 请根据<任务教案>,为教师生成本的教学ppt的大纲,大纲包含各环节的步骤,学科知识点。
 
 # 参考资料
-任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
+任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
 ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
 
 # 输出格式
@@ -400,82 +779,139 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
                     console.log(error);
                 });
         },
-        createPpt(array) {
+        generateRandomNumber(min, max) {
+            // min 是随机数范围的最小值,max 是随机数范围的最大值
+            return Math.floor(Math.random() * (max - min + 1)) + min;
+        },
+        createPpt(arr) {
+            let array = arr
+            // let array = [
+            //     {
+            //         "page": 1,
+            //         "title": "引入阶段",
+            //         "task": "课程背景",
+            //         "points": "同学们,让我们一起了解一下这门有趣的熊猫课程吧!今天,我们将探索熊猫的生活环境,并尝试去理解这些环境是如何影响熊猫的生存的。"
+            //     },
+            //     {
+            //         "page": 2,
+            //         "title": "引入阶段",
+            //         "task": "整体目标和任务要求",
+            //         "points": "这门课程的主要目标是让大家了解熊猫生活的环境以及生存所需的关键因素。我们将完成一个任务,具体要求是观察、记录、绘制和制作模型哦!"
+            //     },
+            //     {
+            //         "page": 3,
+            //         "title": "引入阶段",
+            //         "task": "驱动性问题",
+            //         "points": "大家思考一下这样一个问题:‘熊猫的生活环境对它们的生存有何重要影响?’ 我们接下去的活动将帮助大家找到答案。"
+            //     },
+            //     {
+            //         "page": 4,
+            //         "title": "引入阶段",
+            //         "task": "观察与记录技巧",
+            //         "points": "今天我们会运用图片和视频,来帮助大家观察熊猫栖息地和它们所吃的竹子等特征。细心观察,并将所见的特征记录下来是非常重要的技能哦!"
+            //     },
+            //     {
+            //         "page": 5,
+            //         "title": "探究阶段",
+            //         "task": "绘图工具和材料",
+            //         "points": "现在我们分发绘图工具和材料,来学习基本的绘图和建模技巧吧!熟练掌握这些工具会帮助我们更好地记录和展示我们的观察结果。"
+            //     },
+            //     {
+            //         "page": 6,
+            //         "title": "探究阶段",
+            //         "task": "观察和记录特征",
+            //         "points": "让我们好好观察一下身边的常见物体,把它们的特征记录下来。这个过程会训练你们的观察力和手眼协调能力。"
+            //     },
+            //     {
+            //         "page": 7,
+            //         "title": "探究阶段",
+            //         "task": "转换二维图像",
+            //         "points": "接下来,我们要把记录的三维物体转化为二维图像。这个步骤非常有趣,大家可以尽情发挥自己的绘画天赋哦!"
+            //     },
+            //     {
+            //         "page": 8,
+            //         "title": "探究阶段",
+            //         "task": "三维模型制作",
+            //         "points": "现在我们提供一些简单的材料,比如纸张和纸板,示范一下如何制作三维模型。记住,比例和结构是模型制作的关键!"
+            //     },
+            //     {
+            //         "page": 9,
+            //         "title": "评估与反馈阶段",
+            //         "task": "评估和检查",
+            //         "points": "大家完成了任务后,我们来检查和评估你们的二维图像和三维模型。确保它们的结构合理、比例协调。"
+            //     },
+            //     {
+            //         "page": 10,
+            //         "title": "评估与反馈阶段",
+            //         "task": "提出改进建议",
+            //         "points": "针对你们完成的作品,我们会提出一些改进建议。大家也可以相互评价,分享制作经验,这样可以互相学习哦!"
+            //     },
+            //     {
+            //         "page": 11,
+            //         "title": "评估与反馈阶段",
+            //         "task": "任务总结",
+            //         "points": "最后,我们要总结这次任务的执行情况,并表扬表现特别突出的同学。希望大家都能有所收获,并继续努力!"
+            //     },
+            //     {
+            //         "page": 12,
+            //         "title": "练习",
+            //         "task": "练习1:二维图像绘制",
+            //         "points": "选择一件日常物品(如书本、杯子),观察其特征,尝试通过手绘将其转换为二维图像。示例:通过绘制书本的正面、侧面和顶面图,展示其主要特征和比例关系。"
+            //     },
+            //     {
+            //         "page": 13,
+            //         "title": "练习",
+            //         "task": "练习2:三维模型制作",
+            //         "points": "使用纸张和纸板制作简单的模型,比如一个基本的房子或盒子。关注其结构和比例哦! 示例:通过折叠和粘贴纸张,制作一个四面体,确保各个面的比例协调,结构稳定。"
+            //     }
+            // ]
             // 1. 创建PPT
             const pres = new Pptxgen();
             const _slideTou = pres.addSlide();
-            _slideTou.background = { path: this.templateList[this.templateIndex].img }
+            _slideTou.background = { path: this.templateList[this.templateIndex].img1.img }
             let title = ''
-            if(this.courseState == 4){
+            if (this.courseState == 4) {
                 title = this.courseName
-            }else if(this.courseState == 5){
+            } else if (this.courseState == 5) {
                 title = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task
             }
-            _slideTou.addText(title, {
-                x: "10%", // 横坐标
-                y: 3,
-                width: "90%",
-                color: this.templateList[this.templateIndex].color,
-                fontSize: 38, // 字号
-                align: "center",
-            });
+            _slideTou.addText(title, this.templateList[this.templateIndex].img1.setting);
             for (var i = 0; i < array.length; i++) {
                 // 2. 创建一个PPT页面,每调用一次 pres.addSlide() 都可以生成一张新的页面
                 // 建议把每个页面的构造抽成一个个函数,然后通过函数调用生成新页面,代码不会很乱
                 const _slide = pres.addSlide();
-                _slide.background = { path: this.templateList[this.templateIndex].img2 }
+                const randomNum = this.generateRandomNumber(0, (this.templateList[this.templateIndex].img2.length - 1))
+                let pContent = this.templateList[this.templateIndex].img2[randomNum]
+                _slide.background = { path: pContent.img }
 
                 // 3. 调用addTetx(),在PPT页面中插入文字“Hello World from PptxGenJS...”
                 // 括号里面是对文字的配置,文字横坐标x为1.5,纵坐标y为1.5,字体颜色 363636……
                 // 关于坐标长度与px的转换 x 1 = 127~128px 左右
                 const page = i + 1 > 10 ? i + 1 : "0" + (i + 1);
+
+                if(pContent.square){
+                    _slide.addText("", pContent.square);
+                    _slide.addText("", pContent.square2);
+                }
                 const tempResult1 = page + " " + array[i].title;
-                _slide.addText(tempResult1, {
-                    x: "10%", // 横坐标
-                    y: 1.1,
-                    width: "90%",
-                    color: this.templateList[this.templateIndex].color,
-                    fontSize: 28, // 字号
-                    align: "center",
-                });
+                _slide.addText(tempResult1, pContent.title);
                 const tempResult2 = array[i].task;
-                _slide.addText(tempResult2, {
-                    x: "10%", // 横坐标
-                    y: 1.8,
-                    width: "90%",
-                    color: "222222",
-                    fontSize: 20, // 字号
-                    align: "center",
-                });
+                _slide.addText(tempResult2, pContent.subTitle);
                 let tempResult3 = '';
                 if (typeof array[i].points == 'object') {
-                    if (Array.isArray(array[i].points)) { 
+                    if (Array.isArray(array[i].points)) {
                         tempResult3 = array[i].points.join('\n')
-                    } else { 
+                    } else {
                         tempResult3 = JSON.stringify(array[i].points)
                     }
                 } else {
                     tempResult3 = array[i].points
                 }
-                _slide.addText(tempResult3, {
-                    x: "20%", // 横坐标
-                    y: 3.2,
-                    w: "60%",
-                    color: "444444",
-                    fontSize: 18, // 字号
-                    align: "center",
-                });
+                _slide.addText(tempResult3, pContent.content);
             }
             const _slideWei = pres.addSlide();
-            _slideWei.background = { path: this.templateList[this.templateIndex].img }
-            _slideWei.addText("谢谢观看,下课!", {
-                x: "10%", // 横坐标
-                y: 3,
-                width: "90%",
-                color: this.templateList[this.templateIndex].color,
-                fontSize: 38, // 字号
-                align: "center",
-            });
+            _slideWei.background = { path: this.templateList[this.templateIndex].imgEnd.img }
+            _slideWei.addText("谢谢观看,下课!", this.templateList[this.templateIndex].imgEnd.setting);
             // 获取PPTX文件的ArrayBuffer
 
             // 保存为 Blob 并处理
@@ -615,27 +1051,27 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
 }
 
 .binfo_textarea:focus-visible {
-  border: 1.5px solid #3681fc !important;
+    border: 1.5px solid #3681fc !important;
 }
 
 .binfo_textarea::-webkit-scrollbar {
-  /*滚动条整体样式*/
-  width: 6px;
-  /*高宽分别对应横竖滚动条的尺寸*/
-  height: 6px;
+    /*滚动条整体样式*/
+    width: 6px;
+    /*高宽分别对应横竖滚动条的尺寸*/
+    height: 6px;
 }
 
 /*定义滚动条轨道 内阴影+圆角*/
 .binfo_textarea::-webkit-scrollbar {
-  border-radius: 10px;
-  background-color: #eee;
+    border-radius: 10px;
+    background-color: #eee;
 }
 
 /*定义滑块 内阴影+圆角*/
 .binfo_textarea::-webkit-scrollbar-thumb {
-  border-radius: 10px;
-  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
-  background-color: rgba(0, 0, 0, 0.1);
+    border-radius: 10px;
+    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+    background-color: rgba(0, 0, 0, 0.1);
 }
 
 .t_box {
@@ -651,20 +1087,23 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
     color: #000;
 }
 
-.template_box{
+.template_box {
     width: 250px;
 }
-.template_box > .title{
+
+.template_box>.title {
     font-size: 18px;
     margin-bottom: 10px;
     display: block;
 }
-.template_list{
+
+.template_list {
     overflow: auto;
     width: 100%;
     height: calc(100% - 31px);
 }
-.template_item{
+
+.template_item {
     cursor: pointer;
     width: 100%;
     height: 165px;
@@ -673,13 +1112,16 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
     box-sizing: border-box;
     border: 5px solid #e5e5e5ee;
 }
-.template_item + .template_item{
+
+.template_item+.template_item {
     margin-top: 10px;
 }
-.template_item.active{
+
+.template_item.active {
     border: 5px solid #0061ff;
 }
-.template_item > img{
+
+.template_item>img {
     width: 100%;
     height: 100%;
     object-fit: cover;

+ 1 - 1
src/components/pages/course.vue

@@ -461,7 +461,7 @@ export default {
       pTypeCheckName: [],
       btnDisplay: false,
       dialogVisibleTemplate: false,
-      orgArray:['1973f6c7-1561-11ee-91d8-005056b86db5','777559d2-7239-11ee-b98c-005056b86db5','884c5665-a453-46f3-b7b6-01d575290aa9','0fec3a8a-ad04-11ed-b13d-005056b86db5','c9a6de59-8b4f-4be1-8565-a08081f649d3'],
+      orgArray:['1973f6c7-1561-11ee-91d8-005056b86db5','777559d2-7239-11ee-b98c-005056b86db5','884c5665-a453-46f3-b7b6-01d575290aa9','0fec3a8a-ad04-11ed-b13d-005056b86db5','c9a6de59-8b4f-4be1-8565-a08081f649d3','7ada499f-4ec7-11ed-8c78-005056b86db5'],
       oidArray:['f297fbdc-f0a0-11ee-b534-005056b86db5','45facc0a-1211-11ec-80ad-005056b86db5']
     };
   },

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.