Prechádzať zdrojové kódy

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

lzw 2 mesiacov pred
rodič
commit
8a9eb8093b

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.ea64c8574fe04ba4b05b8b685277836b.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.85f22e7b4ab99591785c.js></script><script type=text/javascript src=./static/js/app.dda05761b81a9d74fa44.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.5e5245ce3a3a19a51ba3e3f9c7e6fd82.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.85f22e7b4ab99591785c.js></script><script type=text/javascript src=./static/js/app.d8fbf023e6945d7b6ff6.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/static/css/app.5e5245ce3a3a19a51ba3e3f9c7e6fd82.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/static/css/app.5e5245ce3a3a19a51ba3e3f9c7e6fd82.css.map


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/static/js/app.d8fbf023e6945d7b6ff6.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/static/js/app.d8fbf023e6945d7b6ff6.js.map


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 305 - 0
src/assets/css/markdownCss.css

@@ -0,0 +1,305 @@
+.vditor-reset ul ul ul {
+    list-style-type: square
+}
+
+.vditor-reset ul ul {
+    list-style-type: circle
+}
+
+.vditor-reset ul {
+    list-style-type: disc
+}
+
+.vditor-reset ol,.vditor-reset ul {
+    padding-left: 2em;
+    margin-top: 0;
+    margin-bottom: 16px
+}
+
+.vditor-reset li+li {
+    margin-top: .25em
+}
+
+.vditor-reset audio {
+    max-width: 100%
+}
+
+.vditor-reset audio:focus {
+    outline: none
+}
+
+.vditor-reset video {
+    max-height: 90vh;
+    max-width: 100%
+}
+
+.vditor-reset img {
+    max-width: 100%
+}
+
+.vditor-reset img.emoji {
+    cursor: auto;
+    max-width: 20px;
+    vertical-align: sub
+}
+
+.vditor-reset h1, .vditor-reset h2 {
+    padding-bottom: 0.3em;
+    border-bottom: 1px solid #eaecef;
+}
+
+.vditor-reset hr {
+    background-color: #eaecef;
+}
+
+.vditor-reset blockquote {
+    color: #6a737d;
+    border-left: .25em solid #eaecef
+}
+
+.vditor-reset iframe {
+    border: 1px solid #d1d5da
+}
+
+.vditor-reset table tr {
+    border-top: 1px solid #c6cbd1;
+    background-color: #fafbfc
+}
+
+.vditor-reset table td, .vditor-reset table th {
+    border: 1px solid #dfe2e5
+}
+
+.vditor-reset table tbody tr:nth-child(2n) {
+    background-color: #fff
+}
+
+.vditor-reset code:not(.hljs):not(.highlight-chroma) {
+    background-color: rgba(27, 31, 35, .05);
+}
+
+.vditor-reset kbd {
+    color: #24292e;
+    background-color: #fafbfc;
+    border: solid 1px #d1d5da;
+    box-shadow: inset 0 -1px 0 #d1d5da;
+}
+
+.vditor-speech {
+    background-color: #f6f8fa;
+    border: 1px solid #d1d5da;
+    color: #586069;
+}
+
+.vditor-speech--current, .vditor-speech:hover {
+    color: #4285f4;
+}
+
+.vditor-linkcard a {
+    background-color: #f6f8fa;
+}
+
+.vditor-linkcard a:visited .vditor-linkcard__abstract {
+    color: rgba(88, 96, 105, 0.36);
+}
+
+.vditor-linkcard__title {
+    color: #24292e;
+}
+
+.vditor-linkcard__abstract {
+    color: #586069;
+}
+
+.vditor-linkcard__site {
+    color: #4285f4;
+}
+
+.vditor-linkcard__image {
+    background-color: rgba(88, 96, 105, 0.36);
+}
+
+
+.vditor-reset h1,.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6 {
+    margin-top: 24px;
+    margin-bottom: 16px;
+    font-weight: 600;
+    line-height: 1.25
+}
+
+.vditor-reset h1:hover .vditor-anchor svg,.vditor-reset h2:hover .vditor-anchor svg,.vditor-reset h3:hover .vditor-anchor svg,.vditor-reset h4:hover .vditor-anchor svg,.vditor-reset h5:hover .vditor-anchor svg,.vditor-reset h6:hover .vditor-anchor svg {
+    visibility: visible
+}
+
+.vditor-reset h1 {
+    font-size: 1.75em
+}
+
+.vditor-reset h2 {
+    font-size: 1.55em
+}
+
+.vditor-reset h3 {
+    font-size: 1.38em
+}
+
+.vditor-reset h4 {
+    font-size: 1.25em
+}
+
+.vditor-reset h5 {
+    font-size: 1.13em
+}
+
+.vditor-reset h6 {
+    font-size: 1em
+}
+
+.vditor-reset hr {
+    height: 2px;
+    padding: 0;
+    margin: 24px 0;
+    background-color: #eaecef;
+    border: 0
+}
+
+.vditor-reset p {
+    margin-top: 0;
+    margin-bottom: 16px
+}
+
+.vditor-reset blockquote {
+    padding: 0 1em;
+    color: #6a737d;
+    border-left: .25em solid #eaecef;
+    margin: 0 0 16px 0
+}
+
+.vditor-reset blockquote>:first-child {
+    margin-top: 0
+}
+
+.vditor-reset blockquote>:last-child {
+    margin-bottom: 0
+}
+
+.vditor-reset ins>iframe {
+    border: 0
+}
+
+.vditor-reset iframe {
+    border: 1px solid #d1d5da;
+    max-width: 100%;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box
+}
+
+.vditor-reset iframe.iframe__video {
+    min-width: 80%;
+    min-height: 36vh
+}
+
+.vditor-reset table {
+    border-collapse: collapse;
+    empty-cells: show;
+    margin-bottom: 16px;
+    overflow: auto;
+    border-spacing: 0;
+    display: block;
+    word-break: keep-all;
+    width: 100%
+}
+
+.vditor-reset table tr {
+    background-color: #fafbfc;
+    border-top: 1px solid #c6cbd1
+}
+
+.vditor-reset table td,.vditor-reset table th {
+    padding: 6px 13px;
+    border: 1px solid #dfe2e5;
+    word-break: normal;
+    white-space: nowrap
+}
+
+.vditor-reset table td:first-child:after,.vditor-reset table th:first-child:after {
+    content: "";
+    display: inline-block;
+    vertical-align: top;
+    min-height: 24px
+}
+
+.vditor-reset table th {
+    font-weight: 600
+}
+
+.vditor-reset table tbody tr:nth-child(2n) {
+    background-color: #fff
+}
+
+.vditor-reset code:not(.hljs):not(.highlight-chroma) {
+    padding: .2em .4em;
+    margin: 0;
+    font-size: 85%;
+    border-radius: 3px;
+    font-family: mononoki,Consolas,Liberation Mono,Menlo,Courier,monospace,Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
+    word-break: break-word;
+    background-size: 20px 20px;
+    white-space: pre-wrap
+}
+
+.vditor-reset pre {
+    margin: 1em 0
+}
+
+.vditor-reset pre>code {
+    margin: 0;
+    font-size: 85%;
+    padding: .5em;
+    border-radius: 5px;
+    display: block;
+    overflow: auto;
+    white-space: pre;
+    font-family: mononoki,Consolas,Liberation Mono,Menlo,Courier,monospace,Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
+    background-size: 20px 20px;
+    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==);
+    word-break: normal;
+    word-wrap: normal
+}
+
+.vditor-reset pre:hover div.vditor-copy {
+    display: block
+}
+
+
+.vditor-reset kbd {
+    display: inline-block;
+    padding: 3px 5px;
+    font: 11px Consolas,Liberation Mono,Menlo,Courier,monospace;
+    line-height: 10px;
+    color: #24292e;
+    vertical-align: middle;
+    background-color: #fafbfc;
+    border: 1px solid #d1d5da;
+    border-radius: 3px;
+    -webkit-box-shadow: inset 0 -1px 0 #d1d5da;
+    box-shadow: inset 0 -1px 0 #d1d5da
+}
+
+.vditor-reset summary {
+    cursor: pointer
+}
+
+.vditor-reset summary:focus {
+    outline: none
+}
+
+.vditor-reset svg {
+    height: auto;
+    width: auto;
+    stroke-width: initial
+}
+
+.vditor-reset blockquote:last-child,.vditor-reset hr:last-child,.vditor-reset ol:last-child,.vditor-reset p:last-child,.vditor-reset pre:last-child,.vditor-reset ul:last-child {
+    margin-bottom: 0
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 463 - 140
src/components/pages/aiAddCourse/addCourse.vue


+ 243 - 169
src/components/pages/aiAddCourse/aiCreateDialog.vue

@@ -1,7 +1,7 @@
 <template>
     <el-dialog title="AI生成PPT" :visible.sync="dialogVisibleAiCreate" :append-to-body="true" width="700px"
         :before-close="handleClose" class="dialog_diy">
-        <div style="height: 500px;padding:15px" v-loading="loading">
+        <div style="height: 500px; padding: 15px" v-loading="loading">
             <!-- <div class="t_box">
                 <span>选择:</span>
                 <el-radio-group v-model="radio" @change="changeRadio">
@@ -10,15 +10,21 @@
                     <el-radio :label="2">视频</el-radio>
                 </el-radio-group>
             </div> -->
-            <!-- <div class="t_box">
-                <span>提示词:</span>
-                <textarea rows="10" class="binfo_input binfo_textarea" cols placeholder="请输入提示词"
-                    v-model="detail"></textarea>
-            </div> -->
-            <wOffice v-if="url" :url="url"></wOffice>
+            <div class="t_box" v-if="steps == 1" style="height: 100%">
+                <textarea style="height: 100%" rows="10" class="binfo_input binfo_textarea" cols placeholder="请生成大纲"
+                    v-model="outline"></textarea>
+            </div>
+            <div style="height: 100%" v-else>
+                <wOffice v-if="url" :url="url"></wOffice>
+            </div>
         </div>
         <span slot="footer" class="dialog-footer">
-            <el-button @click="aiGet" type="primary">重新生成</el-button>
+            <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 @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>
             <el-button @click="close">关 闭</el-button>
         </span>
@@ -26,8 +32,8 @@
 </template>
 
 <script>
-import Pptxgen from "pptxgenjs"
-import wOffice from '../components/wOffice.vue'
+import Pptxgen from "pptxgenjs";
+import wOffice from "../components/wOffice.vue";
 import { v4 as uuidv4 } from "uuid";
 
 export default {
@@ -37,15 +43,23 @@ export default {
     props: {
         dialogVisibleAiCreate: {
             type: Boolean,
-            default: false
+            default: false,
         },
         courseName: {
             type: String,
-            default: ""
+            default: "",
         },
         infoData: {
             type: Array,
-            default: ""
+            default: "",
+        },
+        courseTypeId: {
+            type: Array,
+            default: "",
+        },
+        CourseTypeJson: {
+            type: Object,
+            default: ()=>({}),
         }
     },
     // 根据用户给你的参考资料
@@ -65,147 +79,188 @@ export default {
 ## 限制
 - 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
 - 你不能输出违反伦理的内容`,
-                word: '',
-                video: ''
+                word: "",
+                video: "",
             },
             aiUrl: {
-                ppt: '',
-                word: '',
-                video: ''
+                ppt: "",
+                word: "",
+                video: "",
             },
             detail: "",
             loading: false,
             url: "",
-            uJson: {}
-        }
+            uJson: {},
+            outline: "",
+            steps: 1,
+        };
     },
     watch: {
         dialogVisibleAiCreate(newValue, oldValue) {
             if (newValue) {
-                // if (this.radio == 0) {
-                    this.detail =  `## 任务
-请根据用户给你的参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt,页数在20页左右。PPT的内容主要是讲解该课程中所有可能涉及到的知识点。
-
-## 工作流
-1. 从用户提供的参考资料中提取10个最重要的知识点(知识点水平限制在小学和初中),并输出。
-2. 针对10个知识点中的每个,你使用1~3页ppt详细的对知识点进行讲解。你的讲解词应该在100token左右
-3. 讲解完所有知识点后,再根据知识点出5道单选题(放在5页ppt中)
-
-## 限制
-- 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
-- 你不能输出违反伦理的内容`
-                // }
-                // if (this.radio == 1) {
-                //     this.detail = this.aiJson.word
-                // }
-                // if (this.radio == 2) {
-                //     this.detail = this.aiJson.video
-                // }
-                // this.loading = false
-                this.aiGet()
+                this.aiGet(2);
             }
         },
     },
     methods: {
         handleClose(done) {
-            this.close()
+            this.close();
             done();
         },
         close() {
-            this.$emit('update:dialogVisibleAiCreate', false)
+            this.$emit("update:dialogVisibleAiCreate", false);
         },
         confirm() {
-            if(this.url){
-                this.$emit('createAiPpt', this.uJson)
-            }else {
-                this.$message.error('请先生成ppt');
+            if (this.url) {
+                this.$emit("createAiPpt", this.uJson);
+            } else {
+                this.$message.error("请先生成ppt");
             }
         },
         changeRadio() {
             if (this.radio == 0) {
-                this.detail = this.aiJson.ppt
+                this.detail = this.aiJson.ppt;
             }
             if (this.radio == 1) {
-                this.detail = this.aiJson.word
+                this.detail = this.aiJson.word;
             }
             if (this.radio == 2) {
-                this.detail = this.aiJson.video
+                this.detail = this.aiJson.video;
             }
         },
         createFileid(url) {
-            let _this = this
+            let _this = this;
             return new Promise((resolve, reject) => {
                 try {
-                _this.ajax
-                .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
-                    url: url,
-                })
-                .then((res) => {
-                    let _data = res.data.FunctionResponse;
-                    if (_data.result && _data.result.id) {
-                    resolve(_data.result.id)
-                    }
-                }).catch(function (error) {
-                    resolve('')
-                });
-                }catch (e){
-                resolve()
+                    _this.ajax
+                        .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
+                            url: url,
+                        })
+                        .then((res) => {
+                            let _data = res.data.FunctionResponse;
+                            if (_data.result && _data.result.id) {
+                                resolve(_data.result.id);
+                            }
+                        })
+                        .catch(function (error) {
+                            resolve("");
+                        });
+                } catch (e) {
+                    resolve();
                 }
-                
             });
         },
-        async aiGet() {
-            if(this.loading){
-                this.$message.error('正在生成中,请稍后');
+        async aiGet(type) {
+            if (this.loading) {
+                this.$message.error("正在生成中,请稍后");
                 return;
             }
-            this.url = ''
-            this.uJson = {}
-            let _this = this
+            this.url = "";
+            this.uJson = {};
+            let _this = this;
 
-            let fileid = []
+            let fileid = [];
             if (_this.infoData.length) {
                 for (var i = 0; i < _this.infoData.length; i++) {
-                if(_this.infoData[i].fileid){
-                    fileid.push(_this.infoData[i].fileid)
-                }else {
-                    let _fileid = await _this.createFileid(_this.infoData[i].url)
-                    if(_fileid){
-                    _this.infoData[i].fileid = _fileid
-                    _this.$forceUpdate();
-                    fileid.push(_fileid)
+                    if (_this.infoData[i].fileid) {
+                        fileid.push(_this.infoData[i].fileid);
+                    } else {
+                        let _fileid = await _this.createFileid(_this.infoData[i].url);
+                        if (_fileid) {
+                            _this.infoData[i].fileid = _fileid;
+                            _this.$forceUpdate();
+                            fileid.push(_fileid);
+                        }
                     }
                 }
+            }
+            console.log("fileid=========", fileid);
+
+            let mclass = [];
+            if (_this.courseTypeId.length) {
+                for (var i = 0; i < _this.courseTypeId.length; i++) {
+                    let _sid = _this.courseTypeId[i];
+                    for (
+                        var j = 0;
+                        j <
+                        _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"].length;
+                        j++
+                    ) {
+                        if (
+                            _sid ==
+                            _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"][j].id
+                        ) {
+                            mclass.push(
+                                _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"][j]
+                                    .name
+                            );
+                        }
+                    }
                 }
             }
-            console.log('fileid=========',fileid)  
-
-
-            let message = ''
-            if (_this.radio == 0) {
+            let message = "";
+            if (type == 1) {
                 message = `NOTICE
-Role: 提供的参考资料中读取10个最重要的知识点(知识点水平限制在小学和初中,作为ppt内容。
+Role: 从用户提供的参考资料中提取5个最重要的学科概念${mclass.length ? "(水平限制在{面向年级}中)" : ""},作为ppt内容。
 Output: Provide your output in json format.
+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.
 
 # Context 
 ## 任务
-请根据用户给你的参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt,页数在20页左右。PPT的内容主要是讲解该课程中所有可能涉及到的知识点。
+将参考#参考资料,为教师生成这节课的教学ppt。PPT的内容主要是讲解该课程中所有可能涉及到的知识点,每个知识点用1页讲解
 
 ## 工作流
-1. 提供的参考资料中读取10个最重要的知识点(知识点水平限制在小学和初中,作为ppt内容。
-2. 针对10个知识点中的每个,你使用1~3页ppt详细的对知识点进行讲解。你的讲解词应该在100token左右
-3. 讲解完所有知识点后,再根据知识点出5道单选题(放在5页ppt中)。
+1. 针对大纲中的每个知识点,生成200字左右的详细讲解。你的语气应该让小学或初中的学生清晰易懂的讲解。请尽可能的详细,这对我很重要。
+2. 针对大纲中的每个测试,详细设计不同测试题目,例如单选,多选,对错题等。
 
-# Format example
-[{"page": "页码(数字)","title": "标题","task": "对应教学任务:依据用户输入的参考资料而定,如果用户未提供则不输出","points": "知识点讲解:针对知识点的详细讲解,你的语气应该让小学或初中的学生清晰易懂的讲解。你的讲解词在100 token左右。请尽可能的详细,这对我很重要。"}]`
-            } else if (_this.radio == 1) {
+# 每一页输出格式
+- 页数:序列数字
+- 标题:学科概念(请从给你的大纲中摘取)
+- 子标题:知识点(请从给你的大纲中摘取)
+- 知识点讲解:针对大纲中的每个知识点,生成200字左右的详细讲解。你的语气应该让小学或初中的学生清晰易懂的讲解。你的讲解词在200 token左右。请尽可能的详细,这对我很重要。
 
-            } else if (_this.radio == 2) {
+## 限制
+- 你不能输出错误的知识,如果你实在不清楚,修改大纲中的知识点。
+- 你不能输出违反伦理的内容
 
-            }
+## 工作流
+1. 从用户提供的参考资料中提取5个最重要的学科概念,并输出。
+2. 分解每个学科概念为几个子知识点
+3. 简要描述每个知识点
+4.生成5个测试题以考察学生的掌握情况
+
+## 参考资料
+${_this.outline}
 
+# Format example
+[{"page": "页码(数字)","title": "学科概念(请从给你的大纲中摘取)(标题)","task": "知识点(请从给你的大纲中摘取)(子标题)","points": "知识点讲解:针对大纲中的每个知识点,生成200字左右的详细讲解。你的语气应该让小学或初中的学生清晰易懂的讲解。你的讲解词在100 token左右。请尽可能的详细,这对我很重要。"}]`;
+            } else {
+                message = `# 任务
+请根据参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt的大纲,大纲的主要内容课程知识点的讲解与相关练习和测试。你的输出应该符合#输出格式
+
+# 工作流
+1. 从用户提供的参考资料中提取5个最重要的学科概念${mclass.length ? "(水平限制在{面向年级}中)" : ""},并输出。
+2. 分解每个学科概念为几个子知识点
+3. 简要描述每个知识点
+4.生成5个测试题以考察学生的掌握情况
+
+${mclass.length ? "#参考资料\n面向年级:" + mclass.join(",") : ""}
+
+# 输出格式
+- 标题:学科概念1
+  1.知识点:知识点1
+  2.知识点:知识点2
+  3.知识点:知识点3
+  4.知识点:知识点4
+  5.知识点:知识点5
+
+# 限制
+- 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
+- 你不能输出违反伦理的内容
+`;
+            }
 
             // let params = JSON.stringify({
             //     // "model": "Chat",
@@ -245,106 +300,128 @@ Instruction: Based on the context, follow "Format example", write content.
             //     console.log(error);
             // });
 
-
             let parm = {
-                assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
-                message: [{"type":"text", "text":message}],
+                assistant_id:
+                    type == 1
+                        ? "6063369f-289a-11ef-8bf4-12e77c4cb76b"
+                        : "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
+                message: [{ type: "text", text: message }],
                 session_name: uuidv4(),
                 userId: this.userid,
-                file_ids: fileid.length ? [...fileid] : '',
-            }
-            _this.loading = true
+                file_ids: fileid.length ? [...fileid] : "",
+            };
+            _this.loading = true;
             this.ajax
                 .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
                 .then((response) => {
-                console.log(response);
-                let data = response.data.FunctionResponse
-                if (data.message) {
-                    console.log(data.message);
-                    try {
-                        let _data = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
-                        _this.createPpt(_data)
-                    } catch (e) {
-                        console.log('error_________________'+e);
-                        // _this.$message.error(data.message)
-                        try {
-                            // let _data = JSON.parse(data.message.match(/(?<=```json).*?(?=```)/)[0])
-                            var message = data.message;
-                            var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
-                            var jsonEnd = message.indexOf("```", jsonStart);
-                            if (jsonStart !== -1 && jsonEnd !== -1) {
-                                var jsonString = message.substring(jsonStart, jsonEnd).trim();
-                                var _data2 = JSON.parse(jsonString);
-                                _this.createPpt(_data2);
-                            }else {
-                                _this.$message.error('生成失败,正在重新生成')
-                                _this.aiGet()
+                    console.log(response);
+                    let data = response.data.FunctionResponse;
+                    if (data.message) {
+                        console.log(data.message);
+                        if (type == 1) {
+                            try {
+                                let _data = JSON.parse(
+                                    data.message.replaceAll("```json", "").replaceAll("```", "")
+                                );
+                                _this.createPpt(_data);
+                                _this.steps = 2;
+                            } catch (e) {
+                                console.log("error_________________" + e);
+                                // _this.$message.error(data.message)
+                                try {
+                                    // let _data = JSON.parse(data.message.match(/(?<=```json).*?(?=```)/)[0])
+                                    var message = data.message;
+                                    var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
+                                    var jsonEnd = message.indexOf("```", jsonStart);
+                                    if (jsonStart !== -1 && jsonEnd !== -1) {
+                                        var jsonString = message
+                                            .substring(jsonStart, jsonEnd)
+                                            .trim();
+                                        var _data2 = JSON.parse(jsonString);
+                                        _this.createPpt(_data2);
+                                        _this.steps = 2;
+                                    } else {
+                                        _this.$message.error("生成失败,正在重新生成");
+                                        _this.aiGet(type);
+                                    }
+                                } catch (error) {
+                                    _this.$message.error("生成失败,正在重新生成");
+                                    _this.aiGet(type);
+                                    _this.loading = false;
+                                }
                             }
-                        } catch (error) {
-                            _this.$message.error('生成失败,正在重新生成')
-                            _this.aiGet()
-                            _this.loading = false   
+                        } else {
+                            _this.outline = data.message;
+                            _this.steps = 1;
+                            _this.loading = false;
                         }
                     }
-                }
                 })
                 .catch((error) => {
-                _this.loading = false
-                console.log(error);
+                    _this.loading = false;
+                    console.log(error);
                 });
         },
         createPpt(array) {
             // 1. 创建PPT
-            const pres = new Pptxgen()
+            const pres = new Pptxgen();
             for (var i = 0; i < array.length; i++) {
                 // 2. 创建一个PPT页面,每调用一次 pres.addSlide() 都可以生成一张新的页面
                 // 建议把每个页面的构造抽成一个个函数,然后通过函数调用生成新页面,代码不会很乱
-                const _slide = pres.addSlide()
+                const _slide = pres.addSlide();
 
                 // 3. 调用addTetx(),在PPT页面中插入文字“Hello World from PptxGenJS...”
                 // 括号里面是对文字的配置,文字横坐标x为1.5,纵坐标y为1.5,字体颜色 363636……
                 // 关于坐标长度与px的转换 x 1 = 127~128px 左右
-                const tempResult1 = array[i].title
+                const page = i+1 > 10 ? i+1 : "0"+(i+1);
+                _slide.addText(page, {
+                    x: 0.2, // 横坐标
+                    y: 0.5,
+                    color: "363636",
+                    fontSize: 20, // 字号
+                    align: "left",
+                });
+                const tempResult1 = array[i].title;
                 _slide.addText(tempResult1, {
-                    x: 0.5, // 横坐标
+                    x: 0.6, // 横坐标
                     y: 0.5,
-                    color: '363636',
-                    fontSize: 24, // 字号
-                    fill: { color: 'F1F1F1' },
-                    align: 'center'
-                })
-                const tempResult2 = array[i].task
+                    color: "363636",
+                    fontSize: 28, // 字号
+                    bold: true,
+                    align: "left",
+                });
+                const tempResult2 = array[i].task;
                 _slide.addText(tempResult2, {
-                    x: 0.5, // 横坐标
-                    y: 2,
-                    color: '363636',
+                    x: 0.6, // 横坐标
+                    y: 1.5,
+                    color: "363636",
                     fontSize: 18, // 字号
-                    fill: { color: 'F1F1F1' },
-                    align: 'center'
-                })
-                const tempResult3 = array[i].points
+                    align: "left",
+                });
+                const tempResult3 = array[i].points;
                 _slide.addText(tempResult3, {
-                    x: 0.5, // 横坐标
-                    y: 4,
-                    color: '363636',
+                    x: 0.6, // 横坐标
+                    y: 3,
+                    w: "60%",
+                    color: "363636",
                     fontSize: 18, // 字号
-                    fill: { color: 'F1F1F1' },
-                    align: 'center'
-                })
+                    align: "left",
+                });
             }
 
             // 获取PPTX文件的ArrayBuffer
 
             // 保存为 Blob 并处理
-            pres.write('blob').then((blob) => {
+            pres.write("blob").then((blob) => {
                 // 现在你有了一个 Blob 对象
                 console.log(blob);
 
-                const file = new File([blob], 'aiPpt.pptx', { type: "application/vnd.openxmlformats-officedocument.presentationml.presentation" });
-                console.log(pres)
-                this.beforeUpload(file)
+                const file = new File([blob], this.courseName+".pptx", {
+                    type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
+                });
+                console.log(pres);
+                this.beforeUpload(file);
             });
-
         },
         beforeUpload(event) {
             var file = event;
@@ -382,23 +459,23 @@ Instruction: Based on the context, follow "Format example", write content.
                         // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
                     })
                     .send(function (err, data) {
-                        _this.loading = false
+                        _this.loading = false;
                         if (err) {
                             _this.$message.error("上传失败");
                         } else {
-                            _this.url = data.Location
+                            _this.url = data.Location;
                             _this.uJson = {
-                              name: file.name,
-                              url: data.Location,
-                              type: 3,
-                            }
+                                name: file.name,
+                                url: data.Location,
+                                type: 3,
+                            };
                             console.log(data.Location);
                         }
                     });
             }
         },
     },
-}
+};
 </script>
 
 <style scoped>
@@ -418,7 +495,6 @@ Instruction: Based on the context, follow "Format example", write content.
     padding: 0px;
 }
 
-
 .dialog_diy>>>.el-dialog__title {
     color: #fff;
 }
@@ -435,7 +511,6 @@ Instruction: Based on the context, follow "Format example", write content.
     color: #fff;
 }
 
-
 .dialog_diy>>>.el-dialog__body,
 .dialog_diy>>>.el-dialog__footer {
     background: #fafafa;
@@ -473,7 +548,6 @@ Instruction: Based on the context, follow "Format example", write content.
     border: 1.5px solid #3681fc !important;
 }
 
-
 .t_box {
     display: flex;
     margin-bottom: 15px;

+ 3 - 2
src/components/pages/aiAddCourse/aiCreateVideoDialog.vue

@@ -16,7 +16,7 @@
                     <span class="detail">{{ item.snippet.description }}</span> 
                     <div class="btn">
                         <span @click="openUrl(item.id.videoId)">查看</span>
-                        <span @click="checkUrl(item.snippet.title,item.id.videoId)">选择</span>
+                        <span @click="checkUrl(item.snippet.title,item.id.videoId)">加入</span>
                     </div>
                 </div>
             </div>
@@ -102,6 +102,7 @@ export default {
                 type: 8,
             }
             this.$emit('createAiVideo', json)
+            this.$message.success('加入成功')
         },
         changeRadio() {
             if (this.radio == 0) {
@@ -118,7 +119,7 @@ export default {
             let _this = this
             _this.loading = true
             this.ajax
-                .get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${this.detail}`)
+                .get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${this.detail}&maxResults=10&type=video&order=relevance&regionCode=HK`)
                 .then((response) => {
                     console.log(response);
                     _this.data = response.data.items

+ 25 - 25
src/components/pages/classroomObservation/components/chatArea.vue

@@ -1161,31 +1161,31 @@ export default {
 
 				// })
 				_historyMessage.push({ role: "user", content: _text });
-				// let params = JSON.stringify({
-				// 	model: "gpt-3.5-turbo",
-				// 	temperature: 0,
-				// 	max_tokens: 4096,
-				// 	top_p: 1,
-				// 	frequency_penalty: 0,
-				// 	presence_penalty: 0,
-				// 	messages: _historyMessage,
-				// 	uid: _uuid,
-				// 	mind_map_question: "",
-				// });
 				let params = JSON.stringify({
-					message: {
-						anthropic_version: "bedrock-2023-05-31",
-						max_tokens: 4096,
-						temperature: 0,
-						top_p: 1,
-						messages: _historyMessage,
-					},
+					model: "gpt-3.5-turbo",
+					temperature: 0,
+					max_tokens: 4096,
+					top_p: 1,
+					frequency_penalty: 0,
+					presence_penalty: 0,
+					messages: _historyMessage,
 					uid: _uuid,
-					model: "Claude 3 Sonnet", // Claude 3 Sonnet或者Claude 3 Haiku
+					mind_map_question: "",
 				});
+				// let params = JSON.stringify({
+				// 	message: {
+				// 		anthropic_version: "bedrock-2023-05-31",
+				// 		max_tokens: 4096,
+				// 		temperature: 0,
+				// 		top_p: 1,
+				// 		messages: _historyMessage,
+				// 	},
+				// 	uid: _uuid,
+				// 	model: "Claude 3 Sonnet", // Claude 3 Sonnet或者Claude 3 Haiku
+				// });
 				this.ajax
-					// .post("https://gpt4.cocorobo.cn/chat", params)
-					.post("https://claude3.cocorobo.cn/chat", params)
+					.post("https://gpt4.cocorobo.cn/chat", params)
+					// .post("https://claude3.cocorobo.cn/chat", params)
 					.then((res) => {
 						if (res.data.FunctionResponse.result == "发送成功") {
 						} else {
@@ -1199,10 +1199,10 @@ export default {
 			}
 		},
 		getAiContent(_uid) {
-			let _source = new EventSource(
-				`https://claude3.cocorobo.cn/streamChat/${_uid}`
-			);
-			// let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+			// let _source = new EventSource(
+			// 	`https://claude3.cocorobo.cn/streamChat/${_uid}`
+			// );
+			let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
 			let _allText = "";
 			let _mdText = "";
 			const md = new MarkdownIt();

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

@@ -594,8 +594,8 @@ export default {
       // this.$router.push(path);
     },
     oepnTemplate(){
-      this.goToCourseTemplate('');
-      // this.dialogVisibleTemplate = true;
+      // this.goToCourseTemplate('');
+      this.dialogVisibleTemplate = true;
     },
     goToCourseTemplate(tid){
       this.$router.push(

+ 26 - 26
src/components/pages/pblCourse/component/chatArea.vue

@@ -162,33 +162,33 @@ export default {
 				history.push({role:"user",content:_msg})
 			}
 			history.push({role:"user",content:this.textValue})
-			// let params = {
-			// 	model: "gpt-3.5-turbo",
-			// 		temperature: 0,
-			// 		max_tokens: 4096,
-			// 		top_p: 1,
-			// 		frequency_penalty: 0,
-			// 		presence_penalty: 0,
-			// 		messages: history,
-			// 		uid: _uuid,
-			// 		mind_map_question: this.textValue,
-			// }
-			let params = JSON.stringify({
-        message: {
-          anthropic_version: "bedrock-2023-05-31",
-          max_tokens: 4096,
-          temperature: 0,
-          top_p: 1,
-          messages: history
-        },
-        uid: _uuid,
-        model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
-      });
+			let params = {
+				model: "gpt-3.5-turbo",
+					temperature: 0,
+					max_tokens: 4096,
+					top_p: 1,
+					frequency_penalty: 0,
+					presence_penalty: 0,
+					messages: history,
+					uid: _uuid,
+					mind_map_question: this.textValue,
+			}
+			// let params = JSON.stringify({
+      //   message: {
+      //     anthropic_version: "bedrock-2023-05-31",
+      //     max_tokens: 4096,
+      //     temperature: 0,
+      //     top_p: 1,
+      //     messages: history
+      //   },
+      //   uid: _uuid,
+      //   model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
+      // });
 			this.scrollBottom();
 			this.textValue = "";
 			this.ajax
-					 // .post("https://gpt4.cocorobo.cn/chat", params)
-					 .post("https://claude3.cocorobo.cn/chat", params)
+					 .post("https://gpt4.cocorobo.cn/chat", params)
+					//  .post("https://claude3.cocorobo.cn/chat", params)
 					.then((res) => {
 						if (res.data.FunctionResponse.result == "发送成功") {
 						} else {
@@ -205,8 +205,8 @@ export default {
 			this.getAiContent(_uuid)
 		},
 		getAiContent(_uid) {
-			let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`);
-      // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+			// let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`);
+      let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
 			let _allText = "";
 			let _mdText = "";
 			const md = new MarkdownIt();

+ 0 - 16
src/components/pages/test/examine/conpoments/cteach.vue

@@ -1,16 +0,0 @@
-<template>
-  <div>
-    班主任
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      
-    };
-  },
-};
-</script>
-<style scoped></style>

+ 26 - 0
src/components/pages/test/examine/conpoments/personPage.vue

@@ -0,0 +1,26 @@
+<template>
+  <div>
+    <div v-if="pType==0">
+      按人员专任教师
+    </div>
+    <div v-if="pType==1">
+      按人员班主任
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    pType: {
+      //0专任教师 1班主任
+      type: Number,
+      default: 0
+    }
+  },
+  data() {
+    return {};
+  }
+};
+</script>
+<style scoped></style>

+ 0 - 26
src/components/pages/test/examine/conpoments/regularTea.vue

@@ -1,26 +0,0 @@
-<template>
-  <div>
-    专任教师
-  </div>
-</template>
-
-<script>
-export default {
-
-  data() {
-    return {
-      
-    };
-  },
-
-  mounted() {
-    
-  },
-
-  methods: {
-    
-  },
-};
-</script>
-
-<style scoped></style>

+ 31 - 0
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -0,0 +1,31 @@
+<template>
+  <div>
+    <div v-if="pType==0">
+      按指标专任教师
+    </div>
+    <div v-if="pType==1">
+      按指标班主任
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    pType: {
+      //0专任教师 1班主任
+      type: Number,
+      default: 0
+    }
+  },
+  data() {
+    return {};
+  },
+
+  mounted() {},
+
+  methods: {}
+};
+</script>
+
+<style scoped></style>

+ 50 - 17
src/components/pages/test/examine/index.vue

@@ -2,37 +2,70 @@
   <div class="testExamine">
     <div class="testTit">
       <div class="teaLis">
-        <div class="teal" @click="cutPage(0)" :class="[type == 0?'Tbor':'']">专任教师</div>
-        <div class="teal" @click="cutPage(1)" :class="[type == 1?'Tbor':'']">班主任</div>
+        <div
+          class="teal"
+          @click="cutPage(0)"
+          :class="[pType == 0 ? 'Tbor' : '']"
+        >
+          专任教师
+        </div>
+        <div
+          class="teal"
+          @click="cutPage(1)"
+          :class="[pType == 1 ? 'Tbor' : '']"
+        >
+          班主任
+        </div>
+      </div>
+      <div style="margin-right: 100px;">
+        <el-select v-model="cutTable" placeholder="请选择">
+          <el-option
+            v-for="item in cutTabOpts"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
       </div>
-      <div style="margin-right: 100px;">按指标</div>
     </div>
     <div class="testCon">
-      <cteach v-if="type == 0"></cteach>
-      <regularTea v-if="type == 1"></regularTea>
+      <targetPage :pType="pType" v-if="cutTable == 0"></targetPage>
+      <personPage :pType="pType" v-if="cutTable == 1"></personPage>
     </div>
   </div>
 </template>
 
 <script>
-import cteach from "./conpoments/cteach.vue";
-import regularTea from "./conpoments/regularTea";
+import personPage from "./conpoments/personPage.vue";
+import targetPage from "./conpoments/targetPage";
 
 export default {
   components: {
-    cteach,
-    regularTea
+    personPage,
+    targetPage
   },
   data() {
     return {
-      type: 0
+      pType: 0,
+      cutTable: 0,
+      cutTabOpts: [
+        {
+          value: 0,
+          label: "按指标"
+        },
+        {
+          value: 1,
+          label: "按人员"
+        }
+      ]
     };
   },
   methods: {
-    cutPage(e){
-      this.type = e
+    cutPage(e) {
+      this.pType = e;
     }
-  },
+  }
 };
 </script>
 
@@ -50,17 +83,17 @@ export default {
   justify-content: space-between;
   align-items: center;
 }
-.teaLis{
+.teaLis {
   display: flex;
 }
-.teal{
+.teal {
   padding: 10px 20px;
   cursor: pointer;
 }
-.Tbor{
+.Tbor {
   border-bottom: 2px rgba(54, 129, 252, 1) solid;
 }
-.testCon{
+.testCon {
   box-sizing: border-box;
   padding: 20px;
 }

+ 1 - 0
src/main.js

@@ -20,6 +20,7 @@ import Clipboard from "clipboard";
 import hevueImgPreview from './components/tools/hevue-img-preview'
 import './assets/css/button.css'
 import './assets/css/dialog.css'
+import './assets/css/markdownCss.css'
 import VueAudio from 'vue-audio-better'
 
 const echarts = require('echarts');

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov