lsc 8 kuukautta sitten
vanhempi
commit
402f7b51a7

+ 1 - 1
dist/index.html

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

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.f537fee6bc07df00664b97105654db3a.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.f537fee6bc07df00664b97105654db3a.css.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.1f011cc4d2bb4e0591b1.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.1f011cc4d2bb4e0591b1.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 106 - 31
src/components/pages/aiAddCourse/addCourse.vue

@@ -2678,7 +2678,7 @@
 
                   <div style="margin: 0 0 10px 0; padding: 0" v-for="(item, index) in unitJson[unitIndex].chapterInfo"
                     :key="index">
-                    <div v-if="courseState == 4" style="position: relative;
+                    <div v-loading="anLoading[0]" v-if="courseState == 4" style="position: relative;
                             background: #fff;
                             box-sizing: border-box;
                             padding: 1px 20px 10px;
@@ -2703,7 +2703,7 @@
                           </el-tooltip>
                         </div>
                       </div>
-                      <div>
+                      <div >
                         <div class="add_chapters_box add_c_none" v-if="
                           item.taskJson[0].chapterData &&
                           item.taskJson[0].chapterData.length == 0
@@ -3117,6 +3117,7 @@
                           </div>
                         </div>
                         <div
+                          v-loading="anLoading[itemTaskIndex]"
                           style="position: relative"
                           v-if="courseState == 5"
                         >
@@ -7877,6 +7878,7 @@ export default {
       r_agentid: "",
       course_info: "",
       stepShow: true,
+      anLoading: [],
     };
   },
   directives: {
@@ -9634,9 +9636,9 @@ export default {
     },
     async createTeacherAn(index){
       // this.lineCount = index;
-      this.loading = true
       let md = new MarkdownIt();
       if(this.courseState == 4){
+        this.anLoading[0] = true
         // if(index == 0 || index){
         //   let _task = this.unitJson[0].chapterInfo[0].taskJson[index]
         //   let name = _task.task+'-教案'
@@ -9651,6 +9653,7 @@ export default {
         }
         // }
       }else if(this.courseState == 5){
+        this.anLoading[index] = true
         if(index == 0 || index){
           let _task = this.unitJson[0].chapterInfo[0].taskJson[index]
           let name = _task.task+'-教案'
@@ -9766,11 +9769,18 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
       let params = convertApi.createParams()
       params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
-      await this.beforeUploadHtml(file, index, callback)
+      try {
+        let result = await convertApi.convert('docx', 'docx', params)
+        file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+          return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+        });
+        await this.beforeUploadHtml(file, index, callback)
+      } catch (error) {
+        console.log('=================','报错')
+        await this.beforeUploadHtml(file, index, callback)
+        return
+      }
+
     },
     async generateExport(a, html, index) {
       // <html lang="en">
@@ -9809,13 +9819,19 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
       let params = convertApi.createParams()
       params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
+      try {
+        let result = await convertApi.convert('docx', 'docx', params)
+        file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+          return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+        });
 
-      // 执行下载
-      saveAs(file, dname);
+        // 执行下载
+        saveAs(file, dname);
+      } catch (error) {
+        saveAs(file, dname);
+        // this.$message.error('导出失败')
+      }
+    
       // return file
     },
     async generateExport2(a, html, index) {
@@ -9856,12 +9872,17 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
         let params = convertApi.createParams()
         params.add('file', file)
-        let result = await convertApi.convert('docx', 'docx', params)
-        file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-          return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-        });
+        try {
+          let result = await convertApi.convert('docx', 'docx', params)
+          file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+            return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+          });
+
+          resolve(file);  // 通过 Promise 返回 File 对象
+        } catch (error) {
+          resolve('');  // 通过 Promise 返回 File 对象
+        }
 
-        resolve(file);  // 通过 Promise 返回 File 对象
       });
     },
     beforeUploadHtml(event, index, callback) {
@@ -9901,13 +9922,15 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
                 })
                 .send(function (err, data) {
                   if(index == (_this.unitJson[0].chapterInfo[0].taskJson.length - 1) && _this.courseState == 4){
-                    _this.loading = false
+                    _this.anLoading[0] = false
                   }
 
                   if(_this.courseState == 5){
-                    _this.loading = false
+                    _this.anLoading[index] = false
                   }
                   callback ? callback() : ''
+                  _this.$forceUpdate();
+
                   if (err) {
                       _this.$message.error("上传失败");
                   } else {
@@ -9966,11 +9989,16 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
       let params = convertApi.createParams()
       params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
-      await this.beforeUploadHtml2(file, index, callback)
+      try {
+        let result = await convertApi.convert('docx', 'docx', params)
+        file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+          return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+        });
+        await this.beforeUploadHtml2(file, index, callback)
+      } catch (error) {
+        await this.beforeUploadHtml2(file, index, callback)
+        return;
+      }
     },
     beforeUploadHtml2(event, index, callback) {
         var file = event;
@@ -10807,11 +10835,58 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
           // this.inputShow = true;
           let params = convertApi.createParams()
           params.add('file', file)
-          let result = await convertApi.convert('doc', 'docx', params)
-          // Get result file URL
-          file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-            return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-          });
+          try {
+            let result = await convertApi.convert('doc', 'docx', params);
+            // Get result file URL
+            file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+              return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+            });
+          } catch (error) {
+            cfindex2++;
+            if(type == 14){
+              _this.teacherinfoisFinishSize = cfindex2;
+            }else if(type == 16){
+              _this.mubiaoinfoisFinishSize = cfindex2;
+            }else if(type == 17){
+              _this.xuanzeinfoisFinishSize = cfindex2;
+            }else if(type == 18){
+              _this.pingjiainfoisFinishSize[tindex] = cfindex2;
+            }else if(type == 19){
+              _this.knowinfoisFinishSize = cfindex2;
+            }else if(type == 20){
+              _this.knowinfoisFinishSize2 = cfindex2;
+            }else {
+              _this.infoisFinishSize = cfindex2;
+            }
+            setTimeout(() => {
+              if (
+                cfindex2 == event.target.files.length ||
+                cfindex2 > event.target.files.length
+              ) {
+                if(type == 14){
+                  _this.teacherinfoproVisible = false;
+                }else if(type == 16){
+                  _this.mubiaoinfoproVisible = false;
+                }else if(type == 17){
+                  _this.xuanzeinfoproVisible = false;
+                }else if(type == 18){
+                  _this.pingjiainfoproVisible[tindex] = false;
+                }else if(type == 19){
+                  _this.knowinfoproVisible = false;
+                }else if(type == 20){
+                  _this.knowinfoproVisible2 = false;
+                }else{
+                  _this.infoproVisible = false;
+                }
+              }
+            
+              _this.$forceUpdate();
+            }, 1000);
+            _this.$message.error("上传失败");
+            // 捕捉到这个convertApi.convert报错就不要往下走了
+            return; // 直接返回,不继续执行后续代码
+          }
+
           console.log(result)
           console.log(file)
           // return;

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä