lsc 5 月之前
父节点
当前提交
2e5a1fe242

+ 1 - 1
dist/index.html

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

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.5f6ed8e307b205d0edd2ab1b214dd9e3.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.5f6ed8e307b205d0edd2ab1b214dd9e3.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.911a4acbb7e9479d9987804197c3982c.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.2006fc46bd8df4124394.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.2006fc46bd8df4124394.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 101 - 0
src/components/pages/aiAddCourse/addCourse.vue

@@ -2413,6 +2413,7 @@
                   </button>
                   <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="openAiDialog2(2, 'aiTask3','all'), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</button>
                   <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="allEvaCan(), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有评价按钮`)" v-if="panTaskElist() == 0 && panEvaCont() == 0">一键生成所有评价</button>
+                  <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="exportTaskEA(), addCourseBehavior('courseBehavior', `点击学历案-导出评价和学历案按钮`)">导出评价和学历案</button>
                   <button class="c_pub_button_confirm" style="margin: 0 0 0 10px;" v-if="steps < 4 && istemplate != 1" @click="nextSteps">
                     {{ steps == 3 ? "确认上传" : "下一步" }}
                   </button> 
@@ -7153,6 +7154,44 @@ let converter2 = OpenCC.Converter({
 		to:'hk'
 })
 
+const getFile = (url) => {
+  return new Promise((resolve, reject) => {
+    var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+      let url2 = url;
+      let _url2 = "";
+      if (
+        url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      ) {
+        _url2 = url2.split(
+          "https://view.officeapps.live.com/op/view.aspx?src="
+        )[1];
+      } else {
+        _url2 = url2;
+      }
+      var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+      let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
+      var params = {
+        Bucket: "ccrb",
+        Key: name
+      };
+      s3.getObject(params, function (err, data) {
+        if (err) {
+          console.log(err, err.stack)
+          resolve({ data: 1 });
+        }else {
+          resolve({ data: data.Body });
+          console.log(data); 
+        }          // sxuccessful response
+
+      });
+  });
+};
+
 export default {
   components: {
     EditorBar,
@@ -17061,6 +17100,68 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       // });
 
     },
+    async exportTaskEA(){
+      this.loading = true
+      const zip = new JSZip();
+      let md = new MarkdownIt();
+
+      for(var i = 0; i < this.unitJson[0].chapterInfo[0].taskJson.length; i++){
+        let _task = this.unitJson[0].chapterInfo[0].taskJson[i]
+        for(var j = 0; j < _task.chapterData.length; j++){
+          
+          if(_task.chapterData[j].type == 3 && _task.chapterData[j].name.includes('学历案')){
+            let file = await getFile(_task.chapterData[j].url)
+            if (file.data != 1) {
+              // 下载文件, 并存成ArrayBuffer对象
+              const file_name = _task.chapterData[j].name; // 获取文件名
+              const fileExt = file_name.split('.').pop(); // 获取文件后缀
+              const fileNameWithoutExt = file_name.substring(0, file_name.length - fileExt.length - 1); // 获取文件名不包括后缀的部分
+              // 判断是否有重复的文件名字
+              if (!zip.file(file_name)) {
+                zip.file(file_name, file.data, { binary: true }); // 逐个添加文件
+              } else {
+                // 如果有重复的文件名,则在文件名后添加序号
+                let count = 1;
+                let newFileName = fileNameWithoutExt;
+                while (zip.file(`${newFileName}.${fileExt}`)) {
+                  newFileName = `${fileNameWithoutExt}(${count})`;
+                  count++;
+                }
+                zip.file(`${newFileName}.${fileExt}`, file.data, { binary: true });
+              }
+            }
+          }
+        }
+        for(var j = 0; j < _task.toolChoose.length; j++){
+          let tool = _task.toolChoose[j]
+          if(tool.eList && tool.eList.length){
+            let tableContent = '| 素养 | 评价标准 | 评价细则 |\n| --- | --- | --- |\n';
+            tool.eList.forEach(item => {
+              tableContent += `| ${item.target} | ${item.detail} | ${item.rule.replaceAll('\n', ' ')} |\n`;
+            });
+            let html = md.render(tableContent);
+            let name = `任务${i+1}工具${j+1}的评价`
+            let file = await this.generateExport2(name, html, i)
+
+            zip.file(`${name}.docx`, file, { binary: true })
+          } 
+        }
+        
+        // let file = await this.generateExport(name, _html, i)
+
+        // zip.file(`${name}.docx`, file, { binary: true })
+      }
+      zip.generateAsync({ type: "blob" }).then((content) => {
+        // 生成二进制流
+        saveAs(
+          content,
+          this.courseName + "-" + "评价和学历案.zip"
+        ); // 利用file-saver保存文件  自定义文件名
+        setTimeout(() => {
+          this.loading = false
+        }, 2000);
+      });
+    },
     clickGenTT2(){
       if (this.courseName == "") {
         this.$message.error("请补充填写课程名称");

+ 6 - 6
src/components/pages/aiAddCourse/aiBoxRight.vue

@@ -1006,14 +1006,14 @@ ${data.area + ':' + data.value}
         this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
       });
       let params = {
-        id: 'adfdb66c-9108-11ef-a04e-12e77c4cb76b',
+        id: '957e191f-92a6-11ef-a04e-12e77c4cb76b',
         userId: this.userid,
         message: _replaceText,
         session_name: this.continuous ? `${this.courseId}-addCourseA` : uuidv4(),
         uid: _uuid,
-        model: "qwen-plus",
+        model: "qwen-plus-own",
         sound_url: "",
-        file_ids: [...this.fileids],
+        file_ids: [],//...this.fileids
         // model: "gpt-4o-mini"
         // model: "qwen-plus"
       };
@@ -1249,14 +1249,14 @@ ${message}`;
             this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
           });
           let params = {
-            id: 'adfdb66c-9108-11ef-a04e-12e77c4cb76b',
+            id: '957e191f-92a6-11ef-a04e-12e77c4cb76b',
             userId: this.userid,
             message: _replaceText,
             session_name: this.continuous ? `${this.courseId}-addCourseA` : uuidv4(),
-            model: "qwen-plus",
+            model: "qwen-plus-own",
             sound_url: "",
             uid: _uuid,
-            file_ids: [...this.fileids],
+            file_ids: [],//...this.fileids
             // model: "gpt-4o-mini"
             // model: "qwen-plus"
           };

部分文件因为文件数量过多而无法显示