Просмотр исходного кода

调整积木下拉框参数遮挡问题

丸子 6 месяцев назад
Родитель
Сommit
83294b0ffe
2 измененных файлов с 8 добавлено и 10 удалено
  1. 6 5
      src/views/block/Blockly.vue
  2. 2 5
      src/views/block/Blockly2.vue

+ 6 - 5
src/views/block/Blockly.vue

@@ -243,8 +243,6 @@ const goBack = () => {
 const toggleLight = () => {
   state.lamp.isLightOn = true;
   generateCode('javascript');
-  // 在运行前设置为正在录音状态
-  startRecordingStatus();
   runCode();
 };
 
@@ -267,7 +265,7 @@ function startRecordingStatus() {
   countdownInterval = setInterval(() => {
     recordingCountdown.value--;
     if (recordingCountdown.value <= 0) {
-clearInterval(countdownInterval);
+      clearInterval(countdownInterval);
       endRecordingStatus();
     }
   }, 1000);
@@ -422,6 +420,7 @@ const jsonDataString = computed({
 // });
 
 //输出结果
+
 const output = ref('');
 const statusMessage = ref('');
 const statusType = ref('');
@@ -558,7 +557,9 @@ async function pollTaskStatus(taskType, taskIds, fetchApi, onSuccess, onFailure)
 const aiService = {
   // 语音识别
   recognizeVoice: withErrorHandling('语音识别', async function(promptText = "", language = "zh-CN") {
-    console.log("语音识别开始");
+    // 在运行前设置为正在录音状态
+  startRecordingStatus();
+  console.log("语音识别开始");
     // 前端语音采集
     const recognitionResult = await this.captureVoice(language, promptText);
     return recognitionResult || "";
@@ -1638,7 +1639,7 @@ const showStatus = (message, type = 'success') => {
   left: 0;
   right: 0;
   bottom: 0;
-  z-index: 2000;
+  z-index: 1000;
   background-color: rgba(255, 255, 255, 0.9);
   // backdrop-filter: blur(5px);
   overflow: auto;

+ 2 - 5
src/views/block/Blockly2.vue

@@ -257,7 +257,6 @@ const goBack = () => {
   window.location.href = "/virtual-laboratory";
 };
 
-// 运行
 const executeCode = () => {
   generateCode('javascript');
   runCode();
@@ -466,15 +465,14 @@ async function pollTaskStatus(taskType, taskIds, fetchApi, onSuccess, onFailure)
 const aiService = {
   // 语音识别
   recognizeVoice: withErrorHandling('语音识别', async function(promptText = "", language = "zh-CN") {
-    
   // 在运行前设置为正在录音状态
   startRecordingStatus();
-  
   console.log("语音识别开始");
     // 前端语音采集
     const recognitionResult = await this.captureVoice(language, promptText);
     return recognitionResult || "";
   }, '语音识别失败'),
+  
 
   // 前端语音采集
   captureVoice(language, promptText) {
@@ -1844,9 +1842,8 @@ const showStatus = (message, type = 'success') => {
   left: 0;
   right: 0;
   bottom: 0;
-  z-index: 2000;
+  z-index: 1000;
   background-color: rgba(255, 255, 255, 0.9);
-  // backdrop-filter: blur(5px);
   overflow: auto;
 }