瀏覽代碼

课堂观察

SanHQin 2 月之前
父節點
當前提交
6a37aee7e6

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.6f437a5eba7a68ebf94f34671242b0de.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.a677c35545aaa393cfbb.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.01bfb0a0501ad76e4f0fb8894d35de7c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.3106cfaf0322bbffdfb2.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.01bfb0a0501ad76e4f0fb8894d35de7c.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/app.01bfb0a0501ad76e4f0fb8894d35de7c.css.map


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.3106cfaf0322bbffdfb2.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.3106cfaf0322bbffdfb2.js.map


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 84 - 65
src/components/pages/classroomObservation/components/chatArea.vue

@@ -85,9 +85,21 @@
         >
         <el-popover placement="top" trigger="click" v-if="!wavGetTextLoading">
           <div style="display: flex;">
-            <el-input size="small" style="width: 150px;margin-right: 10px;" v-model="replace1" placeholder="替换之前的文字"></el-input>
-          <el-input size="small" style="width: 150px;margin-right: 10px;"  v-model="replace2" placeholder="替换之后的文字"></el-input>
-          <el-button type="primary" size="small" @click="replaceText()">替换</el-button>
+            <el-input
+              size="small"
+              style="width: 150px;margin-right: 10px;"
+              v-model="replace1"
+              placeholder="替换之前的文字"
+            ></el-input>
+            <el-input
+              size="small"
+              style="width: 150px;margin-right: 10px;"
+              v-model="replace2"
+              placeholder="替换之后的文字"
+            ></el-input>
+            <el-button type="primary" size="small" @click="replaceText()"
+              >替换</el-button
+            >
           </div>
           <el-button
             slot="reference"
@@ -790,8 +802,8 @@ export default {
       },
       userName: "",
       curRequestController: null,
-      replace1:"",//替换1
-      replace2:"",//替换2
+      replace1: "", //替换1
+      replace2: "" //替换2
     };
   },
   computed: {
@@ -1671,78 +1683,83 @@ ${JSON.stringify(_list)}
           console.log("👇转译结果👇");
           console.log(privText);
           console.log(privSpeakerId);
-          console.log(privDuration)
-          console.log(privOffset)
-          if (!privText && !privSpeakerId){
-            console.log(privText,privSpeakerId)
-            console.log(!privText || !privSpeakerId)
-            return
-          };
+          console.log(privDuration);
+          console.log(privOffset);
+          if (!privText && !privSpeakerId) {
+            console.log(privText, privSpeakerId);
+            console.log(!privText || !privSpeakerId);
+            return;
+          }
 
-          if(_roleList[privSpeakerId]){
-            privSpeakerId = _roleList[privSpeakerId]
-          }else{
+          if (_roleList[privSpeakerId]) {
+            privSpeakerId = _roleList[privSpeakerId];
+          } else {
             _getRoleList.push({
-              index:textList.length,
-              role:privSpeakerId,
-              content:privText
-            })
+              index: textList.length,
+              role: privSpeakerId,
+              content: privText
+            });
           }
 
-          if(_getRoleList.length>=5 && !_getRoleLoading){
+          if (_getRoleList.length >= 5 && !_getRoleLoading) {
             let params = {
-              inputs:{
-                options:"老师,学生",
-                rows:JSON.stringify(_getRoleList.map(i=>{return {content:i.content,role:i.role}}))
+              inputs: {
+                options: "老师,学生",
+                rows: JSON.stringify(
+                  _getRoleList.map(i => {
+                    return { content: i.content, role: i.role };
+                  })
+                )
               },
-              response_mode:"blocking",
-              user:this.userId
-            }
+              response_mode: "blocking",
+              user: this.userId
+            };
+            _getRoleLoading = true;
+            _this.$ajax
+              .post("https://dify.cocorobo.cn/v1/workflows/run", params)
+              .then(res => {
+                let _runData = res.data;
+                let _runResult = _runData.outputs.result;
+                _runResult.forEach((txt, index) => {
+                  let _oldRole = _getRoleList[index].role;
+                  if (!_roleList[_oldRole]) {
+                    _roleList[_oldRole] = txt;
+                  }
+                });
+                // 去除内容
+                _getRoleList.splice(0, _runResult.length);
+                let _indexList = [];
+                _getRoleList.forEach((i, index) => {
+                  if (_roleList[i.role]) {
+                    textList[i.index].role = _roleList[i.role];
+                    _indexList.push(index);
+                  }
+                });
+                _getRoleList = _getRoleList.filter(
+                  (item, index) => !_indexList.includes(index)
+                );
+                _getRoleLoading = false;
+              })
+              .catch(err => {
+                console.log("获取说话人编码失败", err);
+                _getRoleLoading = false;
+              });
           }
 
-          _getRoleLoading = true;
-          _this.$ajax.post("https://dify.cocorobo.cn/v1/workflows/run",params).then(res=>{
-            let _runData = res.data;
-            let _runResult = _runData.outputs.result;
-            _runResult.forEach((txt,index)=>{
-              let _oldRole = _getRoleList[index].role;
-              if(!_roleList[_oldRole]){
-                _roleList[_oldRole] = txt;
-              }
-            })
-            // 去除内容
-            _getRoleList.splice(0, _runResult.length);
-            let _indexList = [];
-            _getRoleList.forEach((i,index)=>{
-              if(_roleList[i.role]){
-                textList[i.index].role = _roleList[i.role];
-                _indexList.push(index)
-              }
-            })
-            _getRoleList = _getRoleList.filter((item, index) => !_indexList.includes(index));
-            _getRoleLoading = false;
-          }).catch(err=>{
-            console.log("获取说话人编码失败",err)
-            _getRoleLoading = false;
-          })
-
-
-
           _endTime = (privOffset + privDuration) / 10000000;
           textList.push({
             value: privText,
             startTime: _this.updateRecordedTime({ duration: _startTime }),
-            endTime: _this.updateRecordedTime({duration:_endTime}),
+            endTime: _this.updateRecordedTime({ duration: _endTime }),
             time: _this.updateRecordedTime({ duration: _endTime - _startTime }),
             role: privSpeakerId
           });
 
           _startTime = _endTime;
 
-
           _this.transcriptionData.content += privText;
 
-          console.log(textList)
+          console.log(textList);
 
           let _result = `
 				<table
@@ -3105,21 +3122,23 @@ ${JSON.stringify(_list)}
     },
     // ============ end 声扬录音转译
     //替换文字
-    replaceText(){
-      if(!this.tid)return;
-      if(!this.replace1.trim() || !this.replace2.trim()){
-        return this.$message.error("请输入内容")
+    replaceText() {
+      if (!this.tid) return;
+      if (!this.replace1.trim() || !this.replace2.trim()) {
+        return this.$message.error("请输入内容");
       }
 
       let _replace1 = this.replace1.trim();
       let _replace2 = this.replace2.trim();
-      console.log(_replace1,_replace2)
+      console.log(_replace1, _replace2);
       // console.log(this.editorBarData)
-      this.editorBarData.content = this.editorBarData.content.replace(new RegExp(_replace1, 'g'), _replace2);
+      this.editorBarData.content = this.editorBarData.content.replace(
+        new RegExp(_replace1, "g"),
+        _replace2
+      );
       this.$forceUpdate();
       // this.saveEditorBar();
-    },
-
+    }
   },
   mounted() {
     this.loadVoiceprints();

部分文件因文件數量過多而無法顯示