Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js =================================================================== diff -u -r27317 -r27339 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 27317) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/sterilizationRecordForm.js (.../sterilizationRecordForm.js) (revision 27339) @@ -382,7 +382,24 @@ //给已扫描数量(大号字体)赋值 top.Ext.getCmp('nowScanAmountId').setValue(statisticsAmount['灭菌物品总数量']) } - +/* + * 根据谷歌或IE浏览器选择不同的语音播放的方式 + */ + function googleOrIESpeak(content){ + if(!!window.ActiveXObject || "ActiveXObject" in window){ + if(speaker){ + speaker.speak(content); + } + }else { + var synth = window.speechSynthesis; + var googleSpeack = new SpeechSynthesisUtterance(); + //汉语 + googleSpeack.lang = 'zh-CN'; + googleSpeack.rate = 1; + googleSpeack.text = content; + synth.speak(googleSpeack); + } + } /** * 扫描灭菌架条码 * @param barcode 架条码条码 @@ -394,7 +411,7 @@ var resultArray = sterilizationShelfName.split(":"); if(resultArray[0] == "success"){ top.Ext.getCmp('sterilizationShelf').setValue(resultArray[1]); - speaker.speak(resultArray[1]); + googleOrIESpeak(resultArray[1]); }else{ showResult(resultArray[1], null , sstsConfig.messagePauseTimeOnSterilizationRecordPage); }