11
WXL
昨天 616d4a1b45ac9e1442a5541e21c8c755cde2c78f
public/integration.html
@@ -443,8 +443,10 @@
        appState.runningIndicator++;
        $('#runningIndicator').css('backgroundColor', appState.runningIndicator % 2 === 0 ? '#67c23a' : '#e6a23c');
        getList();
        console.log(appState.curSpeakPat,'555');
        
        if (appState.curSpeakPat == null) {
        console.log(appState.curSpeakPat,'666');
          initiateSpeak();
        }
      }, 5000);
@@ -474,25 +476,28 @@
    // 叫号功能
    function initiateSpeak() {
      // 这里替换为实际的API调用
      $.ajax({
        url: appState.apiBaseUrl + '/ecg/call/next',
        type: 'GET',
        dataType: 'json',
        success: function(response) {
          appState.curSpeakPat = response.data || response;
          if (appState.curSpeakPat != null && appState.curSpeakPat.called === 0) {
            speak("请、" + appState.curSpeakPat.patName + "到" + appState.curSpeakPat.roomName + "就诊");
          }
        },
        error: function(xhr, status, error) {
          console.error('获取下一个叫号失败:', error);
        }
      });
            speak("请、" + '吴龙' + "到" + '康复科' + "就诊");
      // $.ajax({
      //   url: appState.apiBaseUrl + '/ecg/call/next',
      //   type: 'GET',
      //   dataType: 'json',
      //   success: function(response) {
      //     appState.curSpeakPat = response.data || response;
      //     if (appState.curSpeakPat != null && appState.curSpeakPat.called === 0) {
      //       console.log(111);
      //       speak("请、" + appState.curSpeakPat.patName + "到" + appState.curSpeakPat.roomName + "就诊");
      //     }
      //   },
      //   error: function(xhr, status, error) {
      //     console.error('获取下一个叫号失败:', error);
      //   }
      // });
    }
    // 语音播报
    function speak(msg) {
      console.info("speak " + msg);
      if (!appState.speechSynthesis) {
        console.warn("当前浏览器不支持语音合成");
@@ -509,7 +514,6 @@
      speech.volume = 100;
      speech.lang = 'zh-CN';
      speech.onend = onSpeachEndEvent;
      appState.speechSynthesis.speak(speech);
    }