Parcourir la source

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

lsc il y a 8 mois
Parent
commit
89f4422632
1 fichiers modifiés avec 29 ajouts et 17 suppressions
  1. 29 17
      src/components/pages/classroomObservation/components/chatArea.vue

+ 29 - 17
src/components/pages/classroomObservation/components/chatArea.vue

@@ -460,7 +460,8 @@ const OPTIONS_GROUP = {
   ],
 };
 const ATTENTION_GROUP = {
-  default: "- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`",
+  default:
+    "- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`",
 };
 
 // 自定义指令,用于处理点击外部区域的事件
@@ -1849,11 +1850,14 @@ ${JSON.stringify(_list)}
                         _this.controlsStatus = 2;
                         _this.showIndexPage = false;
                         _this.pageStatus = 2;
-                        const arr = Papa.parse(_res.data, {
-                          header: false,
-                        }).data.slice(1);
-                        console.log(arr);
-                        const _editorBarDataContent = `<table
+                        _this.editorBarData.type = "0";
+                        // _this.transcriptionData.content = _res.data;
+                        if (flag) {
+                          const arr = Papa.parse(_res.data, {
+                            header: false,
+                          }).data.slice(1);
+                          console.log(arr);
+                          const _editorBarDataContent = `<table
                           border="0"
                           width="100%"
                           cellpadding="0"
@@ -1862,7 +1866,7 @@ ${JSON.stringify(_list)}
                         >
                           <tbody>
                             <tr>
-                              <th>序号1</th>
+                              <th>序号</th>
                               <th>开始时间</th>
                               <th>结束时间</th>
                               <th>发言内容</th>
@@ -1870,8 +1874,9 @@ ${JSON.stringify(_list)}
                               <th>说话人身份</th>
                               <th>行为编码</th>
                             </tr>
-                            ${arr.map(
-                              (row) => `
+                            ${arr
+                              .map(
+                                (row) => `
                               <tr>
                                 <td>${_.get(row, 0, "")}</td>
                                 <td>${_.get(row, 1, "")}</td>
@@ -1882,12 +1887,14 @@ ${JSON.stringify(_list)}
                                 <td>${_.get(row, 6, "")}</td>
                               </tr>
                               `
-                            ).join('\n')}
+                              )
+                              .join("\n")}
                           </tbody>
                         </table>`;
-                        _this.editorBarData.type = '0';
-                        _this.editorBarData.content = _editorBarDataContent;
-                        // _this.transcriptionData.content = _res.data;
+                          _this.editorBarData.content = _editorBarDataContent;
+                        } else {
+                          _this.editorBarData.content = _res.data;
+                        }
                         _this.editorBarData.url = "";
                         _this.saveEditorBar();
                       });
@@ -2373,10 +2380,11 @@ ${JSON.stringify(_list)}
             rows.length,
             ...Object.assign(new Array(rows.length), chunkResult.slice(0, rows.length))
           );
-          this.changeEditorBar({
-            transcriptionData: this.transcriptionData.content,
-            editorBarData: this.editorBarData,
-          });
+          // PERF dom更新太卡了
+          // this.changeEditorBar({
+          //   transcriptionData: this.transcriptionData.content,
+          //   editorBarData: this.editorBarData,
+          // });
         };
       });
       while (!this.jobContext.ctrl.signal.aborted && jobs.length > 0) {
@@ -2416,6 +2424,10 @@ ${JSON.stringify(_list)}
           }
         }
       }
+      this.changeEditorBar({
+        transcriptionData: this.transcriptionData.content,
+        editorBarData: this.editorBarData,
+      });
       this.jobContext = null;
     },
   },