Browse Source

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

SanHQin 11 months ago
parent
commit
1df956442d

+ 1 - 1
dist/index.html

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

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.d77257d7d6e226c97d8f6ad9ce790d0a.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.d77257d7d6e226c97d8f6ad9ce790d0a.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.82aba29f7eade0c11919.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.82aba29f7eade0c11919.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


BIN
src/assets/icon/fileIcon/downImg.png


BIN
src/assets/icon/fileIcon/retractImg.png


BIN
src/assets/icon/fileIcon/upImg.png


+ 91 - 25
src/components/pages/aiAddCourse/addCourse.vue

@@ -393,7 +393,7 @@
                     <div class="add_info_box" style="margin: 0 0 0 auto">
                       <button class="c_pub_button_add pub_btn_add_img" @click="addImg($event)">
                         上传补充资料
-                        <input type="file" accept="*" style="display: none" v-if="inputShow" @change="
+                        <input type="file" accept=".docx,.doc,.ppt,.pptx,.md,.txt" style="display: none" v-if="inputShow" @change="
                           beforeUploadInfo2(
                             $event,
                             13
@@ -677,13 +677,18 @@
                 <div class="task_outline">
                   <div class="outline_detail" v-loading="cpoteLoading.cpote1">
                     <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入概念群"
-                      v-model="cpote.cpote1"></textarea>
+                      v-model="cpote.cpote1" v-if="cpote.cpote1s"></textarea>
+                    <div class="markBox" v-html="MarkdownT(cpote.cpote1)" v-else></div>
                     <div class="op_box">
                       <div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
-                      <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                        <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote1')"
+                      <div style="display: flex;">
+                          <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                            <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote1')"
                             @click="openAiDialog(2, 'aiCpote1')">智能优化</div>
-                      </el-tooltip>
+                          </el-tooltip>
+                          <div class="r_pub_button_edit" style="margin-left:10px" @click="editCpote('cpote1s')">{{
+                            cpote.cpote1s ? '确定' : '编辑'}}</div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -697,13 +702,18 @@
                 <div class="task_outline">
                   <div class="outline_detail" v-loading="cpoteLoading.cpote2">
                     <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入问题链"
-                      v-model="cpote.cpote2"></textarea>
+                      v-model="cpote.cpote2" v-if="cpote.cpote2s"></textarea>
+                    <div class="markBox" v-html="MarkdownT(cpote.cpote2)" v-else></div>
                     <div class="op_box">
                       <div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
-                      <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                        <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote2')"
-                            @click="openAiDialog(2, 'aiCpote2')">智能优化</div>
-                      </el-tooltip>
+                      <div style="display: flex;">
+                          <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                            <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote2')"
+                            @click="openAiDialog(2, 'aiCpote1')">智能优化</div>
+                          </el-tooltip>
+                          <div class="r_pub_button_edit" style="margin-left:10px" @click="editCpote('cpote2s')">{{
+                            cpote.cpote2s ? '确定' : '编辑'}}</div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -717,13 +727,18 @@
                 <div class="task_outline">
                   <div class="outline_detail" v-loading="cpoteLoading.cpote3">
                     <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入目标层"
-                      v-model="cpote.cpote3"></textarea>
+                      v-model="cpote.cpote3" v-if="cpote.cpote3s"></textarea>
+                    <div class="markBox" v-html="MarkdownT(cpote.cpote3)" v-else></div>
                     <div class="op_box">
                       <div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
-                      <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                        <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote3')"
+                      <div style="display: flex;">
+                          <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                            <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote3')"
                             @click="openAiDialog(2, 'aiCpote3')">智能优化</div>
-                      </el-tooltip>
+                          </el-tooltip>
+                          <div class="r_pub_button_edit" style="margin-left:10px" @click="editCpote('cpote3s')">{{
+                            cpote.cpote3s ? '确定' : '编辑'}}</div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -737,13 +752,18 @@
                 <div class="task_outline">
                   <div class="outline_detail" v-loading="cpoteLoading.cpote4">
                     <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols placeholder="请输入任务簇"
-                      v-model="cpote.cpote4"></textarea>
+                      v-model="cpote.cpote4" v-if="cpote.cpote4s"></textarea>
+                      <div class="markBox" v-html="MarkdownT(cpote.cpote4)" v-else></div>
                     <div class="op_box">
                       <div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
-                      <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
-                        <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote4')"
+                      <div style="display: flex;">
+                          <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                            <div class="r_pub_button_op" @contextmenu.prevent="openAiDialog(1, 'aiCpote4')"
                             @click="openAiDialog(2, 'aiCpote4')">智能优化</div>
-                      </el-tooltip>
+                          </el-tooltip>
+                          <div class="r_pub_button_edit" style="margin-left:10px" @click="editCpote('cpote4s')">{{
+                            cpote.cpote4s ? '确定' : '编辑'}}</div>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -1498,9 +1518,9 @@
                         <button class="c_pub_button_add pub_btn_add_img" @click="createTeacherAn(0)">
                           AI生成教案
                         </button>
-                        <!-- <button class="c_pub_button_add pub_btn_add_img" @click="openAiCreateVideo(0)">
+                        <button class="c_pub_button_add pub_btn_add_img" @click="openAiCreateVideo(0)">
                           AI生成视频
-                        </button> -->
+                        </button>
                       </div>
                       <div v-if="
                         unitJson[unitIndex].chapterInfo[0].taskJson[
@@ -5218,8 +5238,8 @@
     </aiDialog>
     <tipsDialog :dialogVisibleTips.sync="dialogVisibleTips" :tipsJson.sync="tipsJson" :aiJson="aiJson" :userid="userid"
       @retrunCourse="retrunCourse" :templateid="templateid"></tipsDialog>
-    <aiCreateDialog :dialogVisibleAiCreate.sync="dialogVisibleAiCreate" :courseName="courseName" @createAiPpt="createAiPpt" :infoData="infoData"></aiCreateDialog>
-    <aiCreateVideoDialog :dialogVisibleAiCreateVideo.sync="dialogVisibleAiCreateVideo" :courseName="courseName"></aiCreateVideoDialog>
+    <aiCreateDialog :dialogVisibleAiCreate.sync="dialogVisibleAiCreate" :courseName="courseName" @createAiPpt="createAiPpt" :infoData="infoData" :courseTypeId="courseTypeId"></aiCreateDialog>
+    <aiCreateVideoDialog :dialogVisibleAiCreateVideo.sync="dialogVisibleAiCreateVideo" :courseName="courseName" @createAiVideo="createAiVideo"></aiCreateVideoDialog>
   </div>
 </template>
 
@@ -5582,7 +5602,7 @@ export default {
       aitype: "",
       aiJson: {
         "aiDetail": "请根据<课程简要描述>设计一个名为<课程名字>的<课程学科>学科的,面向<面向年级>的项目式学习课程。",
-        "aiOutline": "请为这个名为<课程名字>的<课程学科>学科的,面向<面向年级>学生的项目式学习课程设计序列教学活动(需要每个任务都需要至少50个token的详细描述)。你需要参考课程简要描述<课程简要描述>,并产出每个教学任务的设计(可以直接使用文件内容)以及每个教学活动的评价量规(学生能做到...)。",
+        "aiOutline": "请为这个名为<课程名字>的<课程学科>学科的,面向<面向年级>学生的项目式学习课程设计序列教学活动(需要每个任务都需要至少100个token的详细描述)。你需要参考课程简要描述<课程简要描述>,并产出每个教学任务的设计(可以直接使用文件内容)以及每个教学活动的评价量规(学生能做到...)。",
         "aiTask": "请根据<教学任务教案>。",
         "aiDetail1": "请根据<课程描述>,重新设计该教学任务。任务需要至少50个token的详细描述,包含任务设计,评价标准。",
         "aiDetail2": "请你在考虑到整个课程的情况下,优化该任务描述和任务名:<任务名>:<任务描述>",
@@ -6859,6 +6879,10 @@ export default {
     openAiCreateVideo(){
       this.dialogVisibleAiCreateVideo = true;
     },
+    createAiVideo(json){
+      this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.push(json);
+      this.dialogVisibleAiCreateVideo = false;
+    },
     createTeacherAn(){
       this.loading = true
       let md = new MarkdownIt();
@@ -7566,6 +7590,22 @@ export default {
 
       var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
       var _this = this;
+      var xianObj = ['DOCX','DOC','PPT','PPTX','MD','TXT']
+      if (
+        xianObj.indexOf(
+            file.name
+              .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase()
+          ) == -1
+        ) {
+        this.$message.error("请上传.doc,.docx,.ppt,.pptx,.md,.txt文件!");
+        this.inputShow = true;
+        // var a = _this.$refs.upload1.uploadFiles;
+        // a.splice(a.length - 1, a.length);
+        // loading.close();
+        return;
+      }
+
       if (type == 3) {
         var b = [
           "DOC",
@@ -7613,6 +7653,7 @@ export default {
           }
         }
       }
+      
       this.inputShow = false;
       _this.infoprogress = 0;
       _this.infoproVisible = true;
@@ -10964,11 +11005,17 @@ export default {
           .then((res) => {
             let _unitJson = JSON.parse(res.data[0][0].chapters);
             let fileInfo = []
+            var xianObj = ['DOCX','DOC','PPT','PPTX','MD','TXT']
+
             for(var i = 0; i < _unitJson.length; i++){
               let tasks = _unitJson[i].chapterInfo[0].taskJson
               for(var j = 0; j < tasks.length; j++){
-                if(tasks[j].chapterData.length){
-                  fileInfo = [...fileInfo, ...tasks[j].chapterData] 
+                let _infoData = tasks[j].chapterData.filter(el => {
+                  return xianObj.indexOf(el.url.split(".")[el.url.split(".").length - 1].toLocaleUpperCase()) != -1
+                })
+
+                if(_infoData.length){
+                  fileInfo = [...fileInfo, ..._infoData] 
                 }
               }
             }
@@ -12890,7 +12937,18 @@ export default {
       }
       this.$forceUpdate();
     },
+    editCpote(index){
+      if(this.cpote[index]){
+        this.cpote[index] = false
+      }else {
+        this.cpote[index] = true
+      }
+      this.$forceUpdate();
+    },
     openAiDialog(clickType, type, callback, index, tindex) {
+      // if(clickType == 1){
+      //   return;
+      // }
       if (this.courseName == "") {
         this.$message.error("请补充填写课程名称");
         return;
@@ -13096,6 +13154,7 @@ export default {
 // ${this.infoData.length ? '使用文件检索的方式完整的去分析文件内容,并请完全按照要求输出。' : ''}
         let message = `NOTICE
 Role: 作为学生的学习指导Agent,你熟悉熟悉PBL(基于问题的学习)和5EX教学模型,能够根据学生的学情数据(当前的学习任务设计、学习表现数据、作业数据等)生成自适应的学习任务和对应的5道考核题目。
+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.
 
@@ -13254,6 +13313,7 @@ ${this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" ? '## 目标层\n'+t
 // 补充描述:${this.courseText2} ##补充参考资料和
 
       let msg = `
+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".
 
 --------
@@ -14030,6 +14090,7 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
         }
       }
       let messages = `
+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".
 
 --------
@@ -14139,6 +14200,7 @@ ${msg} 及#教学任务描述 以文本格式输出任务设计和评价标准
       const _tindex = 'task-' + index
       const _tindex2 = index
       let messages = `
+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".
 
 --------
@@ -14247,6 +14309,7 @@ ${msg}
       const _tindex3 = tindex
       // **重点考虑该任务及工具名和工具内容的情况下*
       let messages = `
+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".
 
 --------
@@ -14363,6 +14426,7 @@ ${msg} 输出格式和内容要求参考#格式与要求
       }
       // **重点考虑该任务详情**
       let messages = `
+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".
 
 --------
@@ -14453,6 +14517,7 @@ ${msg} 输出格式和内容要求参考# 格式与要求
         _text2 += `任务名称:${_this.unitJson[0].chapterInfo[0].taskJson[i].task} 教案描述:${_this.unitJson[0].chapterInfo[0].taskJson[i].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')} \n`
       }
       let messages = `
+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".
 
 --------
@@ -14590,6 +14655,7 @@ ${_text2}`
 // ${this.cpote[_index] ? '## 优化内容\n'+this.cpote[_index] : ''}
 
       let messages = `
+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".
 
 ${msg} 

+ 236 - 157
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,16 +43,20 @@ export default {
     props: {
         dialogVisibleAiCreate: {
             type: Boolean,
-            default: false
+            default: false,
         },
         courseName: {
             type: String,
-            default: ""
+            default: "",
         },
         infoData: {
             type: Array,
-            default: ""
-        }
+            default: "",
+        },
+        courseTypeId: {
+            type: Array,
+            default: "",
+        },
     },
     // 根据用户给你的参考资料
     data() {
@@ -65,147 +75,182 @@ 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页讲解你的输出应该符合#Format example
 
 ## 工作流
-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) {
+## 限制
+- 你不能输出错误的知识,如果你实在不清楚,修改大纲中的知识点。
+- 你不能输出违反伦理的内容
 
-            } 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
+  --知识点:知识点2
+  --知识点:知识点3
+  --知识点:知识点4
+  --知识点:知识点5
+
+# 限制
+- 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
+- 你不能输出违反伦理的内容
+`;
+            }
 
             // let params = JSON.stringify({
             //     // "model": "Chat",
@@ -245,91 +290,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)
-                        _this.$message.error('生成失败,正在重新生成')
-                        _this.aiGet()
-                        _this.loading = false
+                    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;
+                                }
+                            }
+                        } 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], "aiPpt.pptx", {
+                    type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
+                });
+                console.log(pres);
+                this.beforeUpload(file);
             });
-
         },
         beforeUpload(event) {
             var file = event;
@@ -367,23 +449,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>
@@ -403,7 +485,6 @@ Instruction: Based on the context, follow "Format example", write content.
     padding: 0px;
 }
 
-
 .dialog_diy>>>.el-dialog__title {
     color: #fff;
 }
@@ -420,7 +501,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;
@@ -458,7 +538,6 @@ Instruction: Based on the context, follow "Format example", write content.
     border: 1.5px solid #3681fc !important;
 }
 
-
 .t_box {
     display: flex;
     margin-bottom: 15px;

+ 48 - 9
src/components/pages/aiAddCourse/aiCreateVideoDialog.vue

@@ -14,12 +14,16 @@
                     <img :src="item.snippet.thumbnails.high.url" />
                     <span class="name">{{ item.snippet.title }}</span> 
                     <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>
+                    </div>
                 </div>
             </div>
         </div>
         <span slot="footer" class="dialog-footer">
             <!-- <el-button @click="aiGet" type="primary">重新生成</el-button> -->
-            <el-button @click="confirm" type="primary">确 定</el-button>
+            <!-- <el-button @click="confirm" type="primary">确 定</el-button> -->
             <el-button @click="close">关 闭</el-button>
         </span>
     </el-dialog>
@@ -87,12 +91,17 @@ export default {
         close() {
             this.$emit('update:dialogVisibleAiCreateVideo', false)
         },
-        confirm() {
-            if (this.url) {
-                this.$emit('createAiPpt', this.uJson)
-            } else {
-                this.$message.error('请先生成ppt');
+        openUrl(url){
+            window.open('https://www.youtube.com/embed/'+url)
+        },
+        checkUrl(name,id) {
+            let json = {
+                name: "链接",
+                title: name,
+                url: 'https://www.youtube.com/embed/'+id,
+                type: 8,
             }
+            this.$emit('createAiVideo', json)
         },
         changeRadio() {
             if (this.radio == 0) {
@@ -109,7 +118,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`)
                 .then((response) => {
                     console.log(response);
                     _this.data = response.data.items
@@ -238,11 +247,11 @@ export default {
 }
 .video_box {
     width: calc(100% / 2 - 10px);
-    overflow: hidden;
+    /* overflow: hidden; */
     margin-right: 10px;
     display: flex;
     flex-direction: column;
-    margin-bottom: 10px;
+    margin-bottom: 15px;
     cursor: pointer;
 }
 .video_box > img{
@@ -256,5 +265,35 @@ export default {
 .video_box > .name{
     color: #000;
     margin: 5px 0;
+    height: 32px;
+}
+
+.btn{
+    width: 100%;
+    height: 35px;
+    display: flex;
+    align-items: center;
+    margin-top: auto;
+}
+
+.btn > span:hover{
+    background: #4087f1;
+}
+
+.btn > span{
+    width: 100%;
+    height: 100%;
+    background: #3681fc;
+    color: #fff;
+    border-radius: 5px;
+    margin-top: 10px;
+    cursor: pointer;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.btn > span + span{
+    margin-left: 10px;
 }
 </style>

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

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

+ 28 - 0
src/components/pages/test/add/components/checkOrder.vue

@@ -440,6 +440,19 @@ export default {
         },
         editCheck(index, item) {
 
+        },
+        setJsonCheck(newItems){
+            let _index = this.checkC.replace("x", "").split("-");
+            let cJson = {}
+            if (this.ctype == 1) {
+                cJson = newItems[_index[0]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].json)) : '';
+            } else if (this.ctype == 2) {
+                cJson = newItems[_index[0]].array[_index[1]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].array[_index[1]].json)) : '';
+            } else if (this.ctype == 3) {
+                cJson = newItems[_index[0]].array[_index[1]].array[_index[2]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].array[_index[1]].array[_index[2]].json)) : '';
+            }
+            this.$emit("update:cJson", cJson)
+            this.$forceUpdate()
         },
         dragStart(val, i, index) {
             if (this.isdrag != index) {
@@ -478,7 +491,12 @@ export default {
             newItems.splice(this.oldIndex, 1);
             // 在列表中目标位置增加新的节点
             newItems.splice(this.newIndex, 0, this.oldData);
+            console.log('................',...newItems);
+            /* 修改选中的并且切换的题目 */
+            this.setJsonCheck(newItems)
+
             this.$emit("changeJson", [...newItems]);
+
             this.typeIndex = "";
             this.newIndex = "";
             this.dragType = "";
@@ -536,6 +554,11 @@ export default {
             } else {
                 newItems[this.newIndex].array.splice(this.newIndex2, 0, this.oldData);
             }
+
+            /* 修改选中的并且切换的题目 */
+            this.setJsonCheck(newItems)
+            
+
             this.$emit("changeJson", [...newItems]);
             this.typeIndex = "";
             this.newIndex = "";
@@ -597,6 +620,11 @@ export default {
             } else {
                 newItems[this.newIndex].array.splice(this.newIndex2, 0, this.oldData);
             }
+
+            /* 修改选中的并且切换的题目 */
+            this.setJsonCheck(newItems)
+
+
             this.$emit("changeJson", [...newItems]);
             this.typeIndex = "";
             this.newIndex = "";

+ 1 - 0
src/components/pages/test/add/edit/index.vue

@@ -78,6 +78,7 @@ export default {
       return s ? JSON.parse(JSON.stringify(s)) : ''
     },
     changeJson(json) {
+      console.log(json);
       this.$emit("update:cJson", json);
     }
   },

+ 539 - 22
src/components/pages/test/check/index.vue

@@ -24,7 +24,7 @@
           <div class="r_pub_button_retrun" @click="retrunCourse">返回</div>
         </div>
         <div class="step_box" ref="stepBox" v-loading="pdfLoading">
-          <div class="test_title">
+          <div class="test_title" :style="!isDesktop?'justify-content: center;':''">
             <div class="left">
               <div class="title">{{ testJson.title }}</div>
               <div class="info"  v-if="isDesktop">
@@ -61,7 +61,7 @@
               </div>
             </div>
           </div>
-          <div class="search_nav">
+          <div class="search_nav" v-if="isDesktop">
             <div class="right">
               <span :class="{ active: stype == 1 }" @click="checkDataType(1)">按题目查看</span>
               <span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
@@ -118,7 +118,15 @@
               <div class="btnA" v-if="stype == 3" @click="exportAllWord2">导出人员数据</div>
             </div>
           </div>
-          <div class="title_content" v-if="stype == 1">
+          <div class="search_nav" style="display:flex;justify-content:space-evenly;border: none;" v-if="!isDesktop">
+            <div class="right">
+              <span :class="{ active2: stype == 1 }" @click="checkDataType(1)">按题目查看</span>
+              <span :class="{ active2: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
+              <span :class="{ active2: stype == 3 }" @click="checkDataType(3)" v-show="false">按数量查看</span>
+            </div>
+          </div>
+
+          <div class="title_content" v-if="stype == 1 && isDesktop" v-loading="isLoading">
             <div class="title_box" v-if="!testArray.length"
               style="display: flex;align-items: center;justify-content: center;height: 500px;">
               暂无内容
@@ -276,7 +284,190 @@
               </div>
             </div>
           </div>
-          <div class="table_content" v-if="stype == 2">
+          <div class="title_content" v-if="stype == 1 && !isDesktop" v-loading="isLoading">
+            <div class="title_box" v-if="!testArray.length"
+              style="display: flex;align-items: center;justify-content: center;height: 500px;">
+              暂无内容
+            </div>
+            <div class="title_box" v-for="(item, index) in testArray" :key="index">
+              <div class="title" style="font-size: 16px;display: flex;justify-content: space-between;align-items: center;">
+                <!-- <el-tooltip :content="selectType(item)" placement="top" effect="dark">
+                  <span class="test_icon"
+                    :class="{ test_icon_check: item.type == 1 && item.atype == 2, test_icon_checkO: item.type == 1 && item.atype == 1, test_icon_gap: item.type == 3, test_icon_file: item.type == 5, test_course_file: item.type == 6, test_eva_file: item.type == 7,test_icon_time: item.type == 8 }"></span>
+                </el-tooltip> -->
+                <div style="display: flex;">
+                  <div class="topicTitCss">第{{ index+1 }}题:</div>
+                  <el-tooltip :content="item.title" placement="top" effect="dark">
+                    <div style="width: 100px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.title }}</div>
+                  </el-tooltip>
+
+                  
+                </div>
+                <div style="display: flex;">
+                  <!-- <div v-if="item.type==7" style="right:0;position: absolute;">平均分:{{ getAverageScore(index) }}</div> -->
+                  <div style="color: rgba(0, 0, 0, 0.4);display: flex;align-items: center;">[{{ selectType(item) }}]</div>
+                  <!-- <el-button style="padding: 5px;" v-if="item.type == 5 && item.array.length>0" class="title_downBtn" type="primary" size="small" @click.stop="downloadFileType5(item.array,item.title)">批量下载附件</el-button> -->
+                </div>
+              </div>
+              <div class="detail" v-if="item.detail">{{ item.detail }}</div>
+              <div class="content1" style="width:100%;display: block;" v-if="item.type == 1">
+                <div class="left" style="width:100%" v-if="!item.cut">
+                  <div class="isDesktopTitle">
+                    <div>选项</div>
+                    <div>小计</div>
+                    <div>比例</div>
+                  </div>
+                  <div class="isDesktopTitle" v-for="(data, index2) in item.array" :key="index + '-' + index2">
+                    <!-- <span> -->
+                      <el-tooltip :content="data.name" placement="top" effect="dark">
+                        <!-- content to trigger tooltip here -->
+                        <div>{{ data.name }}</div>
+                      </el-tooltip>
+                    <!-- </span> -->
+                    <div>{{ data.count }}</div>
+                    <div>
+                      {{ data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0 }}
+                       <!-- <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
+                        :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress> -->
+                    </div>
+                  </div>
+                </div>
+                <div class="right isDesktopRight" v-if="item.cut">
+                  <checkPie :dataJ="item.array"></checkPie>
+                </div>
+                <div class="cutBtnBlockCss">
+                  <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
+                </div>
+              </div>
+              <div class="content2"  style="width:100%;display: block;" v-if="item.type == 3">
+                <div class="left" style="width:100%" v-if="!item.cut">
+                  <div class="title">
+                    <span>序号</span>
+                    <span>词频</span>
+                    <span>答案文本</span>
+                  </div>
+                  <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
+                    <span>{{ index2 + 1 }}</span>
+                    <span>{{ data.count }}次</span>
+                    <el-tooltip :content="data.name" placement="top" effect="dark">
+                      <!-- content to trigger tooltip here -->
+                      <span>{{ data.name }}</span>
+                    </el-tooltip>
+                  </div>
+                </div>
+                <div class="right isDesktopRight" v-if="item.cut">
+                  <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
+                    :wordClick="wordClickHandler">
+                  </wordcloud>
+                </div>
+                <div class="cutBtnBlockCss">
+                  <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
+                </div>
+              </div>
+              <div class="content3" v-if="item.type == 5">
+                <div class="file" v-for="(file, index2) in item.array" :key="index + '-' + index2"
+                  @click.stop="checkFile(file)">
+                  <img class="download" src="../../../../assets/icon/fileIcon/download.png"
+                    @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
+                  <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
+                  <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
+                  <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
+                  <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
+                  <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
+                  <div class="name">
+                    <el-tooltip :content="file.name" placement="top" effect="dark">
+                      <span>{{ file.name }}</span>
+                    </el-tooltip>
+                  </div>
+                </div>
+              </div>
+              <div class="content4" v-if="item.type == 6">
+                <div class="out_box" v-for="(item, index) in item.courseArray" :key="index + '-' + index2">
+                  <div class="tup">
+                    <img :src="item.cover != null && item.cover != ''
+    ? JSON.parse(item.cover).length > 0
+      ? JSON.parse(item.cover)[0].url
+      : mr
+    : mr
+    " alt />
+                    <div class="bottom_box">
+                      <div>
+                        <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
+                          <span>{{ item.title }}</span>
+                        </el-tooltip>
+                      </div>
+                      <div class="kc_t">
+                        <span>{{ item.username }}</span>
+                        <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span>
+                      </div>
+                      <div class="kc_time">
+                        <span style="color: #717C8D">创建日期:</span>{{ item.time }}
+                      </div>
+                      <div class="kc_time">
+                        <span style="color: #717C8D">修改日期:</span>{{ item.update_at }}
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <!-- <div class="courses" v-for="(courses, index2) in item.array" :key="index + '-' + index2">
+                  {{ courses }}
+                </div> -->
+              </div>
+              <div class="content1" style="width:100%;display: block;" v-if="item.type == 7">
+                <div class="left" style="width:100%" v-if="!item.cut">
+                  <div class="isDesktopTitle">
+                    <div>评分</div>
+                    <div>小计</div>
+                    <div style="width: 120px;">比例</div>
+                  </div>
+                  <div class="isDesktopTitle" v-for="(data, index2) in item.array" :key="index + '-' + index2">
+                    <!-- <span> -->
+                    <div>{{ data.name }}</div>
+                    <!-- </span> -->
+                    <div>{{ data.count }}</div>
+                    <div style="width: 120px;">
+                      {{ data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0 }}
+                      <!-- <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
+                        :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress> -->
+                    </div>
+                  </div>
+                </div>
+                <div class="right isDesktopRight"  v-if="item.cut">
+                  <checkPie :dataJ="item.array"></checkPie>
+                </div>
+                <div class="cutBtnBlockCss">
+                  <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
+                </div>
+
+              </div>
+              <div class="content2"  style="width:100%;display: block;" v-if="item.type == 8">
+                <div class="left" style="width:100%" v-if="!item.cut">
+                  <div class="title">
+                    <span>序号</span>
+                    <span>词频</span>
+                    <span>日期</span>
+                  </div>
+                  <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
+                    <span>{{ index2 + 1 }}</span>
+                    <span>{{ data.count }}次</span>
+                    <el-tooltip :content="data.name" placement="top" effect="dark">
+                      <!-- content to trigger tooltip here -->
+                      <span>{{ data.name }}</span>
+                    </el-tooltip>
+                  </div>
+                </div>
+                <div class="right isDesktopRight" v-if="item.cut">
+                  <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
+                    :wordClick="wordClickHandler">
+                  </wordcloud>
+                </div>
+                <div class="cutBtnBlockCss">
+                  <div class="cutBtnCss" @click="item.cut=!item.cut">{{ item.cut?'查看详情':'查看视图' }}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="table_content" v-if="stype == 2 && isDesktop">
             <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2" v-loading="isLoading"
               style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
               @filter-change="handleFilterChange">
@@ -341,6 +532,205 @@
               </el-table-column>
             </el-table>
           </div>
+          <div class="table_content" v-if="stype == 2 && !isDesktop">
+
+            <div v-for="(i,index) in worksArray"  :key="i.id" class="isDesktopTable_content">
+              <div class="isDTitle CutCss">
+                <div style="font-size: 16px;font-weight: 600;">{{ i.name }}</div>
+                <div :style="'font-size: 14px',i.cut?'color:rgba(54, 129, 252, 1)':'color: rgba(0, 0, 0, 0.6);'">{{ i.time }}</div>
+                <div @click="i.cut=!i.cut">
+                  <img v-if="!i.cut" src="../../../../assets/icon/fileIcon/downImg.png" alt="">
+                  <img v-else src="../../../../assets/icon/fileIcon/upImg.png" alt="">
+                </div>
+              </div>
+              <div v-if="i.cut">
+                <div class="isDBri">
+                  <div>序号:{{ i.time }}</div>
+                  <div>提交时间:{{ i.time }}</div>
+                  <div>评课人:</div>
+                </div>
+                <div style="height: 1px;background-color: #717C8D;width: 100%;margin-bottom: 10px;"></div>
+                <div>
+                  <div v-for="(k,kin) in chapters" :key="k.id" class="isCTiBlc">
+                    <div v-if="k.type == 1">
+                      <div class="isDTitle2">
+                        <div style="display: flex;justify-content: space-between;">
+                          <div style="display: flex;">
+                            <span class="topicTitCss">第{{kin+1}}题:</span>
+                            <div class="isDTitle2JsonTit">
+                              {{ k.json.title }}
+                            </div>
+                          </div>
+                          <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>  
+                        </div>
+                        <div class="IsDAnswer">
+                          <div v-for="(r, index2) in i.array[kin].json.answer2"
+                          :key="index + '-' + index2">
+                          {{ i.array[kin].json.array[r].option }}
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div v-if="k.type == 3 || k.type == 8">
+                      <div class="isDTitle2">
+                        <div style="display: flex;justify-content: space-between;">
+                          <div style="display: flex;">
+                            <span class="topicTitCss">第{{kin+1}}题:</span>
+                            <div class="isDTitle2JsonTit">
+                              {{ k.json.title }}
+                            </div>
+                          </div>
+                          <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
+                        </div>
+                        <div class="IsDAnswer">
+                          {{ i.array[kin].json.answer2 }}
+                        </div>
+                      </div>
+                    </div>
+                    <div v-if="k.type == 5">
+                      <div class="isDTitle2">
+                        <div style="display: flex;justify-content: space-between;">
+                          <div style="display: flex;">
+                            <span class="topicTitCss">第{{kin+1}}题:</span>
+                            <div class="isDTitle2JsonTit">
+                              {{ k.json.title }}
+                            </div>
+                          </div>
+                          <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
+                        </div>
+                        <div class="IsDAnswer">
+                          <div class="IsDFile" v-for="(file, index2) in i.array[kin].json.file"
+                            :key="index + '-' + index2" @click.stop="checkFile(file)">
+                            <img class="IsDownload" src="../../../../assets/icon/fileIcon/download.png"
+                              @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
+                            <img class="IsDImg" :src="wordIcon" alt="" v-if="file.type == 1" />
+                            <img class="IsDImg" :src="videoIcon" alt="" v-if="file.type == 2" />
+                            <img class="IsDImg" :src="file.url" alt="" v-if="file.type == 3" />
+                            <img class="IsDImg" :src="wordIcon" alt="" v-if="file.type == 4" />
+                            <img class="IsDImg" :src="fileIcon" alt="" v-if="file.type == 5" />
+                            <div class="name" style="height: 30px;background-color: #ccc;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
+                              <!-- <el-tooltip :content="file.name" placement="top" effect="dark"> -->
+                                {{ file.name }}
+                              <!-- </el-tooltip> -->
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div v-if="k.type.type == 6">
+                      <div class="isDTitle2">
+                        <div style="display: flex;justify-content: space-between;">
+                          <div style="display: flex;">
+                            <span class="topicTitCss">第{{kin+1}}题:</span>
+                            <div class="isDTitle2JsonTit">
+                              {{ k.json.title }}
+                            </div>
+                          </div>
+                          <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
+                        </div>
+                        <div class="IsDAnswer">
+                          {{ i.array[kin].json.answer2 }}
+                        </div>
+                      </div>
+                    </div>
+                    <div v-if="k.type == 7">
+                      <div class="isDTitle2">
+                        <div style="display: flex;justify-content: space-between;">
+                          <div style="display: flex;">
+                            <span class="topicTitCss">第{{kin+1}}题:</span>
+                            <div class="isDTitle2JsonTit">
+                              {{ k.json.title }}
+                            </div>
+                          </div>
+                          <div style="color: rgba(0, 0, 0, 0.4);">[{{ selectType2(k.type,k.json.type) }}]</div>
+                        </div>
+                        <div class="IsDAnswer">
+                          {{ getScore(i.array[index].json) }}
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+
+                </div>
+                
+                <div style="width: 100%;display: flex;justify-content: end;">
+                  <div @click="i.cut=!i.cut" style="display: flex;flex-direction: column;align-items: center">
+                    <img src="../../../../assets/icon/fileIcon/retractImg.png" alt="">
+                    <div style="color: rgba(0, 0, 0, 0.4);font-size: 16px;">收起</div>
+                  </div>
+                </div>
+              </div>
+
+              <div style="height: 1px;background-color: #717C8D;width: 100%;margin-bottom: 10px;"></div>
+
+            </div>
+
+
+
+            <!-- <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2" v-loading="isLoading"
+              style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
+              @filter-change="handleFilterChange">
+              <el-table-column fixed label="序号" width="80px" align="left">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column fixed prop="name" label="提交人" width="120px" align="left">
+              </el-table-column>
+              <el-table-column prop="time" label="提交时间" width="170px" align="left">
+								<template slot-scope="scope">
+									<span :style="`${testJson.overtime&&new Date(testJson.overtime)<new Date(scope.row.time)?'color:#d12920':''}`">{{ scope.row.time }}</span>
+								</template>
+              </el-table-column>
+              <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title"
+                :min-width="item.type == 5 ? 200 : 150" align="left" :filters="item.type == 1 ? item.nameFilters : item.type ==  6? item.nameFilters : null"
+                :filter-method="item.type == 1 ? (value, row) => { return filterName(value, row, index) } : item.type == 6?(value, row) => { return filterCourse(value, row, index)}:null"
+                :filter-placement="item.type == 1 || item.type ==6 ? filterPlacement : null">
+
+                <template slot-scope="scope">
+                  <div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
+                    <span class="answer_type" v-for="(answer2, index2) in scope.row.array[index].json.answer2"
+                      :key="index + '-' + index2">{{ scope.row.array[index].json.array[answer2].option }}</span>
+                  </div>
+                  <div v-if="scope.row.array[index].type == 3 || scope.row.array[index].type == 8" style="display: flex; flex-wrap: wrap;">
+                    {{ scope.row.array[index].json.answer2 }}
+                  </div>
+                  <div v-if="scope.row.array[index].type == 5" style="display: flex; flex-wrap: wrap;"
+                    class="table_file">
+                    <div class="file" v-for="(file, index2) in scope.row.array[index].json.file"
+                      :key="index + '-' + index2" @click.stop="checkFile(file)">
+                      <img class="download" src="../../../../assets/icon/fileIcon/download.png"
+                        @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
+                      <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
+                      <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
+                      <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
+                      <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
+                      <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
+                      <div class="name">
+                        <el-tooltip :content="file.name" placement="top" effect="dark">
+                          <span>{{ file.name }}</span>
+                        </el-tooltip>
+                      </div>
+                    </div>
+                  </div>
+                  <div v-if="scope.row.array[index].type == 6" style="display: flex; flex-wrap: wrap;">
+                    {{ scope.row.array[index].json.answer2}}
+                  </div>
+                  <div v-if="scope.row.array[index].type == 7" style="display: flex; flex-wrap: wrap;">
+                    {{ getScore(scope.row.array[index].json) }}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" width="300px" fixed="right" v-if="isN!=1">
+
+                <template slot-scope="scope">
+                  <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
+                  <el-button @click="setWordHtml(scope.row)" type="primary" size="small">导出答题信息</el-button>
+                  <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table> -->
+          </div>
           <div class="table_content" v-if="stype == 3">
             <div class="student_table">
               <el-table ref="table" :data="tableData" border :fit="true" v-loading="isLoading" style="width: 100%"
@@ -509,17 +899,6 @@ export default {
         // `this` 指向 vm 实例
         return this.TeachingOptions.filter(i => {return i.id == this.TeachingValue})
     },
-    // TeachNameCpt(){
-    //   return function (val) {
-    //     let a = this.TeachingOptions.filter(i => {
-    //       if (i.id == val) {
-    //          return i.name  
-    //       }}
-    //     )
-    //     console.log('aaaaaaaaaaaaaa',a);
-    //     return a;
-    //   };
-    // },
     // vcWords() {
     //   return function (array) {
     //     let _array = [];
@@ -564,6 +943,25 @@ export default {
           return '日期'
         }
       };
+    },
+    selectType2() {
+      return function (val1,val2) {
+        if (val1 == 1 && val2 == 2) {
+          return '多选题'
+        } else if (val1 == 1 && val2 == 1) {
+          return '单选题'
+        } else if (val1 == 3) {
+          return '问答题'
+        } else if (val1 == 5) {
+          return '附件'
+        } else if (val1 == 6) {
+          return '课程'
+        } else if (val1 == 7) {
+          return '评分'
+        } else if (val1 == 8) {
+          return '日期'
+        }
+      };
     },
 		// 获取评分的平均分
 		getAverageScore(){
@@ -574,8 +972,8 @@ export default {
 					_result+=i1.array[_index].json.answer2
 					_sum+=1;
 				})
-				_result=(_result/_sum).toFixed(2)
-				return _result;
+				_result = _sum ? (_result/_sum).toFixed(2) : 0
+				return _result ? _result : 0;
 			}
 		}
   },
@@ -743,7 +1141,7 @@ export default {
                 let _json2 = _json[ja].json
                 if (_json[ja].type == 6) {
                   let _cjson = await this.getCourse(_json2.answer2)
-                  _json2.answer2 =  _cjson.title
+                  _json2.answer2 =  _cjson ? _cjson.title : ''
                 }
               }
               array.push({
@@ -753,6 +1151,7 @@ export default {
                 name: this.works[i].username ? this.works[i].username : '匿名',
                 time: this.works[i].time,
                 array: _json,
+                cut:0,
                 courseJson: JSON.parse(this.works[i].courseJson),
               })
             }
@@ -762,6 +1161,7 @@ export default {
             let el = this.chapters[i]
             let topic = {
               type: el.type,
+              cut: 0,
               title: el.json ? el.json.title : '',
               detail: el.json ? el.json.detail : '',
               atype: el.json ? el.json.type : '',
@@ -789,7 +1189,7 @@ export default {
               topic.array = _answer
               topic.courseArray = [];
 							let params = {
-								cid:topic.array.join(",")
+								cid:topic.array ? topic.array.join(",") : ''
 							}
 
 							let data = await this.ajax.get(this.$store.state.api + 'getCourseInfoTestAll',params);
@@ -859,7 +1259,7 @@ export default {
                 }
               }
             }
-            console.log(topic)
+            console.log('topictopictopictopic',topic)
             testArray.push(topic)
           }
           this.testArray = testArray
@@ -1349,7 +1749,7 @@ export default {
           }
         } else if (item.type == 6 && item.json.answer2) {
             let _cjson = await this.getCourse(item.json.answer2)
-            let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${_cjson.title}</div>`
+            let _option = `<div style='margin:10px 0 0 40px;'>打分课程:${ _cjson ? _cjson.title : ''}</div>`
             _test += _option
         } else if (item.type == 7 && item.json.answer2 ) {
             let _score = this.getScore2(item.json)
@@ -1640,7 +2040,68 @@ export default {
   height: 100% !important;
   /* margin: 0 20px 0 20px; */
 }
+.cutBtnBlockCss{
+  width: 100%;display: flex;justify-content: end;
+}
+.cutBtnCss{
+  width: 68px;
+  height: 27px;
+  font-size: 14px;
+  border-radius: 5px;
+  display: flex;
+  color: rgba(54, 129, 252, 1);
+  justify-content: center;
+  align-items: center;
+  margin-top: 10px;
+  border: 1px rgba(54, 129, 252, 1) solid;
+}
+.isDesktopRight{
+  width:100% !important;
+  margin:0 !important;
+  height: 300px !important;
+  border: none !important;
+}
+.isDTitle2JsonTit{
+  width: 130px;
+  color: rgba(0, 0, 0, 0.9);
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.IsDAnswer{
+  margin: 20px 0 30px;color: rgba(0, 0, 0, 0.6);
+}
 
+.CutCss{
+  height: 60px;
+  line-height: 60px;
+}
+.topicTitCss{
+  color:  rgba(0, 0, 0, 0.9);
+  font-weight: 600;
+  margin-right: 5px;
+}
+.IsDFile{
+  width: 150px;
+  height: 120px;
+  border-radius: 10px;
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+  margin-bottom: 5px;
+}
+.IsDownload{
+  position: absolute;
+  width: 30px;
+  top: 5px;
+  right: 5px;
+}
+.IsDImg{
+  width: 100%;
+  height: 70px;
+  flex: 1;
+}
 .pb_content_body {
   width: 100% !important;
   height: 100%;
@@ -1816,7 +2277,11 @@ export default {
   cursor: pointer;
   position: relative;
 }
-
+.search_nav>.isDesktopRightCut{
+  display: flex;
+  justify-content: space-between;
+  width: 60%;
+}
 .search_nav>.right>span+span {
   margin-left: 35px;
 }
@@ -1843,6 +2308,21 @@ export default {
   margin-left: auto;
 }
 
+.search_nav>.right>span.active2 {
+  color: #3681FC;
+  font-weight: 600;
+}
+.search_nav>.right>span.active2::before {
+  content: "";
+  position: absolute;
+  bottom: -10px;
+  width: 100%;
+  height: 3px;
+  background: #3681fc;
+  left: 50%;
+  transform: translateX(-50%);
+}
+
 
 .student_input>>>.el-input__inner {
   height: 40px;
@@ -1945,6 +2425,27 @@ export default {
 .title_content>.title_box>.content1>.left>.data>span:nth-child(3) {
   width: 320px;
 }
+.isDesktopTitle{
+  display: flex;
+  justify-content: space-around;
+}
+.isDesktopTitle >div {
+  width: 60px;
+  height: 30px;
+  line-height: 30px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+/* .isDesktopTitle:nth-child(1){
+  width: 60px;
+}
+.isDesktopTitle:nth-child(2){
+  width: 60px;
+}
+.isDesktopTitle:nth-child(3){
+  flex: 1;
+} */
 
 .title_content>.title_box>.content1>.left>.title {
   font-weight: 700;
@@ -2097,6 +2598,22 @@ export default {
 .table_content>>>.el-table td {
   padding: 5px 0;
 }
+.isDesktopTable_content{
+  width: 100%;
+}
+.isDTitle{
+  display: flex;
+  justify-content: space-between;
+}
+.isDBri{
+  display: flex;
+  padding: 15px 0;
+  font-size: 14px;
+  color: rgba(0, 0, 0, 0.4);
+  flex-direction: column;
+  height: 80px;
+  justify-content: space-between;
+}
 
 .answer_type {
   background: #F0F2F5;

+ 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>

+ 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>

+ 100 - 0
src/components/pages/test/examine/index.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="testExamine">
+    <div class="testTit">
+      <div class="teaLis">
+        <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>
+    <div class="testCon">
+      <targetPage :pType="pType" v-if="cutTable == 0"></targetPage>
+      <personPage :pType="pType" v-if="cutTable == 1"></personPage>
+    </div>
+  </div>
+</template>
+
+<script>
+import personPage from "./conpoments/personPage.vue";
+import targetPage from "./conpoments/targetPage";
+
+export default {
+  components: {
+    personPage,
+    targetPage
+  },
+  data() {
+    return {
+      pType: 0,
+      cutTable: 0,
+      cutTabOpts: [
+        {
+          value: 0,
+          label: "按指标"
+        },
+        {
+          value: 1,
+          label: "按人员"
+        }
+      ]
+    };
+  },
+  methods: {
+    cutPage(e) {
+      this.pType = e;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.testExamine {
+  width: 100%;
+  height: 100%;
+  padding: 10px;
+  box-sizing: border-box;
+  background-color: #fff;
+}
+.testExamine > .testTit {
+  height: 100px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.teaLis {
+  display: flex;
+}
+.teal {
+  padding: 10px 20px;
+  cursor: pointer;
+}
+.Tbor {
+  border-bottom: 2px rgba(54, 129, 252, 1) solid;
+}
+.testCon {
+  box-sizing: border-box;
+  padding: 20px;
+}
+</style>

+ 1 - 1
src/components/pages/test/shareBox/index.vue

@@ -95,7 +95,7 @@ export default {
             if (this.TeachingValue == '') {
                 return this.testJson.juriP ? this.testJson.juriP : '所有人'
             }else{
-                return this.TeachName[0].name
+                return this.TeachName ? this.TeachName[0].name :'所有人'
             }
         }
     },

+ 13 - 0
src/components/pages/testPerson/examine/index.vue

@@ -0,0 +1,13 @@
+<template>
+  <div>审核</div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style>
+
+</style>

+ 10 - 2
src/components/pages/testPerson/test/test.vue

@@ -1,6 +1,9 @@
 <template>
     <div class="i_body_box">
         <div class="check_nav">
+            <div class="nav all" v-show="false" :class="{ active: type == '1' }" @click="checkType('1')">
+                年度考核
+            </div>
             <div class="nav all" :class="{ active: type == '' }" @click="checkType('')">
                 全部
             </div>
@@ -19,10 +22,11 @@
             </div>
         </div>
         <div class="check_box" v-loading="loading">
-            <div class="noneData" v-if="!worksArray.length" style="text-align: center; margin-top: 20px;">
+            <examine v-if="type==1"></examine>
+            <div class="noneData"  v-if="!worksArray.length && type!=1" style="text-align: center; margin-top: 20px;">
                 暂无数据
             </div>
-            <div class="test_panel" v-for="(item, index) in worksArray" :key="index">
+            <div class="test_panel" v-if="type!=1" v-for="(item, index) in worksArray" :key="index">
                 <div class="test_panel_title">
                     <div class="title" :style="{paddingLeft: (item.array.length > 0 || item.carray.length > 0) ? '0' : '30px'}" @click="openWork(index)">
                         <span class="open" :class="{active: item.open}" v-if="item.array.length > 0 || item.carray.length > 0"></span>
@@ -112,6 +116,7 @@
 </template>
 
 <script>
+import examine from '../examine/index'
 export default {
     props: {
         userid: {
@@ -121,6 +126,9 @@ export default {
             type: String,
         },
     },
+    components:{
+        examine
+    },
     data() {
         return {
             type: "",

+ 5 - 3
src/components/pages/testStudent/view/component/file.vue

@@ -32,19 +32,19 @@
             <div class="choices">
                 <div class="uploadBtn" v-if="checktype == 1">
                     <div class="btn" @click.stop="addImg($event)">
-                        <span>添加本地文件</span>
+                        <span :style="isN==1? 'font-size: 12px;' : ''">添加本地文件</span>
                         <input type="file" accept="*" style="display: none" multiple="multiple"
                             @change="beforeUpload($event)" />
                     </div>
                     <div class="btn" @click="openFileBox()">
-                        <span>从资源库添加</span>
+                        <span :style="isN==1? 'font-size: 12px;' : ''">从资源库添加</span>
                     </div>
                     <div class="switch">
                         <el-switch
                             active-color="#3681fc"
                             v-model="isTong">
                         </el-switch>
-                        <span @click="isTong = !isTong">同步至资源库</span>
+                        <span :style="isN==1? 'font-size: 12px;' : ''" @click="isTong = !isTong">同步至资源库</span>
                     </div>
                 </div>
                 <div class="binfo_input">
@@ -197,6 +197,8 @@ export default {
                 1: { name: '附件' },
             },
             userid: this.$route.query.userid,
+            isN: this.$route.query.isN,
+
             checkJson: undefined,
             progress: 0,
             isFinishSize: 0,

+ 1 - 1
src/components/pages/testStudent/view/component/topic.vue

@@ -262,7 +262,7 @@ export default {
         let checkArray = _json.filter((item) => {
           if (item.array) {
             item.array = item.array.filter((item2) => {
-              if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7 && item.type != 8) {
+              if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item2.type != 7 && item2.type != 8) {
                 item2.json.answer2 = [];
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type == 6) {
                 item2.json.answer2 = this.gcourseid ? this.gcourseid : item2.json.courses[0];

+ 6 - 6
src/components/pages/testStudent/view/preview.vue

@@ -407,20 +407,20 @@ export default {
       let checkArray = _json.filter((item) => {
         if (item.array) {
           item.array = item.array.filter((item2) => {
-            if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item2.type != 7) {
+            if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item2.type != 7 && item2.type != 8) {
               item2.json.answer2 = [];
             }else if(item2.type == 6){
               item2.json.answer2 = this.courseid ? this.courseid : '';
-            }else if(item2.type == 7){
+            }else if(item2.type == 7 || item2.type == 8){
               item2.json.answer2 = '';
             }
             if (item2.array) {
               item2.array = item2.array.filter((item3) => {
-                if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7) {
+                if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7 && item3.type != 8) {
                   item3.json.answer2 = [];
                 }else if(item3.type == 6){
                   item3.json.answer2 = this.courseid ? this.courseid : '';
-                }else if(item3.type == 7){
+                }else if(item3.type == 7 || item3.type == 8){
                   item3.json.answer2 = '';
                 }
                 return item3;
@@ -431,11 +431,11 @@ export default {
             );
           });
         }
-        if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 6 && item.type != 7) {
+        if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 6 && item.type != 7 && item.type != 8) {
           item.json.answer2 = [];
         }else if(item.type == 6){
           item.json.answer2 = this.courseid ? this.courseid : '';
-        }else if(item.type == 7){
+        }else if(item.type == 7 || item.type == 8){
           item.json.answer2 = '';
         }
         console.log(item.array);

+ 18 - 1
src/router/index.js

@@ -128,7 +128,8 @@ import classroomObservation from '@/components/pages/classroomObservation/index'
 import contrastObservation from '@/components/pages/contrastObservation/index'//对比分析
 import pblCourse from '@/components/pages/pblCourse/index'
 import guide from '@/components/pages/pblCourse/guide'
-
+import testExamine from '@/components/pages/test/examine'
+import testPersonExamine from '@/components/pages/testPerson/examine'
 // 全局修改默认配置,点击空白处不能关闭弹窗
 ElementUI.Dialog.props.closeOnClickModal.default = false
 Vue.use(Router).use(ElementUI)
@@ -1100,6 +1101,22 @@ export default new Router({
 					meta:{
 						requireAuth:''//不需要鉴权
 					}
+				},
+                 {//pblCourse
+					path:"/testExamine",
+					name:"testExamine",
+					component:testExamine,
+					meta:{
+						requireAuth:''//不需要鉴权
+					}
+				},
+                 {//testPerson
+					path:"/testPersonExamine",
+					name:"testPersonExamine",
+					component:testPersonExamine,
+					meta:{
+						requireAuth:''//不需要鉴权
+					}
 				}
     ]
 })

Some files were not shown because too many files changed in this diff