SanHQin 8 月之前
父节点
当前提交
be502cf04c

+ 41 - 1
src/components/pages/classroomObservation/components/chatArea.vue

@@ -64,6 +64,9 @@
         v-if="pageStatus == 2 && !showIndexPage && editorBarData.type == '0'"
         v-loading="uploadFileLoading"
       >
+			  <div class="wavGetTextProgress" v-if="wavGetTextLoading" style="position: absolute; bottom: 20px; right: 285px; z-index: 10002">
+					<el-progress :text-inside="true" :stroke-width="26" :percentage="wavGetTextProgress"></el-progress>
+				</div>
         <el-button
           style="position: absolute; bottom: 20px; right: 185px; z-index: 10002"
           size="small"
@@ -688,6 +691,7 @@ export default {
       showRoleList: false,
       showGetTextLoading: false,
       wavGetTextLoading: false,
+      wavGetTextProgress: 0,
       roleListIndex: 0,
 
       userId: this.$route.query["userid"],
@@ -1473,6 +1477,10 @@ ${JSON.stringify(_list)}
     // 	return new Blob(buffer, { type: "audio/mp3" });
     // },
     async wavFileGetText(audioFile) {
+			this.wavGetTextProgress = 0;
+			let _TimeProgress = 3000;//六秒
+			let _totalTime = 0;
+			let _duration = 0;
       let flag = true;
       let textList = [];
       let _file = null;
@@ -1488,6 +1496,13 @@ ${JSON.stringify(_list)}
       console.log("将转录的文件👇");
       console.log(_file);
 
+			const audio = new Audio(URL.createObjectURL(_file));
+			audio.addEventListener("canplaythrough",()=>{
+				_duration = (audio.duration * 1000).toFixed(0);
+				console.log("音频时长",_duration)
+			})
+
+
       try {
 				let iiframe = this.$refs["iiframe"];
 				let _this = this;
@@ -1510,6 +1525,22 @@ ${JSON.stringify(_list)}
             _this.editorBarData.content = "";
             textList = [];
           }
+					if(_this.wavGetTextProgress<=70){
+						_TimeProgress = 3000;//六秒
+					}else if(_this.wavGetTextProgress<=80){
+						_TimeProgress = 2000;//改为三秒
+					}else if(_this.wavGetTextProgress<=90){
+						_TimeProgress = 1000;//改为一秒
+					}else if(_this.wavGetTextProgress<95){
+						_TimeProgress = 500;//改为0.5秒
+					}else if(_this.wavGetTextProgress<99){
+						_TimeProgress = 100;//改为0.1秒
+					}else{
+						_TimeProgress = 0;//改为0秒不动
+					}
+
+					_totalTime+=_TimeProgress;
+					_this.wavGetTextProgress = (_totalTime/_duration*100).toFixed(0);
           _this.wavGetTextLoading = true;
           _this.showGetTextLoading = true;
           let privText = e.privText;
@@ -1573,6 +1604,7 @@ ${JSON.stringify(_list)}
         };
 
         iiframe.contentWindow.onSessionStopped = function(e) {
+					_this.wavGetTextProgress = 100;
           if(_this.wavFileGetTextLoading)_this.$message.success("转译完成");
           _this.showGetTextLoading = false;
           _this.wavGetTextLoading = false;
@@ -1595,6 +1627,7 @@ ${JSON.stringify(_list)}
           iiframe.contentWindow.scenarioStopButton.click();
           this.wavGetTextLoading = false;
           this.showGetTextLoading = false;
+					this.wavGetTextProgress = 0;
           this.$message.success("终止转译成功");
         } catch (error) {
           this.$message.error("终止转译失败");
@@ -2043,7 +2076,7 @@ ${JSON.stringify(_list)}
             // 	this.chatLoading = false;
             // 	return this.getChatList()
             // };
-            let _data = JSON.parse(res.data.FunctionResponse);
+            let _data = JSON.parse(res.data.FunctionResponse).response;
             if (_data.length > 0) {
               let _chatList = [];
               for (let i = 0; i < _data.length; i++) {
@@ -3530,4 +3563,11 @@ ${JSON.stringify(_list)}
 .cal_box >>> .el-progress-bar__innerText {
   color: #fff !important;
 }
+
+.wavGetTextProgress{
+	width: 250px;
+	height: 32px;
+	box-sizing: border-box;
+	padding: 3px 0;
+}
 </style>

+ 1 - 1
src/components/pages/pocAi/index.vue

@@ -477,7 +477,7 @@ export default {
         this.ajax
           .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
           .then(res => {
-            let _data = JSON.parse(res.data.FunctionResponse);
+            let _data = JSON.parse(res.data.FunctionResponse).response;
             if (_data.length > 0) {
               let _chatList = [];
               for (let i = 0; i < _data.length; i++) {

+ 1 - 1
src/components/pages/pocAiClassroom/chatArea.vue

@@ -752,7 +752,7 @@ export default {
         this.ajax
           .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
           .then(res => {
-            let _data = JSON.parse(res.data.FunctionResponse);
+            let _data = JSON.parse(res.data.FunctionResponse).response;
             if (_data.length > 0) {
               let _chatList = [];
               for (let i = 0; i < _data.length; i++) {

+ 1 - 1
src/components/pages/test/check/aiBoxRight.vue

@@ -1166,7 +1166,7 @@ export default {
         this.ajax
           .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
           .then(res => {
-            let _data = JSON.parse(res.data.FunctionResponse);
+            let _data = JSON.parse(res.data.FunctionResponse).response;
             if (_data.length > 0) {
               let _chatList = [];
               for (let i = 0; i < _data.length; i++) {

+ 1 - 1
src/components/pages/test/checkAi/aiLeader.vue

@@ -2025,7 +2025,7 @@ export default {
         this.ajax
           .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
           .then(res => {
-            let _data = JSON.parse(res.data.FunctionResponse);
+            let _data = JSON.parse(res.data.FunctionResponse).response;
             console.log("data", _data);
             if (_data.length > 0) {
               let _chatList = [];